/* --------------------------------------------------------------------------------------------------------------- -------------------------------------ATTRACTORS VERSION B (quasi-random event order)--------------------------- --------------------------------------------------------------------------------------------------------------- */ // MATT SAYS: GOOD IDEA MAYBE TO CREATE AN ENVIRONMENT // SPACEBAR FOR GUI INSTEAD OF CLICK PERHAPS ( // 1. Server config s = Server.local; s.options.outDevice_( "Built-in Output" ); s.options.numOutputBusChannels_(2); // might need to change to value of ~numChans s.options.inDevice_("Built-in Microphone"); s.options.numInputBusChannels_(2); // might need to change to value of ~numChans s.options.sampleRate_(44100); s.options.memSize_(2.pow(20)); s.newBusAllocators; ServerBoot.removeAll; ServerTree.removeAll; ServerQuit.removeAll; // 2. Initialize gloabal variables ~out = 0; ~numChans = 2; //~speakersOrHeadphones = "speakers"; // 3. Define piece-specific functions ~ambiArray = { if ( ~numChans == 2, { [-0.25pi, 0.25pi] }, {if ( ~numChans == 4, { [-0.25pi, 0.25pi, 0.75pi, 1.25pi] }, {if (~numChans == 8, { [-0.25pi, 0pi, 0.25pi, 0.5pi, 0.75pi, pi, 1.25pi, 1.5pi] // REVISE IF NECESSARY }, { "Error: setup not available".postln } )} )} ) }.value; ~makeBusses = { ~bus = Dictionary.new; ~bus.add(\reverb -> Bus.audio(s, ~numChans)); ~bus.add(\equalization -> Bus.audio(s, ~numChans)); }; ~cleanup = { s.newBusAllocators; ServerBoot.removeAll; ServerTree.removeAll; ServerQuit.removeAll; }; ~makeNodes = { s.bind({ ~mainGrp = Group.new; ~reverbGrp = Group.after(~mainGrp); ~eqGrp = Group.after(~reverbGrp); ~reverbSynth = Synth.new( \reverberator, [ \mix, ~mix.value(0, 1), \delaytime, ~delaytime.value.linlin(0, 1, 0.001, 0.1), \decaytime1, ~decaytimecomb.value.linlin(0, 1, 0.1, 5), \decaytime2, ~decaytimeallpass.value.linlin(0, 1, 0.1, 1), \in, ~bus[\reverb], \out, ~bus[\equalization], ], ~reverbGrp ); ~eqSynth = Synth.new( \eq, [ \lowshelf_cf, ~lowshelf_cf.value.linlin(0, 1, 100, 300), \lowshelf_db, ~lowshelf_db.value.linlin(0, 1, -12, 12), \db_scalar, ~db_scalar.value.linlin(0, 1, 0.1, 10), \lowpass, ~lowpass.value.linlin(0, 1, 10000, 20000), \in, ~bus[\equalization], \out, ~out, ], ~eqGrp ); }); }; // Pitch process conversions ~convert = { arg pc; ((84/66) * pc) + 21 }; ~infraConvert = { arg freq; var output; Pif( freq < 60, { output = freq * 4 }, { Pif( (freq > 60) && (freq < 120), { output = freq * 2 }, { output = freq } ) }) }; ~graph_C_convert = {arg pc; var transpose; if ( (pc == 0) || (pc == 1) || (pc == 2) || (pc == 3) || (pc == 7), {transpose = pc + 11}, // transpose to register 2 {transpose = pc + 22} // transpose to register 3 ); transpose; }; ~graph_D_conversion = {arg pcs; var new = Array(pcs.size), i = 0; while ( {i < pcs.size}, { if ( (pcs[i] == 0) || (pcs[i] == 1) || (pcs[i] == 2) || (pcs[i] == 5) || (pcs[i] == 7) || (pcs[i] == 10), {new.add(pcs[i] + 33)}, // transpose to register 4 {new.add(pcs[i] + 44) } ); i = i + 1} // transpose to register 5 ); new; }; // Group Factorings ~pseq_B32 = {var seq; seq = [[[0, 33].scramble, [11, 44].scramble, [22, 55].scramble].scramble, // Coset-0 [ [1, 34].scramble, [12, 45].scramble, [23, 56].scramble].scramble, // Coset-1 [ [2, 35].scramble, [13, 46].scramble, [24, 57].scramble].scramble, // Coset-2 [ [3, 36].scramble, [14, 47].scramble, [25, 58].scramble].scramble, // Coset-3 [ [4, 37].scramble, [15, 48].scramble, [26, 59].scramble].scramble, // Coset-4 [ [5, 38].scramble, [16, 49].scramble, [27, 60].scramble].scramble, // Coset-5 [ [6, 39].scramble, [17, 50].scramble, [28, 61].scramble].scramble, // Coset-6 [ [7, 40].scramble, [18, 51].scramble, [29, 62].scramble].scramble, // Coset-7 [ [8, 41].scramble, [19, 52].scramble, [30, 63].scramble].scramble, // Coset-8 [ [9, 42].scramble, [20, 53].scramble, [31, 64].scramble].scramble, // Coset-9 [ [10, 43].scramble, [21, 54].scramble, [32, 65].scramble].scramble].scramble; // Coset-10 seq.choose.flat; }; ~pseq_B23 = {var seq; seq = [[[0, 22, 44].scramble, [11, 33, 55].scramble].scramble, // Coset-0 [ [1, 23, 45].scramble, [12, 34, 56].scramble].scramble, // Coset-1 [ [2, 24, 46].scramble, [13, 35, 57].scramble].scramble, // Coset-2 [ [3, 25, 47].scramble, [14, 36, 58].scramble].scramble, // Coset-3 [ [4, 26, 48].scramble, [15, 37, 59].scramble].scramble, // Coset-4 [ [5, 27, 49].scramble, [16, 38, 60].scramble].scramble, // Coset-5 [ [6, 28, 50].scramble, [17, 39, 61].scramble].scramble, // Coset-6 [ [7, 29, 51].scramble, [18, 40, 62].scramble].scramble, // Coset-7 [ [8, 30, 52].scramble, [19, 41, 63].scramble].scramble, // Coset-8 [ [9, 31, 53].scramble, [20, 42, 64].scramble].scramble, // Coset-9 [ [10, 32, 54].scramble, [21, 43, 65].scramble].scramble].scramble; // Coset-10 seq.choose.flat; }; ~pseq_3B2 = {var seq; seq = [[[0, 33].scramble, [6, 39].scramble, [12, 45].scramble, [18, 51].scramble, // Coset-0 [24, 57].scramble, [30, 63].scramble, [3, 36].scramble, [9, 42].scramble, [15, 48].scramble, [21, 54].scramble, [27, 60].scramble].scramble, [[1, 34].scramble, [7, 40].scramble, [13, 46].scramble, [19, 52].scramble, // Coset-1 [25, 58].scramble, [31, 64].scramble, [4, 37].scramble, [10, 43].scramble, [16, 49].scramble, [22, 55].scramble, [28, 61].scramble].scramble, [[2, 35].scramble, [8, 41].scramble, [14, 47].scramble, [20, 53].scramble, // Coset-2 [26, 59].scramble, [32, 65].scramble, [5, 38].scramble, [11, 44].scramble, [17, 50].scramble, [23, 56].scramble, [29, 62].scramble].scramble].scramble; seq.choose.flat; }; ~pseq_32B = {var seq; seq = [[[0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60].scramble, // Coset-0 [33, 39, 45, 51, 57, 63, 3, 9, 15, 21, 27].scramble].scramble, [[1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61].scramble, // Coset-1 [34, 40, 46, 52, 58, 64, 4, 10, 16, 22, 28].scramble].scramble, [[2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62].scramble, // Coset-2 [35, 41, 47, 53, 59, 65, 5, 11, 17, 23, 29].scramble].scramble].scramble; seq.choose.flat; }; ~pseq_2B3 = {var seq; seq = [[[0, 22, 44].scramble, [6, 28, 50].scramble, [12, 34, 56].scramble, [18, 40, 62].scramble, // Coset-0 [24, 46, 2].scramble, [30, 52, 8].scramble, [36, 58, 14].scramble, [42, 64, 20].scramble, [48, 4, 26].scramble, [54, 10, 32].scramble, [60, 16, 38].scramble].scramble, [[1, 23, 45].scramble, [7, 29, 51].scramble, [13, 35, 57].scramble, [19, 41, 63].scramble, // Coset-1 [25, 47, 3].scramble, [31, 53, 9].scramble, [37, 59, 15].scramble, [43, 65, 21].scramble, [49, 5, 27].scramble, [55, 11, 33].scramble, [61, 17, 39].scramble].scramble].scramble; seq.choose.flat; }; ~pseq_23B = {var seq; seq = [[[0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60].scramble, // Coset-0 [22, 28, 34, 40, 46, 52, 58, 64, 4, 10, 16].scramble, [44, 50, 56, 62, 2, 8, 14, 20, 26, 32, 38].scramble].scramble, [[1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61].scramble, // Coset-1 [23, 29, 35, 41, 47, 53, 59, 65, 5, 11, 17].scramble, [45, 51, 57, 63, 3, 9, 15, 21, 27, 33, 39].scramble].scramble]; //sel = ~convert.value(seq.choose.flat); seq.choose.flat; }; // Minimal Cycles of Graphs ~cycles_A = {var seq; seq = [[0, 3, 6, 7, 10], [0, 3, 6, 1, 2, 5, 8, 4, 10], [0, 3, 6, 1, 2, 5, 8, 4, 7, 10], [0, 3, 4, 10], [0, 3, 4, 7, 10], [1, 2, 5, 8, 4, 10, 0, 3, 6], [1, 2, 5, 8, 4, 10, 6], [1, 2, 5, 8, 4, 7, 10, 0, 3, 6], [1, 2, 5, 8, 4, 7, 10, 6], [1, 2, 5, 8, 9], [2, 5, 8, 4, 10, 0, 3, 6, 1], [2, 5, 8, 4, 10, 6, 1], [2, 5, 8, 4, 7, 10, 0, 3, 6, 1], [2, 5, 8, 4, 7, 10, 6, 1], [2, 5, 8, 9, 1], [3, 6, 7, 10, 0], [3, 6, 1, 2, 5, 8, 4, 10, 0], [3, 6, 1, 2, 5, 8, 4, 7, 10, 0], [3, 4, 10, 0], [3, 4, 7, 10, 0], [4, 10, 0, 3, 6, 1, 2, 5, 8], [4, 10, 0, 3], [4, 10, 6, 1, 2, 5, 8], [4, 7, 10, 0, 3, 6, 1, 2, 5, 8], [4, 7, 10, 0, 3], [4, 7, 10, 6, 1, 2, 5, 8], [5, 8, 4, 10, 0, 3, 6, 1, 2], [5, 8, 4, 10, 6, 1, 2], [5, 8, 4, 7, 10, 0, 3, 6, 1, 2], [5, 8, 4, 7, 10, 6, 1, 2], [5, 8, 9, 1, 2], [6, 7, 10, 0, 3], [6, 7, 10], [6, 1, 2, 5, 8, 4, 10, 0, 3], [6, 1, 2, 5, 8, 4, 10], [6, 1, 2, 5, 8, 4, 7, 10, 0, 3], [6, 1, 2, 5, 8, 4, 7, 10], [7, 10, 0, 3, 6], [7, 10, 0, 3, 6, 1, 2, 5, 8, 4], [7, 10, 0, 3, 4], [7, 10, 6], [7, 10, 6, 1, 2, 5, 8, 4], [8, 4, 10, 0, 3, 6, 1, 2, 5], [8, 4, 10, 6, 1, 2, 5], [8, 4, 7, 10, 0, 3, 6, 1, 2, 5], [8, 4, 7, 10, 6, 1, 2, 5], [8, 9, 1, 2, 5], [9, 1, 2, 5, 8], [10, 0, 3, 6, 7], [10, 0, 3, 6, 1, 2, 5, 8, 4], [10, 0, 3, 6, 1, 2, 5, 8, 4, 7], [10, 0, 3, 4], [10, 0, 3, 4, 7], [10, 6, 7], [10, 6, 1, 2, 5, 8, 4], [10, 6, 1, 2, 5, 8, 4, 7]]; seq.choose + 11; // 'transposition by one 'octave' }; ~cycles_B = {var seq; seq = [[0, 7, 1, 3, 5, 8, 10, 6, 9], [0, 7, 1, 3, 5, 8, 10, 6], [0, 7, 9], [0, 2, 4, 6, 9], [0, 2, 4, 6], [0, 2, 4, 7, 1, 3, 5, 8, 10, 6, 9], [0, 2, 4, 7, 1, 3, 5, 8, 10, 6], [0, 2, 4, 7, 9], [1, 3, 5, 8, 10, 6, 9, 0, 7], [1, 3, 5, 8, 10, 6, 9, 0, 2, 4, 7], [1, 3, 5, 8, 10, 6, 0, 7], [1, 3, 5, 8, 10, 6, 0, 2, 4, 7], [2, 4, 6, 9, 0], [2, 4, 6, 0], [2, 4, 7, 1, 3, 5, 8, 10, 6, 9, 0], [2, 4, 7, 1, 3, 5, 8, 10, 6, 0], [2, 4, 7, 9, 0], [3, 5, 8, 10, 6, 9, 0, 7, 1], [3, 5, 8, 10, 6, 9, 0, 2, 4, 7, 1], [3, 5, 8, 10, 6, 0, 7, 1], [3, 5, 8, 10, 6, 0, 2, 4, 7, 1], [4, 6, 9, 0, 2], [4, 6, 0, 2], [4, 7, 1, 3, 5, 8, 10, 6, 9, 0, 2], [4, 7, 1, 3, 5, 8, 10, 6, 0, 2], [4, 7, 9, 0, 2], [5, 8, 10, 6, 9, 0, 7, 1, 3], [5, 8, 10, 6, 9, 0, 2, 4, 7, 1, 3], [5, 8, 10, 6, 0, 7, 1, 3], [5, 8, 10, 6, 0, 2, 4, 7, 1, 3], [6, 9, 0, 7, 1, 3, 5, 8, 10], [6, 9, 0, 2, 4], [6, 9, 0, 2, 4, 7, 1, 3, 5, 8, 10], [6, 0, 7, 1, 3, 5, 8, 10], [6, 0, 2, 4], [6, 0, 2, 4, 7, 1, 3, 5, 8, 10], [7, 1, 3, 5, 8, 10, 6, 9, 0], [7, 1, 3, 5, 8, 10, 6, 9, 0, 2, 4], [7, 1, 3, 5, 8, 10, 6, 0], [7, 1, 3, 5, 8, 10, 6, 0, 2, 4], [7, 9, 0], [7, 9, 0, 2, 4], [8, 10, 6, 9, 0, 7, 1, 3, 5], [8, 10, 6, 9, 0, 2, 4, 7, 1, 3, 5], [8, 10, 6, 0, 7, 1, 3, 5], [8, 10, 6, 0, 2, 4, 7, 1, 3, 5], [9, 0, 7, 1, 3, 5, 8, 10, 6], [9, 0, 7], [9, 0, 2, 4, 6], [9, 0, 2, 4, 7, 1, 3, 5, 8, 10, 6], [9, 0, 2, 4, 7], [10, 6, 9, 0, 7, 1, 3, 5, 8], [10, 6, 9, 0, 2, 4, 7, 1, 3, 5, 8], [10, 6, 0, 7, 1, 3, 5, 8], [10, 6, 0, 2, 4, 7, 1, 3, 5, 8]]; seq.choose + 44; // transposition by four 'octaves' }; ~fsm_C = {arg input; var output, toArr; if ( input == 0, {output = 9}, {if ( input == 1, {output = 10}, {if ( input == 2, {output = 4}, {if ( input == 3, {output = 5}, {if ( input == 4, {output = [0, 7].choose}, {if ( input == 5, {output = [1, 6].choose}, {if ( input == 6, {output = [0, 2].choose}, {if ( input == 7, {output = 7}, {if ( input == 8, {output = [1, 3].choose}, {if ( input == 9, {output = [2, 8].choose}, {if ( input == 10, {output = [3, 7].choose}, {"nil"} ) } )} )} )} )} )} )} )} )} )} )}; ~cycles_D = {var seq; seq = [[0, 2, 3, 5, 6], [0, 2, 3, 4], [0, 2, 3, 4, 5, 6], [1, 10, 9, 8, 7, 6], [1, 10, 9, 8], [1, 10, 9, 7, 6], [2, 3, 5, 6, 0], [2, 3, 4, 0], [2, 3, 4, 5, 6, 0], [3, 5, 6, 0, 2], [3, 4, 0, 2], [3, 4, 5, 6, 0, 2], [4, 0, 2, 3], [4, 5, 6, 0, 2, 3], [5, 6, 0, 2, 3], [5, 6, 0, 2, 3, 4], [6, 1, 10, 9, 8, 7], [6, 1, 10, 9, 7], [6, 0, 2, 3, 5], [6, 0, 2, 3, 4, 5], [7, 6, 1, 10, 9, 8], [7, 6, 1, 10, 9], [8, 7, 6, 1, 10, 9], [8, 1, 10, 9], [9, 8, 7, 6, 1, 10], [9, 8, 1, 10], [9, 7, 6, 1, 10], [10, 9, 8, 7, 6, 1], [10, 9, 8, 1], [10, 9, 7, 6, 1]]; ~graph_D_conversion.(seq.choose); // performs 'octave' transpositions }; // Rhythm classes ~rClass_6 = {var rtms; rtms = [16, 12.8, 10.66, 9.14]; rtms.choose; }; ~rClass_12 = {var rtms; rtms = [2.0, 1.33, 1.6]; rtms.choose; }; ~rClass_18 = {var rtms; rtms = [0.4, 0.28]; rtms.choose; }; // Ordered rate, disordered scale ~rClass_29 = {var rtms; rtms = [0.166, 10.666]; rtms.choose; }; ~rClass_38 = {var rtms; rtms = [0.143, 1.143, 4.57]; rtms.choose; }; ~rClass_42 = {var rtms; rtms = [0.125, 0.5, 2.0, 8.0]; rtms.choose; }; ~rClass_51 = {var rtms; rtms = [0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4]; rtms.choose; }; // Ordered Scale and Rate ~rClass_23 = {var rtms; rtms = [0.2]; rtms.choose; }; ~rClass_0 = {var rtms; rtms = [8]; rtms.choose; }; // Disordered Scale and Rate ~rClass_34 = {var rtms; rtms = [0.25, 16.0, 0.166, 10.666, 0.2, 12.8, 0.143, 9.143]; rtms.choose; }; ~rClass_40 = {var rtms; rtms = [0.25, 2.0, 8.0, 0.166, 1.333, 5.333, 0.2, 1.6, 6.4]; rtms.choose; }; ~rClass_46 = {var rtms; rtms = [0.1, 0.4, 1.6, 6.4, 0.071, 0.28, 1.143, 4.57]; rtms.choose; }; ~rClass_55 = {var rtms; rtms = [0.13, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0, 16.0, 0.08, 0.17, 0.33, 0.67, 1.33, 2.67, 5.33, 10.67, 0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4, 12.8, 0.07, 0.14, 0.29, 0.57, 1.14, 2.29, 4.57, 9.14]; rtms.choose; }; // Process-makers // Input is of the form (~pitch1_to_pitch2, "pitch1", "prob_state1", "prob_play", "pitch2", "prob_play") ~pitch1_to_pitch2 = "Prout({ var pitchType = %, pitch1, state = 'state1', probState1 = %, i = 0, probPlay = %, eventType, event; pitch1 = pitchType.value; loop { eventType = ['play', 'rest'].wchoose([probPlay, 1 - probPlay]); if ( eventType == 'rest', {event = Rest()}, {event = pitch1[i]} ); event.yield; state = ['state1', 'state2'].wchoose([probState1, 1 - probState1]); if ( eventType != 'rest', { if ( i == (pitch1.size - 1), {i = 0}, {i = i + 1} ) }, {i = i} ); if ( eventType != 'rest', { if ( i == 0, {pitch1 = pitchType.value}, {pitch1 = pitch1} ) }, {i = i} ); if (state != 'state2', {event}, { var pitchType = %, pitch2, i = 0, probPlay = %, eventType, event; 'Pitch: State 2'.postln; pitch2 = pitchType.value; loop { eventType = ['play', 'rest'].wchoose([probPlay, 1 - probPlay]); if ( eventType == 'rest', {event = Rest()}, {event = pitch2[i]} ); event.yield; if ( eventType != 'rest', { if ( i == (pitch2.size - 1), {i = 0}, {i = i + 1} ) }, {i = i} ); if ( eventType != 'rest', { if ( i == 0, {pitch2 = pitchType.value}, {pitch2 = pitch2} ) }, {i = i} ); } } ); }; });"; // Input is of the form (~~pitch1_to_fsmC, "pitch1", "prob_state1", "prob_play", "prob_play") ~pitch1_to_fsmC = "Prout({var pitchType = %, pitch1, state = 'state1', probState1 = %, i = 0, probPlay = %, eventType, event; pitch1 = pitchType.value; loop { eventType = ['play', 'rest'].wchoose([probPlay, 1-probPlay]); if ( eventType == 'rest', {event = Rest()}, {event = pitch1[i]} ); event.yield; state = ['state1', 'state2'].wchoose([probState1, 1-probState1]); if ( eventType != 'rest', { if ( i == (pitch1.size - 1), {i = 0}, {i = i + 1} ) }, {i = i} ); if ( eventType != 'rest', { if ( i == 0, {pitch1 = pitchType.value}, {pitch1 = pitch1} ) }, {i = i} ); if (state != 'state2', {event}, { var pitch2, input = 0, probPlay = %, eventType, event; 'Pitch: State 2'.postln; pitch2 = ~fsm_C.value(input); loop { eventType = ['play', 'rest'].wchoose([probPlay, 1 - probPlay]); if ( eventType == 'rest', {event = Rest()}, {event = ~graph_C_convert.value(pitch2); pitch2 = ~fsm_C.value(pitch2)} ); event.yield; } } ); }; });"; // Input is of the form (~~pitch1_to_fsmC, "prob_state1", "prob_play", "pitch2", "prob_play") ~fsmC_to_pitch2 = "Prout({ var pitch1, input = 0, state = 'state1', probState1 = %, probPlay = %, eventType, event; pitch1 = ~fsm_C.value(input); loop { eventType = ['play', 'rest'].wchoose([probPlay, 1 - probPlay]); if ( eventType == 'rest', {event = Rest()}, {event = ~graph_C_convert.value(pitch1); pitch1 = ~fsm_C.value(pitch1)} ); event.yield; state = ['state1', 'state2'].wchoose([probState1, 1-probState1]); if (state != 'state2', {event}, { var pitchType = %, pitch2, i = 0, probPlay = %, eventType, event; 'Pitch: State 2'.postln; pitch2 = pitchType.value; loop { eventType = ['play', 'rest'].wchoose([probPlay, 1 - probPlay]); if ( eventType == 'rest', {event = Rest()}, {event = pitch2[i]} ); event.yield; if ( eventType != 'rest', { if ( i == (pitch2.size - 1), {i = 0}, {i = i + 1} ) }, {i = i} ); if ( eventType != 'rest', { if ( i == 0, {pitch2 = pitchType.value}, {pitch2 = pitch2} ) }, {i = i} ); } } ); }; });"; // Input is of the form (~rtm1_to_rtm2, "rtm1", "prob_state1", "rtm2") ~rtm1_to_rtm2 = "Prout({ var rtmSel = %, rtm, state = 'state1', probState1 = %; rtm = rtmSel.value; loop { rtm.yield; state = ['state1', 'state2'].wchoose([probState1, 1 - probState1]); rtm = rtmSel.value; if (state != 'state2', {rtm}, { var rtmSel = %, rtm; 'Rhythm: State 2'.postln; rtm = rtmSel.value; loop { rtm.yield; rtm = rtmSel.value; }}); }; });"; // Input is of the form (~rtm1_to_rtm2, "rtm1", "prob_state1", "rtm2", "minValue") ~rtm1_to_rtm2_setStart = "Prout({ var rtmSel = %, rtm, state = 'state1', probState1 = %, running_sum = 0; rtm = rtmSel.value; loop { rtm.yield; running_sum = running_sum + rtm; state = ['state1', 'state2'].wchoose([probState1, 1 - probState1]); rtm = rtmSel.value; if (state != 'state2', {rtm}, { var division, wait_time, rtmSel = %, rtm, min = %; 'Rhythm: State 2'.postln; division = running_sum / min; division = division - division.floor; wait_time = division * min; Rest(wait_time); rtm = rtmSel.value; loop { rtm.yield; rtm = rtmSel.value; }}); }; });"; // INSTRUMENT SPATIAL POSITIONS // section 1 ~s1_Infra10spat = [0]; // section 2 ~s2_Audio2spat = [0]; // section 3 ~s3_Infra7spat = [90, 270]; // section 4 ~s4_Audio4spat = [200.0, 320.0, 80.0]; // 3 // section 5 ~s5_Infra9spat = [45.0, 135.0, 225.0, 315.0]; // 4 // section 6 ~s6_Infra6spat = [45, 315]; // 2 ~s6_Infra7spat = [135, 225]; // 2 ~s6_Infra9spat = [0]; // 1 // section 7 ~s7_Audio3spat = [45.0, 165.0, 285.0]; // 3 ~s7_Audio4spat = [105.0, 225.0, 345.0]; // 2 ~s7_Audio5spat = [0]; // 1 // section 8 ~s8_Audio1spat = [45.0, 135.0, 225.0, 315.0]; // 4 ~s8_Infra6spat = [90.0, 270.0]; // 2 ~s8_Audio2spat = [0]; // 1 // section 9 ~s9_Infra8spat = [290, 337, 23, 70]; // 4 ~s9_Infra10spat = [150, 195, 240]; // 3 ~s9_Audio5spat = [0]; // 1 // section 10 ~s10_Audio1spat = [315.0, 27.0, 99.0, 171.0, 243.0]; // 5 ~s10_Audio2spat = [45.0, 165.0, 285.0]; // 3 ~s10_Infra9spat = [20.0, 200.0]; // 2 ~s10_Infra8spat = [0]; // 1 // section 11 ~s11_Audio2spat = [45.0, 165.0, 285.0]; // 3 ~s11_Audio4spat = [345.0, 105.0, 225.0]; // 3 ~s11_Audio3spat = [90, 270]; // 2 ~s11_Infra6spat = [45];// 1 ~s11_Infra7spat = [225]; // 1 ~s11_Infra8spat = [315]; // 1 ~s11_Infra9spat = [0]; // 1 ~s11_Infra10spat = [135]; // 1 // section 12 ~s12_Infra7spat = [315.0, 6.43, 57.86, 109.29, 160.71, 212.14, 263.57]; // 7 ~s12_Audio4spat = [30.0, 150.0, 270.0]; // 3 ~s12_Infra10spat = [90.0, 210.0, 330.0]; // 3 ~s12_Audio2spat = [90]; // 1 ~s12_Infra9spat = [270]; // 1 // section 13 ~s13_Audio1spat = [110.0, 230.0, 350.0]; // 3 ~s13_Audio3spat = [150.0, 270.0, 30.0]; // 3 ~s13_Infra8spat = [190.0, 310.0, 70.0]; // 3 ~s13_Infra6spat = [295.0, 115.0]; // 2 ~s13_Audio2spat = [340.0, 160.0]; // 2 ~s13_Infra9spat = [25.0, 205.0]; // 2 ~s13_Audio4spat = [70.0, 250.0]; // 2 ~s13_Infra7spat = [30]; // 1 ~s13_Infra10spat = [0]; // 1 ~s13_Audio5spat = [0]; // 1 // Event making ~makeEvents = { e = Dictionary.new; e.add(\event1 -> { ~s1_Infra10 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 30), // CAN ALSO BE WRITTIN AS ~rtm1_to_rtm2_setStart.format("~rClass_6", "0.85", "~rClass_42", "9.14").interpret \dur, format(~rtm1_to_rtm2_setStart, "~rClass_6", "0.8", "~rClass_42", "9.14").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 4, \dut_varRate, Pwhite(0.5, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_2B3", "0.85", "1", "~cycles_B", "1").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(4, 8), \bpf_varRate, Pwhite(1, 8), \atk, Pwhite(0.005, 0.01), \dec, Pwhite(0.1, 0.5), \amp_low, -28.6, \amp_high, -11.4, \amp_scalar, 1 * 20.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s1_Infra10spat[i], \azimBnd, 360, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event1Rest -> { ~s1_Infra10[0].stop; }); e.add(\event2 -> { ~s2_Audio2 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~cycles_D", "0.9", "0.2", "~pseq_32B", "0.69").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_18", "0.92", "~rClass_55", "0.28").interpret, \dur_scalar, 0.2, \pulse_varBand, 6/5, \pulse_varRate, 20, \dut_mid, 0.1, \dut_varBand, 2, \dut_varRate, Pwhite(0.125, 0.25), \rq, 0.2, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(2, 2+9/8), \bpf_varRate, Pwhite(0.5, 4), \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -22.9, \amp_high, -17.1, \amp_scalar, 1 * 20.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s2_Audio2spat[i], \azimBnd, 360, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event2Rest -> { ~s2_Audio2[0].stop; }); e.add(\event3 -> { ~s3_Infra7 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(8, 12), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_34", "0.9", "~rClass_12", "0.143").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(2, 4), \pulse_varRate, Pwhite(0.25, 2), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_B23", "0.9", "1", "~cycles_A", "0.8").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1.02, 9/8), \bpf_varRate, Pwhite(0.25, 1), \atk, Pwhite(0.1, 0.5), \dec, Pwhite(0.1, 0.5), \amp_low, -40, \amp_high, -22.9, \amp_scalar, 1/2 * 30.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s3_Infra7spat[i], \azimBnd, 20, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event3Rest -> { ~s3_Infra7[0].stop; ~s3_Infra7[1].stop; }); e.add(\event4 -> { ~s4_Audio4 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(50, 2000), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_42", "0.9", "~rClass_6", "0.125").interpret, \dur_scalar, 0, \pulse_varBand, 2, \pulse_varRate, 160, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.1, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.85", "0.7", "~cycles_D", "0.85").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 9/8), \bpf_varRate, 0.25, \atk, Pswitch1([Pwhite(0.001, 0.003), Pkey(\dur) - Pwhite(0.2, 0.5)], Pfunc { 0.5.coin.binaryValue }), \dec, Pkey(\dur) - Pkey(\atk), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/9 * 23.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s4_Audio4spat[i], \azimBnd, 10, \azimRate, Pif(Pkey(\atk) < 0.0031, Pwhite(4, 8), Pwhite(0.125, 1)), \distRate, Pif(Pkey(\atk) < 0.0031, Pwhite(4, 8), Pwhite(0.125, 1)), \group, ~mainGrp, \out, ~bus[\reverb], ).play}) }); e.add(\event4Rest -> { ~s4_Audio4[0].stop; ~s4_Audio4[1].stop; ~s4_Audio4[2].stop; }); e.add(\event5 -> { ~s5_Infra9 = Array.fill(4, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(12, 50), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_55", "0.9", "~rClass_23", "0.07").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1, 4), \pulse_varRate, Pwhite(0.25, 4), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.2, \bpf_cf, ~convert.value(format(~fsmC_to_pitch2, "0.93", "0.5", "~pseq_23B", "0.05").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 4), \bpf_varRate, Pwhite(0.25, 4), \atk, Pwhite(0.001, 0.005), \dec, Pwhite(0.001, 0.005), \amp_low, -28.6, \amp_high, -5.7, \amp_scalar, 1/4 * 27.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s5_Infra9spat[i], \azimBnd, 10, \azimRate, Pwhite(1, 8), \distRate, Pwhite(1, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event5Rest -> { ~s5_Infra9[0].stop; ~s5_Infra9[1].stop; ~s5_Infra9[2].stop; ~s5_Infra9[3].stop; }); e.add(\event6 -> { ~s6_Infra6 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(4, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_29", "0.88", "~rClass_12", "0.166").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_A", "0.85", "1", "~pseq_B32", "0.2").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 1.02), \bpf_varRate, Pwhite(1, 4), \atk, Pwhite(0.01, 0.1), \dec, Pwhite(0.01, 0.1), \amp_low, -5.7, \amp_high, 0, \amp_scalar, 1/10 * 29.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s6_Infra6spat[i], \azimBnd, 10, \azimRate, Pwhite(0.25, 1), \distRate, Pwhite(0.25, 1), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s6_Infra7 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(8, 12), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_29", "0.88", "~rClass_12", "0.166").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(2, 4), \pulse_varRate, Pwhite(0.25, 2), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_A", "0.85", "1", "~pseq_B32", "0.2").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1.02, 9/8), \bpf_varRate, Pwhite(0.25, 1), \atk, Pwhite(0.01, 0.1), \dec, Pwhite(0.01, 0.1), \amp_low, -5.7, \amp_high, 0, \amp_scalar, 1/10 * 29.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s6_Infra7spat[i], \azimBnd, 10, \azimRate, Pwhite(0.25, 1), \distRate, Pwhite(0.25, 1), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s6_Infra9 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(12, 50), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_29", "0.88", "~rClass_12", "0.166").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1, 4), \pulse_varRate, Pwhite(0.25, 4), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.2, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_A", "0.85", "0.3", "~pseq_B32", "0.1").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 4), \bpf_varRate, Pwhite(0.25, 4), \atk, Pwhite(0.01, 0.1), \dec, Pwhite(0.01, 0.1), \amp_low, -5.7, \amp_high, 0, \amp_scalar, 1/10 * 29.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s6_Infra9spat[i], \azimBnd, 360, \azimRate, Pwhite(0.25, 1), \distRate, Pwhite(0.25, 1), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event6Rest -> { ~s6_Infra6[0].stop; ~s6_Infra6[1].stop; ~s6_Infra7[0].stop; ~s6_Infra7[1].stop; ~s6_Infra9[0].stop; }); e.add(\event7 -> { ~s7_Audio3 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.93", "0.9", "~cycles_B", "0.2").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_38", "0.91", "~rClass_23", "0.143").interpret, \dur_scalar, 0, \pulse_varBand, 5/3, \pulse_varRate, 4, \dut_mid, 0.5, \dut_varBand, 2, \dut_varRate, 0.5, \rq, 0.1, \bpf_cf, Pexprand(200, 4000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, 4, \bpf_varRate, 0.25, \atk, Pif((Pkey(\dur) > 0.5), Pkey(\dur) / Pwhite(2.01, 4), Pwhite(0.003, 0.008)), \dec, Pif((Pkey(\dur) > 0.5), Pkey(\dur) / Pwhite(2.01, 4), Pwhite(0.01, 0.05)), \amp_low, -17.1, \amp_high, 0, \amp_scalar, 1/12 * 27.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s7_Audio3spat[i], \azimBnd, 15, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s7_Audio4 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(50, 2000), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_38", "0.91", "~rClass_23", "0.143").interpret, \dur_scalar, 0, \pulse_varBand, 2, \pulse_varRate, 160, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.1, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.93", "0.9", "~cycles_B", "0.2").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 9/8), \bpf_varRate, 0.25, \atk, Pif((Pkey(\dur) > 0.5), Pkey(\dur) / Pwhite(2.01, 4), Pwhite(0.003, 0.008)), \dec, Pif((Pkey(\dur) > 0.5), Pkey(\dur) / Pwhite(2.01, 4), Pwhite(0.01, 0.05)), \amp_low, -17.1, \amp_high, 0, \amp_scalar, 1/12 * 27.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s7_Audio4spat[i], \azimBnd, 15, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s7_Audio5 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.93", "0.9", "~cycles_B", "0.2").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_38", "0.91", "~rClass_23", "0.143").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(4, 6), \pulse_varRate, Pwhite(8, 16), \dut_mid, 0.1, \dut_varBand, 1, \dut_varRate, 1, \rq, 1.6, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pwhite(1, 2), \bpf_varRate, Pwhite(0.25, 4), \atk, Pif((Pkey(\dur) > 0.5), Pkey(\dur) / Pwhite(2.01, 4), Pwhite(0.003, 0.008)), \dec, Pif((Pkey(\dur) > 0.5), Pkey(\dur) / Pwhite(2.01, 4), Pwhite(0.01, 0.05)), \amp_low, -17.1, \amp_high, 0, \amp_scalar, 1/12 * 27.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s7_Audio5spat[i], \azimBnd, 360, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event7Rest -> { ~s7_Audio3[0].stop; ~s7_Audio3[1].stop; ~s7_Audio3[2].stop; ~s7_Audio4[0].stop; ~s7_Audio4[1].stop; ~s7_Audio5[0].stop; }); e.add(\event8 -> { ~s8_Audio1 = Array.fill(4, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~pseq_B32", "0.92", "1", "~cycles_A", "0.8").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_23", "0.94", "~rClass_42", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1.02, 1.05), \pulse_varRate, 2, \dut_mid, 0.5, \dut_varBand, 2, \dut_varRate, Pwhite(0.25, 4), \rq, Pwhite(0.2, 0.2), \bpf_cf, Pexprand(200, 3000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, 1, \bpf_varRate, 1, \atk, Pwhite(0.01, 0.05), \dec, Pwhite(0.01, 0.05), \amp_low, -17.1, \amp_high, -17.1, \amp_scalar, 1/7 * 35.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s8_Audio1spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s8_Infra6 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(4, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_23", "0.94", "~rClass_42", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_B32", "0.92", "1", "~cycles_A", "0.8").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 1.02), \bpf_varRate, Pwhite(1, 4), \atk, Pwhite(0.01, 0.05), \dec, Pwhite(0.01, 0.05), \amp_low, -17.1, \amp_high, -17.1, \amp_scalar, 1/7 * 35.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s8_Infra6spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s8_Audio2 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~pseq_B32", "0.92", "1", "~cycles_A", "0.8").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_23", "0.94", "~rClass_42", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 6/5, \pulse_varRate, 20, \dut_mid, 0.1, \dut_varBand, 2, \dut_varRate, Pwhite(0.125, 0.25), \rq, 0.2, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(2, 2+9/8), \bpf_varRate, Pwhite(0.5, 4), \atk, Pwhite(0.01, 0.05), \dec, Pwhite(0.01, 0.05), \amp_low, -17.1, \amp_high, -17.1, \amp_scalar, 1/7 * 35.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s8_Audio2spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event8Rest -> { ~s8_Audio1[0].stop; ~s8_Audio1[1].stop; ~s8_Audio1[2].stop; ~s8_Audio1[3].stop; ~s8_Infra6[0].stop; ~s8_Infra6[1].stop; ~s8_Audio2[0].stop; }); e.add(\event9 -> { ~s9_Infra8 = Array.fill(4, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_12", "0.9", "~rClass_0", "1.33").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 3, \dut_varRate, Pwhite(0.25, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.88", "0.2", "~pseq_3B2", "0.4").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 2), \bpf_varRate, Pwhite(20, 40), \atk, Pkey(\dur) - Pwhite(0.003, 0.008), \dec, Pkey(\dur) - Pkey(\atk) - 0.001, \amp_low, -40, \amp_high, -22, \amp_scalar, 1/8 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s9_Infra8spat[i], \azimBnd, 10, \azimRate, Pwhite(2, 6), \distRate, Pwhite(2, 6), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s9_Infra10 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 30), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_12", "0.9", "~rClass_0", "1.33").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 4, \dut_varRate, Pwhite(0.5, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.88", "0.2", "~pseq_3B2", "0.4").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(4, 8), \bpf_varRate, Pwhite(1, 8), \atk, Pkey(\dur) - Pwhite(0.003, 0.008), \dec, Pkey(\dur) - Pkey(\atk) - 0.001, \amp_low, -40, \amp_high, -22, \amp_scalar, 1/8 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s9_Infra10spat[i], \azimBnd, 10, \azimRate, Pwhite(2, 6), \distRate, Pwhite(2, 6), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s9_Audio5 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.88", "0.1", "~pseq_3B2", "0.2").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_12", "0.9", "~rClass_0", "1.33").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(4, 6), \pulse_varRate, Pwhite(8, 16), \dut_mid, 0.1, \dut_varBand, 1, \dut_varRate, 1, \rq, 1.6, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pwhite(1, 2), \bpf_varRate, Pwhite(0.25, 4), \atk, Pkey(\dur) - Pwhite(0.003, 0.008), \dec, Pkey(\dur) - Pkey(\atk) - 0.001, \amp_low, -40, \amp_high, -34.3, \amp_scalar, 1/8 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s9_Audio5spat[i], \azimBnd, 360, \azimRate, Pwhite(2, 6), \distRate, Pwhite(2, 6), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event9Rest -> { ~s9_Infra8[0].stop; ~s9_Infra8[1].stop; ~s9_Infra8[2].stop; ~s9_Infra8[3].stop; ~s9_Infra10[0].stop; ~s9_Infra10[1].stop; ~s9_Infra10[2].stop; ~s9_Audio5[0].stop; }); e.add(\event10 -> { ~s10_Audio1 = Array.fill(5, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_fsmC, "~pseq_23B", "0.88", "0.2", "0.8").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_0", "0.85", "~rClass_46", "8").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1.02, 1.05), \pulse_varRate, 2, \dut_mid, 0.5, \dut_varBand, 2, \dut_varRate, Pwhite(0.25, 4), \rq, Pwhite(0.2, 0.2), \bpf_cf, Pexprand(200, 3000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, 1, \bpf_varRate, 1, \atk, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pswitch1([Pwhite(0.001, 0.005), Pkey(\dur) - Pwhite(0.01, 0.05)], Pfunc { 0.5.coin.binaryValue })), \dec, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pkey(\dur) - Pkey(\atk)), \amp_low, -34, \amp_high, -17, \amp_scalar, 1/11 * 35.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s10_Audio1spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s10_Audio2 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_fsmC, "~pseq_23B", "0.88", "0.2", "0.8").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_0", "0.85", "~rClass_46", "8").interpret, \dur_scalar, 0, \pulse_varBand, 6/5, \pulse_varRate, 20, \dut_mid, 0.1, \dut_varBand, 2, \dut_varRate, Pwhite(0.125, 0.25), \rq, 0.2, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(2, 2+9/8), \bpf_varRate, Pwhite(0.5, 4), \atk, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pswitch1([Pwhite(0.001, 0.005), Pkey(\dur) - Pwhite(0.01, 0.05)], Pfunc { 0.5.coin.binaryValue })), \dec, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pkey(\dur) - Pkey(\atk)), \amp_low, -34, \amp_high, -17, \amp_scalar, 1/11 * 35.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s10_Audio2spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s10_Infra9 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(12, 50), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_0", "0.85", "~rClass_46", "8").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1, 4), \pulse_varRate, Pwhite(0.25, 4), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.2, \bpf_cf, ~convert.value(format(~pitch1_to_fsmC, "~pseq_23B", "0.88", "0.8", "0.2").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 4), \bpf_varRate, Pwhite(0.25, 4), \atk, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pswitch1([Pwhite(0.001, 0.005), Pkey(\dur) - Pwhite(0.01, 0.05)], Pfunc { 0.5.coin.binaryValue })), \dec, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pkey(\dur) - Pkey(\atk)), \amp_low, -34, \amp_high, 0, \amp_scalar, 1/11 * 35.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s10_Infra9spat[i], \azimBnd, 30, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s10_Infra8 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_0", "0.85", "~rClass_46", "8").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 3, \dut_varRate, Pwhite(0.25, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_fsmC, "~pseq_23B", "0.88", "0.8", "0.2").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 2), \bpf_varRate, Pwhite(20, 40), \atk, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pswitch1([Pwhite(0.001, 0.005), Pkey(\dur) - Pwhite(0.01, 0.05)], Pfunc { 0.5.coin.binaryValue })), \dec, Pif(((Pkey(\dur) > 7.99) && (Pkey(\dur) < 8.01)), Pwhite(0.1, 1), Pkey(\dur) - Pkey(\atk)), \amp_low, -34, \amp_high, 0, \amp_scalar, 1/11 * 35.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s10_Infra8spat[i], \azimBnd, 360, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event10Rest -> { ~s10_Audio1[0].stop; ~s10_Audio1[1].stop; ~s10_Audio1[2].stop; ~s10_Audio1[3].stop; ~s10_Audio1[4].stop; ~s10_Audio2[0].stop; ~s10_Audio2[1].stop; ~s10_Audio2[2].stop; ~s10_Infra9[0].stop; ~s10_Infra9[1].stop; ~s10_Infra8[0].stop; }); e.add(\event11 -> { ~s11_Audio2 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "0.05", "~cycles_D", "0.1").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, 6/5, \pulse_varRate, 20, \dut_mid, 0.1, \dut_varBand, 2, \dut_varRate, Pwhite(0.125, 0.25), \rq, 0.2, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(2, 2+9/8), \bpf_varRate, Pwhite(0.5, 4), \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -17, \amp_high, -5.7, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Audio2spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s11_Audio4 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(50, 2000), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, 2, \pulse_varRate, 160, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.1, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "0.1", "~cycles_D", "1").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 9/8), \bpf_varRate, 0.25, \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -34.3-12, \amp_high, -21-12, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Audio4spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s11_Audio3 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "0.1", "~cycles_D", "0.15").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, 5/3, \pulse_varRate, 4, \dut_mid, 0.5, \dut_varBand, 2, \dut_varRate, 0.5, \rq, 0.1, \bpf_cf, Pexprand(200, 4000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, 4, \bpf_varRate, 0.25, \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -34.3, \amp_high, -24, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Audio3spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s11_Infra6 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(4, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "0.15", "~cycles_D", "1").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 1.02), \bpf_varRate, Pwhite(1, 4), \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -34.3, \amp_high, -5.7, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Infra6spat[i], \azimBnd, 20, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s11_Infra7 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(8, 12), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(2, 4), \pulse_varRate, Pwhite(0.25, 2), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "0.15", "~cycles_D", "1").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1.02, 9/8), \bpf_varRate, Pwhite(0.25, 1), \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -34.3, \amp_high, -5.7, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Infra7spat[i], \azimBnd, 20, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s11_Infra8 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 3, \dut_varRate, Pwhite(0.25, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "1", "~cycles_D", "0.15").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 2), \bpf_varRate, Pwhite(20, 40), \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -34.3, \amp_high, -5.7, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Infra8spat[i], \azimBnd, 20, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s11_Infra9 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(12, 50), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1, 4), \pulse_varRate, Pwhite(0.25, 4), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.2, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "0.1", "~cycles_D", "0.1").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 4), \bpf_varRate, Pwhite(0.25, 4), \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -17, \amp_high, -5.7, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Infra9spat[i], \azimBnd, 360, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s11_Infra10 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 30), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_51", "0.91", "~rClass_34", "0.1").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 4, \dut_varRate, Pwhite(0.5, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_32B", "0.91", "1", "~cycles_D", "0.15").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(4, 8), \bpf_varRate, Pwhite(1, 8), \atk, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \dec, Pif(Pkey(\dur) < 2, Pwhite(0.01, 0.05), Pkey(\dur) / Pwhite(2.01, 4)), \amp_low, -34.3, \amp_high, -5.7, \amp_scalar, 1/13 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s11_Infra10spat[i], \azimBnd, 20, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event11Rest -> { ~s11_Audio2[0].stop; ~s11_Audio2[1].stop; ~s11_Audio2[2].stop; ~s11_Audio4[0].stop; ~s11_Audio4[1].stop; ~s11_Audio4[2].stop; ~s11_Audio3[0].stop; ~s11_Audio3[1].stop; ~s11_Infra6[0].stop; ~s11_Infra7[0].stop; ~s11_Infra8[0].stop; ~s11_Infra9[0].stop; ~s11_Infra10[0].stop; }); e.add(\event12 -> { ~s12_Infra7 = Array.fill(7, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(8, 12), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_46", "0.91", "~rClass_0", "0.071").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(2, 4), \pulse_varRate, Pwhite(0.25, 2), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.9", "0.25", "~cycles_B", "1").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1.02, 9/8), \bpf_varRate, Pwhite(0.25, 1), \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -22.9, \amp_high, -11.4, \amp_scalar, 1/15 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s12_Infra7spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s12_Audio4 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(50, 2000), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_46", "0.91", "~rClass_0", "0.071").interpret, \dur_scalar, 0, \pulse_varBand, 2, \pulse_varRate, 160, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.1, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.9", "0.01", "~cycles_B", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 9/8), \bpf_varRate, 0.25, \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -22.9, \amp_high, -22.9, \amp_scalar, 1/30 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s12_Audio4spat[i], \azimBnd, 10, \azimRate, Pwhite(1, 4), \distRate, Pwhite(1, 4), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s12_Infra10 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 30), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_46", "0.91", "~rClass_0", "0.071").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 4, \dut_varRate, Pwhite(0.5, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.9", "0.01", "~cycles_B", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(4, 8), \bpf_varRate, Pwhite(1, 8), \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -22.9, \amp_high, -22.9, \amp_scalar, 1/15 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s12_Infra10spat[i], \azimBnd, 10, \azimRate, Pwhite(1, 4), \distRate, Pwhite(1, 4), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s12_Audio2 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.9", "0.01", "~cycles_B", "0.5").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_46", "0.91", "~rClass_0", "0.071").interpret, \dur_scalar, 0, \pulse_varBand, 6/5, \pulse_varRate, 20, \dut_mid, 0.1, \dut_varBand, 2, \dut_varRate, Pwhite(0.125, 0.25), \rq, 0.2, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(2, 2+9/8), \bpf_varRate, Pwhite(0.5, 4), \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -22.9, \amp_high, -22.9, \amp_scalar, 1/15 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s12_Audio2spat[i], \azimBnd, 30, \azimRate, Pwhite(4, 8), \distRate, Pwhite(4, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s12_Infra9 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(12, 50), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_46", "0.91", "~rClass_0", "0.071").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1, 4), \pulse_varRate, Pwhite(0.25, 4), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.2, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~pseq_3B2", "0.9", "0.01", "~cycles_B", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 4), \bpf_varRate, Pwhite(0.25, 4), \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -22.9, \amp_high, -22.9, \amp_scalar, 1/15 * 40.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s12_Infra9spat[i], \azimBnd, 30, \azimRate, Pwhite(1, 4), \distRate, Pwhite(1, 4), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event12Rest -> { ~s12_Infra7[0].stop; ~s12_Infra7[1].stop; ~s12_Infra7[2].stop; ~s12_Infra7[3].stop; ~s12_Infra7[4].stop; ~s12_Infra7[5].stop; ~s12_Infra7[6].stop; ~s12_Audio4[0].stop; ~s12_Audio4[1].stop; ~s12_Audio4[2].stop; ~s12_Infra10[0].stop; ~s12_Infra10[1].stop; ~s12_Infra10[2].stop; ~s12_Audio2[0].stop; ~s12_Infra9[0].stop; }); e.add(\event13 -> { ~s13_Audio1 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1.02, 1.05), \pulse_varRate, 2, \dut_mid, 0.5, \dut_varBand, 2, \dut_varRate, Pwhite(0.25, 4), \rq, Pwhite(0.2, 0.2), \bpf_cf, Pexprand(200, 3000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, 1, \bpf_varRate, 1, \atk, Pkey(\dur) - Pwhite(0.2, 0.5), \dec, Pkey(\dur) - Pkey(\atk), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Audio1spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Audio3 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 5/3, \pulse_varRate, 4, \dut_mid, 0.5, \dut_varBand, 2, \dut_varRate, 0.5, \rq, 0.1, \bpf_cf, Pexprand(200, 4000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, 4, \bpf_varRate, 0.25, \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Audio3spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Infra8 = Array.fill(3, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 3, \dut_varRate, Pwhite(0.25, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 2), \bpf_varRate, Pwhite(20, 40), \atk, Pwhite(0.001, 0.005), \dec, Pkey(\dur) - Pkey(\atk), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Infra8spat[i], \azimBnd, 10, \azimRate, Pwhite(4, 8), \distRate, Pwhite(4, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Infra6 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(4, 20), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 1.02), \bpf_varRate, Pwhite(1, 4), \atk, Pkey(\dur) / Pwhite(2.01, 4), \dec, Pkey(\dur) / Pwhite(2.01, 4), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Infra6spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 8), \distRate, Pwhite(0.125, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Audio2 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.95", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 6/5, \pulse_varRate, 20, \dut_mid, 0.1, \dut_varBand, 2, \dut_varRate, Pwhite(0.125, 0.25), \rq, 0.2, \bpf_cf, Pexprand(200, 2000), \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(2, 2+9/8), \bpf_varRate, Pwhite(0.5, 4), \atk, Pkey(\dur) - Pwhite(0.2, 0.5), \dec, Pkey(\dur) - Pkey(\atk), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Audio2spat[i], \azimBnd, 10, \azimRate, Pwhite(0.125, 0.5), \distRate, Pwhite(0.125, 0.5), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Infra9 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(12, 50), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(1, 4), \pulse_varRate, Pwhite(0.25, 4), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.2, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(6/5, 4), \bpf_varRate, Pwhite(0.25, 4), \atk, Pwhite(0.001, 0.005), \dec, Pkey(\dur) - Pkey(\atk), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Infra9spat[i], \azimBnd, 10, \azimRate, Pwhite(4, 8), \distRate, Pwhite(4, 8), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Audio4 = Array.fill(2, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pexprand(50, 2000), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 2, \pulse_varRate, 160, \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, 0.1, \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1, 9/8), \bpf_varRate, 0.25, \atk, Pwhite(0.001, 0.005), \dec, Pkey(\dur) - Pkey(\atk), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Audio4spat[i], \azimBnd, 10, \azimRate, Pwhite(4, 8), \distRate, Pwhite(4, 8), \group, ~mainGrp, ).play}); ~s13_Infra7 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(8, 12), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(2, 4), \pulse_varRate, Pwhite(0.25, 2), \dut_mid, 0.5, \dut_varBand, 1, \dut_varRate, 1, \rq, Pwhite(0.005, 0.008), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(1.02, 9/8), \bpf_varRate, Pwhite(0.25, 1), \atk, Pwhite(0.01, 0.1), \dec, Pwhite(0.01, 0.1), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Infra7spat[i], \azimBnd, 10, \azimRate, Pwhite(1, 4), \distRate, Pwhite(1, 4), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Infra10 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, Pwhite(10, 30), \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, 1, \pulse_varRate, 1, \dut_mid, 0.5, \dut_varBand, 4, \dut_varRate, Pwhite(0.5, 2), \rq, Pwhite(0.2, 0.5), \bpf_cf, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \bpf_scalar, Pif(Pkey(\bpf_cf) < 60, 4, (Pif(Pkey(\bpf_cf) < 120, 2, 1))), \bpf_varBand, Pexprand(4, 8), \bpf_varRate, Pwhite(1, 8), \atk, Pwhite(0.01, 0.1), \dec, Pwhite(0.01, 0.1), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Infra10spat[i], \azimBnd, 360, \azimRate, Pwhite(1, 4), \distRate, Pwhite(1, 4), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); ~s13_Audio5 = Array.fill(1, {arg i; Pbind( \instrument, \bpf_pulse, \freq, ~convert.value(format(~pitch1_to_pitch2, "~cycles_B", "0.9", "0.5", "~pseq_3B2", "0.5").interpret).midicps, \dur, format(~rtm1_to_rtm2_setStart, "~rClass_40", "0.9", "~rClass_38", "0.2").interpret, \dur_scalar, 0, \pulse_varBand, Pwhite(4, 6), \pulse_varRate, Pwhite(8, 16), \dut_mid, 0.1, \dut_varBand, 1, \dut_varRate, 1, \rq, 1.6, \bpf_cf, Pexprand(200, 2000), \bpf_varBand, Pwhite(1, 2), \bpf_varRate, Pwhite(0.25, 4), \atk, Pwhite(0.01, 0.1), \dec, Pwhite(0.01, 0.1), \amp_low, -40, \amp_high, 0, \amp_scalar, 1/20 * 32.5.dbamp, \amp_varRate, Pwhite(0.25, 1), \azimPos, ~s13_Audio5spat[i], \azimBnd, 360, \azimRate, Pwhite(1, 4), \distRate, Pwhite(1, 4), \group, ~mainGrp, \out, ~bus[\reverb], ).play}); }); e.add(\event13Rest -> { ~s13_Audio1[0].stop; ~s13_Audio1[1].stop; ~s13_Audio1[2].stop; ~s13_Audio3[0].stop; ~s13_Audio3[1].stop; ~s13_Audio3[2].stop; ~s13_Infra8[0].stop; ~s13_Infra8[1].stop; ~s13_Infra8[2].stop; ~s13_Infra6[0].stop; ~s13_Infra6[1].stop; ~s13_Audio2[0].stop; ~s13_Audio2[1].stop; ~s13_Infra9[0].stop; ~s13_Infra9[1].stop; ~s13_Audio4[0].stop; ~s13_Audio4[1].stop; ~s13_Infra7[0].stop; ~s13_Infra10[0].stop; ~s13_Audio5[0].stop; }); }; // Randomly order events ~randPerm = Array.fill(13, { arg i; i+1 }).scramble; ~eventOrder = [Array.fill(13, { arg i; "'event" ++ (~randPerm[i]).asString ++ "'"}), Array.fill(13, { arg i; "'event" ++ (~randPerm[i]).asString ++ "Rest'"})].lace(13 * 2); //~eventOrderPlay = Array.fill(13.asInt, { arg i; "'event" ++ (~randPerm[i]).asString ++ "'"}); //~eventOrderRest = Array.fill(13.asInt, { arg i; "'event" ++ (~randPerm[i]).asString ++ "Rest'"}); //~eventOrder = Array.with(~eventOrderPlay, ~eventOrderRest); //~eventOrder.lace(13.asInt * 2); ~eventOrder.value; // GUI ~font = "Helvetica"; r = Routine { var index = 0, status; loop { if (index == ~eventOrder.size, {~all_stop.value; "Piece Finished".yield}, {("Event Name: " ++ ~eventOrder[index]).postln} ); e.at(~eventOrder[index].interpret).value.yield; index = index + 1; } }; Window.closeAll; w = Window("Attractors – Version B", Rect(600, 40, 470, 550)) .front .alwaysOnTop_(true); a = Array.fill(~eventOrder.size, { arg i; if ( i.even, ["Section " ++ ((i / 2) + 1).asInt.asString], ["Section " ++ ((i + 1) / 2).asInt.asString ++ " Rest"] ) } ); a = a.add(["Piece Finished"]); a = a.insert(0, ["Click to Start"]); b = Button(w, Rect(20, 20, 170, 130)) .font_(Font.new(~font, 18)) .states_(a) .action_({ |index| if (index.value > 0) { r.next } { r.reset; } }); ~events = Button(w, Rect(220, 40, 75, 35)) .font_(Font.new(~font, 12)) .states_([["Event order"]]) .action_({ Array.fill(13, {arg i; ~eventOrder[i*2]}).postln; } ); ~info = StaticText(w, Rect(300, 0, 100, 50)) .font_(Font.new(~font, 12)) .string_("Click to print section event type"); ~s1 = Button(w, Rect(300, 40, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S1"]]) .action_({ ~eventOrder[0].postln; } ); ~s2 = Button(w, Rect(340, 40, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S2"]]) .action_({ ~eventOrder[2].postln; } ); ~s3 = Button(w, Rect(380, 40, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S3"]]) .action_({ ~eventOrder[4].postln; } ); ~s4 = Button(w, Rect(420, 40, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S4"]]) .action_({ ~eventOrder[6].postln; } ); ~s5 = Button(w, Rect(300, 65, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S5"]]) .action_({ ~eventOrder[8].postln; } ); ~s6 = Button(w, Rect(340, 65, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S6"]]) .action_({ ~eventOrder[10].postln; } ); ~s7 = Button(w, Rect(380, 65, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S7"]]) .action_({ ~eventOrder[12].postln; } ); ~s8 = Button(w, Rect(420, 65, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S8"]]) .action_({ ~eventOrder[14].postln; } ); ~s9 = Button(w, Rect(300, 90, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S9"]]) .action_({ ~eventOrder[16].postln; } ); ~s10 = Button(w, Rect(340, 90, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S10"]]) .action_({ ~eventOrder[18].postln; } ); ~s11 = Button(w, Rect(380, 90, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S11"]]) .action_({ ~eventOrder[20].postln; } ); ~s12 = Button(w, Rect(420, 90, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S12"]]) .action_({ ~eventOrder[22].postln; } ); ~s13 = Button(w, Rect(300, 115, 35, 20)) .font_(Font.new(~font, 12)) .states_([["S13"]]) .action_({ ~eventOrder[24].postln; } ); ~lowshelf_cf = Slider(w, Rect(20, 190, 150, 20)) .font_(Font.new(~font, 12)) .value_(0.5) .action_({ arg obj; var cf; cf = obj.value.linlin(0, 1, 100, 300); ~eqSynth.set(\lowshelf_cf, cf); ~lowshelf_cfNum.value_(obj.value.linlin(0, 1, 100, 300)); }); ~lowshelf_cf = Slider(w, Rect(20, 190, 150, 20)) .font_(Font.new(~font, 12)) .value_(0.5) .action_({ arg obj; var cf; cf = obj.value.linlin(0, 1, 100, 300); ~eqSynth.set(\lowshelf_cf, cf); ~lowshelf_cfNum.value_(obj.value.linlin(0, 1, 100, 300)); }); ~lowshelf_cfNum = NumberBox(w, Rect(180, 190, 50, 15)) .font_(Font.new(~font, 12)) .value_(200) .clipLo_(100) .clipHi_(300) .decimals_(2) .action_({ arg obj; ~lowshelf_cf.valueAction_(obj.value.linlin(100, 300, 0, 1)) }); ~lowshelf_cfLabel = StaticText(w, Rect(20, 170, 80, 20)) .font_(Font.new(~font, 12)) .string_("Lowshelf freq"); ~lowshelf_db = Slider(w, Rect(20, 250, 150, 20)) .font_(Font.new(~font, 12)) .value_(0.625) .action_({ arg obj; var db; db = obj.value.linlin(0, 1, -12, 12); ~eqSynth.set(\lowshelf_db, db); ~lowshelf_dbNum.value_(obj.value.linlin(0, 1, -12, 12)) }); ~lowshelf_dbNum = NumberBox(w, Rect(180, 250, 40, 15)) .font_(Font.new(~font, 12)) .value_(3) .clipLo_(-12) .clipHi_(12) .decimals_(2) .action_({ arg obj; ~lowshelf_db.valueAction_(obj.value.linlin(-12, 12, 0, 1)) }); ~lowshelf_dbLabel = StaticText(w, Rect(20, 230, 80, 20)) .font_(Font.new(~font, 12)) .string_("Lowshelf dB"); ~lowpass = Slider(w, Rect(20, 370, 150, 20)) .font_(Font.new(~font, 12)) .value_(1) .action_({ arg obj; var freq; freq = obj.value.linlin(0, 1, 10000, 20000); ~eqSynth.set(\lowpass, freq); ~lowpassNum.value_(obj.value.linlin(0, 1, 10000, 20000)); }); ~lowpassNum = NumberBox(w, Rect(180, 370, 50, 15)) .font_(Font.new(~font, 12)) .value_(20000) .clipLo_(10000) .clipHi_(20000) .decimals_(0) .action_({ arg obj; ~lowshelf_cf.valueAction_(obj.value.linlin(10000, 20000, 0, 1)) }); ~lowpassLabel = StaticText(w, Rect(20, 350, 80, 20)) .font_(Font.new(~font, 12)) .string_("Lowpass freq"); ~db_scalar = Slider(w, Rect(20, 310, 150, 20)) .font_(Font.new(~font, 12)) .value_(0.5) .action_({ arg obj; var db; db = obj.value.linlin(0, 1, -40, 40); ~eqSynth.set(\db_scalar, db); ~db_scalarNum.value_(obj.value.linlin(0, 1, -40, 40)); }); ~db_scalarNum = NumberBox(w, Rect(180, 310, 40, 15)) .font_(Font.new(~font, 12)) .value_(0) .clipLo_(-40) .clipHi_(40) .decimals_(2) .action_({ arg obj; ~db_scalar.valueAction_(obj.value.linlin(0, 1, -40, 40)) }); ~db_scalarLabel = StaticText(w, Rect(20, 290, 80, 20)) .font_(Font.new(~font, 12)) .string_("dB scalar"); ~mix = Slider(w, Rect(250, 190, 150, 20)) .font_(Font.new(~font, 12)) .value_(0.0) .action_({ arg obj; var mx; mx = obj.value(0, 1); ~reverbSynth.set(\mix, mx); ~mixNum.value_(obj.value(0, 1)); }); ~mixNum = NumberBox(w, Rect(410, 190, 40, 15)) .font_(Font.new(~font, 12)) .value_(0) .clipLo_(0) .clipHi_(1) .decimals_(2) .action_({ arg obj; ~mix.valueAction_(obj.value(0, 1)) }); ~mixLabel = StaticText(w, Rect(250, 170, 80, 20)) .font_(Font.new(~font, 12)) .string_("Mix"); ~delaytime = Slider(w, Rect(250, 250, 150, 20)) .font_(Font.new(~font, 12)) .value_(0.4) .action_({ arg obj; var deltime; deltime = obj.value.linlin(0, 1, 0.001, 0.1); ~reverbSynth.set(\delaytime, deltime); ~delaytimeNum.value_(obj.value.linlin(0, 1, 0.001, 0.1)); }); ~delaytimeNum = NumberBox(w, Rect(410, 250, 50, 15)) .font_(Font.new(~font, 12)) .value_(0.04) .clipLo_(0.001) .clipHi_(0.1) .decimals_(3) .action_({ arg obj; ~delaytime.valueAction_(obj.value.linlin(0.001, 0.1, 0, 1)) }); ~delaytimeLabel = StaticText(w, Rect(250, 230, 80, 20)) .font_(Font.new(~font, 12)) .string_("Delay time"); ~delaytimeMod = Slider(w, Rect(250, 310, 150, 20)) .value_(0) .action_({ arg obj; var deltimeMod; deltimeMod = obj.value.linlin(0, 1, 1, 4); ~reverbSynth.set(\deltimeRatio, deltimeMod); ~delaytimeModNum.value_(obj.value.linlin(0, 1, 1, 4)); }); ~delaytimeModNum = NumberBox(w, Rect(410, 310, 50, 15)) .font_(Font.new(~font, 12)) .value_(1) .clipLo_(1) .clipHi_(4) .decimals_(3) .action_({ arg obj; ~delaytimeMod.valueAction_(obj.value.linlin(1, 4, 0, 1)) }); ~delaytimeModLabel = StaticText(w, Rect(250, 278, 120, 30)) .font_(Font.new(~font, 12)) .string_("Delay time modulation amount"); ~delaytimeModrate = Slider(w, Rect(250, 370, 150, 20)) .value_(0) .action_({ arg obj; var deltimeModrate; deltimeModrate = obj.value.linexp(0, 1, 0.1, 20); ~reverbSynth.set(\deltimeModrate, deltimeModrate); ~delaytimeModrateNum.value_(obj.value.linexp(0, 1, 0.1, 20)); }); ~delaytimeModrateNum = NumberBox(w, Rect(410, 370, 50, 15)) .font_(Font.new(~font, 12)) .value_(0.1) .clipLo_(0.1) .clipHi_(20) .decimals_(2) .action_({ arg obj; ~delaytimeModrate.valueAction_(obj.value.explin(0.1, 20, 0, 1)) }); ~delaytimeModrateLabel = StaticText(w, Rect(250, 338, 100, 30)) .font_(Font.new(~font, 12)) .string_("Delay time modulation freq"); ~decaytimecomb = Slider(w, Rect(250, 430, 150, 20)) .font_(Font.new(~font, 12)) .value_(0) .action_({ arg obj; var dectime; dectime = obj.value.linexp(0, 1, 0.1, 15); ~reverbSynth.set(\decaytime1, dectime); ~decaytimecombNum.value_(obj.value.linexp(0, 1, 0.1, 15)); }); ~decaytimecombNum = NumberBox(w, Rect(410, 430, 50, 15)) .font_(Font.new(~font, 12)) .value_(0.1) .clipLo_(0.1) .clipHi_(15) .decimals_(3) .action_({ arg obj; ~decaytime.valueAction_(obj.value.explin(0.1, 15, 0, 1)) }); ~decaytimecombLabel = StaticText(w, Rect(250, 398, 100, 30)) .font_(Font.new(~font, 12)) .string_("Comb filter decay time"); ~decaytimeallpass = Slider(w, Rect(250, 490, 150, 20)) .font_(Font.new(~font, 12)) .value_(0.45) .action_({ arg obj; var dectime; dectime = obj.value.linlin(0, 1, 0.1, 1); ~reverbSynth.set(\decaytime2, dectime); ~decaytimeallpassNum.value_(obj.value.linlin(0, 1, 0.1, 1)); }); ~decaytimeallpassNum = NumberBox(w, Rect(410, 490, 50, 15)) .font_(Font.new(~font, 12)) .value_(0.5) .clipLo_(0.1) .clipHi_(1) .decimals_(3) .action_({ arg obj; ~decaytime.valueAction_(obj.value.linlin(0.1, 1, 0, 1)) }); ~decaytimeallpassLabel = StaticText(w, Rect(250, 458, 100, 30)) .font_(Font.new(~font, 12)) .string_("All-pass filter decay time"); w.front; // 4. Register functions with ServerBoot/Quit/Tree ServerBoot.add(~makeBusses); ServerQuit.add(~cleanup); // 5. Boot server s.waitForBoot({ s.sync; // 6a. Synths SynthDef(\bpf_pulse, { arg dur = 5, dur_scalar = 1.0, amp_varRate = 1, amp_low = -40, amp_high = 0, atk = 0.1, dec = 0.1, freq = 440, pulse_varBand = 1.0, pulse_varRate = 4, bpf_cf = 440, bpf_varBand = 1.0, bpf_varRate = 4, bpf_scalar = 1, dut_mid = 0.5, dut_varBand = 1.0, dut_varRate = 4, rq = 1, out = 0, amp_scalar = 1.0, azimPos = 0, azimBnd = 0, azimRate, distRate; var dur_new, sig, env, pulse_mod, bpf_mod, bpf_cfNew, dut_mod, dut_range, amp_var, w, x, y, z, azim, dist, spat; dur_new = dur + dur_scalar; env = EnvGen.ar(Env([0, 1, 1, 0], [atk, dur_new-(atk+dec), dec], [1, 0, -1]), doneAction: 2); bpf_cfNew = bpf_cf * bpf_scalar; // lower and upper bounds for pulse fm pulse_mod = [freq - (pulse_varBand.reciprocal * freq), (pulse_varBand * freq) - freq]; // noise modulation used for frequency of pulse wave pulse_mod = LFNoise1.kr(pulse_varRate).exprange(freq - pulse_mod[0], freq + pulse_mod[1]); // same mod process as above but for bandpass filter bpf_mod = [bpf_cfNew - (bpf_varBand.reciprocal * bpf_cfNew), (bpf_varBand * bpf_cfNew) - bpf_cfNew]; bpf_mod = LFNoise1.kr(bpf_varRate).exprange(bpf_cfNew - bpf_mod[0], bpf_cfNew + bpf_mod[1]); // mod process for duty cycle dut_range = dut_mid - (dut_varBand.reciprocal * dut_mid); dut_mod = [dut_varRate - (dut_varRate / 1.5), dut_varRate + (dut_varRate * 1.5)]; dut_mod = LFNoise1.kr(dut_varRate).exprange(dut_mod[0], dut_mod[1]); dut_mod = SinOsc.kr(dut_mod).exprange(dut_mid - dut_range, dut_mid + dut_range); // amplitude variation amp_var = LFNoise1.kr(amp_varRate).range(amp_low-6, amp_high-6); // signal making sig = Pulse.ar(pulse_mod, width: dut_mod); sig = BPF.ar(sig, bpf_mod, rq, 1/rq.sqrt); sig = sig * env * amp_var.dbamp * amp_scalar; // ambisonics azim = LFNoise2.kr(azimRate).range(azimPos-(azimBnd/2), azimPos+(azimBnd/2)); // random movement of azimuth position azim = azim * (pi/180); // convert degrees to radians dist = LFNoise2.kr(distRate).range(0.5, 1.5); #w, x, y, z = BFEncode1.ar(sig, azim, 0, dist); spat = BFDecode1.ar(w, x, y, z, ~ambiArray, 0); Out.ar(out, spat); }).add; /* SynthDef(\reverberator, { arg in, out = 0, mix = 0.33, room = 0.5, damp = 0.5; var sig; sig = In.ar(in, ~numChans); sig = reverberator.ar(sig, mix, room, damp); Out.ar(out, sig); }).add; */ SynthDef(\reverberator, { arg in, out = 0, mix = 0, delaytime = 0.04, deltimeRatio = 1, deltimeModrate = 0.2, decaytime1 = 0.1, decaytime2 = 0.5; var input, numc, numa, delmod, deltimebnd, z, y, mixL, deltimeL, dectime1L, dectime2L, deltimeRatioL, deltimeModrateL; input = In.ar(in, ~numChans); // get ~numChans channels of input starting (and ending) on bus 0 numc = 7; // number of comb delays numa = 4; // number of allpass delays // lagged signals mixL = mix.lag(0.5); deltimeL = delaytime.lag(0.5); dectime1L = decaytime1.lag(0.5); dectime2L = decaytime2.lag(0.5); deltimeRatioL = deltimeRatio.lag(0.5); deltimeModrateL = deltimeModrate.lag(0.5); // modulate delay time deltimebnd = deltimeL-(deltimeL/deltimeRatioL); // value to add and subtract for modulation bandwidth delmod = LFNoise1.ar(deltimeModrateL).range(deltimeL-deltimebnd, deltimeL+deltimebnd); // reverb predelay time : z = DelayN.ar(input, 0.048); y = Mix.ar(Array.fill(numc, { CombL.ar(z, 0.15, delmod, dectime1L) })); // chain of 4 allpass delays on each of ~numChans channels : numa.do({ y = AllpassL.ar(y, 0.051, Array.fill(~numChans, {rrand(0.01, 0.05)}), dectime2L) }); //Array.fill(~numChans, {rrand(0.01, 0.05)}); // add original sound to reverb and play it : Out.ar(out, input + (mixL * y)); }).add; SynthDef(\eq, { arg in, out = 0, lowshelf_cf = 200, lowshelf_db = 6, db_scalar = 0, lowpass = 20000; var sig; sig = In.ar(in, ~numChans); sig = BHiPass4.ar(sig, 20, 1); sig = BLowShelf.ar(sig, lowshelf_cf.lag(0.5), 1.0, lowshelf_db.lag(0.5)); sig = BLowPass4.ar(sig, lowpass.lag(0.5), 1); sig = sig * db_scalar.lag(0.5).dbamp; Out.ar(out, sig); }).add; // 6b. Register remaining functions ServerTree.add(~makeNodes); ServerTree.add(~makeEvents); s.freeAll; s.sync; "done".postln; }); )