2 summary:: Pulse counter.
3 related:: Classes/PulseCount
4 categories:: UGens>Triggers
9 Each trigger increments a counter which is output as a signal. The
10 counter wraps between code::min:: and
20 The trigger. Trigger can be any signal. A trigger happens when
21 the signal changes from non-positive to positive.
33 Minimum value of the counter.
38 Maximum value of the counter.
43 Step value each trigger. May be negative.
48 Value to which the counter is reset when it receives a reset
49 trigger. If nil, then this is patched to
58 SynthDef("help-Stepper",{ arg out=0;
61 Stepper.kr(Impulse.kr(10), 0, 4, 16, 1) * 100,
67 SynthDef("help-Stepper",{ arg out=0;
70 Stepper.kr(Impulse.kr(10), 0, 4, 16, -3) * 100,
76 SynthDef("help-Stepper",{ arg out=0;
79 Stepper.kr(Impulse.kr(10), 0, 4, 16, 4) * 100,
86 ///////////////////////////////////////////////////////////////////////////////////
88 // Using Stepper and BufRd for sequencing
93 s.sendMsg(\b_alloc, 10, 128);
97 a = ({rrand(0,15)}.dup(16).degreeToKey(m) + 36).midicps;
98 s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
102 var rate, clock, index, freq, ffreq, env, out, rev, lfo;
104 rate = MouseX.kr(1,5,1);
105 clock = Impulse.kr(rate);
106 env = Decay2.kr(clock, 0.002, 2.5);
107 index = Stepper.kr(clock, 0, 0, 15, 1, 0);
108 freq = BufRd.kr(1, 10, index, 1, 1);
109 freq = Lag2.kr(freq) + [0,0.3];
110 ffreq = MouseY.kr(80,1600,1) * (env * 4 + 2);
111 out = Mix.ar(LFPulse.ar(freq * [1, 3/2, 2], 0, 0.3));
112 out = RLPF.ar(out, ffreq, 0.3, env);
113 out = RLPF.ar(out, ffreq, 0.3, env);
117 out = CombL.ar(out, 1, 0.66/rate, 2, 0.8, out);
121 5.do { rev = AllpassN.ar(rev, 0.05, {0.05.rand}.dup, rrand(1.5,2.0)) };
122 out = out + (0.3 * rev);
124 out = LeakDC.ar(out);
127 lfo = SinOsc.kr(0.2, [0,0.5pi], 0.0024, 0.0025);
128 1.do { out = DelayL.ar(out, 0.1, lfo, 1, out) };
130 // slight bass emphasis
131 out = OnePole.ar(out, 0.9);
138 s.sendMsg(\s_new, \stepper, 1000, 0, 0);
140 a = ({rrand(0,15)}.dup(16).degreeToKey(m) + 38).midicps;
141 s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
143 a = a * 2.midiratio; // transpose up 2 semitones
144 s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
148 a = [ 97.999, 195.998, 523.251, 466.164, 195.998, 233.082, 87.307, 391.995, 87.307, 261.626, 195.998, 77.782, 233.082, 195.998, 97.999, 155.563 ];
149 s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
152 s.sendMsg(\n_free, 1000);