@grame/faustwasm 0.0.56 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
package/package.json
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
declare name "Sinusoide";
|
|
2
|
+
declare author "Developpement Grame - CNCM par Elodie Rabibisoa et Romain Constant.";
|
|
3
|
+
|
|
4
|
+
import ("stdfaust.lib");
|
|
5
|
+
|
|
6
|
+
process = mode_switch : os.osc * 0.333 * volume <: sinus_reverb,_ : dry_wet <: limiter :>_ * on_off;
|
|
7
|
+
|
|
8
|
+
on_off = checkbox("[1]ON / OFF");
|
|
9
|
+
freq_slide = vslider("Slide [unit:Hz][acc:0 0 -10 0 10][hidden:1]", freq(5), freq(0), freq(10), 0.001) : si.smooth(0.998);
|
|
10
|
+
freq_scale = vslider("Radio [unit:Hz][acc:0 0 -10 0 10][hidden:1]", 1, 0, (N-1), 1);
|
|
11
|
+
volume = hslider("Volume [hidden:1][acc:1 0 -9 0 10]", 0.35, 0, 0.7, 0.001):si.smooth(0.991):min(1):max(0);
|
|
12
|
+
|
|
13
|
+
// Default mode = slide (0)
|
|
14
|
+
toggle_mode = checkbox("[0]SLIDE / SCALE");
|
|
15
|
+
mode_switch = select2(toggle_mode, freq_slide, scale);
|
|
16
|
+
|
|
17
|
+
//----------------- Frequencies --------------------//
|
|
18
|
+
N = 11;
|
|
19
|
+
scale = par(i, N, freq(i) * choice(i)) :>_;
|
|
20
|
+
choice(n) = abs(freq_scale - n) < 0.5;
|
|
21
|
+
|
|
22
|
+
freq(0) = 523.5;
|
|
23
|
+
freq(1) = 587.3;
|
|
24
|
+
freq(2) = 622.3;
|
|
25
|
+
freq(3) = 784;
|
|
26
|
+
freq(4) = 830.6;
|
|
27
|
+
freq(5) = 1046.5;
|
|
28
|
+
freq(6) = 1174.7;
|
|
29
|
+
freq(7) = 1244.5;
|
|
30
|
+
freq(8) = 1568;
|
|
31
|
+
freq(9) = 1661.2;
|
|
32
|
+
freq(10) = 2093;
|
|
33
|
+
|
|
34
|
+
//----------------- Limiter -----------------------//
|
|
35
|
+
limiter(x,y) = x*coeff,y*coeff
|
|
36
|
+
with {
|
|
37
|
+
epsilon = 1/(44100*1.0);
|
|
38
|
+
peak = max(abs(x),abs(y)) : max ~ -(epsilon);
|
|
39
|
+
coeff = 1.0/max(1.0,peak);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
//------------------ Reverb ----------------------//
|
|
43
|
+
sinus_reverb = _<: instrReverb :>_;
|
|
44
|
+
|
|
45
|
+
instrReverb = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) :
|
|
46
|
+
re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+
|
|
47
|
+
with {
|
|
48
|
+
reverbGain = 0.4;
|
|
49
|
+
roomSize = 2;
|
|
50
|
+
rdel = 20;
|
|
51
|
+
f1 = 200;
|
|
52
|
+
f2 = 6000;
|
|
53
|
+
t60dc = roomSize*3;
|
|
54
|
+
t60m = roomSize*2;
|
|
55
|
+
fsmax = 48000;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
dry_wet(x,y) = (x*c) + (y*(1-c)) with {
|
|
59
|
+
c = vslider("[1] Dry/Wet Mix [hidden:1][style:knob]", 1,0,1.0,0.01) : si.smoo;
|
|
60
|
+
};
|