Skip to content

Instantly share code, notes, and snippets.

@edeleflie
Created October 5, 2011 03:57
Show Gist options
  • Save edeleflie/1263591 to your computer and use it in GitHub Desktop.
Save edeleflie/1263591 to your computer and use it in GitHub Desktop.
SC GUI controlled
~orchestra= Buffer.read(s, "/Users/etiennedeleflie/Documents/teaching/music_synthesis/08/classical_long.wav");
~orchestra= Buffer.read(s, "/Users/etiennedeleflie/imagesynth/audio/DoubleBass.wav");
(
~first_filter = Synth("auditory_s_s", [ \in, 100, \out, 0, \pan, 0.3, \source_vol, 0.5, \vol, 0.5, \room, 0.7 ]); // try a rate of 0.1
~xenakish_1 = Synth("Xenakish", [ \out, 100, \soundFile, ~orchestra, \speed, 1.0, \goTo, 0.5, \t_ramp, 1, \grainLength, 0.05, \triggerGrainEvery, 0.01, \randomPosSpread, 0.008 ]);
// create a Lindenmeyer system pattern
~linden_1 = Prewrite(0, ( 0: #[0.0125, 0.0375, 0.075, 0.125, 0.250, 0.5, 2.0 ],
0.0375: #[0.0125, 0.0375, 0.5 ],
0.0125: #[0.250, 0.0125, 0.0375, 0.0125],
0.5: #[0.5, 0.0125, 0.0375, 0.0125 , 0.0375]),
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, ~xenakish_1.nodeID,
  \args, #[vol, triggerGrainEvery],
\triggerGrainEvery, ~linden_1,
\dur, 1
).play;
)
// this maps all the OSC messages to their corresponding synth
(
var savedGoIn = 0;
var window = SCWindow.new("",Rect(318, 456, 400, 400)).front;
SCSlider.new(window,Rect(56, 26, 288, 36))
.action_{|v| ~first_filter.set(\source_vol, v.value * 2 ); };
SCSlider.new(window,Rect(36, 275, 337, 49))
.action_{|v| ~xenakish_1.set(\goTo, v.value, \goIn, savedGoIn, \t_ramp, 1); };
SCKnob.new(window,Rect(38, 153, 82, 72))
.action_{|v| savedGoIn = (v.value * 2000);};
SCButton.new(window,Rect(197, 149, 100, 20))
.states_([ [ "Root", Color(0.0, 0.0, 0.0, 1.0), Color(1.0, 0.0, 0.0, 1.0) ] ])
.action_{|v| ~xenakish_1.set(\speed, Scale.major.tuning.ratios[0] ) };
SCButton.new(window,Rect(197, 175, 100, 20))
.states_([ [ "Fourth", Color(0.0, 0.0, 0.0, 1.0), Color(1.0, 0.0, 0.0, 1.0) ] ])
.action_{|v| ~xenakish_1.set(\speed, Scale.major.tuning.ratios[6] ) };
SCButton.new(window,Rect(197, 204, 100, 20))
.states_([ [ "Fifth", Color(0.0, 0.0, 0.0, 1.0), Color(1.0, 0.0, 0.0, 1.0) ] ])
.action_{|v| ~xenakish_1.set(\speed, Scale.major.tuning.ratios[8] ) };
SCStaticText.new(window,Rect(60, 68, 100, 20))
.string_("Source_vol")
.action_{|v| };
SCStaticText.new(window,Rect(39, 343, 100, 20))
.string_("goIn")
.action_{|v| };
SCStaticText.new(window,Rect(36, 235, 100, 20))
.string_("goTo")
.action_{|v| };
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment