/usr/share/SuperCollider/HelpSource/Classes/Stepper.schelp is in supercollider-common 1:3.8.0~repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | class:: Stepper
summary:: Pulse counter.
related:: Classes/PulseCount
categories:: UGens>Triggers
Description::
Each trigger increments a counter which is output as a signal. The
counter wraps between code::min:: and
code::max:: .
classmethods::
method::ar, kr
argument::trig
The trigger. Trigger can be any signal. A trigger happens when
the signal changes from non-positive to positive.
argument::reset
Resets the counter to
code::resetval:: when
triggered.
argument::min
Minimum value of the counter.
argument::max
Maximum value of the counter.
argument::step
Step value each trigger. May be negative.
argument::resetval
Value to which the counter is reset when it receives a reset
trigger. If nil, then this is patched to
code::min:: .
Examples::
code::
SynthDef("help-Stepper",{ arg out=0;
Out.ar(out,
SinOsc.ar(
Stepper.kr(Impulse.kr(10), 0, 4, 16, 1) * 100,
0, 0.05
)
)
}).play;
SynthDef("help-Stepper",{ arg out=0;
Out.ar(out,
SinOsc.ar(
Stepper.kr(Impulse.kr(10), 0, 4, 16, -3) * 100,
0, 0.05
)
)
}).play;
SynthDef("help-Stepper",{ arg out=0;
Out.ar(out,
SinOsc.ar(
Stepper.kr(Impulse.kr(10), 0, 4, 16, 4) * 100,
0, 0.05
)
)
}).play;
///////////////////////////////////////////////////////////////////////////////////
//
// Using Stepper and BufRd for sequencing
//
s.boot;
s.sendMsg(\b_alloc, 10, 128);
m = #[0,3,5,7,10];
a = ({rrand(0,15)}.dup(16).degreeToKey(m) + 36).midicps;
s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
(
SynthDef(\stepper, {
var rate, clock, index, freq, ffreq, env, out, rev, lfo;
rate = MouseX.kr(1,5,1);
clock = Impulse.kr(rate);
env = Decay2.kr(clock, 0.002, 2.5);
index = Stepper.kr(clock, 0, 0, 15, 1, 0);
freq = BufRd.kr(1, 10, index, 1, 1);
freq = Lag2.kr(freq) + [0,0.3];
ffreq = MouseY.kr(80,1600,1) * (env * 4 + 2);
out = Mix.ar(LFPulse.ar(freq * [1, 3/2, 2], 0, 0.3));
out = RLPF.ar(out, ffreq, 0.3, env);
out = RLPF.ar(out, ffreq, 0.3, env);
out = out * 0.02;
// echo
out = CombL.ar(out, 1, 0.66/rate, 2, 0.8, out);
// reverb
rev = out;
5.do { rev = AllpassN.ar(rev, 0.05, {0.05.rand}.dup, rrand(1.5,2.0)) };
out = out + (0.3 * rev);
out = LeakDC.ar(out);
// flanger
lfo = SinOsc.kr(0.2, [0,0.5pi], 0.0024, 0.0025);
1.do { out = DelayL.ar(out, 0.1, lfo, 1, out) };
// slight bass emphasis
out = OnePole.ar(out, 0.9);
Out.ar(0, out);
}).add;
)
s.sendMsg(\s_new, \stepper, 1000, 0, 0);
a = ({rrand(0,15)}.dup(16).degreeToKey(m) + 38).midicps;
s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
a = a * 2.midiratio; // transpose up 2 semitones
s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
(
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 ];
s.performList(\sendMsg, \b_setn, 10, 0, a.size, a);
)
s.sendMsg(\n_free, 1000);
::
|