View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

Triggerology






//using a wavetable as a way to trigger rhythms (sc2)
//jrh 99
(
var h, w, box, t, speed, level, autorange, decaya, freq;
v = Signal.newClear(512).sineFill(1.0/#[0]).normalize.asWavetable;
h = HarmonicsDialog.new(v);
w = GUIWindow.new("trigger wave", Rect.newBy(40,60,400,220));
WavetableView.new(w, Rect.newBy(32,15,215,146), v).hElastic.vElastic;
w.onClose = { Synth.stop };

speed = SliderView.new(w,                                       ////performance speed
                Rect.newBy(30, 170, 220, 30),
                nil, 3, 0, 10 , 0);

level = SliderView.new(w,                                       ////scans vertically through the waveform
                Rect.newBy(260, 15, 26, 146),
                nil, 0,-1, 1 ,0);

autorange = SliderView.new(w,                                   ////scanning extent 
                        Rect.newBy(305, 15, 30, 146),
                nil, 0, 0, 1 ,0);
                                                                        
decaya = SliderView.new(w,                                      ////performance speed
                Rect.newBy(260, 170, 120, 20),
                nil, 0.01, 0.001, 0.1, 0);

freq =  SliderView.new( w, Rect.newBy(339, 15, 30, 146), "nil", 400, 40, 1400, 0, 'linear');

t = 0.01;                                                               //// grain size



Synth.play({ var trig, auto, dec;
                auto = SinOsc.kr(0.1, 0,  autorange.kr, level.kr);              /// auto is the autopilot scans slowly through
                                                                                                /// the waveform
       trig = Osc.ar(v, speed.kr, 0, 1, 0); //// waveform as trigger
       trig = HPZ1.kr(trig > auto).abs;
      Decay.ar(trig, decaya.kr/speed.kr, Osc.ar(v, freq.kr, 0, 0.01)) //// waveform as sound
                });
                

h.close; w.close;
)
 







feel free to contribute
back to sc

Links to this Page