PLOrk Assignment DrumMachine

From CSWiki
Jump to: navigation, search

PLOrk Assignment: Build a Drum Machine and Perform It

ChucK component

  • play with ChucK - install and get it to make sounds
  • create a drum machine using multiple shreds - you should be able to play them using on-the-fly commands
  • write a short README text file that describes what you did and any interesting problems or challenges you encountered
  • practice playing the drum machine using on-the-flly programming commands (+, -, =, --, ^, etc)

what to do

  • experiment with playing otf_*.ck and e*.ck using on-the-flly programming commands (+, -, =, --, ^, etc)
  • find some drum samples (or samples of other percussive sounds) that you like
  • each sample should be only a single strike (and not a drum loop), you may to edit them slightly (audacity or other sound editor)
  • either use the ones provided, find some from the internet, or lift them from a solo drum segment of a recording (use audacity or another editor). this need not take a long time, but do pay attention to individual and collective quality and feel of the sounds, as that will make a big difference in the final result.
  • put these files in a folder (your chuck files will refer to these files)
  • if possible, credit the source of the sample in your README (even if you lifted them)
  • make a shred for each drum sound (feel free to base on otf_01 (or 2, 3, 4, 7)
  • choose a tempo that all shreds should agree on (i.e. .5::second => T;)
  • remember to synchronize to this period at top of each file (i.e. T - (now % T) => now;)
  • in certain cases, it might make sense to control more than one drum sound in a shred (like if two sounds always go together). In general, however, you should split up the drum machine so that you can independently control each component.
  • you may add additional parts (drone, melody, bassline, etc) if you like, but that is not required - focus on getting the percussive parts done first.
  • practice playing the drum machine you created using on-the-flly programming commands (+, -, =, --, ^, etc)
  • have fun!

on-the-fly programming quick reference

start chuck listener on on Terminal 1:

   $ chuck --loop

for greater stability do:

   $ chuck --bufsize2048 --blocking ---loop

(or run chuck-server on the plorktop)

on Terminal 2 (3 or 4...):

--add / + adds new shreds from source files to the listener VM. this process then exits. for example:

   $ chuck +

integrates and into the listener VM. the shreds are internally responsible for finding about the timing and other shreds via the timing mechanism and vm interface.

--remove / - removes existing shreds from the VM by ID. how to find out about the id? (see --status below) for example:

   $ chuck - 2 3 8

removes shred 2, 3, 8.

--removeall: removes all shreds from the VM. new shred id reset to 0.

   $ chuck --removeall

--replace / = replace existing shred with a new shred. for example:

   $ chuck = 2

replaces shred 2 with

--status / ^ queries the status of the VM - output on the listener VM. for example:

   $ chuck ^

this prints the internal shred start at the listener VM, something like:

   [chuck](VM): status (now == 0h:2m:34s) ...
      [shred id]: 1  [source]:  [sporked]: 21.43s ago
      [shred id]: 2  [source]:  [sporked]: 28.37s ago

--time prints out the value of now on the listener VM. for example:

   $ chuck --time

something like:

   [chuck](VM): the value of now:
      now = 403457 (samp)
           = 9.148685 (second)
           = 0.152478 (minute)
           = 0.002541 (hour)
           = 0.000106 (day)
           = 0.000015 (week)

--kill semi-gracefully kills the listener VM - removes all shreds first.