/******************************************************************************************************//* Wesley Self, Assignment 3 */ /******************************************************************************************************/ /* This supercollider patch, "The Big Dirty Random Synth", is composed of 3 randomly generated synth lines steadily playing different note values in the same rhythm. Sliders control the frequency ranges of each of the lines, the loudness of each line, the "noisiness" of the first Sine lines, and the panning of the Sawtooth line. I used the Saw oscillator, brown and pink noise, and panner because I was trying to make a flexible synth that could sound at least mildly "cool" - not melodically pleasing. The 11 sliders are inputs for the "ControlIn" unit generators, which then are used to define the variables used as synth parameters (I now realize that this was pointless). The 3 separate instruments, referred to on the GUI window as quarter notes, eighth notes, and sixteenth notes, become such because of the ratio of the "nextTime" paramaters of the Spawn UGens, which is 1:2:4. The envelopes for the quarter note, eight note, and sixteenth note oscillators - e, e2, and e3 respectively, are inputs into the 'mul' parameters of the SinOsc, BrownNoise, PinkNoise, and Saw UGens, altering the amplitude of the signal; and the amp (for sin), bamp (brown noise), pamp(pink noise), amp2 (fast sine), bamp2 (brown noise of fast sine), pamp2 (pink noise of fast sine), and amp3 (saw) are inputs into the 2nd parameters of their EnvGen UGens, thus being multiplied by the already enveloped signals. ( var w, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; w = GUIWindow.new("Big Dirty Random Synth", Rect.newBy( 128, 64, 720, 391 )); s1 = SliderView.new( w, Rect.newBy( 22, 57, 128, 20 ), "SinFreq", 500, 60, 1000, 1, 'linear'); s2 = SliderView.new( w, Rect.newBy( 179, 56, 128, 20 ), "SinAmp", 0.15, 0, 1, 0.01, 'linear'); s3 = SliderView.new( w, Rect.newBy( 178, 105, 128, 20 ), "Brownsinamp", 0, 0, 0.4, 0.01, 'linear'); s4 = SliderView.new( w, Rect.newBy( 23, 104, 128, 20), "Pinksinamp", 0, 0, 0.4, 0.01, 'linear'); s6 = SliderView.new( w, Rect.newBy( 349, 53, 128, 20 ), "FSinFreq", 800, 60, 1000, 1, 'linear'); s7 = SliderView.new( w, Rect.newBy( 504, 52, 128, 20 ), "FSinAmp", 0.15, 0, 1, 0.01, 'linear'); s8 = SliderView.new( w, Rect.newBy( 352, 108, 128, 20 ), "FBrownAmp", 0, 0, 0.4, 0.01, 'linear'); s9 = SliderView.new( w, Rect.newBy( 504, 108, 128, 20), "FPinkAmp", 0, 0, 0.4, 0.01, 'linear'); s5 = SliderView.new( w, Rect.newBy( 203, 210, 128, 20 ), "SawAmp", 0.15, 0, 1, 0.01, 'linear'); s10 = SliderView.new( w, Rect.newBy( 355, 210, 128, 20 ), "SawFreq", 700, 80, 1000, 1, 'linear'); s11 = SliderView.new( w, Rect.newBy( 274, 263, 128, 20 ), "SawPan", 0.3, -1, 1, 0.1, 'linear'); StringView.new( w, Rect.newBy( 26, 78, 128, 20 ), "Frequency Range"); StringView.new( w, Rect.newBy( 180, 81, 128, 20 ), "Sin Amplitude"); StringView.new( w, Rect.newBy( 179, 133, 128, 20 ), "Add Noise"); StringView.new( w, Rect.newBy( 23, 135, 128, 20 ), "Add Fuzz"); StringView.new( w, Rect.newBy( 354, 80, 128, 20 ), "Fast Sine Frequency"); StringView.new( w, Rect.newBy( 504, 79, 128, 20 ), "Fast Sine Amplitude"); StringView.new( w, Rect.newBy( 506, 134, 128, 20 ), "Fast Sine Noise"); StringView.new( w, Rect.newBy( 351, 136, 128, 20 ), "Fast Sine Fuzz"); StringView.new( w, Rect.newBy( 81, 11, 153, 30 ), "Quarter Note Sine"); StringView.new( w, Rect.newBy( 396, 9, 162, 31 ), "Eight Note Sine"); StringView.new( w, Rect.newBy( 262, 168, 143, 29 ), "Sixteenth Note Sawtooth"); StringView.new( w, Rect.newBy( 355, 235, 128, 20 ), "Wave Frequency Range"); StringView.new( w, Rect.newBy( 203, 239, 128, 20 ), "Wave Amplitude"); StringView.new( w, Rect.newBy( 276, 292, 128, 20 ), "Pan"); { var freq, freq2, freq3, e, e2, e3, amp, amp2, amp3, pan, pamp, pamp2, bamp, bamp2; freq = ControlIn.kr(s1); amp = ControlIn.kr(s2); bamp = ControlIn.kr(s3); pamp = ControlIn.kr(s4); freq2 = ControlIn.kr(s6); amp2 = ControlIn.kr(s7); bamp2 = ControlIn.kr(s8); pamp2 = ControlIn.kr(s9); amp3 = ControlIn.kr(s5); freq3 = ControlIn.kr(s10); pan = ControlIn.kr(s11); e = Env.linen(0.02, 0.68, 0.3, 1); e2 = Env.linen(0.02, 0.3, 0.18, 1); e3 = Env.linen(0.02, 0.15, 0.08, 1); s = Spawn.ar({SinOsc.ar(freq.rand, 0, EnvGen.kr(e, amp)) + BrownNoise.ar(EnvGen.kr(e, pamp)) + PinkNoise.ar(EnvGen.kr(e, bamp)) }, 1, 1); p = Spawn.ar({SinOsc.ar(freq2.rand, 0, EnvGen.kr(e2, amp2)) + BrownNoise.ar(EnvGen.kr(e, pamp2)) + PinkNoise.ar(EnvGen.kr(e, bamp2)) }, 1, 0.5); q = Pan2.ar(Spawn.ar({Saw.ar(freq3.rand, EnvGen.kr(e3, amp3))}, 1, 0.25), pan); s + p + q }.scope; w.close; )