my aim for this project was to create a performable effect to work in tandem with an acoustic piano. i originally had 3 sub-goals:
my background is in piano performance, and since becoming interested in electronic music, i've been curious as to how i can integrate the skills i already have with the ones i'm currently developing. prior to starting this project, i hadn't seriously attempted to bridge my interests in these two areas. i found that in bringing electronics to the piano, or vice versa, i had difficulty retaining the artistic freedom i felt when creating with either tool separately. this motivated me to create an effect and interface that are performable both on their own and with the piano.
the overall signal flow of the patch is as follows:
i decided to use piezo contact mics to mic the piano. while the audio quality isn't great, using contact microphones eliminates any risk of feedback while recording, and the low fidelity of the piezos adds some charm to the sound.
when recording is initiated, incoming audio is recorded into the buffers. the recordhead slider displays the portion of the buffers that is overwritten while recording is enabled. when recording is initiated, writing begins, and the amplitude of the incoming audio is enveloped from 0 to 1. when recording is ended, the audio is enveloped from 1 to 0, and writing stops. this is done to prevent any sudden jumps in amplitude. if the end of a buffer is reached while recording, then the record-head circles back to the beginning of the buffer.
figure 6 illustrates the relationship between sample index and time when a buffer is played back at normal speed and normal pitch. one way to play the buffer at twice the pitch would be to play the buffer at twice the speed, however a change in playback speed may not be desired (fig. 7). borrowing a technique from granular synthesis, we can separate playback speed and playback pitch.
each grain-reader reads through its corresponding buffer according to the sum of two sawtooth waves (called phasor~ in pd). the first sawtooth determines playback pitch, the second determines playback speed. the pitch phasor reads through a small window of the buffer at a frequency corresponding to the desired pitch. the size of this window is determined by the window size slider in figure 8. for the purposes of my patch, i've decided to keep it at 2000 samples. at the beginning of each cycle, this smaller phasor is added to an offset value determined by the playback speed phasor. this offset compensates for any unwanted speed changes by overlapping windows, and repeating portions of the buffer (fig. 9), or skipping portions of the buffer (fig. 10). the sum of these sawtooth waves is sent to a tabread4~ object, which reads through the corresponding buffer. the sudden jumps in sample index cause a click at the beginning of each new window, so the amplitude of the output is scaled by a hanning function. this windowing is done with 50% overlap to maintain constant power.
there are micro and macro controls for the patch. the micro controls are relatively straight-forward, and change the parameters of each individual grain-pair. using the loop # radio object (fig. 1), or the corresponding midi control, one can select which grain-pair is being affected. when any given micro control change is given, the value from that slider is prepended by a number (0-5) before being sent to the cloned grain-reader patch (fig. 6). the sub-patch above (fig. 12) shows how this is done, and how the MIDI controls are mapped.
the macro controls are a bit more convoluted. (fig. 13, 14, 15 below) the two macro controls are labeled speed and density. they function together to randomize the parameters of each grain. speed controls the rate of a metro~which bangs a random object. the outputted value is compared to a value determined by the density control, using the moses~ object. if density is low, then theprobability that parameter randomization will occur is low. figure 13 illustrates this process. if the random value passes the moses object, then one of the grains has its playback speed and pitch randomized. a random transposition value is chosen from a set determined in figure 14. there are four sets; no transposition, octave up or down, 5th up or 4th down, or any semitone within an octave from the original pitch. the active set can be selected by the user. in addition, a bang is sent to each of the random objects in figure 15, the output of which goes through another comparison against the density value. if this random value passes the test, then one of the grains is sent an amplitude envelope with a randomized duration.
the audio output stage of the patch can be seen in figure 16. the objects labeled clone grain read are clones of the grain-reader patch (fig. 6). as stated earlier, all of the parameter changes sent to the clone objects are prepended by a clone number that addresses the parameter change to the correct clone. there are 6 clones that read from the left buffer, and 6 clones that read from the right buffer. the combined output of either side is scaled by the output slider (fig. 1). there is also a mute button in figure 1, which mutes the output.
while i do feel that i accomplished most of what i set out to do, my original goals for i this project were ambitious, and there are some things that i left out/didn't get to. i spent most of my time working on on the patch portion of the project, as it underwent a few different iterations. this left me little time to further develop the physical interface portion of the project, and i ended up using a midi controller that i already had to control the patch. while it works as intended, i would like to further explore interface design in the future.
timestretch/pitchshift demo looper demo