This GitLab instance reached the end of its service life. It won't be possible to create new users or projects.

Please read the deprecation notice for more information concerning the deprecation timeline

Visit migration.git.tu-berlin.de to import your old projects to the new GitLab platform 📥

Commit 715bb42d by Henrik von Coler

Added website!

parent 3df94581
#N canvas 684 393 988 854 10;
#X obj 495 743 waveguide_string~;
#X obj 559 770 dac~;
#X msg 7 305 pluck 1;
#X msg 70 306 pluck 0;
#X obj 8 209 metro 100;
#X obj 70 261 delay 1;
#X obj -16 130 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X floatatom 103 103 5 0 0 0 - - -, f 5;
#X obj 124 153 / 2;
#X obj 572 233 osc~;
#X obj 572 302 snapshot~;
#X obj 511 259 metro 10;
#X obj 511 216 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X msg 572 325 length \$1;
#X floatatom 572 196 5 0 0 0 - - -, f 5;
#X obj 306 284 osc~;
#X obj 306 353 snapshot~;
#X obj 240 300 metro 10;
#X obj 240 257 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X floatatom 306 253 5 0 0 0 - - -, f 5;
#X msg 306 376 lowpass \$1;
#X obj 306 330 +~ 0.9;
#X obj 306 307 *~ 0.1;
#X obj 784 306 osc~;
#X obj 784 375 snapshot~;
#X obj 717 316 metro 10;
#X obj 717 273 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X floatatom 784 281 5 0 0 0 - - -, f 5;
#X obj 784 329 *~ 0.1;
#X msg 784 398 gain \$1;
#X obj 572 279 +~ 3;
#X floatatom 511 295 5 0 0 0 - - -, f 5;
#X obj 784 352 +~ 0.8;
#X obj 572 256 *~ 0.2;
#X floatatom 864 283 5 0 0 0 - - -, f 5;
#X floatatom 374 282 5 0 0 0 - - -, f 5;
#X floatatom 378 309 5 0 0 0 - - -, f 5;
#X text 13 23 Test patch for the waveguide example;
#X text 1 39 - based on additional OSC externals (mrpeach \, iemnet)
;
#X text 456 164 LFO modulation of the string's length;
#X text 188 223 LFO modulation of the termination lowpass;
#X text 685 242 LFO modulation of the termination gain;
#X connect 0 1 1 0;
#X connect 0 2 1 1;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X connect 6 0 4 0;
#X connect 7 0 4 1;
#X connect 7 0 8 0;
#X connect 8 0 5 1;
#X connect 9 0 33 0;
#X connect 10 0 13 0;
#X connect 11 0 10 0;
#X connect 12 0 11 0;
#X connect 13 0 0 0;
#X connect 14 0 9 0;
#X connect 15 0 22 0;
#X connect 16 0 20 0;
#X connect 17 0 16 0;
#X connect 18 0 17 0;
#X connect 19 0 15 0;
#X connect 20 0 0 0;
#X connect 21 0 16 0;
#X connect 22 0 21 0;
#X connect 23 0 28 0;
#X connect 24 0 29 0;
#X connect 25 0 24 0;
#X connect 26 0 25 0;
#X connect 27 0 23 0;
#X connect 28 0 32 0;
#X connect 29 0 0 0;
#X connect 30 0 10 0;
#X connect 31 0 13 0;
#X connect 32 0 24 0;
#X connect 33 0 30 0;
#X connect 34 0 32 1;
#X connect 35 0 22 1;
#X connect 36 0 21 1;
// waveguide_input.dsp
//
// waveguide with excitation by input signal
//
// - one-pole lowpass termination
//
// Henrik von Coler
// 2020-11-19
import("all.lib");
// use '(pm.)l2s' to calculate number of samples
// from length in meters:
segment(maxLength,length) = waveguide(nMax,n)
with{
nMax = maxLength : l2s;
n = length : l2s/2;
};
// one lowpass terminator
fc = hslider("lowpass",1000,10,10000,1);
rt = rTermination(basicBlock,*(-1) : si.smooth(1.0-2*(fc/ma.SR)));
// one gain terminator with control
gain = hslider("gain",0.99,0,1,0.01);
lt = lTermination(*(-1)* gain,basicBlock);
// a simple allpass (Smith Paper)
s = hslider("s",0.9,0,0.9,0.01);
c = hslider("c",0.9,0,0.9,0.01);
allpass = _ <: *(s),(*(c):(+:_)~(*(-s))):_, mem*c:+;
// another allpass
g = hslider("g",0.9, 0,0.9,0.01);
allp = allpass_comb(2,1,g);
scatter = pm.basicBlock(allpass);
idString(length,pos,excite) = endChain(wg)
with{
nUp = length*pos;
nDown = length*(1-pos);
wg = chain(lt : segment(6,nUp) : out : in(excite) : scatter : segment(6,nDown) : rt); // waveguide chain
};
exc = select2(gain>0.9,1,0);
length = hslider("length",1,0.1,10,0.01):si.smoo;
process(in) = idString(length,0.15, in) <: _,_;
\ No newline at end of file
.. title: Faust: A Simple Envelope
.. slug: faust-a-simple-envelope
.. date: 2020-05-07 09:27:37 UTC
.. tags:
.. category: faust:faust
.. link:
.. description:
.. type: text
Temporal envelopes are essential for many sound synthesis
applications. Often, triggered envelopes are used,
which can be started by a single trigger value.
Faust offers a selection of useful envelopes in
the ``envelopes`` library.
The following example uses an attack-release envelope
with exponential trajectories which can be handy for
plucked sounds.
The output of the sinusoid with fixed frequency
is simply multiplied with the ``en.arfe()`` function.
Check the envelopes in the library list for more
information and other envelopes:
https://faust.grame.fr/doc/libraries/#en.asr
.. code:: cpp
// envelope.dsp
//
// A fixed frequency sine with
// a trigger and controllable release time.
//
// - mono (left channel only)
//
// Henrik von Coler
// 2020-05-07
import("stdfaust.lib");
// a simple trigger button
trigger = button("Trigger");
// a slider for the release time
release = hslider("Decay",0.5,0.01,5,0.01);
// generate a single sine and apply the arfe envelope
// the attack time is set to 0.01
process = os.osc(666) * 0.77 * en.arfe(0.01, release, 0,trigger) : _ ;
.. title: Faust: A Simple Envelope
.. slug: faust-a-simple-envelope
.. date: 2020-05-07 09:27:37 UTC
.. tags:
.. category: faust:introduction_2
.. link:
.. description:
.. type: text
Temporal envelopes are essential for many sound synthesis
applications. Often, triggered envelopes are used,
which can be started by a single trigger value.
Faust offers a selection of useful envelopes in
the ``envelopes`` library.
The following example uses an attack-release envelope
with exponential trajectories which can be handy for
plucked sounds.
The output of the sinusoid with fixed frequency
is simply multiplied with the ``en.arfe()`` function.
Check the envelopes in the library list for more
information and other envelopes:
https://faust.grame.fr/doc/libraries/#en.asr
.. code:: cpp
// envelope.dsp
//
// A fixed frequency sine with
// a trigger and controllable release time.
//
// - mono (left channel only)
//
// Henrik von Coler
// 2020-05-07
import("stdfaust.lib");
// a simple trigger button
trigger = button("Trigger");
// a slider for the release time
release = hslider("Decay",0.5,0.01,5,0.01);
// generate a single sine and apply the arfe envelope
// the attack time is set to 0.01
process = os.osc(666) * 0.77 * en.arfe(0.01, release, 0,trigger) : _ ;
.. title: Faust: Conditional Logic
.. slug: faust-conditional-logic
.. date: 2020-06-03 09:24:28 UTC
.. tags:
.. category: faust:faust
.. link:
.. description:
.. type: text
The ``select2()`` directive can be used as a
switch condition with two cases, as shown in
``switch_example.dsp``
.. code:: cpp
// switch_example.dsp
//
//
// Henrik von Coler
// 2020-05-28
import("all.lib");
// outputs 0 if x is greater 1
// and 1 if x is below 0
// 'l' is used as an implicit argument
sel(l,x) = select2((x>=0), 0, 1);
process = -0.1 : sel(2);
.. title: Faust: Conditional Logic
.. slug: faust-conditional-logic
.. date: 2020-06-03 09:24:28 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
Write your post here.
.. title: Faust: MIDI
.. slug: faust-midi
.. date: 2020-05-17 11:53:59 UTC
.. tags:
.. category: faust:faust
.. link:
.. description:
.. type: text
Using MIDI CC
-------------
Using MIDI in Faust requires only minor
additions to the code and compiler arguments.
For first steps it can be helpful to control single
synth parameters with MIDI controllers.
This can be configured via the UI elements.
The following example uses MIDI controller
number 48 to control the frequency of a sine wave
by adding ``[midi:ctrl 48]`` to the hslider parameters.
-----
.. code-block:: cpp
// midi-example.dsp
//
// Control a sine wave frequency with a MIDI controller.
//
// Henrik von Coler
// 2020-05-17
import("stdfaust.lib");
freq = hslider("frequency[midi:ctrl 48]",100,20,1000,0.1) : si.smoo;
process = os.osc(freq) <: _,_ ;
-----
CC 48 has been chosen since it is the first slider on the
AKAI APC mini.
If the controller numbers for other devices are not known,
they can be found using the PD patch ``reverse_midi.pd``.
-----
Compiling with MIDI
-------------------
In order to enable the MIDI functions,
the compiler needs to be called with an
additional flag ``-midi``:
::
$ faust2xxxx -midi midi_example.dsp
-----
This flag can also be combined with the ``-osc``
flag to make synths listen to both MIDI and OSC.
-----
Note Handling & Polyphony
-------------------------
Typical monophonic and polyphonic synth control
can be added to Faust programs by defining
and mapping three parameters:
- freq
- gain
- gate
When used like in the following example, they will be
linked to the parameters of MIDI note on and note off
events with a frequency and a velocity.
.. code-block:: cpp
// midi_trigger.dsp
//
// Henrik von Coler
// 2020-05-17
import("stdfaust.lib");
freq = nentry("freq",200,40,2000,0.01) : si.polySmooth(gate,0.999,2);
gain = nentry("gain",1,0,1,0.01) : si.polySmooth(gate,0.999,2);
gate = button("gate") : si.smoo;
process = vgroup("synth",os.sawtooth(freq)*gain*gate <: _,_);
-----
Compiling Polyphonic Code
-------------------------
::
$ faust2xxxx -midi -nvoices 12 midi_trigger.dsp
-----
MIDI on Linux
-------------
Faust programs use Jack MIDI,
whereas MIDI controllers usually
connect via ALSA MIDI.
In order to control the synth with
an external controller, a bridge is
nedded:
::
$ a2jmidi_bridge
The MIDI controller can now connect to the
``a2j_bridge`` input, which is then connected
to the synth input.
.. title: Faust: MIDI
.. slug: faust-midi
.. date: 2020-05-17 11:53:59 UTC
.. tags:
.. category: faust:faust
.. link:
.. description:
.. type: text
Using MIDI in Faust requires only minor
additions to the code and compiler arguments.
Using MIDI CC
-------------
MIDI control over single parameters
is configured via the UI elements.
The following example uses MIDI controller
number 48 to control the frequency of a sine wave
by adding ``[midi:ctrl 48]`` to the hslider parameters:
.. code-block:: cpp
// midi-example.dsp
//
// Control a sine wave frequency with a MIDI controller.
//
// Henrik von Coler
// 2020-05-17
import("stdfaust.lib");
freq = hslider("frequency[midi:ctrl 48]",100,20,1000,0.1) : si.smoo;
process = os.osc(freq) <: _,_ ;
Compiling with MIDI
-------------------
In order to enable the MIDI functions,
the compiler needs to be called with an
additional flag ``-midi``:
::
$ faust2xxxx -midi midi_example.dsp
-----
Note Handling & Polyphony
-------------------------
Typical monophonic and polyphonic synth control
can be added to Faust programs by defining
and mapping three parameters:
- freq
- gain
- gate
When used like in the following example, they will be
linked to the parameters of MIDI note on and note off
events with a frequency and a velocity.
.. code-block:: cpp
// midi-example.dsp
//
// Control a square wave oscillator with a MIDI controller.
//
// Compile with: faust2xxxx -midi -nvoices 12 midi_trigger.dsp
//
// (from: https://ccrma.stanford.edu/~rmichon/faustTutorials)
//
// Henrik von Coler
// 2020-05-17
import("stdfaust.lib");
freq = nentry("freq",200,40,2000,0.01) : si.polySmooth(gate,0.999,2);
gain = nentry("gain",1,0,1,0.01) : si.polySmooth(gate,0.999,2);
gate = button("gate") : si.smoo;
process = vgroup("synth",os.sawtooth(freq)*gain*gate <: _,_);
-----
Compiling Polyphonic Code
-------------------------
::
$ faust2xxxx -midi -nvoices 12 midi_trigger.dsp
-----
MIDI on Linux
-------------
Faust programs use Jack MIDI,
whereas MIDI controllers usually
connect via ALSA MIDI.
In order to control the synth with
an external controller, a bridge is
nedded:
::
$ a2jmidi_bridge
The MIDI controller can now connect to the
``a2j_bridge`` input, which is then connected
to the synth input.
.. title: Wavetable Oscillator with Phase Reset
.. slug: wavetable-oscillator-with-phase-reset
.. date: 2020-08-31 21:01:01 UTC
.. tags:
.. category: faust:faust
.. link:
.. description:
.. type: text
The Faust *oscillators.lib* comes with many different
implementations of oscillators for various waveforms.
At some point one might still need a behavior not included
and lower level approaches are necessary.
This example shows how to use a
phasor to read a wavetable with a
sine waveform.
This implementation has an additional
trigger input for resetting the phase
of the oscillator on each positive
zero crossing.
This can come handy in various applications,
especially for phase-sensitive transients,
as for example in kick drums.
The example is derived from Barkati et. al (2013) and part of the
`repository <https://gitlab.tubit.tu-berlin.de/henrikvoncoler/sound_synthesis_faust>`_:
.. code-block:: cpp
import("stdfaust.lib");
// some basic stuff
sr = SR;
twopi = 2.0*ma.PI;
// define the waveform in table
ts = 1<<16; // size = 65536 samples (max of unsigned short)
time = (+(1) ~ _ ) , 1 : - ;
sinewave = ((float(time) / float(ts)) * twopi) : sin;
phase = os.hs_phasor(ts,freq,trig);
// read from table
sin_osc( freq) = rdtable(ts ,sinewave , int(phase)) ;
// generate a one sample impulse from the gate
trig = pm.impulseExcitation(reset);
reset = button ("reset");
freq = hslider("freq", 100, 0, 16000, 0.00001);
// offset = hslider("offset", 0, 0, 1, 0.00001);
process = sin_osc(freq);
.. publication_list:: bibtex/oscillators.bib
:style: unsrt
.. title: Wavetable Oscillator with Phase Reset
.. slug: wavetable-oscillator-with-phase-reset
.. date: 2020-08-31 21:01:01 UTC
.. tags:
.. category: faust:faust
.. link:
.. description:
.. type: text
This example shows how to use a
phasor to read a wavetable with a
sine waveform.
This implementation has an additional
trigger input for resetting the phase
of the oscillator on each positive
zero crossing.
This can come handy in various applications,
especially for phase-sensitive transients,
as for example in kick drums.
The example is derived from Barkati et. al (2013) and part of the
`repository <https://gitlab.tubit.tu-berlin.de/henrikvoncoler/sound_synthesis_faust>`_:
.. code-block:: cpp
import("stdfaust.lib");
// some basic stuff
sr = SR;
twopi = 2.0*ma.PI;
// define the waveform in table
ts = 1<<16; // size = 65536 samples (max of unsigned short)
time = (+(1) ~ _ ) , 1 : - ;
sinewave = ((float(time) / float(ts)) * twopi) : sin;
phase = os.hs_phasor(ts,freq,trig);
// read from table
sin_osc( freq) = rdtable(ts ,sinewave , int(phase)) ;
// generate a one sample impulse from the gate
trig = pm.impulseExcitation(reset);
reset = button ("reset");
freq = hslider("freq", 100, 0, 16000, 0.00001);
// offset = hslider("offset", 0, 0, 1, 0.00001);
process = sin_osc(freq);
.. publication_list:: bibtex/oscillators.bib
:style: unsrt
.. title: Faust: Getting started with Windows
.. slug: faust-getting-started-with-windows
.. date: 2020-04-24 11:33:49 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
Write your post here.
.. title: Faust: OSC Control
.. slug: faust-osc-control
.. date: 2020-04-21 21:29:38 UTC
.. tags:
.. category: faust:introduction
.. link:
.. description:
.. type: text
For standalone standalone and embedded plugins,
OSC control can be a useful option.
Faust compiles with OSC functionality
with the ``-osc`` flag:
::
$ faust2jaqt -osc sine.dsp
Starting the program in the command line
gives information on the standard faust
OSC ports:
::
$ ./sine
Faust OSC version 1.22 - 'sine' is running on UDP ports 5510, 5511, 5512, sending on localhost
The running program can now be controlled through any
OSC sender, using the proper IP address, port and paths:
.. figure:: /images/Sound_Synthesis/sine_osc_example.png
:width: 500
.. title: Faust OSC Control
.. slug: faust-osc-control
.. date: 2020-04-21 21:29:38 UTC
.. tags:
.. category: faust:introduction
.. link:
.. description:
.. type: text
For standalone standalone and embedded plugins,
OSC control can be a useful option.
Faust compiles with OSC functionality
with the ``-osc`` flag:
::
$ faust2jaqt -osc sine.dsp
Starting the program in the command line
gives information on the standard faust
OSC ports:
::