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 (internal network only) to import your old projects to the new GitLab platform 📥

Commit 6a1838ce by Henrik von Coler

Added Fourier example!

parent 2b15e3d6
// fourier_series.dsp
//
// Generate a square wave through Fourier series.
// - without control
//
// Henrik von Coler
// 2020-05-06
import("stdfaust.lib");
// define a fundamental frequency
f0 = 100;
// define the number of partials
n_partial = 50;
// partial function with one argument ()
partial(partIDX) = (4/ma.PI) * os.oscrs(f)*volume
// arguments
with {
f = f0 * (2*partIDX+1);
volume = 1/(2*partIDX+1);
};
// the processing function,
// running 50 partials parallel
// mono output
process = par(i, n_partial, partial(i)) :> +;
\ No newline at end of file
......@@ -3,7 +3,7 @@
// First example for Sound_Synthesis seminar.
//
// Henrik von Coler
// 2000-04-21
// 2020-04-21
......@@ -11,7 +11,7 @@ import("stdfaust.lib");
// input parameters with GUI elements
freq = hslider("frequency",100, 10, 1000, 0.001);
gain = hslider("gain",0, 0, 1, 0.001);
gain = hslider("gain",0.5, 0, 1, 0.001);
// a sine oscillator with controllable freuency and aplitude:
process = os.osc(freq)*gain;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment