( /* NB!!! 1. the "range" of sig2 has been adjusted from 1600 to 1000. if you want to fine tune it further, this is the 3rd (maxval) argument to the variable in4Args. 2. "reverb" in sig2 probably means comb decay time. this has been adjusted from 3secs to 2secs. a new variable (sig2DecayTime) has been added below for you to tweak at your leisure. 3. tweak the minval and maxval args in the variable in5Args1 to get the amplitude response that you want in sig3. because this is mapped in inverse proportion to the impulse frequency, minval should be a higher value than maxval. */ var maxAmp1, maxAmp3, maxAmp5, maxAmp6; var sig2DecayTime; var in1Args, in2Args, in3Args, in4Args, in5Args, in5Args1, in6Args, in7Args, in8Args, in3Args1; var w, amp1, amp2, amp3, amp5, amp6; var in, sig1, sig2, sig3, sig5, sig6; // peak amplitudes for each instrument (adjust these values until you get the right balance of signals) maxAmp1 = 0.2; //0.25; //maxAmp1 = 0.3; //0.25; //maxAmp2 = 24; //maxAmp4 = 0.5; //maxAmp2 = 24; //40//30; maxAmp3 = 0.05; //12; //maxAmp3 = 0.08; //12; in5Args maxAmp5 = 24; //60; //maxAmp5 = 24; //60; maxAmp6 = 12; // 20; //maxAmp6 = 12; // 20; // decay time of both comb filters in sig2 sig2DecayTime = 1; // set the effective ranges and response characteristics for each controller in the variables inArgs1-inArgs8 // parameters are midi chan, minval, maxval, warp, lag time // values from the orignal patches are listed in the comment lines // weather station 1: temperature; UNASSIGNED! - where do you want it? channel switching? in1Args = [1, 10, 2000, 'exponential', 1]; // weather station 1: solar radiation; mapped to sig1: centerFreq; args are (100, 8000, 'exponential', 0.1) in original in2Args = [2, 100, 8000, 'exponential', 1]; // weather station 1: wind direction; mapped to sig1: clockRate; args are (1, 200, 'exponential', 0.1) in original in3Args = [3, 1, 200, 'exponential', 1]; // weather station 1: INVERSE wind direction; mapped to sig2: amp3 - varies amplitude of signal; args are (1, 200, 'exponential', 0.1) in original in3Args1 = [3, 20, 1, 'exponential', 3]; // weather station 1: wind speed; mapped to sig2: src1; args are (2, 2000, 'exponential', 0.1) in original in4Args = [4, 2, 1000, 'exponential', 1]; // weather station 2: temperature; mapped to sig3: src; args are (10, 1000, 'exponential', 0.1) in original in5Args = [1, 10, 100, 'exponential', 1]; //[5, 10, 1000, 'exponential', 2] // set these values to map amplitude in sig3 in inverse proportion to impulse frequency in5Args1 = [1, 8, 4, 'exponential', 1]; // weather station 2: solar radiation; mapped to sig4: src; args are (10, 10000, 'exponential', 0.1) in original in6Args = [2, 10, 10000, 'exponential', 1]; // weather station 2: wind direction; mapped to sig5: src; args are (20, 200, 'linear', 0.1) in original in7Args = [3, 20, 160, 'linear', 1]; //in7Args = [7, 20, 200, 'linear', 2]; // weather station 2: wind speed; mapped to sig6: Impulse.ar(freq); args are (0.2, 2.0, 'linear', 0.1) in original in8Args = [4, 0.2, 2.0, 'linear', 1]; // GUI w = GUIWindow.new("mixer", Rect.newBy(632, 109, 179, 133)); amp1 = SliderView.new(w, Rect.newBy(20, 15, 16, 93), "SliderView", maxAmp1, 0, maxAmp1, 0.01, 'linear'); // amp in sig1 //amp2 = SliderView.new(w, Rect.newBy(45, 15, 16, 93), "SliderView", maxAmp2, 0, maxAmp2, 0.01, 'linear'); // amp in sig2 amp3 = SliderView.new(w, Rect.newBy(70, 15, 16, 93), "SliderView", maxAmp3, 0, maxAmp3, 0.01, 'linear'); // amp in sig3 //amp4 = SliderView.new(w, Rect.newBy(95, 15, 16, 93), "SliderView", maxAmp4, 0, maxAmp4, 0.01, 'linear'); // amp in sig4 amp5 = SliderView.new(w, Rect.newBy(120, 15, 16, 93), "SliderView", maxAmp5, 0, maxAmp5, 0.01, 'linear'); // amp in sig5 amp6 = SliderView.new(w, Rect.newBy(145, 15, 16, 93), "SliderView", maxAmp6, 0, maxAmp6, 0.01, 'linear'); // amp in sig6 // input in = { arg inArgs; MIDIPitchBend.kr(inArgs.at(0), inArgs.at(1), inArgs.at(2), inArgs.at(3), inArgs.at(4)); }; // input /* in = { arg inArgs; MIDIController.kr(inArgs.at(0), 7, inArgs.at(1), inArgs.at(2), inArgs.at(3), inArgs.at(4)); }; */ // synths sig1 = { var clockRate, clockTime, clock, centerFreq, freq, panPos, patch; clockRate = in.poll(in3Args); clockTime = clockRate.reciprocal; clock = Impulse.kr(clockRate, amp1.kr * in.poll(in2Args) / 8000); centerFreq = in.poll(in2Args); freq = Latch.kr(WhiteNoise.kr(centerFreq * 0.5, centerFreq), clock); panPos = Latch.kr(WhiteNoise.kr, clock); patch = CombN.ar( Pan2.ar( SinOsc.ar( freq, 0, Decay2.kr(clock, 0.1 * clockTime, 0.9 * clockTime) ), panPos ), 0.3, 0.3, 2 ); patch }; sig3 = { //weather station 2: temperature var fftsize, window, cosineTable, dur, src, out; fftsize = 512; // length of FFT buffer window = Signal.welchWindow(fftsize); // make a signal analysis/synthesis window cosineTable = Signal.fftCosTable(fftsize); // make cosine table required for FFT dur = fftsize/Synth.sampleRate; src = CombN.ar(Impulse.ar(in.poll(in5Args), in.poll(in5Args1)), dur, dur, 3, (amp3.kr * in.poll(in3Args1))); //in5Args // inverse transform out = IFFT.ar(fftsize, 0, cosineTable, nil, window, src, 0); out.real; }; sig5 = { // weather station 2: wind direction; var fftsize, window, cosineTable, src, out; fftsize = 512; // length of FFT buffer window = Signal.hanningWindow(fftsize); // make a signal analysis/synthesis window cosineTable = Signal.fftCosTable(fftsize); // make cosine table required for FFT src = Impulse.ar(in.poll(in7Args), amp5.kr * (in.poll(in2Args) / 8000)); out = IFFT.ar(fftsize, 0, cosineTable, nil, window, src, 0); // inverse transform out.real; // out }; sig6 = { var impulse, a, b, c, d, e, f; impulse = Impulse.ar(30, amp6.kr); a = IFFT.ar(64, 0, Signal.fftCosTable(64), nil, Signal.hanningWindow(64), impulse, 0); b = IFFT.ar(128, 0, Signal.fftCosTable(128), nil, Signal.hanningWindow(128), impulse, 0); c = IFFT.ar(256, 0, Signal.fftCosTable(256), nil, Signal.hanningWindow(256), impulse, 0); d = IFFT.ar(512, 0, Signal.fftCosTable(512), nil, Signal.hanningWindow(512), impulse, 0); e = IFFT.ar(1024, 0, Signal.fftCosTable(1024), nil, Signal.hanningWindow(1024), impulse, 0); f = IFFT.ar(2048, 0, Signal.fftCosTable(2048), nil, Signal.hanningWindow(2048), impulse, 0); TSpawn.ar({ var n, env; n = [a, b, c, d, e, f].choose; env = Env.linen(0.01, rrand(0.1, 2.0), 0.05, 1); // grain envelope EnvGen.ar(env, n.real); // out }, 1, nil, // no. of channels, no. of repeats Impulse.ar(in.poll(in8Args))); }; /* // 4 channels out { [ Mix.ar([sig1.value.at(0), sig1.value.at(1)]), Mix.ar([sig2.value.at(0), sig2.value.at(1)]), Mix.ar([sig3.value, sig4.value]), Mix.ar([sig5.value, sig6.value]) ] }.scope; // 8 channels out { [ sig2.value.at(0), sig1.value.at(1), sig2.value.at(1),sig6.value, //sig2.value.at(1), sig1.value.at(0), sig3.value, sig5.value, sig4.value ] }.scope; */ // stereo out {Mix.ar([sig1.value, sig3.value, sig5.value, sig6.value])}.play; w.close; )