Skip to content

Instantly share code, notes, and snippets.

@zeffii
Last active August 29, 2015 14:10
Show Gist options
  • Save zeffii/77b1566efa04493c00a2 to your computer and use it in GitHub Desktop.
Save zeffii/77b1566efa04493c00a2 to your computer and use it in GitHub Desktop.
s.boot;
s.plotTree;
// left and right
(
SynthDef.new("tutorial", { var outArray;
outArray = [SinOsc.ar(440, 0, 0.2), SinOsc.ar(442, 0, 0.2)];
Out.ar(0, outArray)
}).play;
)
// sequential overtones on l r l r l r l r
(
SynthDef.new("tutorial", {
arg tensor=0.2;
var outArray, src;
// 440*(1, 2..6) makes [ 440, 880, 1320, 1760, 2200, 2640 ]
src = SinOsc.ar(440*(1, 2..6), 0, 0.2);
outArray = Splay.ar(src, 1, tensor);
Out.ar(0, outArray)
}).play;
)
// hit s to see them overlapped
(
{
f = 100;
~pitches = (1,2..12); // [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
// ~volumes = 1 / ~pitches;
~volumes = ~pitches.reciprocal; // [ 1/1, 1/2, 1/3 ...] , expressed as decimals
SinOsc.ar(f*~pitches, mul: ~volumes);
}.scope(12)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment