Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (
  2. o=Server.local.options;
  3. o.numOutputBusChannels=2;
  4. o.numInputBusChannels=0;
  5. o.device="ASIO4ALL";
  6.  
  7. o = ServerOptions.new;
  8. o.memSize= o.memSize*2;
  9.  
  10.  
  11. o.device= "ASIO4ALL";
  12. t= Server(\Local12, NetAddr("127.0.0.1", 57111), options: o);
  13. t.makeWindow;
  14. )
  15.  
  16. s.boot;
  17.  
  18. p= ProxySpace.push(s);
  19.  
  20.  
  21.  
  22.  
  23. (
  24. ~kick= {
  25.     arg atk=0.001, dec=0.006, atk2=0, dec2, index1=2000, t_t1=1, amp=0.3;
  26.     var env1, sig, env2, sig2, lIn, fb, mix;
  27.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [2, -1]), gate: t_t1);
  28.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [2, -1]), gate: t_t1)*1200;
  29.     lIn= LocalIn.ar(1);
  30.     fb= lIn*index1;
  31.  
  32.     sig= SinOsc.ar((20*env2) + fb, 0, 0.06);
  33.  
  34.     sig2= (sig*env1)*amp;
  35.     mix= sig2 + Delay1.ar(sig2, 1);
  36.     LocalOut.ar(mix);
  37.     Out.ar(0, sig2!2);
  38. };
  39. )
  40.  
  41. (
  42. ~kick2= {
  43.     arg atk=0.001, dec=0.5, atk2=0, dec2=0.35, index1=10000, t_t1=1, cv1=1;
  44.     var env1, sig, env2, sig2, lIn, fb, mix;
  45.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec*cv1.lag(0.2)], [2, -1]), gate: t_t1);
  46.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2*cv1.lag(0.2)], [2, -1]), gate: t_t1)*100;
  47.     lIn= LocalIn.ar(1);
  48.     fb= lIn*index1;
  49.  
  50.     sig= SinOsc.ar((20*env2) + fb, 0, 0.06);
  51.  
  52.     sig2= (sig*env1);
  53.     mix= sig2 + Delay2.ar(sig2, 1);
  54.     LocalOut.ar(mix);
  55.     Out.ar(0, sig2!2);
  56. };
  57. )
  58.  
  59. (
  60. ~kick3= {
  61.     arg atk=0.0000, dec=0.00, atk2=0, dec2=0.0, index1=100, t_t1=1, amp=0.2;
  62.     var env1, sig, env2, sig2, lIn, fb, mix, del;
  63.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  64.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*6200;
  65.     lIn= LocalIn.ar(1);
  66.     fb= lIn*index1;
  67.  
  68.     sig= SinOsc.ar((1*env2) + fb, 0, 0.6);
  69.  
  70.     sig2= (sig*env1)*amp;
  71.  
  72.     del= DelayC.ar(sig2, 2, 0.1);
  73.     mix= del + sig2;
  74.     LocalOut.ar(mix);
  75.     Out.ar(0, sig2!2);
  76. };
  77. )
  78.  
  79. (
  80. ~kick4= {
  81.     arg atk=0.006, dec=0.16, atk2=0.0, dec2=0.05, index1=100, t_t1=1, cv1=1;
  82.     var env1, sig, env2, sig2, lIn, fb, mix, del;
  83.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  84.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*(2200*cv1.lag(0.2));
  85.     lIn= LocalIn.ar(1);
  86.     fb= lIn*(index1*cv1.lag(0.2));
  87.  
  88.     sig= SinOsc.ar((2.1*env2) + fb, 0, 0.6);
  89.  
  90.     sig2= (sig*env1);
  91.  
  92.     del= DelayC.ar(sig2, 2, 0);
  93.     mix= del + sig2;
  94.     LocalOut.ar(mix);
  95.     Out.ar(0, sig2!2);
  96. };
  97. )
  98.  
  99. (
  100. ~kick5= {
  101.     arg atk=0.04, dec=0.0001, atk2=0, dec2=0.0, index1=89300, t_t1=1, amp=0.1;
  102.     var env1, sig, env2, sig2, lIn, fb, mix, del;
  103.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  104.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*2200;
  105.     lIn= LocalIn.ar(1);
  106.     fb= lIn*index1;
  107.  
  108.     sig= SinOsc.ar((2*env2) + fb, 0, 0.6);
  109.  
  110.     sig2= (sig*env1)*amp;
  111.  
  112.     del= DelayC.ar(sig2, 2, 0.1);
  113.     mix= del + sig2;
  114.     LocalOut.ar(mix);
  115.     Out.ar(0, sig2!2);
  116. };
  117. )
  118.  
  119. (
  120. ~kick6= {
  121.     arg atk=0.001, dec=0.00006, atk2=0, dec2=0.0, index1=300, t_t1=1;
  122.     var env1, sig, env2, sig2, lIn, fb, mix, del;
  123.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  124.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*1200;
  125.     lIn= LocalIn.ar(1);
  126.     fb= lIn*index1;
  127.  
  128.     sig= SinOsc.ar((10) + fb, 0, 0.6);
  129.  
  130.     sig2= (sig*env1);
  131.  
  132.     del= DelayC.ar(sig2, 2, 0.1);
  133.     mix= del + sig2;
  134.     LocalOut.ar(mix);
  135.     Out.ar(0, sig2!2);
  136. };
  137. )
  138.  
  139.  
  140. l= Environment.new;
  141. l[\t1]= {~kick2.set(\t_t1, 1);}
  142. l[\t2]= {~kick.set(\t_t1, 1);}
  143. l[\t3]= { ~kick3.set(\t_t1, 1); };
  144. l[\t4]= { ~kick4.set(\t_t1, 1); };
  145. (
  146. l[\t4_b]= {
  147.       ~kick4.set(\atk, 0.004, \dec, 0.02, \atk2, 0.0
  148.                     , \dec2, 0.000, \index1, 130, \t_t1, 1);
  149.  
  150. };
  151. )
  152.  
  153. (
  154. l[\t4]= {
  155.       ~kick4.set(\atk, 0.00001, \dec, 0.4, \atk2, 0.00004
  156.                     , \dec2, 0.02, \index1, 100, \t_t1, 1);
  157.  
  158. };
  159. )
  160. l[\t5]= { ~kick5.set(\t_t1, 1); };
  161. l[\t6]= { ~kick6.set(\t_t1, 1); };
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. (
  170. ~a= {
  171.     arg atk=0.001, dec=0.00006, atk2=0, dec2=0.0
  172.                 , freq= 350, r1= 2, r2= 6, r3=7, r4=5
  173.                , index1=120, index2= 100, index3= 120, index4=420
  174.                , t_t1=1, amp=0.01, out;
  175.     var env1, sig, env2, sig2, lIn, fb, mix, del, mod1, op1, op2, mod2, mod3, op3, mod4, op4;
  176.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  177.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*1200;
  178.     lIn= LocalIn.ar(1);
  179.     fb= lIn*index1;
  180.     op2= SinOsc.ar((r2*freq), 0, 0.6);
  181.     mod2= op2* index2;
  182.     op3= SinOsc.ar((r3*freq), 0, 0.6);
  183.     mod3= op3* index3;
  184.     op4= SinOsc.ar((r4*freq), 0, 0.6);
  185.     mod4= op4* index4;
  186.  
  187.     sig= SinOsc.ar((r1*freq) + mod2 + mod3 + mod4, 0, 0.6);
  188.  
  189.     sig2= (sig*amp);
  190.  
  191.     //del= DelayC.ar(sig2, 2, 0.1);
  192.     mix= sig2;
  193.     LocalOut.ar(mix);
  194.     Out.ar(out, sig2!2);
  195. };
  196. )
  197. //(SinOsc.kr(4, 0, (1-mD), 0)+(1+mD)/2)
  198.  
  199. (
  200. ~a2= {
  201.     arg atk=0.001, dec=0.00006, atk2=0, dec2=0.0, key=1.2
  202.                 , f= 350, r1= 3, r2= 2, r3=4, r4=5
  203.                , index1=200, index2= 100, index3= 120, index4=60
  204.                , t_t1=1, amp=0.01, cv1=1, out;
  205.     var env1, sig, env2, sig2, lIn, fb, mix, del, mod1, op1, op2, mod2
  206.           , mod3, op3, mod4, op4, freq;
  207.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  208.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*1200;
  209.     lIn= LocalIn.ar(1);
  210.     freq= f;
  211.     fb= lIn*index1;
  212.  
  213.  
  214.     op2= SinOsc.ar(((r2*freq)*key), 0, 0.6);
  215.     mod2= op2* index2;
  216.     op3= SinOsc.ar(((r3*freq)*key), 0, 0.6);
  217.     mod3= op3* index3;
  218.     op4= SinOsc.ar(((r4*freq)*key), 0, 0.6);
  219.     mod4= op4* index4;
  220.  
  221.     sig= SinOsc.ar(((r1*freq)*key) + mod2 + mod3 + mod4+ fb, 0, 0.6);
  222.  
  223.     sig2= (sig*(amp*cv1.lag(0.2)));
  224.  
  225.     //del= DelayC.ar(sig2, 2, 0.1);
  226.     mix= sig2;
  227.     LocalOut.ar(mix);
  228.     Out.ar(out, sig2!2);
  229. };
  230. )
  231.  
  232.  
  233.  
  234. (
  235. ~a3= {
  236.     arg atk=0.001, dec=0.00006, atk2=0, dec2=0.0, key=1.8
  237.                 , freq= 350, r1= 3, r2= 2, r3=4, r4=9
  238.                , index1=500, index2= 100, index3= 320, index4=120
  239.                , t_t1=1, amp=0.02, cv1=1, out=0;
  240.     var env1, sig, env2, sig2, lIn, fb, mix, del, mod1, op1, op2, mod2, mod3, op3, mod4, op4;
  241.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  242.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*1200;
  243.     lIn= LocalIn.ar(1);
  244.     fb= lIn*index1;
  245.     op2= SinOsc.ar(((r2*freq)*key), 0, 0.6);
  246.     mod2= op2* index2;
  247.     op3= SinOsc.ar(((r3*freq)*key), 0, 0.6);
  248.     mod3= op3* index3;
  249.     op4= SinOsc.ar(((r4*freq)*key), 0, 0.6);
  250.     mod4= op4* index4;
  251.  
  252.     sig= SinOsc.ar(((r1*freq)*key) + mod2 + mod3 + mod4, 0, 0.6);
  253.  
  254.     sig2= (sig*(amp*cv1.lag(0.2)));
  255.  
  256.     //del= DelayC.ar(sig2, 2, 0.1);
  257.     mix= sig2;
  258.     LocalOut.ar(mix);
  259.     Out.ar(out, sig2!2);
  260. };
  261. )
  262.  
  263.  
  264. (
  265. ~a4= {
  266.     arg atk=0.001, dec=0.00006, atk2=0, dec2=0.0, key=1.6
  267.                 , freq= 350, r1= 3, r2= 3, r3=6, r4=4
  268.                , index1=120, index2= 100, index3= 120, index4=120
  269.                , t_t1=1, amp=0.002, cv1=1, out=0;
  270.     var env1, sig, env2, sig2, lIn, fb, mix, del, mod1, op1, op2, mod2, mod3, op3, mod4, op4;
  271.     env1= EnvGen.kr(Env.new([0, 1, 0], [atk, dec], [12, -12]), gate: t_t1);
  272.     env2= EnvGen.kr(Env.new([0, 1, 0], [atk2, dec2], [12, -12]), gate: t_t1)*1200;
  273.     lIn= LocalIn.ar(1);
  274.     fb= lIn*index1*
  275.     op2= SinOsc.ar(((r2*freq)*key), 0, 0.6);
  276.     mod2= op2* index2;
  277.     op3= SinOsc.ar(((r3*freq)*key), 0, 0.6);
  278.     mod3= op3* index3;
  279.     op4= SinOsc.ar(((r4*freq)*key), 0, 0.6);
  280.     mod4= op4* index4;
  281.  
  282.     sig= SinOsc.ar(((r1*freq)*key) + mod2 + mod3 + mod4, 0, 0.6);
  283.  
  284.     sig2= (sig*(amp*cv1.lag(0.2)));
  285.  
  286.     //del= DelayC.ar(sig2, 2, 0.1);
  287.     mix= sig2;
  288.     LocalOut.ar(mix);
  289.     Out.ar(out, sig2!2);
  290. };
  291. )
  292.  
  293.  
  294.  
  295.  
  296. (
  297. ~a.set(\out, l[\bus1]);
  298. ~a2.set(\out, l[\bus1]);
  299. ~a3.set(\out, l[\bus1]);
  300. ~a4.set(\out, l[\bus1]);
  301.  
  302. )
  303. l[\bus1]= Bus.audio(s, 2);
  304. ~reverb.set(\in, l[\bus1]);
  305.  
  306. (
  307.  
  308. ~reverb= {
  309.         arg in, predelay=5, revtime=12,
  310.         lpf=2500, mix=0.4, amp=0.06, out=0;
  311.         var dry, wet, temp, sig;
  312.         dry = HPF.ar(In.ar(in, 2), 320);
  313.         temp = HPF.ar(In.ar(in, 2), 320);
  314.         wet = 0;
  315.         temp = DelayN.ar(temp, 0,2, predelay);
  316.         16.do{
  317.             temp = AllpassN.ar(temp, 0.05, {Rand(0.001,0.05)}!2, revtime);
  318.             temp = LPF.ar(temp, lpf);
  319.             wet = wet + temp;
  320.         };
  321.         sig = XFade2.ar(dry, wet, mix*2-1, amp);
  322.         Out.ar(out, sig);
  323.     };
  324. )
  325.  
  326.  
  327.  
  328.  
  329. TempoClock.default.tempo = 2.3333333333333;
  330.  
  331.  
  332.  
  333.  
  334.  
  335. l= Environment.new;
  336.  
  337.  
  338. //secu1
  339. (
  340. Tdef(\sub1, {
  341.     inf.do{
  342.  
  343.  
  344.         1.do{
  345.                l[\c1Sub1]= -1;
  346.                "start1".postln;
  347.                l[\Dy].value;
  348.         64.do{
  349.  
  350.  
  351.                 l[\c1Sub1]= ((l[\c1Sub1].value) + 1);
  352.  
  353.                 //((l[\c1Sub1]%64)+1).postln;
  354.  
  355.                 switch( ((l[\c1Sub1]%64) + 1)
  356.                     , 1,  {s.makeBundle(s.latency, {l[\t4].value;});}
  357.                     //, 9,  {s.makeBundle(s.latency, {l[\t2].value;});}
  358.                     , 16,  {s.makeBundle(s.latency, {l[\t3].value;});}
  359.  
  360.                     , 20, {s.makeBundle(s.latency, {l[\t5].value;});}
  361.                     , 26, {s.makeBundle(s.latency, {l[\t2].value;});}
  362.                     //, 36, {s.makeBundle(s.latency, {l[\t6].value;});}
  363.                     , 46, {s.makeBundle(s.latency, {l[\t6].value;});}
  364.                     //, 40, {s.makeBundle(s.latency, {l[\t3].value;});}
  365.                     , 48, {s.makeBundle(s.latency, {l[\t3].value;}); }
  366.                     , 56, {s.makeBundle(s.latency, {l[\t3].value;});}
  367.                     , 57, {s.makeBundle(s.latency, {l[\t5].value;});}
  368.                          );
  369.  
  370.  
  371.                 0.026785714285714.wait;
  372.  
  373.               };
  374.  
  375.             l[\c1Sub1]= -1;
  376.  
  377.             "start2".postln;
  378.  
  379.            64.do{
  380.  
  381.  
  382.                 l[\c1Sub1]= ((l[\c1Sub1].value) + 1);
  383.  
  384.                 //((l[\c1Sub1]%64)+1).postln;
  385.  
  386.                 switch( ((l[\c1Sub1]%64) + 1)
  387.                     //, 1,  {s.makeBundle(s.latency, {l[\t6].value;});}
  388.                     , 3,  {s.makeBundle(s.latency, {l[\t6].value;});}
  389.                     , 12,  {s.makeBundle(s.latency, {l[\t5].value;});}
  390.                     , 15,  {s.makeBundle(s.latency, {l[\t2].value; });}
  391.                     //, 18, {s.makeBundle(s.latency, {l[\t3].value;});}
  392.                     //, 21,  {s.makeBundle(s.latency, {l[\t4_b].value; });}
  393.                     , 24, {s.makeBundle(s.latency, {l[\t4_b].value;});}
  394.                     //, 26, {s.makeBundle(s.latency, {l[\t4_b].value;});}
  395.                     , 31, {s.makeBundle(s.latency, {l[\t3].value;});}
  396.                     //, 36, {s.makeBundle(s.latency, {l[\t3].value;});}
  397.                     , 36, {s.makeBundle(s.latency, {l[\t1].value; l[\t3].value; });}
  398.                     //, 49, {s.makeBundle(s.latency, {l[\t1].value;});}
  399.                          );
  400.  
  401.  
  402.                 0.026785714285714.wait;
  403.  
  404.               };
  405.  
  406.  
  407.  
  408.         };
  409.  
  410.     };
  411.  
  412. });
  413.  
  414. )
  415.  
  416.  
  417. //secu2
  418. (
  419. Tdef(\sub2, {
  420.     inf.do{
  421.  
  422.  
  423.         1.do{
  424.                l[\c1Sub2]= -1;
  425.                "start1".postln;
  426.                l[\yEy].value;
  427.         64.do{
  428.  
  429.  
  430.                 l[\c1Sub2]= ((l[\c1Sub2].value) + 1);
  431.  
  432.                 //((l[\c1Sub1]%64)+1).postln;
  433.  
  434.                 switch( ((l[\c1Sub2]%64) + 1)
  435.                     , 1,  {s.makeBundle(s.latency, {l[\t4].value;});}
  436.                     //, 9,  {s.makeBundle(s.latency, {l[\t2].value;});}
  437.                     , 16,  {s.makeBundle(s.latency, {l[\t3].value;});}
  438.  
  439.                     , 20, {s.makeBundle(s.latency, {l[\t5].value;});}
  440.                     , 26, {s.makeBundle(s.latency, {l[\t2].value;});}
  441.                     //, 36, {s.makeBundle(s.latency, {l[\t6].value;});}
  442.                     , 46, {s.makeBundle(s.latency, {l[\t6].value;});  }
  443.                     //, 40, {s.makeBundle(s.latency, {l[\t3].value;});}
  444.                     , 48, {s.makeBundle(s.latency, {l[\t3].value;});}
  445.                     , 56, {s.makeBundle(s.latency, {l[\t3].value;});}
  446.                     , 57, {s.makeBundle(s.latency, {l[\t5].value;});}
  447.                          );
  448.  
  449.  
  450.                 0.026785714285714.wait;
  451.  
  452.               };
  453.  
  454.             l[\c1Sub2]= -1;
  455.  
  456.             "start2".postln;
  457.  
  458.            64.do{
  459.  
  460.  
  461.                 l[\c1Sub2]= ((l[\c1Sub2].value) + 1);
  462.  
  463.                 //((l[\c1Sub1]%64)+1).postln;
  464.  
  465.                 switch( ((l[\c1Sub2]%64) + 1)
  466.                     //, 1,  {s.makeBundle(s.latency, {l[\t6].value;});}
  467.                     , 3,  {s.makeBundle(s.latency, {l[\t6].value;}); }
  468.                     , 12,  {s.makeBundle(s.latency, {l[\t5].value;}); }
  469.                     , 15,  {s.makeBundle(s.latency, {l[\t2].value; });}
  470.                     //, 18, {s.makeBundle(s.latency, {l[\t3].value;});}
  471.                     //, 21,  {s.makeBundle(s.latency, {l[\t4_b].value; });}
  472.                     //, 24, {s.makeBundle(s.latency, {l[\t4_b].value;});}
  473.                     //, 20, {s.makeBundle(s.latency, {l[\t4_b].value;});}
  474.                     , 31, {s.makeBundle(s.latency, {l[\t3].value;});}
  475.                     //, 36, {s.makeBundle(s.latency, {l[\t3].value;});}
  476.                     , 36, {s.makeBundle(s.latency, {l[\t1].value; l[\t3].value; });}
  477.                     //, 49, {s.makeBundle(s.latency, {l[\t1].value;});}
  478.                          );
  479.  
  480.  
  481.                 0.026785714285714.wait;
  482.  
  483.               };
  484.  
  485.  
  486.  
  487.         };
  488.  
  489.     };
  490.  
  491. });
  492.  
  493. )
  494.  
  495.  
  496.  
  497. //secu3
  498. (
  499. Tdef(\sub3, {
  500.     inf.do{
  501.  
  502.  
  503.         1.do{
  504.                l[\c1Sub3]= -1;
  505.                "start1".postln;
  506.              l[\Gy].value;
  507.  
  508.         64.do{
  509.  
  510.  
  511.                 l[\c1Sub3]= ((l[\c1Sub3].value) + 1);
  512.  
  513.                 //((l[\c1Sub1]%64)+1).postln;
  514.  
  515.                 switch( ((l[\c1Sub3]%64) + 1)
  516.                     , 1,  {s.makeBundle(s.latency, {l[\t4].value;});}
  517.                     //, 9,  {s.makeBundle(s.latency, {l[\t2].value;});}
  518.                     , 16,  {s.makeBundle(s.latency, {l[\t3].value;});}
  519.                     //, 20, {s.makeBundle(s.latency, {l[\t5].value;});}
  520.  
  521.                     , 20, {s.makeBundle(s.latency, {l[\t5].value;});}
  522.                     , 26, {s.makeBundle(s.latency, {l[\t2].value;});}
  523.                     //, 36, {s.makeBundle(s.latency, {l[\t6].value;});}
  524.                     , 46, {s.makeBundle(s.latency, {l[\t6].value;});}
  525.                     , 47, {s.makeBundle(s.latency, {l[\t4].value;});}
  526.                     , 48, {s.makeBundle(s.latency, {l[\t3].value;});}
  527.                     //, 56, {s.makeBundle(s.latency, {l[\t3].value;});}
  528.                     , 57, {s.makeBundle(s.latency, {l[\t5].value;});}
  529.                          );
  530.  
  531.  
  532.                 0.026785714285714.wait;
  533.  
  534.               };
  535.  
  536.             l[\c1Sub3]= -1;
  537.  
  538.             "start2".postln;
  539.            64.do{
  540.  
  541.  
  542.                 l[\c1Sub3]= ((l[\c1Sub3].value) + 1);
  543.  
  544.                 //((l[\c1Sub1]%64)+1).postln;
  545.  
  546.                 switch( ((l[\c1Sub3]%64) + 1)
  547.                     //, 1,  {s.makeBundle(s.latency, {l[\t6].value;});}
  548.                     , 3,  {s.makeBundle(s.latency, {l[\t6].value;});}
  549.                     , 12,  {s.makeBundle(s.latency, {l[\t5].value;});}
  550.                     , 15,  {s.makeBundle(s.latency, {l[\t2].value; });}
  551.                     //, 18, {s.makeBundle(s.latency, {l[\t3].value;});}
  552.                     //, 21,  {s.makeBundle(s.latency, {l[\t4_b].value; });}
  553.                     , 24, {s.makeBundle(s.latency, {l[\t6].value;});}
  554.                     //, 30, {s.makeBundle(s.latency, {l[\t4_b].value;});}
  555.                     //, 20, {s.makeBundle(s.latency, {l[\t4_b].value;});}
  556.                     , 31, {s.makeBundle(s.latency, {l[\t3].value;});}
  557.                     //, 36, {s.makeBundle(s.latency, {l[\t3].value;});}
  558.                     , 36, {s.makeBundle(s.latency, {l[\t1].value; l[\t3].value; });}
  559.                     //, 49, {s.makeBundle(s.latency, {l[\t1].value;});}
  560.                          );
  561.  
  562.  
  563.                 0.026785714285714.wait;
  564.  
  565.               };
  566.  
  567.  
  568.  
  569.         };
  570.  
  571.     };
  572.  
  573. });
  574.  
  575. )
  576.  
  577. //global sequencer
  578. (
  579. Tdef(\secu1, {
  580.     var c1;
  581.  
  582.  
  583.  inf.do{
  584.  
  585.  
  586.         c1= (-1);
  587.     128.do{
  588.             c1= c1 + 1;
  589.             if( (((c1%128)+1) == 1).and(l[\SelSeq].value == 1)
  590.                 , {s.makeBundle(s.latency, {  Tdef(\sub2).stop; Tdef(\sub3).stop;
  591.                         Tdef(\sub1).quant_(0).play; "caca".postln;  }); }
  592.                 , { }
  593.             );
  594.  
  595.             if( (((c1%128)+1) == 1).and(l[\SelSeq].value == 2)
  596.                 , { s.makeBundle(s.latency, { Tdef(\sub1).stop; Tdef(\sub3).stop;
  597.                       Tdef(\sub2).quant_(0).play; "____".postln; }); }
  598.                 , {}
  599.             );
  600.  
  601.             if( (((c1%128)+1) == 1).and(l[\SelSeq].value == 3)
  602.                 , { s.makeBundle(s.latency, { Tdef(\sub2).stop; Tdef(\sub1).stop;
  603.                          Tdef(\sub3).quant_(0).play;  "///////".postln; }); }
  604.                 , {}
  605.             );
  606.  
  607.         0.026785714285714.wait;
  608.          };
  609.  
  610.  
  611.     };
  612. });
  613. )
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621. (
  622.  
  623. g= Environment.new;
  624. Window.closeAll;
  625. g[\window]= Window("gui", Rect(750, 50, 500, 200)).front.alwaysOnTop_(true);
  626.  
  627. g[\slider]= Slider(g[\window], Rect(20, 20, 150, 30))
  628. .background_(Color(0.2, 075, 0.95))
  629. .action_({
  630.                   arg obj;
  631.                    var cf, cf2, cf3, cf4, cf5, cf6;
  632.                       cf= obj.value.linexp(0,1, 0.4, 1.1);
  633.                       cf2= obj.value.linexp(0,1, 0.001, 1);
  634.                       cf3= obj.value.linexp(0,1, 1.0, 0.01);
  635.                       cf4= obj.value.linexp(0,1, 0.5, 1.5);
  636.                       cf5= obj.value.linexp(0,1, 0.95, 1.5);
  637.                       cf6= obj.value.linexp(0,1, 1, 0);
  638.  
  639.                      ~kick2.set(\cv1, cf);
  640.  
  641.                     ~kick4.set(\cv1, cf4);
  642.                      //~a4.set(\cv1, cf4);
  643.  
  644.  
  645.  
  646.  
  647.             });
  648.  
  649.  
  650. g[\slider2]= Slider(g[\window], Rect(20, 60, 150, 30))
  651. .background_(Color(0.2, 075, 0.95))
  652. .action_({
  653.                   arg obj;
  654.                    var cf, cf2, cf3;
  655.                       cf= obj.value.linexp(0,1, 0.01, 1.0);
  656.                       cf2= (l[\1].map(g[\slider2].value));
  657.                       cf3= (l[\2].map(g[\slider2].value));
  658.                       cf2= (cf2/100);
  659.                       cf3= (cf3/100);
  660.  
  661.                      ~a2.set(\cv1, cf2);
  662.                      ~a3.set(\cv1, cf3);
  663.                     //~synth1.set(\cv3, cf);
  664.                     ~a4.set(\cv1, cf);
  665.                    // ~a3.set(\cv1, cf);
  666.  
  667.  
  668.             });
  669.  
  670. g[\button1]= Button(g[\window], Rect(190, 20, 30, 30)).states_([
  671. ["1*", Color.black, Color.gray(0.8)]]).action_({
  672. arg obj;
  673.     if( obj.value == 0, { l[\SelSeq]= 1; }, {l[\SelSeq]= 0;});});
  674.  
  675. g[\button2]= Button(g[\window], Rect(225, 20, 30, 30)).states_([
  676. ["2*", Color.black, Color.gray(0.8)]]).action_({
  677. arg obj;
  678.     if( obj.value == 0, { l[\SelSeq]= 2; }, {l[\SelSeq]= 0;});});
  679.  
  680. g[\button3]= Button(g[\window], Rect(260, 20, 30, 30)).states_([
  681. ["3*", Color.black, Color.gray(0.8)]]).action_({
  682. arg obj;
  683.     if( obj.value == 0, { l[\SelSeq]= 3; }, {l[\SelSeq]= 0;});});
  684.  
  685.  
  686. g[\button4]= Button(g[\window], Rect(90, 160, 50, 30)).states_([
  687. ["START", Color.black, Color.green(0.8)]]).action_({
  688. arg obj;
  689.     if( obj.value == 0, { l[\SelSeq]= 1; Tdef(\secu1).quant_(0).play; }, {});});
  690.  
  691. g[\button5]= Button(g[\window], Rect(30, 160, 50, 30)).states_([
  692. ["STOP", Color.black, Color.blue(0.8)]]).action_({
  693. arg obj;
  694.     if( obj.value == 0, { Tdef(\secu1).stop; Tdef(\sub2).stop; Tdef(\sub1).stop; Tdef(\sub3).stop;}, {});});
  695.  
  696.  
  697.  
  698. l[\1]= [  0.0001 , 100.0, \lin, 0.1, 0.5, "hz"].asSpec;//controlSpec
  699. l[\2]= [ -100 , 0.0001, \lin, 0.1, 0.5, "hz"].asSpec;
  700.  
  701. )
  702.  
  703.  
  704.  
  705. l[\SelSeq]= 1; // secu1
  706. l[\SelSeq]= 2; // secu2
  707. l[\SelSeq]= 3; // secu3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement