Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

song manager

  • Loading branch information...
commit 26c2f33b4958807994c05077417a05282adfb434 1 parent 4ed7306
@grirgz authored
Showing with 10,680 additions and 630 deletions.
  1. BIN  .player.sc.un~
  2. BIN  .side.sc.un~
  3. +11 −0 BUGS
  4. +152 −0 abcparser.sc
  5. +119 −0 bindings.sc
  6. +60 −0 crap17.sc
  7. +1 −0  crap18.sc
  8. +2 −0  crap19.sc
  9. +382 −0 crap20.sc
  10. +546 −0 crap21.sc
  11. +42 −0 crap22.sc
  12. +49 −0 crap23.sc
  13. +141 −0 crap24.sc
  14. +93 −0 crap25.sc
  15. +50 −0 crap26.sc
  16. +68 −0 crap27.sc
  17. +41 −0 crap28.sc
  18. +4 −0 crap29.sc
  19. +435 −0 crap30.sc
  20. +35 −5 eventscore.sc
  21. +12 −118 keycode.sc
  22. +1 −0  live13.sc
  23. +286 −14 live14.sc
  24. +344 −0 live15.sc
  25. +471 −0 live16.sc
  26. +1,099 −0 live17.sc
  27. +221 −0 live18.sc
  28. +314 −0 live19.sc
  29. +416 −0 live20.sc
  30. +493 −0 live21.sc
  31. +406 −0 live22.sc
  32. +378 −0 live23.sc
  33. +137 −0 live24.sc
  34. +468 −0 live26.sc
  35. +138 −0 live27.sc
  36. +43 −8 main.sc
  37. +165 −3 matrix.sc
  38. +131 −3 midi.sc
  39. +222 −13 node_manager.sc
  40. +210 −65 param.sc
  41. +254 −60 player.sc
  42. +61 −0 samplelib.sc
  43. +206 −0 sccode.sc
  44. +796 −331 side.sc
  45. +537 −0 sidematrix.sc
  46. +418 −0 synthlab.sc
  47. +113 −10 synthpool.sc
  48. +109 −0 synthpool_sts.sc
