Skip to content

tai-studio/faust-sc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

faust-sc

2020, LFSaw (interaction | music)

DSP function definitions for the FAUST dsp language inspired by the interface of SuperCollider functionality.


scUgens.lib

sc = import("scUGens.lib") 

Synthesis

hasher

process = sc.hasher(v) : _;

See Hasher (SuperCollider reference) for details.

impulse

process = sc.impulse(freq, phase) : _;

See Impulse (SuperCollider reference) for details.

lfsaw

process = sc.lfsaw(freq, phase) : _;

See LFsaw (SuperCollider reference) for details.

lfsaw_uni

unipolar LFSaw

process = sc.lfsaw_uni(freq, phase) : _;

sinosc

process = sc.sinosc(freq, phase)

See SinOsc (SuperCollider reference) for details.

lfpulse

process = sc.lfpulse(freq, width, phase)

See LFPulse (SuperCollider reference) for details.

lftri

process = sc.lftri(freq, phase)

See LFTri (SuperCollider reference) for details.

pmosc

process = sc.sc.pmosc(...);

See PMOsc (SuperCollider reference) for details.

sinoscfb

process = sc.sinoscfb(freq, feedback) : _;

See SinOscFB (SuperCollider reference) for details.

sinoscfb_p

SinOscFB with additional phase modulation input

process = sinoscfb_p(freq, phase, feedback) : _;

pmosc

process = sc.sc.pmosc(...);

See PMOsc (SuperCollider reference) for details.

Noise

whitenoise

process = sc.whitenoise(amp) : _;

See WhiteNoise (SuperCollider reference) for details.

pinknoise

process = sc.pinknoise(amp) : _;

See PinkNoise (SuperCollider reference) for details.

dust

process = sc.dust(density) : _;

See Dust (SuperCollider reference) for details.

Filter

lpf

2-nd order butterworth filter

process = _ : sc.lpf(freq) : _;

See LPF (SuperCollider reference) for details.

Tools

mod

save modulo (SC style)

mod : ℝ 2 → ℝ +

process = sc.mod(a, b);

linlin

SC-style linear mapping. See linlin (SuperCollider reference) for details.

process = _ : sc.linlin(0, 1, 4, 10) : _;

Array-methods for lists

size

SuperCollider Array:size. See size. (SuperCollider reference) for details.

process = sc.size((a, b, ...)) : N;

wrapAt

SuperCollider Array:wrapAt. See wrapAt. (SuperCollider reference) for details.

process = sc.wrapAt((a, b, ...), IDX) : _;

at

SuperCollider Array:at. See at. (SuperCollider reference) for details.

process = sc.at((a, b, ...), IDX) : _;

rotate

SuperCollider Array:rotate. See rotate. (SuperCollider reference) for details.

process = sc.rotate(list, AMOUNT) : si.bus(sc.size(list));

drop

SC-style drop for lists (drop N left elements). See drop. (SuperCollider reference) for details.

process = sc.drop(list, N) : si.bus(sc.size(list)-N);

keep

SC-style keep for lists (keep N left elements). See keep. (SuperCollider reference) for details.

process = sc.keep(list, N) : si.bus(N);

reverse

SC-style reverse for lists (reverse N left elements). See reverse. (SuperCollider reference) for details.

process = sc.reverse(list) : si.bus(sc.size(list));

Waveform manipulation

wrap2

SC-style wrap2 a signal. See wrap2 (SuperCollider reference) for details.

process = _ : sc.wrap2(hi) : _;

wrap

SC-style wrap a signal. See wrap (SuperCollider reference) for details.

process = _ : sc.wrap(lo, hi) : _;

clip2

SC-style clip2 a signal. See clip2 (SuperCollider reference) for details.

process = _ : sc.clip2(hi) : _;

clip

SC-style clip a signal. See clip (SuperCollider reference) for details.

process = _ : sc.clip(lo, hi) : _;

fold

SC-style fold a signal. See fold (SuperCollider reference) for details.

process = _ : sc.fold(lo, hi) : _;

fold2

SC-style fold2 a signal. See fold2 (SuperCollider reference) for details.

process = _ : sc.fold2(hi) : _;

Triggers and gates

trig_1

SC-style Trig with 1-sample duration . See Trig (SuperCollider reference) for details.

trig1_1

SC-style Trig1 with 1-sample duration. See Trig1 (SuperCollider reference) for details.

latch

SC-style Latch. See Latch (SuperCollider reference) for details.

gate

SC-style Gate. See Gate (SuperCollider reference) for details.

Demand-like

demand_1

an attempt at Demand-like functionality See Demand (SuperCollider reference) for details.

process = _ : sc.demand_1(f) : _;

tdemand_1

like demand but returning triggers

process = _ : sc.tdemand_1(f) : _;

taiStudio.lib

Signal tools

shameless copy from this issue

strictRising

1 for strictly rising, 0 otherwise.

process = _ : lf.strictRising : _

strictFalling

1 for strictly falling, 0 otherwise.

process = _ : lf.strictFalling : _

changed

1 if signal changes, 0 otherwise.

process = _ : lf.changed : _;

falling

1 for falling or unchanged, 0 otherwise.

process = _ : lf.falling : _;

rising

1 for rising or unchanged, 0 otherwise.

process = _ : lf.rising : _;

unchanged

1 for unchanged, 0 otherwise .

process = _ : lf.unchanged : _;

bit operations

bitNot

bitwise Not

process = 16: lf.bitNot;

left_shift

unsigned left shift operator

process = _ : lf.left_shift(_);

right_shift

unsigned right shift operator

process = _ : lf.right_shift(_);

///////////

Synthesis

phasor

A resettable phasor.

process = lf.phasor(freq, phase, reset, length) : _;

sineosc_s

A hardsynced sine wave with phase offset.

process = lf.sineosc_s(freq, phase, sync) : _;

funcosc

A function oscillator.

process = lf.funcosc(func, freq, phase, reset);

func2waveform

A turn a function (with one variable) into a waveform.

process = lf.func2waveform(function, size) : _,_;

taiRand.lib

Hashing

ihash

An integer hash.

process = int(_): rnd.ihash : _;

fhash

A float hash of an arbitrary number (range doesn't matter), output between [0..1].

process = _: rnd.fhash : _;

Audio-rate random generators

taus_rand

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 seed
  • s2 > 8 — (int) 2nd seed
  • s3 > 16 — (int) 3rd seed

taus_rand_normed

taus-rand normed to a range [0..1]

process = rnd.taus_rand_normed(s1, s2, s3) : _;

with

  • s1 > 2 — (int) 1st seed
  • s2 > 8 — (int) 2nd seed
  • s3 > 16 — (int) 3rd seed

rand1

random values between [0..1] given a single seed (based on taus_rand).

process = rnd.rand1(1248245) : _;

rand2

random values between [-r_max..r_max].

process = rnd.rand2(1248245, 1) : _;

rand

random values between [0..r_max].

process = rnd.rand(1248245, 1) : _;

rrand

random values between [r_min..r_max].

process = rnd.rrand(1248245, -1, 1) : _;

irand

random values (int) between [0..r_max].

process = rnd.irand(1248245, 1) : _;

irand2

random values (int) between [-r_max..r_max].

process = rnd.irand2(1248245, 10) : _;

irrand

random values (int) between [r_min..r_max].

process = rnd.irrand(1248245, 5, 10) : _;

Acknowledgements and Support

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.

ko-fi

About

dsp objects with a supercollider-like interface

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages