e403e4ed93a192f8f99ad6646711a19b49627716
[Faustine.git] / interpretor / faust-0.9.47mr3 / examples / tester.dsp
1 declare name "tester";
2 declare version "1.0";
3 declare author "Grame";
4 declare license "BSD";
5 declare copyright "(c)GRAME 2006";
6
7 //-----------------------------------------------
8 // Tester : tests louspeakers
9 // Send a test signal( sine, noise, pink) to one
10 // of 8 loudspeakers
11 //-----------------------------------------------
12
13 import("music.lib");
14
15 pink = f : (+ ~ g) with {
16 f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x'';
17 g(x) = 1.80116083982126*x - 0.80257737639225*x';
18 };
19
20
21 // User interface
22 //----------------
23 smooth(c) = *(1-c) : +~*(c);
24 vol = hslider("[2] volume [unit:dB]", -96, -96, 0, 1): db2linear : smooth(0.999);
25 freq = hslider("[1] freq [unit:Hz]", 1000, 10, 20000, 1);
26 dest = hslider("[3] destination", 0, 0, 8, 1);
27
28 testsignal = osci(freq)*checkbox("sine wave")
29 + noise * checkbox("white noise")
30 + pink(noise) * db2linear(20) * checkbox("pink noise");
31
32 process = vgroup( "Audio Tester",
33 testsignal*vol
34 <: par(i, 8, *(dest==i))
35 );
36