View
BIN  .player.sc.un~
Binary file not shown
View
BIN  .side.sc.un~
Binary file not shown
View
11 BUGS
@@ -0,0 +1,11 @@
+- les param de type bus sont pas pris en compte lors du liveplay
+- pad_select_param desactivé apres liveplay
+- au load il y a des doubles selections
+- bufferpool fait trop de warning et reagis pas au disable debug
+- effets marche plus
+- impossible de suprimer des effets
+- pas moyen de creer un autre pargroups sans passer par le code ou copier l'existant
+- pas de key_mode pour stepline
+- ralentissement quand on passe en mode matrix
+- lors du load, les buffers en key_mode (mais pas que ?) reviennent par defaut
+- lors de la creation d'un synthdef par un mdef, le mode preset de dur reste
View
152 abcparser.sc
@@ -0,0 +1,152 @@
+
+(
+~abcparser = Environment.make({
+ var cur = currentEnvironment;
+
+ ~notedef = Dictionary.newFrom(("CDEFGABcdefgab".as(Array).collect { arg ch, idx; [ch, idx-7] }).flat);
+ ~notedef[$_] = \r;
+ ~digitdef = Dictionary.newFrom(("123456789".as(Array).collect { arg ch, idx; [ch, idx+1] }).flat);
+
+ ~is_terminal = { arg char;
+ ~notedef[char].notNil or: { [ $[, $] ].includes(char) }
+ };
+
+ ~strip_spaces = { arg str;
+ str.replace(" ", "")
+ };
+
+ ~split_string = { arg str;
+ var res = List.new;
+ var accu = "";
+ str.do { arg char;
+ if( ~is_terminal.(char) ) {
+ if(accu != "") {
+ res.add(accu);
+ };
+ accu = "" ++ char;
+ } {
+ accu = accu ++ char;
+ }
+ };
+ res.add(accu);
+ res;
+ };
+
+ ~extract_chords = { arg token_list;
+ var res = List.new;
+ var accu = List.new;
+ var chord = false;
+ token_list.do { arg token;
+ if( chord ) {
+ if( token == "]") {
+ chord = false;
+ res.add(accu);
+ accu = List.new;
+ } {
+ accu.add(token)
+ };
+ } {
+ if( token == "[") {
+ chord = true;
+ } {
+ res.add(token)
+ };
+ };
+ };
+ //res.add(token);
+ res;
+ };
+
+ ~parse_note = { arg token;
+ var pitch;
+ var len = 1;
+ var char;
+ var divide = false;
+ token = token.as(List).reverse;
+ pitch = token.pop;
+ pitch = ~notedef[pitch];
+ while({ token.isEmpty.not }) {
+ char = token.pop;
+ case
+ { char == $' } {
+ pitch = pitch + 14;
+ }
+ { char == $, } {
+ pitch = pitch - 14;
+ }
+ { char == $/ } {
+ len = 1/2;
+ divide = true;
+ }
+ { ~digitdef[char].notNil } {
+ if(divide) {
+ len = 1 / ~digitdef[char];
+ } {
+ len = ~digitdef[char];
+ }
+ }
+
+ };
+ [pitch, len]
+ };
+
+ ~parse_sentence = { arg token_list;
+ var res_pitch = List.new, res_len = List.new;
+ var pitch, len;
+ token_list.do { arg token;
+ if(token.isString) {
+ #pitch, len = ~parse_note.(token);
+ res_pitch.add(pitch);
+ res_len.add(len);
+ } {
+ #pitch, len = ~parse_sentence.(token);
+ //len = len.maxItem; // workaround to the multichannel expand bug
+ res_pitch.add(pitch);
+ res_len.add(len);
+ }
+ };
+ [res_pitch, res_len]
+ };
+
+ ~parseabc = { arg str;
+ var res;
+ res = ~strip_spaces.(str);
+ res = ~split_string.(res);
+ res = ~extract_chords.(res);
+ res = ~parse_sentence.(res);
+ res;
+ };
+
+ ~add_legato = { arg dur;
+ var legato = List.new;
+ var maxi;
+ dur = dur.collect { arg du;
+ if(du.isSequenceableCollection) {
+ maxi = du.maxItem;
+ legato.add( du.collect { arg leg;
+ leg / maxi
+ });
+ maxi;
+ } {
+ legato.add(1);
+ du;
+ }
+ };
+ [dur, legato]
+ };
+
+ ~abc_to_pbind = { arg str, repeat=inf;
+ var res, dur, legato;
+ res = ~parseabc.(str);
+ #dur, legato = ~add_legato.(res[1]);
+ Pbind(
+ \degree, Pseq(res[0],repeat),
+ \legato, Pkey(\legato) * Pseq(legato,repeat),
+ \dur, Pseq(dur,repeat)
+ )
+ };
+ ~pbind = { arg str, repeat=inf; cur.use{ ~abc_to_pbind.(str, repeat) } };
+}).as(Event);
+
+~abcpbind = { arg str, repeat=inf; ~abcparser[\pbind].(str, repeat) };
+)
View
119 bindings.sc
@@ -0,0 +1,119 @@
+
+~bindings = (
+ editplayer: [
+ ["select_cell", \kb, 0, \kbnumline],
+ ["edit_value", \kb, 0, \enter],
+ ["edit_value_mode.insert_number", \kb, 0, \kbnumpad],
+ ["edit_value_mode.insert_point", \kb, 0, \point],
+ ["edit_value_mode.cancel", \kb, 0, \escape],
+ ["edit_value_mode.ok", \kb, 0, \enter],
+
+ ["solo_selected", \kb, 0, \f7],
+ ["unsolo_selected", \kb, \ctrl, \f7],
+ ["unsolo_selected", \kb, \ctrl, \f7],
+ ["add_effect", \kb, \ctrl, \f1],
+ ["increase_midi_knob_offset", \kb, 0, \down],
+ ["decrease_midi_knob_offset", \kb, 0, \up],
+ ["toggle_cc_recording", \kb, \altshift, "r"],
+ ["change_param_kind.recordbus", \kb, \altshift, "u"],
+ ["start_midi_liveplayer", \kb, \altshift, "e"],
+ ["param_set_pkey_mode", \kb, \alt, "k"],
+ ["param_unset_pkey_mode", \kb, \altshift, "k"],
+
+ ],
+ parlive: [
+ ["select_header", \kb, \alt, \kbnumline],
+ ["show_panel.editplayer", \kb, 0, \f12],
+ ["create_new_livenode", \kb, \alt, "c"],
+ ],
+ side: [
+ ["decrease_select_offset", \midi, 0, \begin],
+ ["increase_select_offset", \midi, 0, \end],
+ ["increase_samplekit_part", \midi, 0, \right],
+ ["decrease_samplekit_part", \midi, 0, \left],
+
+ ["midi.play_group", \midi, \hold, \play],
+ ["midi.stop_group", \midi, \hold, \stop],
+ ["play_group", \kb, \ctrl, \f5],
+ ["stop_group", \kb, \ctrl, \f6],
+ ["play_selected", \kb, 0, \f5],
+ ["midi.play_selected", \midi, 0, \play],
+ ["stop_selected", \kb, 0, \f6],
+ ["stop_selected_quant", \kb, \ctrlshift, \f6],
+ ["midi.stop_selected", \midi, 0, \stop],
+ //["mute_selected", \kb, 0, \f7],
+ //["unmute_selected", \kb, \ctrl, \f7],
+ ["solo_selected", \kb, 0, \f7],
+ ["unsolo_selected", \kb, \ctrl, \f7],
+ ["toggle_solo_selected", \midi, 0, \pause],
+ ["panic", \kb, 0, \f8],
+ ["edit_tempo", \kb, \ctrlalt, "e"], // t open terminal
+ ["edit_quant", \kb, \ctrlalt, "q"],
+ ["edit_barrecord", \kb, \ctrlalt, "b"],
+ ["edit_selected_param", \kb, 0, \enter],
+
+ ["edit_wrapper", \kb, \alt, "w"],
+
+ ["copy_node", \kb, \ctrl, "c"],
+ ["paste_node", \kb, \ctrl, "v"],
+ ["copy_group", \kb, \ctrl, \kbnumpad],
+ ["remove_node", \kb, \ctrlshift, \f4],
+
+ ["load_node_from_lib", \kb, 0, \f1],
+ ["create_default_node", \kb, \alt, "c"],
+ ["reload_player", \kb, \altshift, "r"],
+
+ ["add_effect", \kb, \ctrlshift, \f2],
+
+ ["load_colpreset", \kb, \ctrl, \f1],
+ ["save_colpreset", \kb, \ctrl, \f2],
+
+ ["select_param", \kb, 0, \kbpad8x4_flat],
+ ["pad_select_param", \midi, 0, \midipads],
+
+ ["select_param_cell", \kb, \alt, \kbnumline],
+ ["matrix_select_param_cell", \kb, 0, \kbpad8x4_flat],
+
+ ["select_player", \kb, 0, \kbpad8x4_flat],
+ ["pad_select_player", \midi, 0, \midipads],
+ ["matrix_select_player", \kb, \alt, \kbnumline],
+
+
+ ["select_group", \kb, 0, \kbnumpad],
+
+ ["forward_in_record_history", \kb, 0, \right],
+ ["backward_in_record_history", \kb, 0, \left],
+
+ ["set_global_mode.matrix", \kb, \ctrl, \f10],
+
+ ["set_global_mode.param", \kb, 0, \f9],
+ ["set_global_mode.group", \kb, 0, \f10],
+ ["set_global_mode.liveplay", \kb, 0, \f11],
+ ["set_global_mode.mixer", \kb, 0, \f12],
+ ["midi.set_global_mode.param", \midi, 0, \b1],
+ ["midi.set_global_mode.group", \midi, 0, \b2],
+ ["midi.set_global_mode.liveplay", \midi, 0, \b3],
+ ["midi.set_global_mode.mixer", \midi, 0, \b4],
+
+ ["set_notequant", \kb, \alt, "q"],
+ ["add_cell_bar", \kb, 0, \npplus],
+ ["remove_cell_bar", \kb, \ctrl, \npplus],
+
+
+ //["toggle_player_recording", \midi, 0, \record],
+ ["toggle_player_recording", \midi, 0, \record],
+ ["toggle_param_recording", \midi, \hold, \record],
+ ["toggle_metronome", \kb, \alt, "m"],
+
+ ["change_param_kind.seq", \kb, \altshift, "q"],
+ ["change_param_kind.scalar", \kb, \altshift, "s"],
+ ["change_param_kind.recordbus", \kb, \altshift, "d"],
+ ["change_param_kind.bus", \kb, \altshift, "f"],
+ ["change_param_kind.seg", \kb, \altshift, "g"],
+ ["change_param_kind.pkey", \kb, \altshift, "h"],
+
+ ["change_player_mode.stepline", \kb, \altshift, "q"],
+ ["change_player_mode.noteline", \kb, \altshift, "s"],
+ ["change_player_mode.sampleline", \kb, \altshift, "d"],
+ ]
+);
View
60 crap17.sc
@@ -0,0 +1,60 @@
+s = Server.internal;
+s.boot;
+// On a simple sine wave
+x = {Squiz.ar(SinOsc.ar, MouseX.kr(1, 10, 1), zcperchunk: MouseY.kr(1, 10), mul:0.1).dup}.play(s);
+x.free;
+// Scope is helpful for visualising what's going on
+x = {Squiz.ar(SinOsc.ar, MouseX.kr(1, 10, 1), zcperchunk: MouseY.kr(1, 10), mul:0.1).dup}.scope;
+x.free;
+
+// On a sample of some sort - choose one...
+b = Buffer.read(s,"sounds/a11wlk01.wav");
+b = Buffer.read(s,"sounds/amenfast.wav");
+(
+x = {
+ var sig;
+ sig = PlayBuf.ar(1, b.bufnum, BufRateScale.kr(b.bufnum) * 0.5, startPos: 92898, loop: 1);
+ Squiz.ar(sig, MouseX.kr(1, 100, 1), zcperchunk: MouseY.kr(1, 10), mul:0.5).dup
+}.play(s);
+)
+x.free;
+b.free;
+
+// Let's make it a bit more complicated. By analysing the signal we can change the Squiz sound algorithmically.
+s.boot;
+b = Buffer.read(s,"sounds/amenfast.wav");
+c = Buffer.alloc(s, 512);
+(
+x = {
+ var sig, chain, centroid, hicent, locent, fraccent, fraccentl, heaviness, heaviness2, kick2trig, kick2;
+ sig = PlayBuf.ar(1, b.bufnum, BufRateScale.kr(b.bufnum) * 0.5, /*startPos: 92898, */loop: 1);
+ // kick2 to emphasise the main downbeats
+ kick2trig = Impulse.kr(BufDur.kr(b.bufnum).reciprocal * 4);
+ kick2 = SinOsc.ar(50 + EnvGen.ar(Env.perc(0.001, 0.01, 1000, -10), kick2trig));
+ kick2 = EnvGen.ar(Env.perc, kick2trig) * kick2 * 0.3;
+ chain = FFT(c.bufnum, sig);
+ //centroid = FFTCentroid.kr(chain).log.max(0.000001);
+ centroid = FFTPercentile.kr(chain, 0.9);//.log.max(0.000001);
+ hicent = Amplitude.kr(centroid, 0, 10);
+ locent = 10000 - Amplitude.kr(10000 - centroid, 0, 10);
+ fraccent = ((centroid - locent) / (hicent - locent)).min(1).max(0);
+ fraccentl = Latch.kr(fraccent, Onsets.kr(chain));
+ Out.kr(0, fraccentl);
+ // fraccent.poll;
+ //heaviness = MouseX.kr(0,1);
+ //heaviness2 = MouseY.kr(0,1);
+ heaviness = LFPar.kr(0.016, 0, 0.5, 0.5);
+ heaviness2 = LFPar.kr(0.016, 1, 0.5, 0.5);
+ // we don't go really mental until we've got going
+ # heaviness, heaviness2 = [heaviness, heaviness2] * Line.kr(0.1, 1, 100);
+ kick2 + Squiz.ar(sig,
+ ( fraccentl * LFNoise2.kr(0.1).exprange(1, 100) * heaviness) +
+ ((1-fraccentl) * LFNoise2.kr(0.1).exprange(1, 100) * heaviness2) +
+ 0.8,
+ zcperchunk: LFNoise2.kr(0.1).range(1, 10), mul:0.5).dup
+ //sig
+}.play(s);
+)
+//s.scope5
+x.free;
+b.free;
View
1  crap18.sc
@@ -0,0 +1 @@
+~bla ?? { _.isNil }
View
2  crap19.sc
@@ -0,0 +1,2 @@
+
+Mdef.sample(\bla, "bla.wav")
View
382 crap20.sc
@@ -0,0 +1,382 @@
+440 * 6/5
+
+(
+SynthDef(\ChicagoPad, { |out = 0, freq = 440, cutoff = 500, amp = 0.2, gate=1|
+
+ var snd;
+
+ freq = freq + SinOsc.kr(0.1, 0, 1, 20);
+
+ snd = Saw.ar([freq, freq+1, freq-1, freq*3/2 /2, freq*6/5 /2])*0.1;
+
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1,freq*3/2 /2, freq*6/5 /2],0, LFTri.kr(0.3).range(0.25,0.9))*0.1;
+
+ snd = Mix(snd);
+
+ snd = RLPF.ar(snd, SinOsc.kr(0.1, 0, 100, 5000), 0.1);
+
+ snd = GVerb.ar(snd ,40, 10, 0.6, 0.6, -3, -9, -11)*0.2;
+
+
+
+ //snd = RLPF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 0.2);
+
+ snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);
+
+ snd = DelayC.ar(snd, 1.5, 1,0.8);
+
+ //snd = snd * EnvGen.ar(Env.linen(0.001, 0.01,0.01,1), doneAction:2);
+ snd = snd * EnvGen.ar(Env.adsr(0.4, 0.01,0.8,0.4), gate, doneAction:2);
+
+ Out.ar(out, [snd, AllpassC.ar(snd, 0.5, 0.05, 0.3)]*amp);
+
+}).add;
+)
+
+
+(
+SynthDef(\ChicagoPad, { |out = 0, freq = 440, freq2=660, freq3=528, cutoff = 500, amp = 0.2, gate=1, spread=1, center=0|
+
+ var snd;
+
+ freq = freq + SinOsc.kr(freq*1/2, 0, freq/2, 0);
+
+ snd = Saw.ar([freq, freq+1, freq-1, freq2, freq3] * [0.99,1])*0.1;
+
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1, freq2, freq3, freq2+1, freq3+1],0, LFTri.kr(7.13).range(0.00,0.1))*0.1;
+
+
+ snd = Mix(snd);
+ //snd = GVerb.ar(snd ,40, 10, [0.7,0.1], 0.1, -3, -9, -11)*0.2;
+ //snd = GVerb.ar(snd ,40, 20, 0.1, 0.1, 3, 9, 11,1)*0.4;
+ snd = FreeVerb.ar(snd, 0.51,10,0.1)*2;
+ snd = snd *8;
+ snd = RLPF.ar(snd, SinOsc.kr([0.1,4.2], 0, [1700,480], [4000,700,5000])/[20.51,20], SinOsc.ar(0.1,1.5*pi)+1.05)/3;
+ //snd = [AllpassC.ar(snd, 0.15, 0.05+SinOsc.ar(0.15).range(0,0.01), 0.3), snd];
+ //snd = snd ! 2;
+ snd = Mix(snd);
+ //snd = snd.sum;
+
+
+
+
+ //snd = RLPF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 0.2);
+
+ snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);
+
+ //snd = DelayC.ar(snd, 1.5, 1,0.8);
+
+ snd = snd * EnvGen.ar(Env.adsr(0.4, 0.01,0.8,0.4), gate, doneAction:2);
+
+
+ //Out.ar(out, [snd, AllpassC.ar(snd, 0.5, 0.05, 0.3)]*amp);
+ //snd = snd ! 2;
+ snd = [snd , AllpassC.ar(snd, 0.45, 0.05+SinOsc.ar(0.11).range(0,0.045), 0.3)];
+ spread = SinOsc.ar(1).range(0.2, 4.5);
+ spread = 1;
+ center = SinOsc.ar(1).range(-0.7, 0.7);
+ center = 0;
+ //snd = Splay.ar(snd, spread, amp, center);
+ snd = snd * amp;
+ Out.ar(out, snd);
+
+}).add;
+)
+
+(
+Pdef(\plop2, Pbind(
+ \instrument, \ChicagoPad,
+ \degree, Pseq([0,4,0,3,1],inf),
+ \root, -4,
+ \octave, 5,
+ //\degree, 0,
+ \freq2, Pkey(\freq)*(3/2) / 2,
+ //\freq3, Pkey(\freq)*(5/4) / 2,
+ \freq3, Pkey(\freq)*(5/6) / 2,
+ \legato, 1,
+ \cutoff, 4500,
+ \spread, 0,
+ \dur, 4,
+ \amp, 0.2
+)).play;
+);
+(
+Pdef(\mel, Pbind(
+ \instrument, \lead2,
+ \degree_step, Pstep(Pseq([0],inf),4),
+ \degree, Pseq([0,\r, 2b,4, \r, 0,0,0],inf)+Pkey(\degree_step),
+ \root, -4,
+ \fratio, 2.51,
+ \fbfreq, 100,
+ \fbase, 100,
+ \wet, 0.2,
+ \rq, 0.1,
+ \rt, Pseq([0.1,0.1,0.4,0.4,0.8],inf),
+ \rq, Pseq([0.1,0.1,0.4,0.4,0.8]/2,inf),
+ \legato, 0.4,
+ \dur, 0.125,
+ \amp, 0.01
+)).play;
+);
+s.meter
+
+(
+SynthDef(\ChicagoPad, { |out = 0, freq = 440, freq2=660, freq3=528, cutoff = 500, amp = 0.2, gate=1|
+
+ var snd;
+
+ freq = freq + SinOsc.kr(freq*1/2, 0, freq/2, 0);
+
+ snd = Saw.ar([freq, freq+1, freq-1, freq2, freq3] * [0.99,1])*0.1;
+
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1, freq2, freq3, freq2+1, freq3+1],0, LFTri.kr(7.13).range(0.00,0.1))*0.1;
+
+
+ snd = Mix(snd);
+ snd = FreeVerb.ar(snd, 0.51,10,0.1)*2;
+ snd = snd *8;
+ snd = RLPF.ar(snd, SinOsc.kr([0.1,4.2], 0, [1700,480], [4000,700,5000])/[20.51,20], SinOsc.ar(0.1,1.5*pi)+1.05)/3;
+ snd = Mix(snd);
+
+ snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);
+
+ snd = snd * EnvGen.ar(Env.adsr(0.4, 0.01,0.8,0.4), gate, doneAction:2);
+
+ snd = [snd , AllpassC.ar(snd, 0.45, 0.05+SinOsc.ar(0.11).range(0,0.045), 0.3)];
+ snd = snd * amp;
+ Out.ar(out, snd);
+
+}).add;
+)
+
+(
+Pdef(\plop2, Pbind(
+ \instrument, \ChicagoPad,
+ \degree, Pseq([0,4,0,3,1],inf),
+ \root, -4,
+ \freq2, Pkey(\freq)*(3/2) / 2,
+ \freq3, Pkey(\freq)*(5/6) / 2,
+ \legato, 1,
+ \cutoff, 4500,
+ \dur, 4,
+ \amp, 0.2
+)).play;
+);
+
+(
+Instr(\saw_gen, { |freq = 440, freq2=660, freq3=528, saw_width=0.5|
+
+ var snd;
+
+ snd = Saw.ar([freq, freq+1, freq-1] * [0.99,1])*0.1;
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1],0, saw_width)*0.1;
+ snd = Mix(snd);
+});
+
+Instr(\jupi1, {
+ var ou;
+ ou = Instr(\saw_gen).wrap;
+ Instr(\chicago_filter_select).wrap((in:ou));
+
+}).addSynthDef;
+
+Instr(\chicago_gen, { |freq = 440, freq2=660, freq3=528, saw_width=0.5|
+
+ var snd;
+
+ snd = Saw.ar([freq, freq+1, freq-1, freq2, freq3] * [0.99,1])*0.1;
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1, freq2, freq3, freq2+1, freq3+1],0, saw_width)*0.1;
+ snd = Mix(snd);
+});
+
+Instr(\sawpad, { |gate=1, pan=0, amp=0.1|
+
+ var snd;
+ snd = Instr(\chicago_gen).wrap;
+ snd = Pan2.ar(snd, pan, amp);
+ snd = snd * EnvGen.ar(\adsr.kr(Env.adsr(0.4, 0.01,0.8,0.4)), gate, doneAction:2);
+}).addSynthDef;
+
+
+Instr(\chicago_filter, { |in, moog_cut = 500, moog_gain=3, amp = 0.2, gate=1, rlpf_cut=2000, rlpf_rq=0.1, preamp=10,
+ verbmix=0.51, verbroom=10, verbdamp=0.1, allpass_delay=0.05, allpass_decay=0.3|
+
+ var snd, snd2;
+
+ snd = in;
+ snd = FreeVerb.ar(snd, verbmix,verbroom,verbdamp);
+ snd = RLPF.ar(snd, rlpf_cut, rlpf_rq);
+
+ snd = MoogFF.ar(snd, moog_cut, moog_gain, 0);
+ snd = snd * preamp;
+
+ snd2 = AllpassC.ar(snd, allpass_delay, allpass_delay, allpass_decay);
+ snd2 = snd2 * EnvGen.ar(Env.dadsr(allpass_delay,0.1,0.1,1,0.1),gate,doneAction:0);
+ snd2 = SelectX.ar(Line.ar(0,1,allpass_delay*1.5), [snd, snd2]);
+ //snd2 = SelectX.ar(0.5, [snd, snd2]);
+
+ snd = [snd , snd2];
+ snd = Splay.ar(snd, SinOsc.ar([0.32,0.1]).range(-1,1).sum / 2, 2, 0);
+ snd = snd * EnvGen.ar(\adsr.kr(Env.adsr(0.4, 0.4,0.8,0.4)), gate, doneAction:2);
+ snd = snd * amp;
+});
+
+Instr(\chicago_filter_select, { |in, moog_cut = 500, moog_gain=3, amp = 0.2, gate=1, rlpf_cut=2000, rlpf_rq=0.1, preamp=10,
+ verbmix=0.51, verbroom=10, verbdamp=0.1, allpass_delay=0.05, allpass_decay=0.3,
+ mix_verb=1, mix_rlpf=1, mix_moog=1, mix_allpass=1|
+
+ var snd, sndf, snd2;
+
+ snd = in;
+ sndf = FreeVerb.ar(snd, verbmix,verbroom,verbdamp);
+ snd = SelectX.ar(mix_verb, [snd, sndf]);
+ sndf = RLPF.ar(snd, rlpf_cut, rlpf_rq);
+ snd = SelectX.ar(mix_rlpf, [snd, sndf]);
+
+ sndf = MoogFF.ar(snd, moog_cut, moog_gain, 0);
+ snd = SelectX.ar(mix_moog, [snd, sndf]);
+ snd = snd * preamp;
+
+ snd2 = AllpassC.ar(snd, allpass_delay, allpass_delay, allpass_decay);
+ snd2 = snd2 * EnvGen.ar(Env.dadsr(allpass_delay,0.1,0.1,1,0.1),gate,doneAction:0);
+ snd2 = SelectX.ar(Line.ar(0,1,allpass_delay*1.5) * mix_allpass, [snd, snd2]);
+ //snd2 = SelectX.ar(0.5, [snd, snd2]);
+
+ snd = [snd , snd2];
+ snd = Splay.ar(snd, 1, 2, 0);
+ snd = snd * EnvGen.ar(\adsr.kr(Env.adsr(0.4, 0.4,0.8,0.4)), gate, doneAction:2);
+ snd = snd * amp;
+});
+
+Instr(\chicago_pad, {
+ var in;
+ in = Instr(\chicago_gen).wrap(());
+ Instr(\chicago_filter).wrap((in:in));
+}).addSynthDef;
+
+Instr(\chicago_pad_select, {
+ var in;
+ in = Instr(\chicago_gen).wrap(());
+ Instr(\chicago_filter_select).wrap((in:in));
+}).addSynthDef;
+
+Instr(\chicago_pad2, { arg freq=440, rlpf_cut=6800, gate=1, rlpf_rq=1.1;
+ var in;
+ freq = freq + SinOsc.kr(freq*1/2, 0, freq/2, 0);
+ rlpf_cut = SinOsc.ar([0.3,0.4]).range(0,1) * rlpf_cut;
+ rlpf_cut = rlpf_cut.sum;
+ rlpf_cut = EnvGen.ar(Env.adsr(1.1,1.1,0.21,0.4),gate,doneAction:0) * rlpf_cut + 200;
+ rlpf_rq = 1 - EnvGen.ar(Env.adsr(1.1,3.1,0.11,0.4),gate,doneAction:0) * rlpf_rq + 0.05;
+ in = Instr(\chicago_gen).wrap((freq:freq));
+ Instr(\chicago_filter).wrap((in:in,rlpf_cut:rlpf_cut, gate:gate, rlpf_rq:rlpf_rq));
+}).addSynthDef;
+)
+
+(
+Pdef(\plop2, Pbind(
+ \instrument, \chicago_pad2,
+ \degree, Pseq([0,4,0,3,1],inf),
+ \root, -4,
+ \freq2, Pkey(\freq)*(3/2) / 2,
+ \freq3, Pkey(\freq)*(5/6) / 2,
+ \legato, 0.51,
+ \cutoff, 4500,
+ \dur, 0.4,
+ \amp, 0.2
+)).play;
+);
+
+(
+Pdef(\plop2, Pbind(
+ \instrument, \chicago_pad_select,
+ \degree, Pseq([0,4,0,3,1],inf),
+ \root, -4,
+ \mix_verb, 0.8,
+ \mix_moog, 0.0,
+ \mix_rlpf, 0.7,
+ \mix_allpass, 0.0,
+ \freq2, Pkey(\freq)*(3/2) / 2,
+ \freq3, Pkey(\freq)*(5/6) / 2,
+ \legato, 1.0,
+ \rlpf_cut, 500,
+ \rlpf_rq, 1.500,
+ \moog_cut, 500,
+ \dur, 4,
+ \amp, 0.1
+)).play;
+);
+
+
+(
+Pdef(\plop3, (Pbind(
+ \instrument, \jupi1,
+ //\degree, Pseq([0,4,0,3,1],inf),
+ //\root, -4,
+ \mix_verb, 0.5,
+ \mix_moog, 0.7,
+ \mix_rlpf, Pseg(Pseq([0.8,0.1],inf),10),
+ \mix_allpass, 0.0,
+ \legato, 0.8,
+ \rlpf_cut, 500,
+ \rlpf_rq, 0.500,
+ \moog_cut, 500,
+ //\dur, 0.125,
+ \stretch, 1/8,
+ \amp, 0.1
+) <>
+ Pseq([
+ ~abcpbind.("f_d_ f2_B",1),
+ ~abcpbind.("f_d_ f2_G",1),
+ ~abcpbind.("g_e_ f2_b",1),
+ ],inf)
+ ).trace
+).play;
+);
+
+
+DynKlank
+
+(
+Instr(\wouwou, { arg freq=200, pan=0, amp=0.1, fratio=0.5, gate=1, modscale=1;
+ var ou;
+ freq = Lag.kr(freq,2);
+ modscale = Lag.kr(modscale,2);
+ ou = SinOsc.ar([1,4.54,1.6]*modscale)*fratio*freq+freq;
+ ou = SinOsc.ar(ou);
+ ou = ou * EnvGen.kr(\adsr.kr(Env.adsr(0.1,0.1,0.8,0.1)), gate, doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+}).addSynthDef;
+
+Instr(\tchou, { arg freq=200, pan=0, amp=0.1, freqscale=(1/4), modscale=1, gate=1;
+ var ou, ou2;
+ ou = WhiteNoise.ar(amp);
+ ou2 = SinOsc.ar([1.214,4.54,1.6]*modscale)*0.5+1;
+ ou = DynKlank.ar(`[[800, 1071, 1153, 1723], nil, [1, 1, 1, 1]], ou, freqscale:freqscale) * ou2;
+ ou = ou * 0.3;
+ ou = ou * EnvGen.kr(\adsr.kr(Env.adsr(0.1,0.1,0.8,0.1)), gate, doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+}).addSynthDef;
+);
+
+(
+Pdef(\plop, Pmono(
+ \wouwou,
+ \degree, Pseq([0,1,4],inf),
+ \modscale, Pseq([1,4,0.2],inf),
+ \fratio, 0.8,
+ \legato, 1,
+ \dur, 4,
+ \amp, 0.1
+)).play;
+);
+
+(
+Pdef(\plop2, Pmono(
+ \tchou,
+ \degree, Pseq([0],inf),
+ \fratio, Pseq([0.1,0.8],inf),
+ \legato, 1,
+ \dur, 4,
+ \amp, 0.1
+)).play;
+);
View
546 crap21.sc
@@ -0,0 +1,546 @@
+////////#superCollider///////////
+
+///// audio @ http://archive.org/details/ChiptuneBreakz
+
+///
+
+(
+
+Tdef(\cheaptune,{
+
+ var sig2,sig1,sig3,a,rel;
+
+ sig1=[8,12,16,20];
+
+ sig2=2/sig1.scramble;
+
+ sig3=2*sig1.scramble;
+
+ rel=Pxrand([0,0,0,0,0,0,0,1],inf).asStream;
+
+ inf.do{
+
+ a=[0.125,0.25,0.5,0.5,0.25,0.125,1].choose;
+
+ x=[60,67,75,79,94].scramble;
+
+ play{EnvGen.ar(Env.perc(0.01,a+rel.next),doneAction:2)*
+
+ AY.ar(x.midicps*a*sig1.choose,x*sig2.choose.midicps,a*sig3.choose.midicps,0.25,3,15,10,7)};
+
+ play{EnvGen.ar(Env.perc(0.01,a/2),Duty.kr(Dseq([0.5,0.25],inf),0,Dxrand([0,1],inf)),doneAction:2)*
+
+ BrownNoise.ar(0.6)!2};
+
+ play{EnvGen.ar(Env.perc(0.01,a/4),Duty.kr(Dseq([0.25,0.5],inf),0,Dseq([0,1],inf)),doneAction:2)*
+
+ LFNoise0.kr(16)*WhiteNoise.ar(0.2)!2};
+
+ a.wait
+
+ }
+
+});
+
+Tdef(\cheaptune).play;
+
+)
+
+s.record;
+
+s.stopRecording;
+
+//
+
+
+
+(
+
+Server.local.waitForBoot({
+
+(
+
+z.free;
+
+z = Buffer.alloc(s, 512, 1);
+
+z.sine1(1.0 / [1, 2, 3, 4], true, true, true);
+
+
+
+ fork( { loop {
+
+ SynthDef("g1",{ arg out=0,bufnum=0,dur=1,rate=1,pos=0,sdens=1,edens=1;
+
+ var dens = Line.kr(sdens,edens,dur);
+
+ var trig = [LFNoise0,SinOsc,Impulse,LFPulse,LFSaw].choose.ar(Line.kr(sdens,edens,dur));
+
+ //var env = EnvGen.kr(Env.perc(0.0001.rrand(0.1),dur*0.5.rrand(2)),doneAction:2);
+
+ var env = EnvGen.kr(Env.perc(0.0001.rrand(0.1),dur*(0.5.rrand(4))),doneAction:2);
+
+ Out.ar(out,
+
+ GrainBuf.ar(2,trig,1/dens,bufnum,rate,pos)*env;
+
+ )
+
+ }).add();
+
+ [1,2,4,8,16,32].choose.postln.wait;
+
+ }
+
+ }
+
+ );
+
+
+
+
+
+a = Pbind(\instrument,\g1,\dur,Pseq([Pseq([0.25],32),Pseq([0.25,0.125,0.125],32),Pseq([0.125],32)],inf),\sdens,Pseq([9000,1000,500]/10,inf),\edens,Prand([Pseq([9000,1000,500]/10,4),Pseq([1],1)],inf),\rate,Pfunc({-10.0.rrand(10)}),\pos,Pfunc({1.0.rand}),\bufnum,z.bufnum);
+
+b = Pbind(\instrument,\g1,\dur,Pseq([4],inf),\sdens,Pseq([9000,1000,500]/100,inf),\edens,Prand([Pseq([9000,1000,500]/10,1),Pseq([1],3)],inf),\rate,Pfunc({-10.0.rrand(10)}),\pos,Pfunc({-10.0.rrand(10)}),\bufnum,z.bufnum);
+
+c = Pbind(\instrument,\g1,\dur,Pseq([4/3],inf),\sdens,Pseq([9000,1000,500,25],inf),\edens,Prand([Pseq([9000,1000,500,25],1),Pseq([1],4)],inf),\rate,Pfunc({-100.0.rrand(100)}),\pos,Pfunc({-10.0.rrand(10)}),\bufnum,z.bufnum);
+
+
+
+
+
+a =a.play;
+
+b =b.play;
+
+c =c.play;
+
+
+
+)
+
+});
+
+)
+
+
+
+
+// NX102
+
+// 2012-08-07_23_05_45
+
+
+
+// La ment no té límits.
+
+
+
+// Use with Jitlib:
+
+
+
+p = ProxySpace.push(s.boot);
+
+
+
+// Read one sample on your collection:
+
+
+
+b = Buffer.read(s,Platform.systemAppSupportDir +/+"/sounds/a11wlk01.wav",bufnum:1);
+
+
+// Play and fun:
+
+
+
+~nx102.play;
+
+
+(
+
+~nx102 = {
+
+ Pan2.ar(LeakDC.ar(Normalizer.ar(
+
+ BPeakEQ.ar(BPeakEQ.ar(BPeakEQ.ar(BPeakEQ.ar(FreeVerb.ar(
+
+ RHPF.ar(RLPF.ar(
+
+ Pulse.ar(
+
+ (PlayBuf.kr(1,1,Rand(50,100),1,0,1)*Rand(100,1000)).clip(
+
+ Rand(5,12),Rand(12,20)))
+
+ ,Rand(100,5000),Rand(0.005,0.1))
+
+ ,Rand(5000,20000),Rand(0.005,0.1))
+
+ ,0.0,0.0,0.0)
+
+ ,100,6.0,6),1000,6.0,0),5000,6.0,0),10000,6.0,6)
+
+ ,(1.25/0.999)*1.0,0.1)),0)
+
+};
+
+)
+
+
+~nx102 = nil;
+
+b.free;
+
+
+
+// this was going to be drum and bass but I got carried away
+
+
+
+(
+
+fork{
+
+ // this is going to be a convoluted step seq
+
+ var i = 0;
+
+
+
+ loop{
+
+ var tempo, step;
+
+ tempo = [
+
+ (3,5..21).reciprocal.choose,
+
+ 1/11,
+
+ 1/7,
+
+ 1/5,
+
+ 1
+
+ ].wchoose([0.1,17,0.4,0.3,0.25].normalizeSum);
+
+
+
+ i = i + 1;
+
+ step = i % 16;
+
+
+
+ play{
+
+ // not sure I used all of these.
+
+ var scale, bdm, hh, sd, bd, bda, sda, hha, bdseq, sdseq, hhseq, reva, revb, rev,
+
+ mix;
+
+
+
+ scale = Scale.harmonicMinor.degrees+26;
+
+
+
+ // bd sequence
+
+ bdseq =[ {2.rand}.dup(16),
+
+ [1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]
+
+ ].choose;
+
+
+
+ // bd amp env
+
+ bda = EnvGen.kr(Env.perc(0.01,tempo*6.0.rand,bdseq[step]), doneAction: 2);
+
+
+
+ // bass freq modulation
+
+ bdm = {LFNoise2.kr(tempo.rand,0.25,1)}.dup;
+
+
+
+ // bd
+
+ bd = LPF.ar(Pulse.ar(scale.choose.midicps,0.5).distort*bdm,1e4.rand).sum * bda;
+
+ bd = bd.tanh;
+
+ 5.do{bd = CombC.ar(bd, 0.5, 0.1.rand, 5.0.rand)+bd};
+
+ 5.do{bd = AllpassC.ar(bd, 0.5, 0.1.rand, 5.0.rand)+bd};
+
+
+
+ // sd seq
+
+ sdseq = [ [0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0],
+
+ {2.rand}.dup(16)
+
+ ].choose;
+
+
+
+ // sd amp env
+
+ sda = EnvGen.kr(Env.perc(0.01,0.1,sdseq[step]));
+
+
+
+ // sd
+
+ sd = PinkNoise.ar(2).distort * sda.lag(0.1.rand);
+
+ 5.do{sd = AllpassC.ar(sd, 0.5, [0.25.rand,0.05.rand].choose, 1.5.rand)+sd};
+
+
+
+ // hh seq
+
+ hhseq = [{2.rand}.dup(16),
+
+ [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
+
+ ].choose;
+
+
+
+ // hh amp env
+
+ hha = EnvGen.kr(Env.perc(0.01,0.01,hhseq[step]));
+
+
+
+ // hh
+
+ hh = HPF.ar(WhiteNoise.ar(0.7),8000) * hha;
+
+
+
+ // drums together
+
+ mix = bd + sd + hh;
+
+
+
+ // rev
+
+ reva = GVerb.ar(mix,1.0.rand.max(0.1),1.0.rand).sum;
+
+ revb = GVerb.ar(mix,1.0.rand.max(1),3.0.rand).sum;
+
+ rev = XFade2.ar(reva,revb,LFNoise0.kr(tempo));
+
+
+
+ // pannnn
+
+ mix = PanAz.ar(5,rev,LFNoise0.kr(tempo*2));
+
+ mix = Limiter.ar(mix);
+
+
+
+ // raussssss
+
+ Out.ar(0,mix.clip);
+
+ };
+
+ tempo.wait;
+
+ };
+
+}
+
+)
+
+
+
+
+
+
+
+
+
+
+(
+
+SynthDef(\ChicagoPad2, { |out = 0, freq = 440, freq2=660, freq3=528, cutoff = 500, amp = 0.2, gate=1|
+
+
+
+ var snd;
+
+
+
+ freq = freq + SinOsc.kr(freq*1/2, 0, freq/2, 0);
+
+
+
+ snd = Saw.ar([freq, freq+1, freq-1, freq2, freq3] * [0.99,1])*0.1;
+
+
+
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1, freq2, freq3, freq2+1, freq3+1],0, LFTri.kr(7.13).range(0.00,0.1))*0.1;
+
+
+
+
+
+ snd = Mix(snd);
+
+ snd = FreeVerb.ar(snd, 0.51,10,0.1)*2;
+
+ snd = snd *8;
+
+ snd = RLPF.ar(snd, SinOsc.kr([0.1,4.2], 0, [1700,480], [4000,700,5000])/[20.51,20], SinOsc.ar(0.1,1.5*pi)+1.05)/3;
+
+ snd = Mix(snd);
+
+
+
+ snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);
+
+
+
+ snd = snd * EnvGen.ar(Env.adsr(0.4, 0.01,0.8,0.4), gate, doneAction:2);
+
+
+
+ snd = [snd , AllpassC.ar(snd, 0.45, 0.05+SinOsc.ar(0.11).range(0,0.045), 0.3)];
+
+ snd = snd * amp;
+
+ Out.ar(out, snd);
+
+
+
+}).add;
+
+SynthDef(\ricky1, { |out = 0, freq = 440, freq2=660, freq3=528, cutoff = 500, amp = 0.2, gate=1|
+
+
+
+ var snd;
+
+
+
+ freq = freq + SinOsc.kr(freq*1/2, 0, freq/2, 0);
+
+
+
+ snd = Saw.ar([freq, freq+1, freq-1, freq2, freq3] * [0.99,1])*0.1;
+
+
+
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1, freq2, freq3, freq2+1, freq3+1],0, LFTri.kr(7.13).range(0.00,0.1))*0.1;
+
+
+
+
+
+ snd = Mix(snd);
+
+ //snd = FreeVerb.ar(snd, 0.51,10,0.1)*2;
+
+ //snd = snd *8;
+
+ //snd = RLPF.ar(snd, SinOsc.kr([0.1,4.2], 0, [1700,480], [4000,700,5000])/[20.51,20], SinOsc.ar(0.1,1.5*pi)+1.05)/3;
+
+ snd = Mix(snd);
+
+
+
+ snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);
+
+
+
+ snd = snd * EnvGen.ar(Env.adsr(0.4, 0.01,0.8,0.4), gate, doneAction:2);
+
+
+
+ snd = [snd , AllpassC.ar(snd, 0.45, 0.05+SinOsc.ar(0.11).range(0,0.045), 0.3)];
+
+ snd = snd * amp;
+
+ Out.ar(out, snd);
+
+
+
+}).add;
+)
+
+
+
+(
+
+Pdef(\plop2, Pbind(
+
+ \instrument, \ChicagoPad2,
+
+ \degree, Pseq([0,8,2],inf),
+
+ \root, -4,
+
+ \freq2, Pkey(\freq) / 2 * Pseq([3/2, 2/7],inf),
+
+ \freq3, Pkey(\freq) / 2 * Pseq([5/6, 4/5, 5/6],inf),
+
+ \legato, 1,
+
+ \cutoff, Pseg(Pseq([10000,0100],inf),10),
+
+ \dur, 4,
+
+ \amp, 0.2
+
+)).play;
+
+);
+
+(
+Pdef(\plop3, Pbind(
+
+ \instrument, \ricky1,
+
+ \degree, Pstep(Pseq([0,8,2],inf),4) + Pseq([0,2,4,\r,7,6,5,4],inf),
+
+ \root, -4,
+
+ \octave, 7,
+
+ \freq2, Pkey(\freq) + 4,
+
+ \freq3, Pkey(\freq) * 2 - 4,
+
+ \legato, 1,
+
+ \cutoff, Pseg(Pseq([10000,0100],inf),10),
+
+ \dur, 1/4,
+
+ \amp, 0.2
+
+)).play;
+)
+
+(
+Pdef(\group, Ppar([
+ Pdef(\plop2),
+ Pdef(\plop3)
+])).play
+)
View
42 crap22.sc
@@ -0,0 +1,42 @@
+//loud
+
+(
+~beautybuf = Buffer.alloc(s, s.sampleRate * 1, 1);
+
+SynthDef(\mm_beauty,
+{
+ arg delays = #[0.4, 0.7, 0.8, 0.9], pans = #[-1, -0.7, 0.6, 1],
+noiseamp = 0.03, hpf = #[20, 60], average = #[8000, 14000], srate = 44100,
+smooths = #[300, 400], lpf = #[13000, 15000];
+ var phase, feedback, sig, local;
+ local = LocalIn.ar(2);
+ sig = WhiteNoise.ar(noiseamp);
+ phase = DelTapWr.ar(~beautybuf, sig + local);
+ feedback = DelTapRd.ar(~beautybuf, phase, delays);
+ feedback = Pan2.ar(feedback[0], pans[0]) + Pan2.ar(feedback[1],
+pans[1]) + Pan2.ar(feedback[2], pans[2]) + Pan2.ar(feedback[3], pans[3]);
+ feedback = HPF.ar(feedback, hpf);
+ feedback = feedback * (0.02 /
+(Lag.ar(AverageOutput.ar(abs(feedback),
+Impulse.kr((average/srate).reciprocal)), smooths/srate).clip(0.0001, 1)));
+ feedback = LPF.ar(feedback, lpf);
+ LocalOut.ar(feedback);
+ Out.ar(0, (feedback));
+}
+).store;
+
+)
+
+//run one by one:
+
+a = Synth(\mm_beauty); // sounds weird, why?
+a.set(\delays, [0.2, 0.3, 0.4, 0.5] * 0.35); //THERE we go
+a.set(\delays, [0.2, 0.3, 0.4, 0.5] * 0.15); //THERE we go
+a.set(\delays, [0.2, 0.3, 0.4, 0.5] * 1.05); //THERE we go
+a.set(\lpf, [4300, 4000]);
+
+a.set(\lpf, [300, 400]);
+a.set(\hpf, [300, 900]);
+a.set(\hpf, [3000, 1900]);
+a.free;
+
View
49 crap23.sc
@@ -0,0 +1,49 @@
+
+(
+SynthDef(\modularLine, { |mod, index, synthDur, carrA, carrB, att, sus, rel|
+var guts, env;
+ guts = PMOsc.ar(Line.kr(carrA, carrB, synthDur, doneAction:2), mod, Line.kr(0.0, index,13, doneAction:2),0,0.1).tanh;
+ env = EnvGen.ar(Env.linen(att, sus, rel, 1, \cubed));
+ Out.ar(0, guts*env !2);
+ }).add;
+
+ SynthDef(\modularFlat, { |mod, index, synthDur, carrA, carrB, att, sus, rel|
+var guts, env;
+ guts = PMOsc.ar(carrA, mod, Line.kr(0.0, index,13, doneAction:2),0,0.1).tanh;
+ env = EnvGen.ar(Env.linen(att, sus, rel, 1, \cubed));
+ Out.ar(0, guts*env!2);
+ }).add;
+)
+
+(
+var func;
+func = { |carrA, carrB, att=2, sus=5, rel=9|
+var synthDur;
+synthDur = att + sus + rel + 2;
+
+r = Routine({
+ 5.do({
+ a = Synth([\modularLine, \modularFlat].choose, [\carrA, 2000.0.rand, \carrB, 2000.0.rand, \mod, 800.0.rand, \index, 12.0.rand, \att, att, \sus, sus, \rel, rel, \synthDur, synthDur]);
+5.wait;
+
+b = Synth([\modularLine, \modularFlat].choose, [\carrA, 2000.0.rand, \carrB, 2000.0.rand, \mod, 800.0.rand, \index, 12.0.rand, \att, att, \sus, sus, \rel, rel, \synthDur, synthDur]);
+5.wait;
+c = Synth([\modularLine, \modularFlat].choose, [\carrA, 2000.0.rand, \carrB, 2000.0.rand, \mod, 800.0.rand, \index, 12.0.rand, \att, att, \sus, sus, \rel, rel, \synthDur, synthDur]);
+5.wait;
+
+ d = Synth([\modularLine, \modularFlat].choose, [\carrA, 2000.0.rand, \carrB, 2000.0.rand, \mod, 800.0.rand, \index, 12.0.rand, \att, att, \sus, sus, \rel, rel, \synthDur, synthDur]);
+5.wait;
+e = Synth([\modularLine, \modularFlat].choose, [\carrA, 2000.0.rand, \carrB, 2000.0.rand, \mod, 800.0.rand, \index, 12.0.rand, \att, att, \sus, sus, \rel, rel, \synthDur, synthDur]);
+5.wait;
+});
+ });
+r.play;
+};
+func.value(2000.0.rand,2000.0.rand);
+)
+
+a.free;
+b.free;
+c.free;
+d.free;
+e.free;
View
141 crap24.sc
@@ -0,0 +1,141 @@
+
+(
+~object = (
+ new: { arg self;
+ var obj = self.deepCopy;
+ obj.init;
+ obj
+ }
+);
+
+~new = { arg obj;
+ obj = obj.deepCopy;
+ obj.init;
+ obj
+};
+
+~class_plop = (
+ parent: ~object,
+ voiture: [4],
+ init: { arg self;
+ "plop: je suis init".postln;
+ self.voiture[0] = 10;
+ },
+ plop_fun: { arg self; "plopfun".postln; }
+);
+
+~class_plop2 = (
+ init: { arg self;
+ "plop2: je suis init".postln;
+ }
+);
+~class_plop3 = (
+ voiture: [4],
+ new: { arg self, bla;
+ self = self.deepCopy;
+ self.bla = bla;
+ "plop3: je suis init".postln;
+ self;
+ }
+);
+
+~class_blah = (
+ parent: ~class_plop,
+ init: { arg self;
+ //self.parent.init;
+ "blah: je suis init".postln;
+ self.voiture.debug("voiture");
+ },
+ blah_fun: { arg self; "blahfun".postln; }
+);
+~init_parent = { arg self, bla; self.parent[\new].(self, *bla); };
+~class_blah3 = (
+ parent: ~class_plop3,
+ new: { arg self, bla;
+ //self = self.parent[\new].(self, bla);
+ self = ~init_parent.(self, [bla]);
+ "blah3: je suis init".postln;
+ self.voiture.debug("voiture");
+ self.bla.debug("bla");
+ self;
+ },
+ blah_fun: { arg self; "blahfun".postln; }
+);
+
+)
+
+~plop = ~class_plop.new;
+~plop = ~new.(~class_plop2);
+~blah = ~class_blah.new;
+~blah.postln;
+~blah.proto
+Event.parentEvents.pairsDo { arg x,y; (x->y).postln };
+~blah.pairsDo { arg x,y; (x->y).postln }; "(parent -> ".post; ~blah.parent.pairsDo { arg x,y; (x->y).postln }; ")".postln;
+~blah.postln; ~blah.parent.postln; ~blah.parent.parent.postln; ~blah.parent.parent.parent.postln;
+~blah.parent
+~blah[\init].postcs
+
+
+PClass(\Bla, (
+ parent: Pclass(\Rah),
+ init: { arg self;
+
+ }
+))
+
+PClass.new(\Bla)
+
+\Event.asClass
+
+
+~bla = 4
+~bla
+{ ^~bla }.value
+
+
+a = { arg *rah; rah.postln; }
+
+~blah = ~class_blah.new;
+~blah2 = ~class_blah.new;
+
+~blah = ~class_blah3.new(\rah);
+~blah2 = ~class_blah3.new;
+
+~blah[\blah_fun].dump
+~blah2[\blah_fun].dump
+
+~blah.voiture[0] = 5
+~blah2.voiture
+
+a = "bla";
+"bla".dump
+a.dump
+b = a.deepCopy
+b.dump
+
+
+[[4,5,6],[7,8,9]].do.do { arg x; x.debug("x"); };
+
+
+(
+var bla;
+bla = (
+ haha: 74,
+ hihi: { bla.haha + 100 }.value,
+)
+)
+
+
+
+a = (bla:{ arg self; self.postln; })
+a[\bla].(5)
+a.bla
+
+a.player = { arg self; "bla".postln; };
+a.mode
+a.redraw
+a.paramlist
+a.extparamlist
+a.redraw_node
+a.group.group
+a.nodegroup
View
93 crap25.sc
@@ -0,0 +1,93 @@
+(
+SynthDef(\ctlPoint, { |outbus, value, time, curve|
+ var start = In.kr(outbus, 1);
+ ReplaceOut.kr(outbus, EnvGen.kr(Env([start, value], [time], curve), doneAction: 2));
+}).store;
+
+// can't Pchain the resulting pattern, so use the "chain" argument to chain the inner pattern
+~penvcontrol = { arg pat, chain=nil;
+ var buskeydict = Dictionary.new;
+ var respat = List.new;
+ var ctlpatlist = List.new;
+ var pbindpat;
+ var makebusmap;
+
+ makebusmap = { arg key;
+ Pfunc { arg ev; ev[key].asMap }
+ };
+
+ if(pat.class == EventPatternProxy) {
+ pbindpat = pat.source;
+ } {
+ pbindpat = pat
+ };
+
+ pbindpat.patternpairs.pairsDo { arg key,val;
+ var buskey;
+ var env;
+ var cbus;
+ var ctlpat;
+ if(val.class == Ref) {
+ buskey = "bus_" ++ key;
+ respat.add(key);
+ respat.add(makebusmap.(buskey));
+ env = val.value;
+ buskeydict[buskey] = env.levels[0];
+ cbus.set(env.levels[0]);
+ ctlpat = Pbind(
+ \instrument, \ctlPoint,
+ \value, Pseq(env.levels[1..],inf),
+ \time, Pseq(env.times,inf) / Pfunc({thisThread.clock.tempo}),
+ \group, Pkey(\busgroup),
+ \outbus, Pfunc { arg ev; ev[buskey].index },
+ \curve, env.curves,
+ \dur, Pseq(env.times,inf)
+ );
+ ctlpatlist.add(ctlpat);
+ }
+ };
+
+ Pfset({
+ buskeydict.keysValuesDo { arg key, val;
+ currentEnvironment[key] = Bus.control(s, 1);
+ currentEnvironment[key].set(val);
+ };
+ currentEnvironment[\busgroup] = Group.new;
+ },
+ Pfpar(
+ [
+ if(chain.notNil) {
+ chain <> Pbind(*respat) <> pat;
+ } {
+ Pbind(*respat) <> pat;
+ }
+ ]
+ ++ ctlpatlist
+ ),
+ {
+ buskeydict.keysValuesDo { arg key, val;
+ currentEnvironment[key].free;
+ };
+ currentEnvironment[\busgroup].freeAll;
+ currentEnvironment[\busgroup].free;
+ }
+ )
+};
+
+)
+
+
+(
+~pb = ~penvcontrol.(Pbind(
+ \instrument, \default,
+ \freq, Ref(Env([100,400,500],[1,0.5],0)),
+ \amp, Ref(Env([0.1,1,0.1],[2,2],0)),
+ \sustain, 1,
+ //\dur, 1,
+ \dur, Pn(1,2) // use finite pattern to restart env in sync
+));
+//~pb.play
+Pn(~pb).play
+
+)
+
View
50 crap26.sc
@@ -0,0 +1,50 @@
+Help.gui
+
+
+
+(
+SynthDef(\ChicagoPad2, { |out = 0, freq = 440, freq2=660, freq3=528, cutoff
+= 500, amp = 0.2, gate=1|
+
+ var snd, snd2;
+
+ freq = freq + SinOsc.kr(freq*1/2, 0, freq/2, 0);
+
+ snd = Saw.ar([freq, freq+1, freq-1, freq2, freq3] * [0.99,1])*0.1;
+
+ snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1, freq2, freq3, freq2+1,
+freq3+1],0, LFTri.kr(7.13).range(0.00,0.1))*0.1;
+
+
+ snd = Mix(snd);
+ snd = FreeVerb.ar(snd, 0.51,10,0.1)*2;
+ snd = snd *8;
+ snd = RLPF.ar(snd, SinOsc.kr([0.1,4.2], 0, [1700,480],
+[4000,700,5000])/[20.51,20], SinOsc.ar(0.1,1.5*pi)+1.05)/3;
+ snd = Mix(snd);
+
+ snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);
+
+ snd = snd * EnvGen.ar(Env.adsr(0.4, 0.01,0.8,0.4), gate, doneAction:2);
+ snd2 = AllpassC.ar(snd, 0.45, 0.05+SinOsc.ar(0.11).range(0,0.045), 0.3) * EnvGen.ar(Env.dadsr(0.06, 0.4, 0.01,0.8,0.4), gate, doneAction:0);
+ snd = [snd , snd2];
+ snd = snd * amp;
+ Out.ar(out, snd);
+
+}).add;
+)
+
+
+(
+Pdef(\plop2, Pbind(
+ \instrument, \ChicagoPad2,
+ \degree, Pseq([0,4,0,3,1],inf),
+ \root, Pseq([Pn(2,4),Pn(1,4)],inf),
+ \freq2, Pkey(\freq)*(3/2) / 2,
+ \freq3, Pkey(\freq)*(5/6) / 2,
+ \legato, 0.8,
+ \cutoff, 4500,
+ \dur, Pseq([Pn(0.25,4),Pn(0.5,4)]*5,inf),
+ \amp, 0.5
+)).play;
+)
View
68 crap27.sc
@@ -0,0 +1,68 @@
+
+(
+SynthDef(\trianglewavebells,{|out= 0 freq = 440 amp = 0.1 gate=1 lforate = 10 lfowidth= 0.0 cutoff= 100 rq=0.5 pan=0.0
+ wet=0.8|
+
+ var osc1, osc2, vibrato, filter, env;
+ var ou;
+
+ vibrato = SinOsc.ar(lforate,Rand(0,2.0));
+
+ osc1 = Saw.ar(vibrato*0.7*freq+freq);
+
+ //Saw a bit rough, possibly slighter smoother:
+ //osc1 = DPW4Saw.ar(freq*(1.0+(lfowidth*vibrato)),0.5);
+
+ //osc2 = Mix(LFTri.ar((freq.cpsmidi+[11.9,12.1]).midicps));
+
+ //filter = (osc1+(osc2*0.5))*0.5; //no filter version
+ filter = RHPF.ar(osc1,cutoff,rq);
+ ou = filter;
+ //ou = CombC.ar(ou, 0.4, 0.4, 1.8);
+ //ou = CombC.ar(ou, 0.4, 0.04, 1.8);
+ ou = FreeVerb.ar(ou, wet, 0.9, 0.1);
+
+
+
+
+ env = EnvGen.ar(Env.adsr(0.01,0.1,1.0,0.5),gate,doneAction:2);
+
+ Out.ar(out,Pan2.ar(ou*env*amp,pan));
+
+}).add;
+)
+
+
+(
+Pdef(\plop, Pbind(
+ \instrument, \trianglewavebells,
+ \sustain,0.1,
+ \amp, 0.2,
+ //\midinote,Prand([0,7,3,0, 8,7,8,5, 7,12,5,3, 12,7,15,-5]+40,inf) + Prand([10,1,5,-10,20],inf),
+ \note,Prand([0,2b,4],inf),
+ \root, Pstep([0,1],2,inf),
+ //\wet, Pseg(Pseq([0,0.5],inf),3) + Pfunc{ 0.5.rand },
+ \lfowidth, 0.010,
+ \lforate, 1,
+ \rq, 0.1,
+ \cutoff,Pn(Pseries(60,10,9),inf),
+ \dur, Pfunc { 1.rand } + Prand([0.1,0.2,0.14]/2,inf),
+)).play
+)
+
+(
+Pdef(\maj, Ptpar([
+ 0, Pset(\amp, Pseg(Pseq([0,0.5,0],1),Pseq([10,10]),Pseq([1,-1])), Pdef(\plop)),
+ 0, Pbind(
+])
+).play
+)
+
+
+
+ Pdef(\kick, Pbind(
+ \instrument, \stereosampler,
+ \bufnum, Mdef.dsample(\kick1),
+ \dur, 0.125,
+ \amp, 1.0
+ );
View
41 crap28.sc
@@ -0,0 +1,41 @@
+(
+~notes = [12,8,7,0,[-12,4,12],[-12,4,12],[-12,4,12],[-11,5,12],[-11,5,12],[-9,7,12],7]+48;
+~durs = [0.5,0.5,0.5,0.5,1.5,1.0,1.0,1.0,1.0,2.0,0.5]/2;
+
+~notespatternproxy = PatternProxy(Pseq(~notes,inf));
+~durspatternproxy = PatternProxy(Pseq(~durs,inf));
+
+~rhodespat = Pfx(
+ Pbind(
+ \instrument, \everythingrhodes,
+ \midinote, ~notespatternproxy,
+ \dur, ~durspatternproxy,
+ \cutoff,Pstutter(11,Pn(Pseries(500,500,4),inf))
+ ),
+ \choruscompresseffect
+);
+)
+
+x = ~rhodespat.play;
+
+
+~notespatternproxy.source = Pseq(~notes,inf);
+~notespatternproxy.source = Pxrand(~notes,inf);
+~notespatternproxy.source = Pseq(~notes.stutter.scramble,inf);
+~notespatternproxy.source = Pxrand(~notes + 7,inf);
+~notespatternproxy.source = Pseq(~notes.stutter,inf);
+~notespatternproxy.source = Pseq(~notes.stutter(3),inf);
+~notespatternproxy.source = Pseq(~notes-5,inf);
+~notespatternproxy.source = Pseq(~notes,inf);
+~notespatternproxy.source = Pseq(~notes.pyramid(5),inf);
+~notespatternproxy.source = Pseq(~notes.pyramid(7) + 3,inf);
+~notespatternproxy.source = Pseq(~notes.mirror,inf);
+~notespatternproxy.source = Pseq(~notes.permute(7),inf);
+~notespatternproxy.source = Pseq(~notes.reverse,inf);
+~notespatternproxy.source = Pseq(~notes,inf);
+
+~durspatternproxy.source = Pseq(~durs,inf);
+~durspatternproxy.source = Pseq(~durs*2,inf);
+~durspatternproxy.source = Pxrand(~durs,inf);
+~durspatternproxy.source = Pxrand(~durs/2,inf);
+~durspatternproxy.source = Pxrand(~durs/4,inf);
View
4 crap29.sc
@@ -0,0 +1,4 @@
+Mx
+
+x = Mx.new.app;
+x.gui
View
435 crap30.sc
@@ -0,0 +1,435 @@
+
+(
+SynthDef(\scansynth1, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;
+ var in, ou;
+ var spring = [01,1.2,1,05,0.5,0.5,8];
+ var damp = [0.8,0.7,0.1,0.2,0.1,0.2,0.9];
+ var springs;
+ var sel;
+ in = LocalIn.ar(1) * 0.95 + Trig.ar(gate, 0.01);
+ ou = in;
+ springs = spring.collect { arg spr, i;
+ ou = Spring.ar(ou, spr, damp[i]);
+ };
+ LocalOut.ar(ou);
+ sel = LFSaw.ar(freq).range(0, spring.size-1);
+ ou = SelectX.ar(sel, springs);
+ ou = ou * EnvGen.ar(\adsr.kr(Env.adsr(0.1,0.1,0.8,0.1)),gate,doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+ Out.ar(out, ou);
+}).add;
+)
+
+(
+Pdef(\plop, Pbind(
+ \instrument, \scansynth1,
+ \degree, Pseq([0,2,4],inf),
+ \dur, 1,
+ \amp, 0.1
+)).play;
+)
+
+
+
+{ SinOsc.ar }.play
+
+
+w = Window.new;
+~tl = MxTimeGui.new
+~tl.gui(w)
+w.front
+
+(
+~model = (
+ channels: [
+ (units:[])
+ ]
+ up:
+);
+~tl = MxTimeGui(~model);
+~tl.gui;
+)
+
+
+
+
+(
+SynthDef(\scansynth1, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;
+ var in, ou;
+ var spring = (7.42).dup(10);
+ var damp = (0.7764812).dup(10);
+ var springs;
+ var sel;
+ spring = 0.1;
+ damp = spring/01;
+ spring = spring.dup(10);
+ damp = damp.dup(10);
+ in = LPF.ar(LocalIn.ar(1), XLine.ar(1,05,0.8)) * 0.90 + (LPF.ar(Trig.ar(gate, 0.01),010) * WhiteNoise.ar.range(0.98,1));
+ ou = in;
+ springs = spring.collect { arg spr, i;
+ ou = Spring.ar(ou, spr, damp[i]);
+ };
+ LocalOut.ar(ou);
+ //sel = VarSaw.ar(freq * [0.999,1,0.499,2,1.01] * 0.5, width: LFNoise2.ar(1/2).range(0.2,0.5)).range(0, spring.size-1);
+ sel = LFSaw.ar(freq * [0.999,1,0.499,2,1.01] * 1.0).range(0, spring.size-1);
+ ou = SelectX.ar(sel, springs);
+ ou = ou.sum;
+ //ou = Splay.ar(ou, 1);
+ ou = ou * EnvGen.ar(\adsr.kr(Env.adsr(0.3,0.1,0.8,0.8)),gate,doneAction:2);
+ ou = ou * amp;
+ ou = Pan2.ar(ou, pan, 1);
+ Out.ar(out, ou);
+}).add;
+)
+
+(
+Pdef(\plop, Pbind(
+ \instrument, \scansynth1,
+ \scale, Scale.minor,
+ //\degree, Pseq([0,2,4],inf) + [0,2,4,-12],
+ \degree, Pseq([0,2,4],inf),
+ \strum, 1/8,
+ \dur, 1,
+ \amp, 2,
+ \legato, 0.5
+)).play;
+)
+
+
+
+
+
+
+
+0
+:
+
+(N:"plop")
+
+
+
+(
+SynthDef(\scansynth1, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;
+ var in, ou;
+ var spring = (0.12).dup(40);
+ var damp = (0.0564812).dup(40);
+ var springs;
+ var sel;
+ in = LPF.ar(LocalIn.ar(1), XLine.ar(1,10,0.3)) * 0.97 + (LPF.ar(Trig.ar(gate, 0.01),200) * WhiteNoise.ar.range(0.98,1));
+ ou = in;
+ springs = spring.collect { arg spr, i;
+ ou = Spring.ar(ou, spr, damp[i]);
+ };
+ LocalOut.ar(ou);
+ sel = VarSaw.ar(freq * [0.999,1,0.499,2,1.01] * 0.5, width: LFNoise2.ar(1/2).range(0.2,0.5)).range(0, spring.size-1);
+ ou = Splay.ar(SelectX.ar(sel, springs), 1);
+ ou = ou * EnvGen.ar(\adsr.kr(Env.adsr(0.3,0.1,0.8,0.1)),gate,doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+ Out.ar(out, ou);
+}).add;
+)
+
+(
+Pdef(\plop, Pbind(
+ \instrument, \scansynth1,
+ \scale, Scale.minor,
+ \degree, Pseq([0,2,4],inf) + [0,2,4,-12],
+ \strum, 3/8,
+ \dur, 3,
+ \amp, 2,
+ \legato, 1.4
+)).play;
+)
+
+
+
+
+ // http://twitter.com/#!/alln4tural/status/99846300173991936
+// http://soundcloud.com/tengototen/esoteric-tweet
+
+
+fork{loop{h=[5,7,8].choose*(2**(2..8).choose);play{Splay.ar({SinOsc.ar(exprand(h,h+(h/64)),0,0.1)}!64)*LFGauss.ar(9,1/4,0,0,2)};2.wait}};
+
+// really i wanted to do this:
+fork{loop{h=([33,38,40].choose.midicps)*(2**((0 .. 5).choose));play{Splay.ar({SinOsc.ar(exprand(h-(h/256),h+(h/256)),0,0.1)}!64)*LFGauss.ar(19,1/4,0,0,2)};4.wait}};
+// or more like a constant drone:
+fork{5.do{h=([33,38,40].choose.midicps)*(2**((0 .. 4).choose));play{Splay.ar({SinOsc.ar(exprand(h-(h/64),h+(h/64)),0,0.1)}!8)*LFGauss.ar(19,1/4,0,0,2)};0.25.wait}};
+// primes
+fork{loop{h=(4 .. 100).choose.nthPrime*(2**(0..3).choose);play{Splay.ar({SinOsc.ar(exprand(h-(h/256),h+(h/256)),0,0.1)}!64)*LFGauss.ar(19,1/4,0,0,2)};2.wait}}; 
+// Fibonacci
+fork{loop{h=(List.fib(15).choose)*(2**(0..4).choose);play{Splay.ar({SinOsc.ar(exprand(h-(h/64),h+(h/64)),0,0.1)}!64)*LFGauss.ar(19,1/4,0,0,2)};2.wait}}; 
+
+// but they were too long.
+// __________________________
+// inspired by http://sctweets.tumblr.com/post/8379573991/sinosc
+// (http://soundcloud.com/rukano)
+
+
+
+Pspawner{|sp|6.do{|i|sp.par(Pbind(*[degree:Pseq(((0..i)*2),inf),octave:7-i,dur:0.2*(2**i)]))};sp.seq}.trace.play //#supercollider #sc140
+
+
+
+:a!
+
+
+
+(
+
+var seed = thisThread.randSeed = 1e8.rand.debug('seed');
+
+{|dur = 30|
+
+ var voices = 2.pow(1.rrand(4)),
+
+ sig = DelayC.ar({ Pan2.ar(
+
+ PMOsc.performList(\ar, {
+
+ var freq = Lag.ar(LFSaw.ar([10,15]/((1..5).choose*[1,2,4].choose)).exprange(
+
+ {200.rrand(400)}!2, {500.rrand(1100)}!2
+
+ * Line.kr(0.5.rrand(2), 3.rrand(8.0),dur)
+
+ ));
+
+ [freq, freq/[2,4].choose + SinOsc.kr([10,25],0,5), XLine.kr(0.1,1.rrand(3.0),dur/1.rrand(2.0))]
+
+ }.()).sum/2,
+
+ [SinOsc,LFTri].choose.kr({4.0.rrand(11)}!2 * [XLine,Line].choose.kr(1,4,dur))
+
+ ).sum/2
+
+ * LFGauss.kr(XLine.kr(\beat.kr, \beat.kr / \beat_change.kr, dur) / [0.5,1,2,4].choose, 0.3)
+
+ * EnvGen.kr([
+
+ Env.perc(0.1,dur),
+
+ Env.sine(dur),
+
+ Env.performList(\new, {|len| [
+
+ [0]++Array.rand(len,0.1,1)++[0],
+
+ Array.rand(len,0.1,1).normalizeSum * dur,
+
+ Array.rand(len-1,-3.0,3.0)+[0]
+
+ ]}.(2.rrand(10)))
+
+ ].choose) } ! voices, 4, { 0.1.rrand(4) } ! voices, 1 / voices).sum * Line.kr(1,1,dur+5,doneAction:2);
+
+ sig = Rotate2.ar(sig[0],sig[1], LFSaw.kr(Duty.kr(dur/4.rrand(16), 0, Drand([-1*\beat.kr,\beat.kr].reciprocal,inf))));
+
+}.play(args:[
+
+ dur:1.rrand(25.0).debug('dur'),
+
+ beat:1.rrand(6)*(1..4).reciprocal.choose/4,
+
+ beat_change:1.rrand(8)
+
+])
+
+)
+
+
+
+// really early first approach...
+(
+x.free;
+x = {
+ var note = Duty.kr(
+ 6/3.2,
+ 0,
+ Dseq([45, 45, 48, 41], inf));
+ var snd = Saw.ar(note.midicps * SinOsc.kr(7.421).range(0.998, 1.001)) * -12.dbamp!2;
+ var trigs = TDuty.kr(
+ Dseq([1, 2, 3]/3.2, inf),
+ 0,
+ 1);
+ var lvls = Duty.kr(
+ Dseq([1, 2, 3]/3.2, inf),
+ 0,
+ Dseq([-9, -3, -6], inf));
+ snd = snd * lvls.dbamp.lag2(0.1);
+ snd = snd * EnvGen.kr(Env.perc(0.3, 0.3), trigs);
+ snd = RLPF.ar(snd, EnvGen.kr(Env.perc(0.5, 0.2), trigs) * 3201 + 2311, 0.2);
+ snd = LPF.ar(snd, 3000);
+ snd = snd * (1 + Latch.ar(WhiteNoise.ar(-8.dbamp), Dust.ar(830))).lag2(0.01);
+ snd = snd + LPF.ar(CombC.ar(snd, 0.4, 0.33, 0.52, -4.dbamp), 932);
+ snd = FreeVerb2.ar(snd, snd, 0.21, 0.93, 0.9);
+ snd * -12.dbamp;
+}.play;
+)
+
+
+
+
+
+(
+~tasks = (
+ N: {
+ 10.do {
+ arg i;
+ x = Synth(\grain_1);
+ 0.5.wait;
+ }
+ },
+ P: {
+ 10.do {
+ arg i;
+ x = Synth(\grain_2);
+ 0.5.wait;
+ }
+ }
+);
+
+j = [ \N, \P];
+
+h = Task({
+ j.do({ arg i, o; //
+ ~tasks[i].value;
+ 1.wait;
+ })
+});
+
+)
+
+h.play;
+
+
+
+//--simple example
+(
+s.waitForBoot{
+RedMst.clear;
+RedMst.clock= TempoClock(140/60);
+RedMst.quant= 8;
+RedMstGUI3(20);
+
+RedTrk(
+ \bass,
+ Pbind(\degree, Pseq([0, 5], inf), \octave, 4),
+ #[0, 1, 2, 3]
+);
+RedTrk(
+ \melody,
+ Pbind(\degree, Pseq([0, 5, 2, 3, 3, 1], inf), \dur, Pseq([0.25, 0.25, 0.5], inf)),
+ #[1, 2, 5]
+);
+RedTrk(
+ \melody2,
+ Pbind(\degree, Pseq([7, 6, 4, 3], inf), \dur, 2, \octave, 6),
+ #[2, 3]
+);
+}
+)
+
+RedMst.play;
+RedMst.next;
+RedMst.next;
+RedMst.quant= 2;
+
+RedMstGUI(64); //add more guis
+RedMstGUI(24, GUI.skins.default);
+RedMstGUI(9);
+
+RedMst.next;
+RedMst.stop;
+RedMst.clear;
+
+
+
+
+
+(
+ {|freq = 080, rq=0.08|
+ Out.ar(0,
+ Pan2.ar(
+ BPF.ar(WhiteNoise.ar * Line.kr(5, 0, 0.02), freq, rq)
+ )
+ )
+ }.play;
+)
+
+
+
+(
+Instr(\plop, { arg amp=0.1, gate=1, pan=0, freq=200;
+ var ou;
+ ou = SinOsc.ar(freq);
+ ou = ou * EnvGen.ar(\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+}).addSynthDef;
+
+)
+
+Mdef.main
+
+(
+t = TempoClock.new;
+~book = Mdef.main.node_manager.make_groupplayer();
+8.do {
+ var song = ~make_parplayer.(Mdef.main);
+ ~book.add_children(song);
+ 1.do {
+ var section = ~make_parplayer.(Mdef.main);
+ song.add_children(section);
+ 1.do {
+ var variant = ~make_parplayer.(Mdef.main);
+ section.add_children(variant);
+ }
+
+ }
+};
+t.beats
+)
+t
+~book = nil
+
+
+[\song1, \section1, \variant1]
+[0,0,0]
+
+~group = (
+ selected_child: 0,
+ children: SparseArray.newClear(~general_sizes.children_per_groupnode, \voidplayer),
+
+ get_child: { arg self, num;
+ var child;
+ if(num.isNil) {
+ child = self.selected_child;
+ } {
+ if(num == 0) {
+ child = self;
+ } {
+ child = self.children[num];
+ if(child == \voidplayer) {
+ main.node_manager.make_groupplayer(\)
+ } {
+
+ }
+ }
+ }
+ }
+);
+
+~bla = 1000.collect { ~group.deepCopy };
+
+(
+
+
+~sm = ~make_song_manager.(Mdef.main);
+//~sm.get_path([1]);
+)
+~sm.get_path([1,1,1],true).uname;
+~sm.get_path([1,3,0],true).uname;
+~sm.change_section(0).uname
+~sm.change_part(1).uname
+~sm.get_current_path;
+
+~sm.current_song.get_childname_by_index(1)
View
40 eventscore.sc
@@ -246,6 +246,7 @@
(
notes: List.new,
book: Dictionary.new,
+ notequant: nil, // used externally to quantify note time
add_note: { arg self, note, abstime, num;
var no = note.deepCopy;
@@ -459,11 +460,12 @@
var size;
notes = self.notescore.get_rel_notes(self.slice_start, self.slice_dur);
- // quantify notes
notes.collect({arg no, x; no.numero = x }); // debug purpose
//notes.debug("update_note_dur: original notes");
qnotes = notes.collect{ arg x;
+ // quantify notes
x = self.quantify_note(x);
+ // set midinote to be compatible with noteline code
if(x.midinote.isNil) {
x.midinote = x.slotnum;
};
@@ -511,12 +513,13 @@
//param.debug("UPDATED NOTES !!!!");
},
- quantify_note: { arg self, note;
+ quantify_note: { arg self, note, quant;
var res;
+ quant = quant ?? self.notescore.notequant;
//note.debug("quantify_note input");
res = note.deepCopy;
- if(self.notequant.notNil) {
- res.dur = res.dur.round(self.notequant);
+ if(quant.notNil) {
+ res.dur = res.dur.round(quant);
res;
} {
res;
@@ -979,8 +982,35 @@
}
},
+ strip_note: { arg self, no;
+ var resno = ();
+ [\velocity, \dur, \sustain, \midinote, \slotnum].do { arg key;
+ if(no[key].notNil) {
+ resno[key] = no[key]
+ }
+ };
+ resno;
+ },
+
+ get_notes_pattern: { arg self, notes, strip=true;
+ notes = notes ?? self.get_notes;
+ if(strip) {
+ notes = notes.collect { arg no;
+ var res;
+ res = self.strip_note(no);
+ if(res[\sustain] < 0) {
+ res[\sustain].debug("get_notes_pattern: negative sustain, fixing it");
+ res[\sustain] = res[\sustain].abs;
+ };
+ res;
+ };
+ };
+ Pseq(notes);
+ },
+
+
set_notequant: { arg self, val;
- self.notequant = val;
+ self.notescore.notequant = val;
self.update_notes;
}
View
130 keycode.sc
@@ -682,28 +682,30 @@
bind_param: { arg self, ccpath, param;
var panel = \midi;
var oldparam;
- //"I---I bind_param".debug;
+ "I---I bind_param".debug;
if(self.midi_handler[panel].isNil) { self.midi_handler[panel] = Dictionary.new };
- //oldparam = self.ccpathdict.get_val_by_key(ccpath);
oldparam = self.ccpathToParam[ccpath];
- //[param.name, ccpath].debug("assigning ccpath to param");
- //self.ccpathdict.bind(ccpath, param); // key: ccpath, val: param
+
+ param.midi.get_param.debug("verif param");
+ [param.name, ccpath].debug("assigning ccpath to param");
+
self.ccpathToParam[ccpath] = param;
self.paramToCcpath[param] = ccpath;
if(oldparam.notNil && (oldparam != param)) {
self.paramToCcpath[oldparam] = nil;
- //self.get_param_binded_ccpath(oldparam).debug("ce n'est point possible");
- //oldparam.name.debug("refreshing oldparam");
+ self.get_param_binded_ccpath(oldparam).debug("ce n'est point possible");
+ oldparam.name.debug("refreshing oldparam");
oldparam.midi.refresh;
};
- //param.midi.get_ccpath.debug("verif");
- //param.name.debug("refreshing param");
+ param.midi.get_ccpath.debug("verif");
+ param.midi.get_param.debug("verif param");
+ param.name.debug("refreshing param");
param.midi.refresh;
self.midi_handler[panel][ccpath] = { arg val;
- //[param.name, val].debug("bind_param function: set_val");
+ [param.name, val].debug("bind_param function: set_val");
param.midi.set_val(val);
};
- //"I---I end bind_param".debug;
+ "I---I end bind_param".debug;
},
get_param_binded_ccpath: { arg self, param;
@@ -870,114 +872,6 @@
};
-~bindings = (
- editplayer: [
- ["select_cell", \kb, 0, \kbnumline],
- ["edit_value", \kb, 0, \enter],
- ["edit_value_mode.insert_number", \kb, 0, \kbnumpad],
- ["edit_value_mode.insert_point", \kb, 0, \point],
- ["edit_value_mode.cancel", \kb, 0, \escape],
- ["edit_value_mode.ok", \kb, 0, \enter],
-
- ["solo_selected", \kb, 0, \f7],
- ["unsolo_selected", \kb, \ctrl, \f7],
- ["unsolo_selected", \kb, \ctrl, \f7],
- ["add_effect", \kb, \ctrl, \f1],
- ["increase_midi_knob_offset", \kb, 0, \down],
- ["decrease_midi_knob_offset", \kb, 0, \up],
- ["toggle_cc_recording", \kb, \altshift, "r"],
- ["change_param_kind.recordbus", \kb, \altshift, "u"],
- ["start_midi_liveplayer", \kb, \altshift, "e"],
- ["param_set_pkey_mode", \kb, \alt, "k"],
- ["param_unset_pkey_mode", \kb, \altshift, "k"],
-
- ],
- parlive: [
- ["select_header", \kb, \alt, \kbnumline],
- ["show_panel.editplayer", \kb, 0, \f12],
- ["create_new_livenode", \kb, \alt, "c"],
- ],
- side: [
- ["decrease_select_offset", \midi, 0, \begin],
- ["increase_select_offset", \midi, 0, \end],
- ["increase_samplekit_part", \midi, 0, \right],
- ["decrease_samplekit_part", \midi, 0, \left],
-
- ["midi.play_group", \midi, \hold, \play],
- ["midi.stop_group", \midi, \hold, \stop],
- ["play_group", \kb, \ctrl, \f5],
- ["stop_group", \kb, \ctrl, \f6],
- ["play_selected", \kb, 0, \f5],
- ["midi.play_selected", \midi, 0, \play],
- ["stop_selected", \kb, 0, \f6],
- ["stop_selected_quant", \kb, \ctrlshift, \f6],
- ["midi.stop_selected", \midi, 0, \stop],
- //["mute_selected", \kb, 0, \f7],
- //["unmute_selected", \kb, \ctrl, \f7],
- ["solo_selected", \kb, 0, \f7],
- ["unsolo_selected", \kb, \ctrl, \f7],
- ["toggle_solo_selected", \midi, 0, \pause],
- ["panic", \kb, 0, \f8],
- ["edit_tempo", \kb, \ctrlalt, "e"], // t open terminal
- ["edit_quant", \kb, \ctrlalt, "q"],
- ["edit_barrecord", \kb, \ctrlalt, "b"],
- ["edit_selected_param", \kb, 0, \enter],
-
- ["edit_wrapper", \kb, \alt, "w"],
-
- ["copy_node", \kb, \ctrl, "c"],
- ["paste_node", \kb, \ctrl, "v"],
-
- ["load_node_from_lib", \kb, 0, \f1],
- ["create_default_node", \kb, \alt, "c"],
- ["reload_player", \kb, \altshift, "r"],
-
- ["add_effect", \kb, \ctrlshift, \f2],
-
- ["load_colpreset", \kb, \ctrl, \f1],
- ["save_colpreset", \kb, \ctrl, \f2],
-
- ["select_param", \kb, 0, \kbpad8x4_flat],
- ["pad_select_param", \midi, 0, \midipads],
-
- ["select_param_cell", \kb, \alt, \kbnumline],
-
- ["select_player", \kb, 0, \kbpad8x4_flat],
- ["pad_select_player", \midi, 0, \midipads],
-
- ["forward_in_record_history", \kb, 0, \right],
- ["backward_in_record_history", \kb, 0, \left],
-
- ["set_global_mode.param", \kb, 0, \f9],
- ["set_global_mode.group", \kb, 0, \f10],
- ["set_global_mode.liveplay", \kb, 0, \f11],
- ["set_global_mode.mixer", \kb, 0, \f12],
- ["midi.set_global_mode.param", \midi, 0, \b1],
- ["midi.set_global_mode.group", \midi, 0, \b2],
- ["midi.set_global_mode.liveplay", \midi, 0, \b3],
- ["midi.set_global_mode.mixer", \midi, 0, \b4],
-
- ["set_notequant", \kb, \alt, "q"],
- ["add_cell_bar", \kb, 0, \npplus],
- ["remove_cell_bar", \kb, \ctrl, \npplus],
-
-
- //["toggle_player_recording", \midi, 0, \record],
- ["toggle_player_recording", \midi, 0, \record],
- ["toggle_metronome", \kb, \alt, "m"],
-
- ["change_param_kind.seq", \kb, \altshift, "q"],
- ["change_param_kind.scalar", \kb, \altshift, "s"],
- ["change_param_kind.recordbus", \kb, \altshift, "d"],
- ["change_param_kind.bus", \kb, \altshift, "f"],
- ["change_param_kind.seg", \kb, \altshift, "g"],
- ["change_param_kind.pkey", \kb, \altshift, "h"],
-
- ["change_player_mode.stepline", \kb, \altshift, "q"],
- ["change_player_mode.noteline", \kb, \altshift, "s"],
- ["change_player_mode.sampleline", \kb, \altshift, "d"],
- ]
-);
~string_to_symbol_list = { arg str;
if(str.class == Symbol) {
View
1  live13.sc
@@ -394,6 +394,7 @@ a.trace.play;
~pbc = ~pb2.trace.play
)
~pbc.stop
+~pb.play
thisThread.clock
View
300 live14.sc
@@ -44,6 +44,8 @@ Mdef.side_gui;
}
)
+Debug.enableDebug = true;
+Debug.enableDebug = false;
(
Mdef(\kick1, Pbind(
@@ -87,12 +89,12 @@ SynthDef(\awi, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, imp_ratio=1, saw_r
adsr_imp = EnvGen.kr(~make_adsr.(\adsr_imp, Env.adsr(0.41,0.2,0.15,0.01)),gate,levelScale:freq*imp_ratio);
adsr_saw = EnvGen.kr(~make_adsr.(\adsr_saw, Env.adsr(0.41,0.2,0.15,0.01)),gate,levelScale:freq*saw_ratio);
adsr_rq = EnvGen.kr(~make_adsr.(\adsr_rq, Env.adsr(0.41,0.2,0.15,0.01)),gate,levelScale:rqscale, levelBias:rqbias);
- //adsr_ff = EnvGen.kr(~make_adsr.(\adsr_ff, Env.adsr(0.41,0.2,0.15,0.01)),gate);
+ adsr_ff = EnvGen.kr(~make_adsr.(\adsr_ff, Env.adsr(0.41,0.2,0.15,0.01)),gate,levelScale:ffratio*freq,levelBias:ffbias);
trig = Impulse.ar(adsr_imp);
freq = LFSaw.ar(adsr_saw).range(freq*(1+fratio),freq*(1-fratio));
ou = GrainSin.ar(1, trig, 0.001,freq*[1,1.01]).sum;
//ou = BPF.ar(ou, adsr_ff*ffratio*freq+freq, adsr_rq);
- //ou = BPF.ar(ou, ffratio*freq, adsr_rq);
+ ou = BPF.ar(ou, adsr_ff, adsr_rq);
ou = ou * EnvGen.ar(~make_adsr.(\adsr,Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:2);
ou = Pan2.ar(ou, pan, amp);
Out.ar(out, ou);
@@ -103,24 +105,40 @@ SynthDef(\awi, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, imp_ratio=1, saw_r
Pdef(\awi, Pbind(
\instrument, \awi,
\adsr_imp, Pseq([
- [ Env.adsr(0.41,0.1,0.014,0.01) ],
+ [ Env.adsr(0.01,0.8,0.814,1.01,2) ],
//[ Env.adsr(0.41,0.2,0.15,0.01) ],
],inf),
\fratio, 0.41,
- \adsr_saw, Pseq([
- [ Env.adsr(0.01,0.02,0.85,0.01,7.1) ],
+ //\sawpeak, Pseq([1,2,3,4,5],inf),
+ \blendsaw, Pseq([0,1,2,3]/3,inf),
+ \adsr_saw,
+ //Pseq([
+ Pfunc{ arg ev; [ Env.adsr(0.01,0.02,0.85,1.01,0.2).blend(
+ Env.adsr(0.11,0.02,0.85,1.01,7.2),
+ ev[\blendsaw]
+ ) ] },
//[ Env.adsr(0.01,0.2,0.15,0.01) ],
- ],inf),
+ //],inf),
\adsr_rq, Pseq([
- [ Env.adsr(0.41,0.2,0.05,0.01,7.1) ],
+ [ Env.adsr(0.11,0.11,7.15,1.01,0.1) ],
],inf),
- \ffratio, 0.4,
- \rqbias, 0.01,
- \imp_ratio, 40.5,
- \saw_ratio, 10.5,
- \degree, Pseq([0,2,4],inf),
- \dur, 1,
- \amp, 0.1
+ \adsr_ff, Pseq([
+ [ Env.adsr(0.01,0.02,1.05,0.01,1.0).range(1,2) ],
+ ],inf),
+ \ffratio, 7,
+ \rqbias, 0.41,
+ \rqratio, 4,
+ \imp_ratio, Pseq([20,40,1,030.5]/1,inf),
+ \saw_ratio, 4.5,
+ \octave, 3,
+ //\degree, Pseq([0,2,4,2, 3,5,7,5],inf),
+ \degree, Pseq([
+ Pshuf([0,2,4,\r]),
+ ],inf)+Pseg(Pseq([3,0,3,4],inf),4,\step),
+ \legato, 2.5,
+ //\degree, Pseq([0,2,\r,2, 3,\r,7,5]+5,inf),
+ \dur, 1/16,
+ \amp, 0.4
)).play;
);
@@ -128,3 +146,257 @@ Pdef(\awi, Pbind(
GUI.swing
~sw = SW_Scope.new;
~sw.window.front
+Quarks.gui
+
+
+(
+SynthDef(\rabi, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;
+ var ou;
+ ou = LFSaw.ar(freq*[1,1.01,0.99],LFSaw.ar(2).range(0,2));
+ ou = ou + DelayL.ar(ou,0.01,[0.02,0.001,LFSaw.ar(freq).range(0,0.02)]);
+ ou = ou.sum;
+ ou = RLPF.ar(ou,freq*2,0.4);
+ ou = ou * EnvGen.ar(Env.adsr(0.7,0.4,0.8,1.7),gate,doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+ Out.ar(out, ou);
+}).add;
+)
+Array.geom(5,0.25,2)
+(
+SynthDef(\rabi2, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, rq=0.4, timeScale=1;
+ var ou, adsr_delay, delaymod;
+ //ou = LFSaw.ar(freq*[1,1.01,0.99],LFSaw.ar(2).range(0,2));
+ //ou = LFSaw.ar(freq,LFSaw.ar(2).range(0,2));
+ //adsr_delay = EnvGen.kr(~make_adsr.(\adsr_delay, Env.adsr(0.21,0.6,0.15,1.21,0.01)),gate);
+ adsr_delay = EnvGen.kr(Env([0.01,0.05,0.101,0.01],[0.5,0.5,0.5]),gate,timeScale:1);
+ ou = 0;
+ delaymod = SinOsc.ar(freq).range(0.01,0.001);
+ //ou = ou + DelayL.ar(ou,0.01,[0.02,0.001,LFSaw.ar(freq).range(0,0.02)]);
+ //ou = ou.sum;
+ //ou = RLPF.ar(ou,freq*2,rq*6);
+ ou = SinOsc.ar(freq) + ou;
+ ou = LFSaw.ar(freq);
+ ou = ou + DelayL.ar(ou, 0.11,delaymod);
+ //ou = LPF.ar(ou, freq*16);
+ //ou = LPF.ar(ou, freq*16);
+ ou = BPF.ar(ou, freq*Array.geom(4,0.25,2), adsr_delay*4).sum;
+ //ou = Limiter.ar(ou, amp);
+ ou = ou * EnvGen.ar(Env.adsr(0.1,0.4,0.8,0.1),gate,doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+ Out.ar(out, ou);
+}).add;
+)
+Ptempo
+(
+Pdef(\rabi, Pbind(
+ \instrument, \rabi,
+ \degree, Pseq([[0,2,4]],inf)+Pseg(Pseq([3,0,3,4],inf),4,\step),
+ \octave, 4,
+ \dur, 4,
+ \timeScale, Pkey(\dur)/Ptempo(),
+ \mylegato, 1,
+ \legato, [0.6,0.7,0.5]+0.35,
+ \amp, 0.1
+)).play;
+);
+(
+Mdef(\jacob, Pbind(
+ \instrument, \rabi2,
+)).play;
+);
+
+(
+Pdef(\par, Ppar([
+ Pdef(\rabi),
+ Pdef(\awi),
+])).play
+)
+
+s.meter
+
+
+Help("instr").gui
+Help.gui
+
+Instr
+
+(
+ Instr(\saw, { arg freq=200,amp=0.5;
+ LFSaw.ar(freq,0.0, amp)
+ });
+
+ Instr(\rlpf, { arg in,freq=200,rq=0.1;
+ RLPF.ar(in, freq, rq);
+ });
+
+ Instr(\ppp, { arg freq=200;
+ var ou;
+ ou = Instr.ar(\saw,[freq,0.5]);
+ Instr.ar(\rlpf, [ou, freq, 0.1]) ! 2
+ });
+)
+
+SynthDescLib.global.at(\rabi2).def.inspect
+
+
+~dn = Instr(\ppp).asDefName
+~dn = Instr(\ppp).asSynthDef.add
+~dn.name
+(
+Pdef(\pam, Pbind(
+ \instrument, ~dn.name,
+ \degree, Pseq([0],inf),
+ \dur, 1,
+ \amp, 0.1
+)).play;
+);
+
+Patch(\ppp).play
+
+(
+a = SynthDef(\joe, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;
+ var ou;
+ ou = LFSaw.ar(freq*[1,1.01,0.99],LFSaw.ar(2).range(0,2));
+ ou = ou + DelayL.ar(ou,0.01,[0.02,0.001,LFSaw.ar(freq).range(0,0.02)]);
+ ou = ou.sum;
+ ou = RLPF.ar(ou,freq*2,0.4);
+ ou = ou * EnvGen.ar(Env.adsr(0.7,0.4,0.8,1.7),gate,doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+ Out.ar(out, ou);
+}).add;
+)
+a.dump
+
+Instr(\saw).func.postcs
+
+
+(
+a = { arg out=0, amp=0.1, gate=1, pan=0, freq=200;
+ var ou;
+ ou = \bla.kr(1);
+ ou = LFSaw.ar(freq*[1,1.01,0.99],LFSaw.ar(2).range(0,2));
+ ou = ou + DelayL.ar(ou,0.01,[0.02,0.001,LFSaw.ar(freq).range(0,0.02)]);
+ ou = ou.sum;
+ ou = RLPF.ar(ou,freq*2,0.4);
+ ou = ou * EnvGen.ar(Env.adsr(0.7,0.4,0.8,1.7),gate,doneAction:2);
+ ou = Pan2.ar(ou, pan, amp);
+ Out.ar(out, ou);
+}
+)
+
+a.def.argNames
+
+
+{ arg out=0, amp=0.1, gate=1, pan=0, freq=200;
+ var ou;
+ ou = LFSaw.ar(freq*[1,1.01,0.99],LFSaw.ar(2).range(0,2));