1 title:: jitlib_asCompileString
2 summary:: asCompileString in JITLib
3 categories:: Libraries>JITLib>Tutorials
6 { 10 + 6 * ~harry }.asCompileString;
9 many objects understand strong::.storeOn::, which a way to post their string that is needed to reproduce them by compilation. sometimes one wants to store a certain configuration of a proxy space, which can be done
10 if all functions used are closed functions.
13 // an example how ProxySpace can document its current state:
15 p = ProxySpace.push(s);
21 4.do { |i| z = z * SinOsc.kr(i.sqrt, i+[0,0.2]) };
25 ~ctl2[0] = { LFNoise2.kr([20,20],20) };
27 LFNoise2.kr([20,20],20) * LFNoise0.kr([20,20],20)
31 SinOsc.ar(~freq.kr, 0, 0.1)
34 ~freq[0] = { ~ctl1.kr(2) + ~ctl2.kr(2) + 400 };
35 ~freq[5] = ~ctl1.wrap2(~ctl2) * ~ctl1 / (~ctl2 + ~ctl1);
37 ~pat = Pbind(\freq, Pfunc({ 1.2.rand }));
39 ~out.set(\freq, 760, \ffreq, 20);
44 // the document message creates a new document which it posts the code into
46 p.document; // document everything
47 p.document([\out]); // document all dependants of ~out
48 p.document([\ctl1]); // document all dependants of ~ctl1