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
- Code Pool SC2 last edited on 5 April 2004 at 3:07 pm by max2-037.dialin.uni-hamburg.de
- enter. last edited on 29 January 2003 at 10:46 pm by 203.14.169.19
- Algorithmen Heute last edited on 24 June 2002 at 12:37 am by max2-068.dialin.uni-hamburg.de