class library: Volume - use ServerBoot to send synthdef
[supercollider.git] / examples / misuse_and_hacks / redSnake.scd
blobe515f4dd14c3e43225619dee265ffd6a95df5178
1 (                                       //z z z z z z z z z z z z z z z z
2 s.waitForBoot{{                                                                 
3         var d= Document.allDocuments.choose.front,              
4                 c, i= 0, j= 1, k= 1,                                            
5                 syn= {|f, o| SinOsc.ar(f*[1, 1.01], LPF.ar(LFSaw.ar(f, 0, o), 80))}.play;
6                 0.5.wait;                                                                       
7         loop{                                                                           
8                 d.selectRange(i.div(2)%d.string.size, i%2); c= d.selectedText[0];
9                 syn.set(\f, 99*k+c.ascii, \o, i%(d.string.size*2)/d.string.size*99);
10                 i= i+j;                                                                 
11                 if("%&@".includes(c), {i= i-[8, 4, -1].choose});
12                 if("(){}.,:".includes(c), {j= [-1, 1, 0.25, 1/3, 3]@@i});
13                 if(c==$\n, {k= [1, 1.06, 0.5]@@i});                     
14                 (1/40).wait                                                             
15         }                                                                                       
16 }                                                                                               
17 .fork(AppClock)                                                                 
18 }                                                                                               
19 )                                       //z z z z z z z z z z z z z z z z
21 // f0 // March 17th 2007