Skip to content

Instantly share code, notes, and snippets.

@edeleflie
Created October 5, 2011 04:54
Show Gist options
  • Save edeleflie/1263669 to your computer and use it in GitHub Desktop.
Save edeleflie/1263669 to your computer and use it in GitHub Desktop.
Shifted ... a synth that processes external sound input
(
SynthDef("shifted", { arg out=0,
shiftAmount = 0; // should be -1 to 1
var in, chain;
in = SoundIn.ar(0);
chain = FFT(LocalBuf(512), in);
chain = PV_BinShift(chain, 1, shiftAmount * 128 );
Out.ar(out, 0.5 * IFFT(chain).dup);
}).store();
)
(
~first_filter = Synth("auditory_s_s", [ \in, 100, \out, 0, \pan, 0.3, \source_vol, 0.5, \vol, 0.3, \room, 0.7 ]); // try a rate of 0.1
~shifty = Synth("shifted", [ \out, 100 ]);
// create a Lindenmeyer system pattern
~linden_1 = Prewrite(0, ( 0: #[ 0, 0.1, 0.2, -0.5, 0.23 ],
0.2: #[ -0.25, 0.2, 0.25, -0.2],
-0.5: #[ 0.5, -0.5 ],
0.23: #[0.05, -0.23, -0.05, -0.10 , -0.9]),
3);
)
// check what the lindenmeyer system gives me
x = ~linden_1.asStream; 40.do({ ((x.next)).post; "-".post });
// run the patterns together
(
// this pattern just changes the volume on the xenakish synth, creates structure
q = Pbind( \type, \set, \id, ~shifty.nodeID,
  \args, #[shiftAmount],
\shiftAmount, ~linden_1,
\dur, 0.2
).play;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment