2 summary:: Triggered linear ramp
3 categories:: UGens>Triggers
7 Starts a linear raise by rate/sec from zero when trig input crosses from
8 non-positive to positive.
18 triggers when trig input crosses from non-positive to positive.
29 // using sweep to modulate sine frequency
32 trig = Impulse.kr(MouseX.kr(0.5, 20, 1));
33 SinOsc.ar(Sweep.kr(trig, 700) + 500, 0, 0.2)
38 // using sweep to index into a buffer
39 b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
43 trig = Impulse.kr(MouseX.kr(0.5, 10, 1));
44 BufRd.ar(1, b, Sweep.ar(trig, BufSampleRate.ir(0)))
48 // backwards, variable offset
50 { var trig, pos, rate;
51 trig = Impulse.kr(MouseX.kr(0.5, 10, 1));
52 rate = BufSampleRate.ir(0);
53 pos = Sweep.ar(trig, rate.neg) + (BufFrames.ir(0) * LFNoise0.kr(0.2));
61 trig = Impulse.kr(MouseX.kr(0.5, 10, 1));
62 rate = Sweep.kr(trig, 2) + 0.5;
63 BufRd.ar(1, b, Sweep.ar(trig, BufSampleRate.ir(0) * rate))
71 Sweep can be used as a resettable link::Classes/Phasor:: or link::Classes/Line:: - one that can start, pause, resume and stop. To get a resettable link::Classes/XLine:: behavior change the code::linlin:: to code::linexp:: in the SynthDef below.
74 SynthDef(\lineReset, {|start= 0, end= 1, dur= 1, t_trig= 1, run= 1|
75 var phasor= (Sweep.ar(t_trig, 1/dur*run)).linlin(0, 1, start, end, \minmax);
77 Out.ar(0, SinOsc.ar(phasor, 0, 0.2));
80 a= Synth(\lineReset, [\start, 400, \end, 800, \dur, 2])
87 //shorter duration and downwards...
88 a= Synth(\lineReset, [\start, 1000, \end, 500, \dur, 0.5])