2020, LFSaw (interaction | music)
DSP function definitions for the FAUST dsp language inspired by SuperCollider functionality.
- faust-sc
sc = import("scUGens.lib")
process = sc.impulse(freq, phase) : _;
See SuperCollider reference for Impulse for details.
process = sc.lfsaw(freq, phase) : _;
See SuperCollider reference for LFsaw for details.
unipolar LFSaw
process = sc.lfsaw_uni(freq, phase) : _;
process = sc.sinosc(freq, phase)
See SuperCollider reference for SinOsc for details.
process = sc.lfpulse(freq, width, phase)
See SuperCollider reference for LFPulse for details.
process = sc.lftri(freq, phase)
See SuperCollider reference for LFTri for details.
process = sc.sc.pmosc(...);
See SuperCollider reference for PMOsc for details.
process = sc.sinoscfb(freq, feedback) : _;
See SuperCollider reference for SinOscFB for details.
SinOscFB with additional phase modulation input
process = sinoscfb_p(freq, phase, feedback) : _;
process = sc.sc.pmosc(...);
See SuperCollider reference for PMOsc for details.
process = sc.whitenoise(amp) : _;
See SuperCollider reference for WhiteNoise for details.
process = sc.pinknoise(amp) : _;
See SuperCollider reference for PinkNoise for details.
process = sc.dust(density) : _;
See SuperCollider reference for Dust for details.
process = sc.hasher(v) : _;
See SuperCollider reference for Hasher for details.
2-nd order butterworth filter
process = _ : sc.lpf(freq) : _;
See SuperCollider reference for LPF for details.
save modulo (SC style)
mod : ℝ 2 → ℝ +
process = sc.mod(a, b);
SC-style linear mapping. See SuperCollider reference for linlin for details.
process = _ : sc.linlin(0, 1, 4, 10) : _;
SC-style exponential mapping. See SuperCollider reference for linexp for details.
process = _ : sc.linexp(0, 1, 4, 10) : _;
SC-style exponential mapping. See SuperCollider reference for explin for details.
process = _ : sc.explin(1, 3, 4, 10) : _;
SC-style wrap2
a signal.
See SuperCollider reference for wrap2 for details.
process = _ : sc.wrap2(hi) : _;
SC-style wrap
a signal.
See SuperCollider reference for wrap for details.
process = _ : sc.wrap(lo, hi) : _;
SC-style clip2
a signal.
See SuperCollider reference for clip2 for details.
process = _ : sc.clip2(hi) : _;
SC-style clip
a signal.
See SuperCollider reference for clip for details.
process = _ : sc.clip(lo, hi) : _;
SC-style fold2
a signal.
See SuperCollider reference for fold2 for details.
process = _ : sc.fold2(hi) : _;
SC-style fold
a signal.
See SuperCollider reference for fold for details.
process = _ : sc.fold(lo, hi) : _;
SuperCollider Array:size
.
See SuperCollider reference for size for details.
process = sc.size_list((a, b, ...)) : N;
SuperCollider Array:wrapAt
.
See SuperCollider reference for wrapAt for details.
process = sc.wrapAt_list((a, b, ...), IDX) : _;
SuperCollider Array:at
.
See SuperCollider reference for at for details.
process = sc.at_list((a, b, ...), IDX) : _;
SuperCollider Array:rotate
.
See SuperCollider reference for rotate for details.
process = sc.rotate_list(list, AMOUNT) : si.bus(sc.size(list));
SuperCollider Array:rotate
for inputs.
See SuperCollider reference for rotate for details.
process = si.bus(N) : sc.rotate(N, AMOUNT) : si.bus(N);
SC-style drop
for lists (drop N left elements).
See SuperCollider reference for drop for details.
process = sc.drop_list(list, N) : si.bus(sc.size(list)-N);
SC-style keep
for lists (keep N left elements).
See SuperCollider reference for keep for details.
process = sc.keep_list(list, N) : si.bus(N);
SC-style reverse
for lists (reverse N left elements).
See SuperCollider reference for reverse for details.
process = sc.reverse_list(list) : si.bus(sc.size(list));
SC-style Trig
with 1-sample duration .
See SuperCollider reference for Trig for details.
SC-style Trig1
with 1-sample duration.
See SuperCollider reference for Trig1 for details.
SC-style Latch
.
See SuperCollider reference for Latch for details.
SC-style Gate
.
See SuperCollider reference for Gate for details.
an attempt at Demand-like functionality
See SuperCollider reference for Demand for details.
process = _ : sc.demand_1(f) : _;
like demand
but returning triggers
process = _ : sc.tdemand_1(f) : _;
shameless copy from this issue
1 for strictly rising, 0 otherwise.
process = _ : lf.strictRising : _
1 for strictly falling, 0 otherwise.
process = _ : lf.strictFalling : _
1 if signal changes, 0 otherwise.
process = _ : lf.changed : _;
1 for falling or unchanged, 0 otherwise.
process = _ : lf.falling : _;
1 for rising or unchanged, 0 otherwise.
process = _ : lf.rising : _;
1 for unchanged, 0 otherwise .
process = _ : lf.unchanged : _;
bitwise Not
process = 16: lf.bitNot;
unsigned left shift operator
process = _ : lf.left_shift(_);
unsigned right shift operator
process = _ : lf.right_shift(_);
///////////
A resettable phasor.
process = lf.phasor(freq, phase, reset, length) : _;
A hardsynced sine wave with phase offset.
process = lf.sineosc_s(freq, phase, sync) : _;
A function oscillator.
process = lf.funcosc(func, freq, phase, reset);
A turn a function (with one variable) into a waveform.
process = lf.func2waveform(function, size) : _,_;
an approximation of tanh
map from one value range to another
convert a stereo AB signal into a mid-side (MS) signal and vice-versa.
Rotate2 does an equal power rotation so it works well on stereo sounds.
It computes
xout = cos(angle) * xin + sin(angle) * yin;
yout = cos(angle) * yin - sin(angle) * xin;
where angle = pos * pi
, so that -1
becomes -pi
and +1
becomes +pi
.
An integer hash.
process = int(_): rnd.ihash : _;
A float hash of an arbitrary number (range doesn't matter), output between [0..1]
.
process = _: rnd.fhash : _;
generates random integer values in the range [0, 2147483647] at sample rate. Based on JMC's implementation of the Ran088: L'Ecuyer's 1996 three-component Tausworthe generator "taus88"
.
process = rnd.taus_rand(s1, s2, s3) : _;
with
s1 > 2
— (int) 1st seeds2 > 8
— (int) 2nd seeds3 > 16
— (int) 3rd seed
taus-rand
normed to a range [0..1]
process = rnd.taus_rand_normed(s1, s2, s3) : _;
with
s1 > 2
— (int) 1st seeds2 > 8
— (int) 2nd seeds3 > 16
— (int) 3rd seed
random values between [0..1]
given a single seed (based on taus_rand
).
process = rnd.rand1(1248245) : _;
random values between [-r_max..r_max]
.
process = rnd.rand2(1248245, 1) : _;
random values between [0..r_max]
.
process = rnd.rand(1248245, 1) : _;
random values between [r_min..r_max]
.
process = rnd.rrand(1248245, -1, 1) : _;
random values (int) between [0..r_max]
.
process = rnd.irand(1248245, 1) : _;
random values (int) between [-r_max..r_max]
.
process = rnd.irand2(1248245, 10) : _;
random values (int) between [r_min..r_max]
.
process = rnd.irrand(1248245, 5, 10) : _;
Though, most of the research that went into this repository is done in my spare time, it has also been partially funded by the RottingSounds (project AR 445-G24, awarded by the Austrian Science Fund (FWF)).
Please support me by listening to (and possibly purchasing) my music on bandcamp.