Music 171 homework 6
This and future assignments are designed to be possible starting points
for a final project. This assignment is to make an interactive sampler that
makes decisions based on microphone inputs. If you clap into it twice it
should then continue the pattern, clapping back to you at whatever time interval
you set (the time between the two claps). If you clap once (i.e., the last
clap it has received is more than a second ago), it should update the sample
without changing the rhythm.
Here are a sample input and
To make the patch:
- Use the bonk~ object to detect attacks (beginnings of sounds) in the
patch's input. The input should come from an adc~ object, but for testing you
can store a sound in an array instead. If not, be sure to use headphones so
that the speaker doesn't feed back into the mic. The bonk~ object is calibrated
to work best for quiet signals; you can multiply the adc~ output by 0.03 or so
before feeding it to bonk~ for good results. Before you go further it would be
a good idea to test this by connecting a bonk~ output (either one) to a print
object and verify that it is triggering OK.
- Each time bonk~ outputs a message, begin recording the adc~ output (or
your test signal) into an array for later playback.
- Also each time bonk~ outputs a message, measure the time from the previous
message. If this time is less than a second, use it to set the time interval of
a metro object and start (or restart) the metro. It will then continue
outputting bang messages at the tempo set by the two bonk~ messages.
- Each time the metro outputs a bang, start a sample playback. You can just
use tabplay~ for this for simplicity, but you should mute the output before
starting playback to avoid clicks, as shown in 4b.more-sampler.pd (although I
only used 5 milliseconds here, not 10 as in that example).
- For sanity's sake, make a button that stops the metronome. (You can start
it again anytime by making another pair of attacks in the audio input).
back to music 171 main page