supernova: fix for small audio vector sizes
[supercollider.git] / HelpSource / Tutorials / JITLib / basic_live_coding_techniques.schelp
blobeef3a65a85b460af12f34445ecec9c1a8ea74d20
1 title:: basic_live_coding_techniques
2 summary:: basic live coding techniques
3 categories:: Libraries>JITLib>Tutorials
5 basic live coding techniques ("object style") without the use of JITLib
7 more to come..
9 using a simple environment. this looks just like ProxySpace, but works differently. for the difference, see link::Tutorials/JITLib/jitlib_basic_concepts_01:: and link::Tutorials/JITLib/jitlib_basic_concepts_02::.
11 code::
12 d = (); // create a new environment
13 d.push; // push it to current
15 // this synthdef can be changed on the fly, but the synth will
16 // not change from this. use expression [1] for replacing a given synth
18 SynthDef(\x, { |freq=440|
19         Out.ar(0,
20                 Ringz.ar(Dust.ar(40), freq, 0.1)
21         )
22 }).send(s);
25 // send a first synth:
26 ~s1 = Synth(\x);
28 // [1]
29 // now you can play around with these lines, as well as with the synth def above
30 ~s1 = Synth.replace(~s1, \x, [\freq, 3000]);
31 ~s1.set(\freq, 4000);
33 // add a bus:
35 ~b1 = Bus.control(s);
36 ~b1.set(350);
37 ~s1.map(\freq, ~b1);
39 // set the bus to different values:
41 ~b1.set(100);
42 ~b1.xline(800, 5);
44 ~s3 = { Out.kr(~b1, MouseX.kr(300, 900, 1)) }; // add some mouse control on the fly
45 ~s3.free; // remove it again.
49 // finish:
51 ~b1.free;
52 d.clear;
53 d.pop;