// title: spawnSynthGranulizer // author: bateslewis // description: // code: //A granular synth using spawned patterns //might be easiest to learn controls using pan //wslib quark and DPW3Tri plugin required //NICOLE = child stream //centr = the basic static value of that variable //shift = the amount of change from grain to grain in a single pbind stream (mostly bi-directional, use <> buttons for rate & filter) //dev = the amount of random deviation from centre using the distribution from the pop-up next to it //round button next to dev changes the effect of the dev∆ slider to work on the Pbind rather than the Pspawnwer //it does not affect the brownian distribution //PAPA = parent stream //step = the step value used if a brownian distribution is chosen from pop-up in nicole //shift∆ = the amount of change from stream to stream created by the spawner (use <> just above for rate & filter directionality here) //dev∆ = the change in the amount of random deviation from stream to stream created by the spawner = default //some of the random deviations can 'pass thru zero" //idiosyncrasies: //the "Ƅ" symbol in the nicole/DELTA section refers to bend - controls the random deviation parameters for bend amount // the distribution type pop-up for the papa/delta is above in the papa/length section //in the nicole/filter section there is a knob to control HPF cutoff //note also the gauss distribution requires much lower setting of dev than either Rand or Brown here // the extra + button in the nicole/freq section opens a gui to creat tuned clouds according to probabilities for each note //some symbols have been used from the Mac character viewer - yet to find out if these are Windows compatible //haven't been on SC too long but thought it might be fun for others to play around with too //it is a work in progress //PS. the reference to PAPA/nicole is from a stupid old car advert stuck in my head //it loosely refers to the parent and child streams of the Pspawn ( Routine.run{ SynthDef(\sinGab, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(FSinOsc.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000)), filter)), hiPass); var env = EnvGen.ar(Env.sine(sustain, amp * AmpComp.ir(freq) * 0.5), doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\sinWide, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, width=0.5, filter=22000, hiPass=20, vol=1| var holdT = sustain * width; var fadeT = 1 - width * sustain * 0.5; var snd = HPF.ar((LPF.ar(FSinOsc.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000)), filter)), hiPass); var env = EnvGen.ar(Env([0, 1, 1, 0], [fadeT, holdT, fadeT], \sin), levelScale: amp * AmpComp.ir(freq) * 0.5, doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 9).add; SynthDef(\sinPerc, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(FSinOsc.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000)), filter)), hiPass); var env = EnvGen.ar( Env.perc(0.1, 0.9, amp * AmpComp.ir(freq) * 0.5), timeScale: sustain, doneAction: 2 ); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\sinPercRev, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(FSinOsc.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000)), filter)), hiPass); var env = EnvGen.ar( Env.perc(0.9, 0.1, amp * AmpComp.ir(freq) * 0.5, 4), timeScale: sustain, doneAction: 2 ); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\noiseGab, { |amp=0.2, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1, rq=0.1| var snd = HPF.ar((LPF.ar((BPF.ar(GrayNoise.ar, Line.ar(freq, freq*bend, sustain).clip(10,22000), rq, 3)), filter)), hiPass); var env = EnvGen.ar(Env.sine(sustain, amp * 0.5), doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 9).add; SynthDef(\noiseWide, { |amp=0.2, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1, rq=0.1, width=0.5| var holdT = sustain * width; var fadeT = 1 - width * sustain * 0.5; var snd = HPF.ar((LPF.ar((BPF.ar(GrayNoise.ar, Line.ar(freq, freq*bend, sustain).clip(10,22000), rq, 3)), filter)), hiPass); var env = EnvGen.ar(Env([0, 1, 1, 0], [fadeT, holdT, fadeT], \sin), levelScale: amp * 0.5, doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 10).add; SynthDef(\noisePerc, { |amp=0.2, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1, rq=0.1| var snd = HPF.ar((LPF.ar((BPF.ar(GrayNoise.ar, Line.ar(freq, freq*bend, sustain).clip(10,22000), rq, 3)), filter)), hiPass); var env = EnvGen.ar(Env.perc(0.1, 0.9, amp * 0.5), timeScale: sustain, doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 9).add; SynthDef(\noisePercRev, { |amp=0.2, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1, rq=0.1| var snd = HPF.ar((LPF.ar((BPF.ar(GrayNoise.ar, Line.ar(freq, freq*bend, sustain).clip(10,22000), rq, 3)), filter)), hiPass); var env = EnvGen.ar( Env.perc(0.9, 0.1, amp * 0.5, 4), timeScale: sustain, doneAction: 2 ); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 9).add; SynthDef(\sqGab, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(Pulse.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000), 0.5), filter)), hiPass); var env = EnvGen.ar(Env.sine(sustain, amp * 0.5), doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\sqWide, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1, width=0.5| var holdT = sustain * width; var fadeT = 1 - width * sustain * 0.5; var snd = HPF.ar((LPF.ar(Pulse.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000), 0.5), filter)), hiPass); var env = EnvGen.ar(Env([0, 1, 1, 0], [fadeT, holdT, fadeT], \sin), levelScale: amp * 0.5, doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 9).add; SynthDef(\sqPerc, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(Pulse.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000), 0.5), filter)), hiPass); var env = EnvGen.ar( Env.perc(0.1, 0.9, amp * 0.5, 4), timeScale: sustain, doneAction: 2 ); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\sqPercRev, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(Pulse.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000), 0.5), filter)), hiPass); var env = EnvGen.ar( Env.perc(0.9, 0.1, amp * 0.5, 4), timeScale: sustain, doneAction: 2 ); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\triGab, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(DPW3Tri.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000)), filter)), hiPass); var env = EnvGen.ar(Env.sine(sustain, amp * 0.5), doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\triWide, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1, width=0.5| var holdT = sustain * width; var fadeT = 1 - width * sustain * 0.5; var snd = HPF.ar((LPF.ar(DPW3Tri.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000)), filter)), hiPass); var env = EnvGen.ar(Env([0, 1, 1, 0], [fadeT, holdT, fadeT], \sin), levelScale: amp * 0.5, doneAction: 2); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 9).add; SynthDef(\triPercRev, { |amp=0.1, freq=440, bend=1.0, sustain=0.05, pan=0, filter=22000, hiPass=20, vol=1| var snd = HPF.ar((LPF.ar(DPW3Tri.ar(Line.ar(freq, freq*bend, sustain).clip(10,22000)), filter)), hiPass); var env = EnvGen.ar( Env.perc(0.9, 0.1, amp * 0.5, 4), timeScale: sustain, doneAction: 2 ); var kak = Pan2.ar(snd * env, pan, vol); Out.ar(4, kak); OffsetOut.ar(0, kak); }, \ir ! 8).add; SynthDef(\Cator, { var imp, delimp, listen; imp = Impulse.kr(20); delimp = Delay1.kr(imp); listen = In.ar(4, 2); SendReply.kr(imp, '/levels', [Amplitude.kr(listen), K2A.ar(Peak.ar(listen, delimp).lag(0, 1))]); }).add; s.sync; // Synth(\triPercRev, [\out, 0, \amp, 0.2, \rate, 1, \pos, 500, \sustain, 0.5, \pan, 0.5] ) defer{ ~w = Window("vOwel moGrains SYNTH", Rect(600, 180, 830, 705)) .background = Color.white; //CLOUD ~cloudView = Window("cloud", Rect(150,423,420,462)); ~cloudView.view.background_(Color.white); ~clow = UserView(~cloudView, Rect(15, 15, 390, 432)); ~clow.background = Color.new255(190, 190, 190); ~clow.drawFunc = {Pen.color = Color.white; Pen.addRect( Rect(40,40,80,16)); Pen.fillStroke; Pen.color = Color.black; Pen.addRect( Rect(40,61,60,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,82,80,16)); Pen.fillStroke; Pen.color = Color.black; Pen.addRect( Rect(40,103,60,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,124,80,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,145,80,16)); Pen.fillStroke; Pen.color = Color.black; Pen.addRect( Rect(40,166,60,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,187,80,16)); Pen.fillStroke; Pen.color = Color.black; Pen.addRect( Rect(40,208,60,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,229,80,16)); Pen.fillStroke; Pen.color = Color.black; Pen.addRect( Rect(40,250,60,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,271,80,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,292,80,16)); Pen.fillStroke; Pen.color = Color.black; Pen.addRect( Rect(40,313,60,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,334,80,16)); Pen.fillStroke; Pen.color = Color.black; Pen.addRect( Rect(40,355,60,16)); Pen.fillStroke; Pen.color = Color.white; Pen.addRect( Rect(40,376,80,16)); Pen.fillStroke; ~clow.refresh;}; //PAPA ~papa = CompositeView(~w, Rect(15, 15, 345, 675)) .background = Color.new255(190, 190, 190); ~pap = StaticText(~papa, Rect(10, 3, 325, 26)) .string = "PAPA"; ~pap.background = Color.new255(190, 190, 190); ~pap.align = \center; ~pap.font = Font("Abadi MT Condensed Extra Bold", 20); ~pap.stringColor = Color.white; ~papaLengthBak = CompositeView(~papa, Rect(8, 40, 318, 53)) .background = Color.new255(105, 105, 105); ~papaLengthWind = CompositeView(~papaLengthBak, Rect(3, 3, 312, 47)) .background = Color.white; ~spawnBak = CompositeView(~papa, Rect(8, 98, 318, 95)) .background = Color.new255(105, 105, 105); ~spawnWind = CompositeView(~spawnBak, Rect(3, 3, 312, 89)) .background = Color.white; ~papaFreqBak = CompositeView(~papa, Rect(8, 198, 318, 74)) .background = Color.new255(105, 105, 105); ~papaFreqWind = CompositeView(~papaFreqBak, Rect(3, 3, 312, 68)) .background = Color.white; ~papaFilterBak = CompositeView(~papa, Rect(8, 277, 318, 74)) .background = Color.new255(105, 105, 105); ~papaFilterWind = CompositeView(~papaFilterBak, Rect(3, 3, 312, 68)) .background = Color.white; ~papaDurBak = CompositeView(~papa, Rect(8, 356, 318, 74)) .background = Color.new255(105, 105, 105); ~papaDurWind = CompositeView(~papaDurBak, Rect(3, 3, 312, 68)) .background = Color.white; ~papaDensityBak = CompositeView(~papa, Rect(8, 435, 318, 74)) .background = Color.new255(105, 105, 105); ~papaDensityWind = CompositeView(~papaDensityBak, Rect(3, 3, 312, 68)) .background = Color.white; ~papaAmpBak = CompositeView(~papa, Rect(8, 514, 318, 74)) .background = Color.new255(105, 105, 105); ~papaAmpWind = CompositeView(~papaAmpBak, Rect(3, 3, 312, 68)) .background = Color.white; ~papaPanBak = CompositeView(~papa, Rect(8, 593, 318, 74)) .background = Color.new255(105, 105, 105); ~papaPanWind = CompositeView(~papaPanBak, Rect(3, 3, 312, 68)) .background = Color.white; //NICOLE ~nicole = CompositeView(~w, Rect(365, 15, 411, 675)) .background = Color.new255(190, 190, 190); ~nic = StaticText(~nicole, Rect(10, 3, 388, 26)) .string = "nicole"; ~nic.background = Color.new255(190, 190, 190); ~nic.align = \center; ~nic.font = Font("Abadi MT Condensed Extra Bold", 20); ~nic.stringColor = Color.white; ~nicoleLengthBak = CompositeView(~nicole, Rect(19, 40, 392, 74)) .background = Color.new255(105, 105, 105); ~nicoleLengthWind = CompositeView(~nicoleLengthBak, Rect(3, 3, 389, 68)) .background = Color.white; ~soundFile = CompositeView(~nicole, Rect(19, 119, 392, 74)) .background = Color.new255(105, 105, 105); ~soundFileBak = CompositeView(~soundFile, Rect(3, 3, 389, 68)) .background = Color.white; ~extraBitH = CompositeView(~w, Rect(776, 126, 36, 3)) .background = Color.new255(105, 105, 105); ~extraBitV = CompositeView(~w, Rect(812, 126, 3, 600)) .background = Color.new255(105, 105, 105); ~freqBak = CompositeView(~nicole, Rect(19, 198, 384, 74)) .background = Color.new255(105, 105, 105); ~freqWind = CompositeView(~freqBak, Rect(3, 3, 378, 68)) .background = Color.white; ~filterBak = CompositeView(~nicole, Rect(19, 277, 384, 74)) .background = Color.new255(105, 105, 105); ~filterWind = CompositeView(~filterBak, Rect(3, 3, 378, 68)) .background = Color.white; ~durBak = CompositeView(~nicole, Rect(19, 356, 384, 74)) .background = Color.new255(105, 105, 105); ~durWind = CompositeView(~durBak, Rect(3, 3, 378, 68)) .background = Color.white; ~densityBak = CompositeView(~nicole, Rect(19, 435, 384, 74)) .background = Color.new255(105, 105, 105); ~densityWind = CompositeView(~densityBak, Rect(3, 3, 378, 68)) .background = Color.white; ~ampBak = CompositeView(~nicole, Rect(19, 514, 384, 74)) .background = Color.new255(105, 105, 105); ~ampWind = CompositeView(~ampBak, Rect(3, 3, 378, 68)) .background = Color.white; ~panBak = CompositeView(~nicole, Rect(19, 593, 384, 74)) .background = Color.new255(105, 105, 105); ~panWind = CompositeView(~panBak, Rect(3, 3, 378, 68)) .background = Color.white; //LABELS ~nicLengthLabel = StaticText(~w, Rect(338, 83, 49, 18)) .string = "length"; ~nicLengthLabel.background = Color.new255(105, 105, 105); ~nicLengthLabel.align = \center; ~nicLengthLabel.font = Font("Helvetica Neue Bold Condensed", 12); ~nicLengthLabel.stringColor = Color.white; ~spawnLabel = StaticText(~w, Rect(338, 162, 49, 18)) .string = "DELTA"; ~spawnLabel.background = Color.new255(105, 105, 105); ~spawnLabel.align = \center; ~spawnLabel.font = Font("Helvetica Neue Bold Condensed", 12); ~spawnLabel.stringColor = Color.white; ~rateLabel = StaticText(~w, Rect(338, 241, 49, 18)) .string = "freq"; ~rateLabel.background = Color.new255(105, 105, 105); ~rateLabel.align = \center; ~rateLabel.font = Font("Helvetica Neue Bold Condensed", 13); ~rateLabel.stringColor = Color.white; ~filterLabel = StaticText(~w, Rect(338, 320, 49, 18)) .string = "filter"; ~filterLabel.background = Color.new255(105, 105, 105); ~filterLabel.align = \center; ~filterLabel.font = Font("Helvetica Neue Bold Condensed", 13); ~filterLabel.stringColor = Color.white; ~durLabel = StaticText(~w, Rect(338, 399, 49, 18)) .string = "dur"; ~durLabel.background = Color.new255(105, 105, 105); ~durLabel.align = \center; ~durLabel.font = Font("Helvetica Neue Bold Condensed", 13); ~durLabel.stringColor = Color.white; ~densityLabel = StaticText(~w, Rect(338, 478, 49, 18)) .string = "delta"; ~densityLabel.background = Color.new255(105, 105, 105); ~densityLabel.align = \center; ~densityLabel.font = Font("Helvetica Neue Bold Condensed", 13); ~densityLabel.stringColor = Color.white; ~ampLabel = StaticText(~w, Rect(338, 557, 49, 18)) .string = "amp"; ~ampLabel.background = Color.new255(105, 105, 105); ~ampLabel.align = \center; ~ampLabel.font = Font("Helvetica Neue Bold Condensed", 13); ~ampLabel.stringColor = Color.white; ~panLabel = StaticText(~w, Rect(338, 636, 49, 18)) .string = "pan"; ~panLabel.background = Color.new255(105, 105, 105); ~panLabel.align = \center; ~panLabel.font = Font("Helvetica Neue Bold Condensed", 13); ~panLabel.stringColor = Color.white; ~cloudView.front; ~w.front; //CLOUD ~cloud1 = EZSlider(~clow, Rect(130, 376, 220, 16), "1", initVal:1, labelWidth:20, numberWidth:40); ~cloud2 = EZSlider(~clow, Rect(130, 355, 220, 16), "2", labelWidth:20, numberWidth:40); ~cloud3 = EZSlider(~clow, Rect(130, 334, 220, 16), "3", labelWidth:20, numberWidth:40); ~cloud4 = EZSlider(~clow, Rect(130, 313, 220, 16), "4", labelWidth:20, numberWidth:40); ~cloud5 = EZSlider(~clow, Rect(130, 292, 220, 16), "5", labelWidth:20, numberWidth:40); ~cloud6 = EZSlider(~clow, Rect(130, 271, 220, 16), "6", labelWidth:20, numberWidth:40); ~cloud7 = EZSlider(~clow, Rect(130, 250, 220, 16), "7", labelWidth:20, numberWidth:40); ~cloud8 = EZSlider(~clow, Rect(130, 229, 220, 16), "8", labelWidth:20, numberWidth:40); ~cloud9 = EZSlider(~clow, Rect(130, 208, 220, 16), "9", labelWidth:20, numberWidth:40); ~cloud10 = EZSlider(~clow, Rect(130, 187, 220, 16), "10", labelWidth:20, numberWidth:40); ~cloud11 = EZSlider(~clow, Rect(130, 166, 220, 16), "11", labelWidth:20, numberWidth:40); ~cloud12 = EZSlider(~clow, Rect(130, 145, 220, 16), "12", labelWidth:20, numberWidth:40); ~cloud13 = EZSlider(~clow, Rect(130, 124, 220, 16), "1", labelWidth:20, numberWidth:40); ~cloud14 = EZSlider(~clow, Rect(130, 103, 220, 16), "2", labelWidth:20, numberWidth:40); ~cloud15 = EZSlider(~clow, Rect(130, 82, 220, 16), "3", labelWidth:20, numberWidth:40); ~cloud16 = EZSlider(~clow, Rect(130, 61, 220, 16), "4", labelWidth:20, numberWidth:40); ~cloud17 = EZSlider(~clow, Rect(130, 40, 220, 16), "5", labelWidth:20, numberWidth:40); //PAPA ~papaCentre = EZSlider(~papaLengthWind, Rect(2, 5, 300, 16), "centr", ControlSpec(0.01, 100.0, \exp, 0.001, 100, nil), {|sl| ~papaCentreV = sl.value}, labelWidth:45); ~spawnRandom = PatternProxy(Pfunc{ |e| e.spawnRand}); ~spawnGaussian = PatternProxy(Pfunc{ |e| e.spawnGauss}); ~spawnBrownian = PatternProxy(Pfunc{ |e| e.spawnBrown}); ~spawnChoice = [~spawnRandom, ~spawnGaussian, ~spawnBrownian]; ~spawnDevShape = PopUpMenu.new(~papaLengthWind, Rect(188, 26, 66, 16)) .items_(["Rand", "Gauss", "Brown"]) .action_( { |menu| ~spawnPop.source = ~spawnChoice.at(menu.value)} ); ~spawnDevShape.value = 0; ~spawnPop = PatternProxy(Pfunc{ |e| e.spawnRand}); ~spawnCentre = EZSlider(~spawnWind, Rect(2, 5, 300, 16), "centr", ControlSpec(0.01, 100.0, \exp, 0.001, 100, nil), {|sl| ~spawnCentreV = sl.value}, labelWidth:45); ~spawnSlope = EZSlider(~spawnWind, Rect(2, 26, 300, 16), "shift", ControlSpec(-0.5, 0.5, \lin, 0.001, 0, nil), {|sl| ~spawnSlopeV = sl.value}, labelWidth:45); ~spawnDev = EZSlider(~spawnWind, Rect(2, 47, 300, 16), "dev", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~spawnDevV = sl.value}, labelWidth:45); ~spawnStep = EZSlider(~spawnWind, Rect(2, 68, 300, 16), "step", ControlSpec(0.0, 0.5, \lin, 0.001, 0, nil), {|sl| ~spawnStepV = sl.value}, labelWidth:45); ~freqStep = EZSlider(~papaFreqWind, Rect(21, 5, 281, 16), "step", ControlSpec(0, 2000, \lin, 1, 0, nil), {|sl| ~freqStepV = sl.value}, labelWidth:26); ~papaFreqSlope = EZSlider(~papaFreqWind, Rect(2, 26, 300, 16), "shift∆", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~papaFreqSlopeV = sl.value}, labelWidth:45); ~spawnFreqDevScaler = EZSlider(~papaFreqWind, Rect(2, 47, 300, 16), "dev∆", ControlSpec(-0.10, 0.10, \lin, 0.001, 0, nil), {|sl| ~spawnFreqDevScalerV = sl.value}, labelWidth:45); ~papaFreqSlopeControl = Button(~papaFreqWind, Rect(3, 5, 15, 15 )) .states_([[">", Color.black, Color.white],["<", Color.black, Color.white]]) .action_({~papaFreqSlopeSwitch = ~papaFreqSlopeDir.at(~papaFreqSlopeControl.value)}); ~papaFreqSlopeControl.value = 0; ~papaFreqSlopeDir = [1,-1]; ~papaFreqSlopeSwitch = ~papaFreqSlopeDir.at(~papaFreqSlopeControl.value); ~filterStep = EZSlider(~papaFilterWind, Rect(21, 5, 281, 16), "step", ControlSpec(0, 5000, \lin, 1, 0, nil), {|sl| ~filterStepV = sl.value}, labelWidth:26); ~papaFilterSlope = EZSlider(~papaFilterWind, Rect(2, 26, 300, 16), "shift∆", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~papaFilterSlopeV = sl.value}, labelWidth:45); ~spawnFilterDevScaler = EZSlider(~papaFilterWind, Rect(2, 47, 300, 16), "dev∆", ControlSpec(-0.25, 0.25, \lin, 0.001, 0, nil), {|sl| ~spawnFilterDevScalerV = sl.value}, labelWidth:45); ~papaFilterSlopeControl = Button(~papaFilterWind, Rect(3, 5, 15, 15 )) .states_([[">", Color.black, Color.white],["<", Color.black, Color.white]]) .action_({~papaFilterSlopeSwitch = ~papaFilterSlopeDir.at(~papaFilterSlopeControl.value)}); ~papaFilterSlopeControl.value = 0; ~papaFilterSlopeDir = [1,-1]; ~papaFilterSlopeSwitch = ~papaFilterSlopeDir.at(~papaFilterSlopeControl.value); ~durStep = EZSlider(~papaDurWind, Rect(2, 5, 300, 16), "step", ControlSpec(0.0, 0.10, \lin, 0.001, 0, nil), {|sl| ~durStepV = sl.value}, labelWidth:45); ~papaDurSlope = EZSlider(~papaDurWind, Rect(2, 26, 300, 16), "shift∆", ControlSpec(-0.10, 0.10, \lin, 0.001, 0, nil), {|sl| ~papaDurSlopeV = sl.value}, labelWidth:45); ~spawnDurDevScaler = EZSlider(~papaDurWind, Rect(2, 47, 300, 16), "dev∆", ControlSpec(-0.10, 0.10, \lin, 0.001, 0, nil), {|sl| ~spawnDurDevScalerV = sl.value}, labelWidth:45); ~densityStep = EZSlider(~papaDensityWind, Rect(2, 5, 300, 16), "step", ControlSpec(0.0, 0.10, \lin, 0.001, 0, nil), {|sl| ~densityStepV = sl.value}, labelWidth:45); ~papaDensitySlope = EZSlider(~papaDensityWind, Rect(2, 26, 300, 16), "shift∆", ControlSpec(-0.10, 0.10, \lin, 0.001, 0, nil), {|sl| ~papaDensitySlopeV = sl.value}, labelWidth:45); ~spawnDensityDevScaler = EZSlider(~papaDensityWind, Rect(2, 47, 300, 16), "dev∆", ControlSpec(-0.10, 0.10, \lin, 0.001, 0, nil), {|sl| ~spawnDensityDevScalerV = sl.value}, labelWidth:45); ~ampStep = EZSlider(~papaAmpWind, Rect(2, 5, 300, 16), "step", ControlSpec(0.0, 0.50, \lin, 0.001, 0, nil), {|sl| ~ampStepV = sl.value}, labelWidth:45); ~papaAmpSlope = EZSlider(~papaAmpWind, Rect(2, 26, 300, 16), "shift∆", ControlSpec(-0.50, 0.50, \lin, 0.001, 0, nil), {|sl| ~papaAmpSlopeV = sl.value}, labelWidth:45); ~spawnAmpDevScaler = EZSlider(~papaAmpWind, Rect(2, 47, 300, 16), "dev∆", ControlSpec(-0.50, 0.50, \lin, 0.001, 0, nil), {|sl| ~spawnAmpDevScalerV = sl.value}, labelWidth:45); ~panStep = EZSlider(~papaPanWind, Rect(2, 5, 300, 16), "step", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~panStepV = sl.value}, labelWidth:45); ~papaPanSlope = EZSlider(~papaPanWind, Rect(2, 26, 300, 16), "shift∆", ControlSpec(-0.50, 0.50, \lin, 0.001, 0, nil), {|sl| ~papaPanSlopeV = sl.value}, labelWidth:45); ~spawnPanDevScaler = EZSlider(~papaPanWind, Rect(2, 47, 300, 16), "dev∆", ControlSpec(-0.50, 0.50, \lin, 0.001, 0, nil), {|sl| ~spawnPanDevScalerV = sl.value}, labelWidth:45); //NICOLE ~nicCentre = EZSlider(~nicoleLengthWind, Rect(2, 5, 293, 16), "centr", ControlSpec(0.01, 100.0, \exp, 0.001, 100, nil), {|sl| ~nicLengthV = sl.value}, labelWidth:38); ~nicSlope = EZSlider(~nicoleLengthWind, Rect(2, 26, 293, 16), "shift", ControlSpec(-1.00, 1.00, \lin, 0.001, 0, nil), {|sl| ~nicSlopeV = sl.value}, labelWidth:38); ~nicDev = EZSlider(~nicoleLengthWind, Rect(2, 47, 293, 16), "dev", ControlSpec(0.0, 5.0, \lin, 0.001, 0, nil), {|sl| ~nicDevV = sl.value}, labelWidth:38); ~moLabel = StaticText(~w, Rect(685, 63, 125, 40)) .string = "moGrains"; ~moLabel.background = Color.white; ~moLabel.align = \center; ~moLabel.font = Font("Cracked", 35); ~moLabel.stringColor = Color.black; //Color.new255(105, 105, 105); ~bendRanger = EZRanger(~soundFileBak, Rect(6, 26, 278, 16), nil, ControlSpec(0.25, 4.0, \exp, 0.001), {|sl| ~bendRangerL = sl.lo.value; ~bendRangerH = sl.hi.value}, [1,1], numberWidth:34); ~bendLabel = StaticText(~soundFileBak, Rect(288, 26, 16, 16)) .string = "Ƅ"; ~bendLabel.background = Color.white; ~bendLabel.align = \left; ~bendLabel.stringColor = Color.new255(190, 190, 190); ~envLabel = StaticText(~soundFileBak, Rect(3, 7, 40, 14)) .string = "synth"; ~envLabel.background = Color.white; ~envLabel.align = \center; ~envLabel.font = Font("Helvetica Neue Bold Condensed", 12); ~envLabel.stringColor = Color.new255(190, 190, 190); ~sinGab = PatternProxy(\sinGab); ~sinWide = PatternProxy(\sinWide); ~sinPerc = PatternProxy(\sinPerc); ~sincreP = PatternProxy(\sinPercRev); ~noiseGab = PatternProxy(\noiseGab); ~noiseWide = PatternProxy(\noiseWide); ~noisePerc = PatternProxy(\noisePerc); ~noisecreP = PatternProxy(\noisePercRev); ~sqGab = PatternProxy(\sqGab); ~sqWide = PatternProxy(\sqWide); ~sqPerc = PatternProxy(\sqPerc); ~sqcreP = PatternProxy(\sqPercRev); ~triGab = PatternProxy(\triGab); ~triWide = PatternProxy(\triWide); ~tricreP = PatternProxy(\triPercRev); ~envChoice = [~sinGab, ~sinWide, ~sinPerc, ~sincreP, ~noiseGab, ~noiseWide, ~noisePerc, ~noisecreP, ~sqGab, ~sqWide, ~sqPerc, ~sqcreP, ~triGab, ~triWide, ~tricreP]; ~envShape = PopUpMenu.new(~soundFileBak, Rect(43, 5, 92, 16)) .items_(["sinGab", "sinWide", "sinPerc", "sincreP", "noiseGab", "noiseWide", "noisePerc", "noisecreP", "sqGab", "sqWide", "sqPerc", "sqcreP", "triGab", "triWide", "tricreP"]) .action_( { |menu| ~envPop.source = ~envChoice.at(menu.value)} ); ~envShape.value = 0; ~envPop = PatternProxy(\sinGab); ~freqCentre = EZSlider(~freqWind, Rect(2, 5, 293, 16), "centr", ControlSpec(20, 20000, \exp, 1, 440, nil), {|sl| ~freqCentreV = sl.value}, labelWidth:38); ~freqSlope = EZSlider(~freqWind, Rect(2, 26, 293, 16), "shift", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~freqSlopeV = sl.value}, labelWidth:38); ~freqDev = EZSlider(~freqWind, Rect(2, 47, 293, 16), "dev", ControlSpec(0, 5.0, \lin, 0.001, 0, nil), {|sl| ~freqDevV = sl.value}, labelWidth:38); ~cloudViz = Button(~freqWind, Rect(303, 6, 15, 15 )) .states_([["+", Color.black, Color.white],["−", Color.white, Color.new255(190, 190, 190)]]) .action_({ |v| ~cloudView.visible = ~cloudViz.value.asBoolean}); ~cloudViz.value = 0; ~freqSlopeControl = Button(~freqWind, Rect(303, 27, 15, 15 )) .states_([[">", Color.black, Color.white],["<", Color.black, Color.white]]) .action_({~freqSlopeSwitch = ~freqSlopeDir.at(~freqSlopeControl.value)}); ~freqSlopeControl.value = 0; ~freqSlopeDir = [1,-1]; ~freqSlopeSwitch = ~freqSlopeDir.at(~freqSlopeControl.value); ~freqRandom = PatternProxy(Pfunc{ |e| e.freqPatternRand}); ~freqGaussian = PatternProxy(Pfunc{ |e| e.freqPatternGauss}); ~freqBrownian = PatternProxy(Pfunc{ |e| e.freqPatternBrown}); ~freqChoice = [~freqRandom, ~freqGaussian, ~freqBrownian]; ~freqDevShape = PopUpMenu.new(~freqWind, Rect(303, 47, 67, 16)) .items_(["Rand", "Gauss", "Brown"]) .action_( { |menu| ~freqPop.source = ~freqChoice.at(menu.value)} ); ~freqDevShape.value = 0; ~freqPop = PatternProxy(Pfunc{ |e| e.freqPatternRand}); ~freqDevSwitcher = RoundButton(~freqWind, Rect(4, 50, 11, 11)) .states_([["", Color.white, Color.white],["", Color.new255(105, 105, 105), Color.new255(105, 105, 105)]]); ~freqDevSwitcher.value=0; ~filterCentre = EZSlider(~filterWind, Rect(2, 5, 293, 16), "centr", ControlSpec(20, 20000, \exp, 1, 20000, nil), {|sl| ~filterCentreV = sl.value}, labelWidth:38); ~filterSlope = EZSlider(~filterWind, Rect(2, 26, 293, 16), "shift", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~ampSlopeV = sl.value}, labelWidth:38); ~filterDev = EZSlider(~filterWind, Rect(2, 47, 293, 16), "dev", ControlSpec(0, 5.0, \lin, 0.001, 0, nil), {|sl| ~filterDevV = sl.value}, labelWidth:38); ~filterSlopeControl = Button(~filterWind, Rect(303, 26, 15, 15 )) .states_([[">", Color.black, Color.white],["<", Color.black, Color.white]]) .action_({~filterSlopeSwitch = ~filterSlopeDir.at(~filterSlopeControl.value)}); ~filterSlopeControl.value = 0; ~filterSlopeDir = [1,-1]; ~filterSlopeSwitch = ~filterSlopeDir.at(~filterSlopeControl.value); ~hiPass = EZKnob(~filterWind, Rect(330, 7, 36, 36), nil, ControlSpec(20, 22000, \exp, 1, 20, nil), {|sl| ~hiPassV = sl.value}, nil, unitWidth: 0, labelHeight: 0); ~filterRandom = PatternProxy(Pfunc{ |e| e.filterPatternRand}); ~filterGaussian = PatternProxy(Pfunc{ |e| e.filterPatternGauss}); ~filterBrownian = PatternProxy(Pfunc{ |e| e.filterPatternBrown}); ~filterChoice = [~filterRandom, ~filterGaussian, ~filterBrownian]; ~filterDevShape = PopUpMenu.new(~filterWind, Rect(303, 47, 66, 16)) .items_(["Rand", "Gauss", "Brown"]) .action_( { |menu| ~filterPop.source = ~filterChoice.at(menu.value)} ); ~filterDevShape.value = 0; ~filterPop = PatternProxy(Pfunc{ |e| e.filterPatternRand}); ~filterDevSwitcher = RoundButton(~filterWind, Rect(4, 50, 11, 11)) .states_([["", Color.white, Color.white],["", Color.new255(105, 105, 105), Color.new255(105, 105, 105)]]); ~filterDevSwitcher.value=0; ~durCentre = EZSlider(~durWind, Rect(2, 5, 293, 16), "centr", ControlSpec(0.001, 2.0, \exp, 0.001, 0.1, nil), {|sl| ~durCentreV = sl.value}, labelWidth:38); ~durSlope = EZSlider(~durWind, Rect(2, 26, 293, 16), "shift", ControlSpec(-0.05, 0.05, \lin, 0.001, 0, nil), {|sl| ~durSlopeV = sl.value}, labelWidth:38); ~durDev = EZSlider(~durWind, Rect(2, 47, 293, 16), "dev", ControlSpec(0.0, 0.25, \lin, 0.001, 0, nil), {|sl| ~durDevV = sl.value}, labelWidth:38); ~durRandom = PatternProxy(Pfunc{ |e| e.durPatternRand}); ~durGaussian = PatternProxy(Pfunc{ |e| e.durPatternGauss}); ~durBrownian = PatternProxy(Pfunc{ |e| e.durPatternBrown}); ~durChoice = [~durRandom, ~durGaussian, ~durBrownian]; ~durDevShape = PopUpMenu.new(~durWind, Rect(303, 47, 66, 16)) .items_(["Rand", "Gauss", "Brown"]) .action_( { |menu| ~durPop.source = ~durChoice.at(menu.value)} ); ~durDevShape.value = 0; ~durPop = PatternProxy(Pfunc{ |e| e.durPatternRand}); ~durDevSwitcher = RoundButton(~durWind, Rect(4, 50, 11, 11)) .states_([["", Color.white, Color.white],["", Color.new255(105, 105, 105), Color.new255(105, 105, 105)]]); ~durDevSwitcher.value=0; ~densityCentre = EZSlider(~densityWind, Rect(2, 5, 293, 16), "centr", ControlSpec(0.001, 1.0, \exp, 0.001, 0.1, nil), {|sl| ~densityCentreV = sl.value}, labelWidth:38); ~densitySlope = EZSlider(~densityWind, Rect(2, 26, 293, 16), "shift", ControlSpec(-0.010, 0.010, \lin, 0.001, 0, nil), {|sl| ~densitySlopeV = sl.value}, labelWidth:38); ~densityDev = EZSlider(~densityWind, Rect(2, 47, 293, 16), "dev", ControlSpec(0.0, 0.50, \lin, 0.001, 0, nil), {|sl| ~densityDevV = sl.value}, labelWidth:38); ~densityRandom = PatternProxy(Pfunc{ |e| e.densityPatternRand}); ~densityGaussian = PatternProxy(Pfunc{ |e| e.densityPatternGauss}); ~densityBrownian = PatternProxy(Pfunc{ |e| e.densityPatternBrown}); ~densityChoice = [~densityRandom, ~densityGaussian, ~densityBrownian]; ~densityDevShape = PopUpMenu.new(~densityWind, Rect(303, 47, 66, 16)) .items_(["Rand", "Gauss", "Brown"]) .action_( { |menu| ~densityPop.source = ~densityChoice.at(menu.value)} ); ~densityDevShape.value = 0; ~densityPop = PatternProxy(Pfunc{ |e| e.densityPatternRand}); ~densityDevSwitcher = RoundButton(~densityWind, Rect(4, 50, 11, 11)) .states_([["", Color.white, Color.white],["", Color.new255(105, 105, 105), Color.new255(105, 105, 105)]]); ~densityDevSwitcher.value=0; ~ampCentre = EZSlider(~ampWind, Rect(2, 5, 293, 16), "centr", ControlSpec(0.0, 1.0, \lin, 0.001, 0.8, nil), {|sl| ~ampCentreV = sl.value}, labelWidth:38); ~ampSlope = EZSlider(~ampWind, Rect(2, 26, 293, 16), "shift", ControlSpec(-0.20, 0.20, \lin, 0.001, 0, nil), {|sl| ~ampSlopeV = sl.value}, labelWidth:38); ~ampDev = EZSlider(~ampWind, Rect(2, 47, 293, 16), "dev", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~ampDevV = sl.value}, labelWidth:38); ~ampRandom = PatternProxy(Pfunc{ |e| e.ampPatternRand}); ~ampGaussian = PatternProxy(Pfunc{ |e| e.ampPatternGauss}); ~ampBrownian = PatternProxy(Pfunc{ |e| e.ampPatternBrown}); ~ampChoice = [~ampRandom, ~ampGaussian, ~ampBrownian]; ~ampDevShape = PopUpMenu.new(~ampWind, Rect(303, 47, 66, 16)) .items_(["Rand", "Gauss", "Brown"]) .action_( { |menu| ~ampPop.source = ~ampChoice.at(menu.value)} ); ~ampDevShape.value = 0; ~ampPop = PatternProxy(Pfunc{ |e| e.ampPatternRand}); ~ampDevSwitcher = RoundButton(~ampWind, Rect(4, 50, 11, 11)) .states_([["", Color.white, Color.white],["", Color.new255(105, 105, 105), Color.new255(105, 105, 105)]]); ~ampDevSwitcher.value=0; ~panCentre = EZSlider(~panWind, Rect(2, 5, 293, 16), "centr", ControlSpec(-1.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~panCentreV = sl.value}, labelWidth:38); ~panSlope = EZSlider(~panWind, Rect(2, 26, 293, 16), "shift", ControlSpec(-0.10, 0.10, \lin, 0.001, 0, nil), {|sl| ~panSlopeV = sl.value}, labelWidth:38); ~panDev = EZSlider(~panWind, Rect(2, 47, 293, 16), "dev", ControlSpec(0.0, 1.0, \lin, 0.001, 0, nil), {|sl| ~panDevV = sl.value}, labelWidth:38); ~panRandom = PatternProxy(Pfunc{ |e| e.panPatternRand}); ~panGaussian = PatternProxy(Pfunc{ |e| e.panPatternGauss}); ~panBrownian = PatternProxy(Pfunc{ |e| e.panPatternBrown}); ~panChoice = [~panRandom, ~panGaussian, ~panBrownian]; ~panDevShape = PopUpMenu.new(~panWind, Rect(303, 47, 66, 16)) .items_(["Rand", "Gauss", "Brown"]) .action_( { |menu| ~panPop.source = ~panChoice.at(menu.value)} ); ~panDevShape.value = 0; ~panPop = PatternProxy(Pfunc{ |e| e.panPatternRand}); ~panDevSwitcher = RoundButton(~panWind, Rect(4, 50, 11, 11)) .states_([["", Color.white, Color.white],["", Color.new255(105, 105, 105), Color.new255(105, 105, 105)]]); ~panDevSwitcher.value=0; //MASTER ~masterButton = Button(~w, Rect(784, 135, 20, 72)); ~masterButton.states_([["O", Color.black, Color.white],["O", Color.white, Color.yellow]]); ~masterButton.action = {|view| if (view.value==1) { x=Synth(\Cator); t=q.play} { t.stop; x.free; ~levelIndicator.value=0 } }; ~masterButton.value=0; ~recordButton = Button(~w, Rect(784, 214, 20, 72)); ~recordButton.states_([["R", Color.black, Color.white],["R", Color.white, Color.red]]); ~recordButton.action = {|view| if (view.value==1) {s.record} {s.stopRecording}}; ~recordButton.value=0; ~masterVolume = SmoothSlider(~w, Rect(784, 293, 20, 151)).value_(0.4); ~levelIndicator = LevelIndicator(~w, Rect(784, 451, 20, 239)); o = OSCFunc({arg msg; { ~levelIndicator.value = msg[3].ampdb.linlin(-40, 0, 0, 1); ~levelIndicator.peakLevel = msg[4].ampdb.linlin(-40, 0, 0, 1); }.defer; }, '/levels', s.addr); ~levelIndicator.warning = -6.dbamp; ~levelIndicator.critical = -3.dbamp; ~levelIndicator.value=0; ~cloudView.visible=false; ~w.onClose = {~cloudView.close} }; s.sync; //sort-> ( p = Pbind( \instrument, ~envPop, \serial, Pseries(0,1,inf), \bend, Pfunc{ exprand(~bendRanger.lo.value, ~bendRanger.hi.value)}, \freqCloud, Pwrand([1, 2.pow(1/12), 2.pow(2/12), 2.pow(3/12), 2.pow(4/12), 2.pow(5/12), 2.pow(6/12), 2.pow(7/12), 2.pow(8/12), 2.pow(9/12), 2.pow(10/12), 2.pow(11/12), 2.pow(12/12), 2.pow(13/12), 2.pow(14/12), 2.pow(15/12), 2.pow(16/12)], Pfunc{[~cloud1.value,~cloud2.value,~cloud3.value,~cloud4.value, ~cloud5.value,~cloud6.value,~cloud7.value,~cloud8.value, ~cloud9.value,~cloud10.value,~cloud11.value,~cloud12.value, ~cloud13.value,~cloud14.value,~cloud15.value,~cloud16.value,~cloud17.value].normalizeSum}, inf), \freqSeriesUp, (Pkey(\freqCloud)*Pfunc{~freqCentre.value}) * (Pfunc{~freqSlope.value} * Pkey(\serial) + 1), \freqSeriesDown, (Pkey(\freqCloud)*Pfunc{~freqCentre.value}) / (Pfunc{~freqSlope.value} * Pkey(\serial) +1), \freqSeries, Pif (Pfunc{~freqSlopeSwitch} > 0, Pkey(\freqSeriesUp), Pkey(\freqSeriesDown)), \filterSeriesUp, (Pfunc{~filterCentre.value} * (Pfunc{~filterSlope.value} * Pkey(\serial) + 1)).clip(20,20000), \filterSeriesDown, (Pfunc{~filterCentre.value} / (Pfunc{~filterSlope.value} * Pkey(\serial) +1)).clip(20,20000), \filterSeries, Pif (Pfunc{~filterSlopeSwitch} > 0, Pkey(\filterSeriesUp), Pkey(\filterSeriesDown)), \hiPass, Pfunc{~hiPass.value}, \durSeries, (Pfunc{~durCentre.value} + (Pfunc{~durSlope.value} * Pkey(\serial))).max(0.001), \densitySeries, (Pfunc{~densityCentre.value} + (Pfunc{~densitySlope.value} * Pkey(\serial))).max(0.001), \ampSeries, (Pfunc{~ampCentre.value} + (Pfunc{~ampSlope.value} * Pkey(\serial))).clip(0,1), \panSeries, (Pfunc{~panCentre.value} + (Pfunc{~panSlope.value} * Pkey(\serial))).clip(-1,1), \vol, Pfunc{~masterVolume.value}*2.5, ); q = Pspawn( Pbind( \spawnSerial, Pif(Ptime(inf) < Pfunc{~papaCentre.value}, Pseries(0,1,inf)), \nicSeries, Pfunc{ |e| Pfunc{~nicCentre.value} + (Pfunc{~nicSlope.value} * e.spawnSerial)}, \nicLength, Pfunc{ |e| rrand(e.nicSeries - Pfunc{~nicDev.value}, e.nicSeries + Pfunc{~nicDev.value}).max(0.01)}, \freqRandP, Pfunc{ |e| exprand(Pkey(\freqSeries) / (Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * e.spawnSerial + 1)), Pkey(\freqSeries) * (Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * e.spawnSerial + 1))).clip(10,22000)}, \freqRandN, Pfunc{ |e| exprand(Pkey(\freqSeries) / (Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * Pkey(\serial) + 1)), Pkey(\freqSeries) * (Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * Pkey(\serial) + 1))).clip(10,22000)}, \freqRand, Pif (Pfunc{~freqDevSwitcher.value} < 1, Pfunc{ |e| e.freqRandP}, Pfunc{ |e| e.freqRandN}), \freqGaussP, Pfunc{ |e| (Pgauss( Pkey(\freqSeries), (Pkey(\freqSeries)*(Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * e.spawnSerial))), inf)).clip(20,20000)}, \freqGaussN, Pfunc{ |e| (Pgauss( Pkey(\freqSeries), (Pkey(\freqSeries)*(Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * Pkey(\serial)))), inf)).clip(20,20000)}, \freqGauss, Pif (Pfunc{~freqDevSwitcher.value} < 1, Pfunc{ |e| e.freqGaussP}, Pfunc{ |e| e.freqGaussN}), \freqBrown, Pfunc{ |e| (Pbrown(Pkey(\freqSeries) / (Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * e.spawnSerial + 1)), Pkey(\freqSeries) * (Pfunc{~freqDev.value} + (Pfunc{~spawnFreqDevScaler.value} * e.spawnSerial + 1)), Pfunc{~freqStep.value}, inf)).clip(10,22000)}, \freqPatternRandUp, Pfunc{ |e| e.freqRand * (Pfunc{~papaFreqSlope.value} * e.spawnSerial +1)}, \freqPatternRandDown, Pfunc{ |e| e.freqRand / (Pfunc{~papaFreqSlope.value} * e.spawnSerial +1)}, \freqPatternRand, Pif (Pfunc{~papaFreqSlopeSwitch} > 0, Pfunc{ |e| e.freqPatternRandUp}, Pfunc{ |e| e.freqPatternRandDown}), \freqPatternGaussUp, Pfunc{ |e| e.freqGauss * (Pfunc{~papaFreqSlope.value} * e.spawnSerial +1)}, \freqPatternGaussDown, Pfunc{ |e| e.freqGauss / (Pfunc{~papaFreqSlope.value} * e.spawnSerial +1)}, \freqPatternGauss, Pif (Pfunc{~papaFreqSlopeSwitch} > 0, Pfunc{ |e| e.freqPatternGaussUp}, Pfunc{ |e| e.freqPatternGaussDown}), \freqPatternBrownUp, Pfunc{ |e| e.freqBrown * (Pfunc{~papaFreqSlope.value} * e.spawnSerial +1)}, \freqPatternBrownDown, Pfunc{ |e| e.freqBrown / (Pfunc{~papaFreqSlope.value} * e.spawnSerial +1)}, \freqPatternBrown, Pif (Pfunc{~papaFreqSlopeSwitch} > 0, Pfunc{ |e| e.freqPatternBrownUp}, Pfunc{ |e| e.freqPatternBrownDown}), \freqPattChoose, ~freqPop, \filterRandP, Pfunc{ |e| exprand(Pkey(\filterSeries) / (Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * e.spawnSerial + 1)), Pkey(\filterSeries) * (Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * e.spawnSerial + 1))).clip(20,20000)}, \filterRandN, Pfunc{ |e| exprand(Pkey(\filterSeries) / (Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * Pkey(\serial) + 1)), Pkey(\filterSeries) * (Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * Pkey(\serial) + 1))).clip(20,20000)}, \filterRand, Pif (Pfunc{~filterDevSwitcher.value} < 1, Pfunc{ |e| e.filterRandP}, Pfunc{ |e| e.filterRandN}), \filterGaussP, Pfunc{ |e| (Pgauss( Pkey(\filterSeries), (Pkey(\filterSeries)*(Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * e.spawnSerial))), inf)).clip(20,20000)}, \filterGaussN, Pfunc{ |e| (Pgauss( Pkey(\filterSeries), (Pkey(\filterSeries)*(Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * Pkey(\serial)))), inf)).clip(20,20000)}, \filterGauss, Pif (Pfunc{~filterDevSwitcher.value} < 1, Pfunc{ |e| e.filterGaussP}, Pfunc{ |e| e.filterGaussN}), \filterBrown, Pfunc{ |e| (Pbrown(Pkey(\filterSeries) / (Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * e.spawnSerial + 1)), Pkey(\filterSeries) * (Pfunc{~filterDev.value} + (Pfunc{~spawnFilterDevScaler.value} * e.spawnSerial + 1)), Pfunc{~filterStep.value}, inf)).clip(20,20000)}, \filterPatternRandUp, Pfunc{ |e| (e.filterRand * (Pfunc{~papaFilterSlope.value} * e.spawnSerial +1)).clip(20,20000)}, \filterPatternRandDown, Pfunc{ |e| (e.filterRand / (Pfunc{~papaFilterSlope.value} * e.spawnSerial +1)).clip(20,20000)}, \filterPatternRand, Pif (Pfunc{~papaFilterSlopeSwitch} > 0, Pfunc{ |e| e.filterPatternRandUp}, Pfunc{ |e| e.filterPatternRandDown}), \filterPatternGaussUp, Pfunc{ |e| (e.filterGauss * (Pfunc{~papaFilterSlope.value} * e.spawnSerial +1)).clip(20,20000)}, \filterPatternGaussDown, Pfunc{ |e| (e.filterGauss / (Pfunc{~papaFilterSlope.value} * e.spawnSerial +1)).clip(20,20000)}, \filterPatternGauss, Pif (Pfunc{~papaFilterSlopeSwitch} > 0, Pfunc{ |e| e.filterPatternGaussUp}, Pfunc{ |e| e.filterPatternGaussDown}), \filterPatternBrownUp, Pfunc{ |e| (e.filterBrown * (Pfunc{~papaFilterSlope.value} * e.spawnSerial +1)).clip(20,20000)}, \filterPatternBrownDown, Pfunc{ |e| (e.filterBrown / (Pfunc{~papaFilterSlope.value} * e.spawnSerial +1)).clip(20,20000)}, \filterPatternBrown, Pif (Pfunc{~papaFilterSlopeSwitch} > 0, Pfunc{ |e| e.filterPatternBrownUp}, Pfunc{ |e| e.filterPatternBrownDown}), \filterPattChoose, ~filterPop, \durRandP, Pfunc{ |e| rrand(Pkey(\durSeries) - (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * e.spawnSerial)), Pkey(\durSeries) + (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * e.spawnSerial))).max(0.001)}, \durRandN, Pfunc{ |e| rrand(Pkey(\durSeries) - (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * Pkey(\serial))), Pkey(\durSeries) + (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * Pkey(\serial)))).max(0.001)}, \durRand, Pif (Pfunc{~durDevSwitcher.value} < 1, Pfunc{ |e| e.durRandP}, Pfunc{ |e| e.durRandN}), \durGaussP, Pfunc{ |e| (Pgauss( Pkey(\durSeries), (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * e.spawnSerial)), inf )).max(0.001)}, \durGaussN, Pfunc{ |e| (Pgauss( Pkey(\durSeries), (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * Pkey(\serial))), inf )).max(0.001)}, \durGauss, Pif (Pfunc{~durDevSwitcher.value} < 1, Pfunc{ |e| e.durGaussP}, Pfunc{ |e| e.durGaussN}), \durBrown, Pfunc{ |e| (Pbrown( Pkey(\durSeries) - (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * e.spawnSerial)), Pkey(\durSeries) + (Pfunc{~durDev.value} + (Pfunc{~spawnDurDevScaler.value} * e.spawnSerial)), Pfunc{~durStep.value}, inf )).max(0.001)}, \durPatternRand, Pfunc{ |e| (e.durRand + (Pfunc{~papaDurSlope.value} * e.spawnSerial)).max(0.001)}, \durPatternBrown, Pfunc{ |e| (e.durBrown + (Pfunc{~papaDurSlope.value} * e.spawnSerial)).max(0.001)}, \durPatternGauss, Pfunc{ |e| (e.durGauss + (Pfunc{~papaDurSlope.value} * e.spawnSerial)).max(0.001)}, \durPattChoose, ~durPop, \densityRandP, Pfunc{ |e| rrand(Pkey(\densitySeries) - (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * e.spawnSerial)), Pkey(\densitySeries) + (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * e.spawnSerial))).max(0.001)}, \densityRandN, Pfunc{ |e| rrand(Pkey(\densitySeries) - (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * Pkey(\serial))), Pkey(\densitySeries) + (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * Pkey(\serial)))).max(0.001)}, \densityRand, Pif (Pfunc{~densityDevSwitcher.value} < 1, Pfunc{ |e| e.densityRandP}, Pfunc{ |e| e.densityRandN}), \densityGaussP, Pfunc{ |e| (Pgauss( Pkey(\densitySeries), (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * e.spawnSerial)), inf )).max(0.001)}, \densityGaussN, Pfunc{ |e| (Pgauss( Pkey(\densitySeries), (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * Pkey(\serial))), inf )).max(0.001)}, \densityGauss, Pif (Pfunc{~densityDevSwitcher.value} < 1, Pfunc{ |e| e.densityGaussP}, Pfunc{ |e| e.densityGaussN}), \densityBrown, Pfunc{ |e| (Pbrown( Pkey(\densitySeries) - (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * e.spawnSerial)), Pkey(\densitySeries) + (Pfunc{~densityDev.value} + (Pfunc{~spawnDensityDevScaler.value} * e.spawnSerial)), Pfunc{~densityStep.value}, inf )).max(0.001)}, \densityPatternRand, Pfunc{ |e| (e.densityRand + (Pfunc{~papaDensitySlope.value} * e.spawnSerial)).max(0.001)}, \densityPatternBrown, Pfunc{ |e| (e.densityBrown + (Pfunc{~papaDensitySlope.value} * e.spawnSerial)).max(0.001)}, \densityPatternGauss, Pfunc{ |e| (e.densityGauss + (Pfunc{~papaDensitySlope.value} * e.spawnSerial)).max(0.001)}, \densityPattChoose, ~densityPop, \ampRandP, Pfunc{ |e| rrand(Pkey(\ampSeries) - (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * e.spawnSerial)), Pkey(\ampSeries) + (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * e.spawnSerial))).clip(0,1)}, \ampRandN, Pfunc{ |e| rrand(Pkey(\ampSeries) - (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * Pkey(\serial))), Pkey(\ampSeries) + (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * Pkey(\serial)))).clip(0,1)}, \ampRand, Pif (Pfunc{~ampDevSwitcher.value} < 1, Pfunc{ |e| e.ampRandP}, Pfunc{ |e| e.ampRandN}), \ampGaussP, Pfunc{ |e| (Pgauss( Pkey(\ampSeries), (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * e.spawnSerial)), inf )).clip(0,1)}, \ampGaussN, Pfunc{ |e| (Pgauss( Pkey(\ampSeries), (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * Pkey(\serial))), inf )).clip(0,1)}, \ampGauss, Pif (Pfunc{~ampDevSwitcher.value} < 1, Pfunc{ |e| e.ampGaussP}, Pfunc{ |e| e.ampGaussN}), \ampBrown, Pfunc{ |e| (Pbrown( Pkey(\ampSeries) - (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * e.spawnSerial)), Pkey(\ampSeries) + (Pfunc{~ampDev.value} + (Pfunc{~spawnAmpDevScaler.value} * e.spawnSerial)), Pfunc{~ampStep.value}, inf )).clip(0,1)}, \ampPatternRand, Pfunc{ |e| (e.ampRand + (Pfunc{~papaAmpSlope.value} * e.spawnSerial)).clip(0,1)}, \ampPatternBrown, Pfunc{ |e| (e.ampBrown + (Pfunc{~papaAmpSlope.value} * e.spawnSerial)).clip(0,1)}, \ampPatternGauss, Pfunc{ |e| (e.ampGauss + (Pfunc{~papaAmpSlope.value} * e.spawnSerial)).clip(0,1)}, \ampPattChoose, ~ampPop, \panRandP, Pfunc{ |e| rrand(Pkey(\panSeries) - (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * e.spawnSerial)), Pkey(\panSeries) + (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * e.spawnSerial))).clip(-1,1)}, \panRandN, Pfunc{ |e| rrand(Pkey(\panSeries) - (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * Pkey(\serial))), Pkey(\panSeries) + (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * Pkey(\serial)))).clip(-1,1)}, \panRand, Pif (Pfunc{~panDevSwitcher.value} < 1, Pfunc{ |e| e.panRandP}, Pfunc{ |e| e.panRandN}), \panGaussP, Pfunc{ |e| (Pgauss( Pkey(\panSeries), (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * e.spawnSerial)), inf )).clip(-1,1)}, \panGaussN, Pfunc{ |e| (Pgauss( Pkey(\panSeries), (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * Pkey(\serial))), inf )).clip(-1,1)}, \panGauss, Pif (Pfunc{~panDevSwitcher.value} < 1, Pfunc{ |e| e.panGaussP}, Pfunc{ |e| e.panGaussN}), \panBrown, Pfunc{ |e| (Pbrown( Pkey(\panSeries) - (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * e.spawnSerial)), Pkey(\panSeries) + (Pfunc{~panDev.value} + (Pfunc{~spawnPanDevScaler.value} * e.spawnSerial)), Pfunc{~panStep.value}, inf )).clip(-1,1)}, \panPatternRand, Pfunc{ |e| (e.panRand + (Pfunc{~papaPanSlope.value} * e.spawnSerial)).clip(-1,1)}, \panPatternBrown, Pfunc{ |e| (e.panBrown + (Pfunc{~papaPanSlope.value} * e.spawnSerial)).clip(-1,1)}, \panPatternGauss, Pfunc{ |e| (e.panGauss + (Pfunc{~papaPanSlope.value} * e.spawnSerial)).clip(-1,1)}, \panPattChoose, ~panPop, \pattern, Pfunc { |e| Pbindf(p,\serialx, Pif(Ptime(inf) < e.nicLength, Pseries(0,1,inf)), \freq, e.freqPattChoose, \filter, e.filterPattChoose, \sustain, e.durPattChoose, \delta, e.densityPattChoose, \amp, e.ampPattChoose, \pan, e.panPattChoose )}, \spawnSeries, Pfunc{~spawnCentre.value} + (Pfunc{~spawnSlope.value} * Pkey(\spawnSerial)), \spawnRand, (Pwhite(Pkey(\spawnSeries) - Pfunc{~spawnDev.value}, Pkey(\spawnSeries) + Pfunc{~spawnDev.value}, inf)).max(0.01), \spawnGauss, (Pgauss(Pkey(\spawnSeries), Pfunc{~spawnDev.value}, inf)).max(0.01), \spawnBrown, (Pbrown(Pkey(\spawnSeries) - Pfunc{~spawnDev.value}, Pkey(\spawnSeries) + Pfunc{~spawnDev.value}, Pfunc{~spawnStep.value}, inf)).max(0.01), \delta, ~spawnPop, \method, \par) ); ) });