soundfiles.lib
Soundfiles library. Its official prefix is so.
This library provides functions and abstractions to read, write, and manage audio files in Faust. It supports interpolation and looping controls for integration of recorded or pre-rendered audio in synthesis, effects, and compositional contexts.
The Soundfiles library is organized into 1 section:
References
Functions Reference
(so.)loop
Play a soundfile in a loop taking into account its sampling rate.
loop is a standard Faust function.
Usage
loop(sf, part) : si.bus(outputs(sf))
Where:
sf: the soundfilepart: the part in the soundfile list of sounds
Test
so = library("soundfiles.lib");
os = library("oscillators.lib");
sf = soundfile("sound[url:{'tests/assets/silence.wav'}]", 1);
loop_test = so.loop(sf, 0) + os.osc(110) * 0.001;
(so.)loop_speed
Play a soundfile in a loop taking into account its sampling rate, with speed control.
loop_speed is a standard Faust function.
Usage
loop_speed(sf, part, speed) : si.bus(outputs(sf))
Where:
sf: the soundfilepart: the part in the soundfile list of soundsspeed: the speed between 0 and n
Test
so = library("soundfiles.lib");
os = library("oscillators.lib");
sf = soundfile("sound[url:{'tests/assets/silence.wav'}]", 1);
loop_speed_test = so.loop_speed(sf, 0, hslider("loop_speed:speed", 1, 0, 2, 0.01)) + os.osc(110) * 0.001;
(so.)loop_speed_level
Play a soundfile in a loop taking into account its sampling rate, with speed and level controls.
loop_speed_level is a standard Faust function.
Usage
loop_speed_level(sf, part, speed, level) : si.bus(outputs(sf))
Where:
sf: the soundfilepart: the part in the soundfile list of soundsspeed: the speed between 0 and nlevel: the volume between 0 and n
Test
so = library("soundfiles.lib");
sf = soundfile("sound[url:{'tests/assets/silence.wav'}]", 1);
os = library("oscillators.lib");
loop_speed_level_test = so.loop_speed_level(
sf,
0,
hslider("loop_speed_level:speed", 1, 0, 2, 0.01),
hslider("loop_speed_level:level", 0.5, 0, 1, 0.01)
) + os.osc(110) * 0.001;
(so.)sound
Environment to handle a given sound of a soundfile: binds a soundfile
primitive and a part number once, and exposes the players as methods
(.loop, .loop_speed(speed), .loop_speed_level(speed, level),
.play(level, gate), .play_rev(level, gate),
.play_interp(ref, freq, level, gate, selector),
.play_alt(level, gate, ctrl)) — see the commented example at the end
of this file.
Usage
sample = sound(soundfile("[url:{'foo.wav'}]", 2), 0);
process = sample.loop;
Where:
sf: asoundfileprimitivepart: the part number in the soundfile list