Permalink
Browse files

song manager

  • Loading branch information...
grirgz committed Oct 7, 2012
1 parent 4ed7306 commit 26c2f33b4958807994c05077417a05282adfb434
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
Binary file not shown.
View
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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1 @@
+~bla ?? { _.isNil }
View
@@ -0,0 +1,2 @@
+
+Mdef.sample(\bla, "bla.wav")
Oops, something went wrong.

0 comments on commit 26c2f33

Please sign in to comment.