Faust waveshaper
-
Hello everyone
Here is a faust question.
I could not run the code below to process with the waveshape equation after peak eq. The output is stereo. What am I missing?
import("stdfaust.lib"); grp (x) = tgroup("", x); grp_prefltr (x) = grp(hgroup("WaveShaper", x)); preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01)); preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01)); preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01)); drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01)); shaper(x,drive) = ma.tanh(10 * drive * x); process = _,_ : par(i, 2, // Pre EQ fi.peak_eq(preUpGain,preUpFreq,preUpQ) : // Distortion shaper ) ;
-
@JulesV said in Faust waveshaper:
import("stdfaust.lib");
grp (x) = tgroup("", x);
grp_prefltr (x) = grp(hgroup("WaveShaper", x));
preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01));
preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01));
preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01));
drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01));shaper(x,drive) = ma.tanh(10 * drive * x);
process = , :
par(i, 2,// Pre EQ fi.peak_eq(preUpGain,preUpFreq,preUpQ) : // Distortion shaper
)
;not so sure, but would that help you ?
fi.peak is mono, i GUESS
import("stdfaust.lib"); grp (x) = tgroup("", x); grp_prefltr (x) = grp(hgroup("WaveShaper", x)); preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01)); preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01)); preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01)); drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01)); shaper(x,drive) = ma.tanh(10 * drive * x); process = _,_ :> par(i, 2, // Pre EQ fi.peak_eq(preUpGain,preUpFreq,preUpQ) <: shaper ) ;
-
fi.peak_eq passes 3 parameters. Lfx,fx,B. fi.peak_eq(Lfx,fx,B);
Lfx: level (dB) at fx (boost Lfx>0 or cut Lfx<0)
fx: peak frequency (Hz)
B: bandwidth (B) of peak in HzYou didn't define them.
-
@Ben-Catman Thanks for the suggestion. But it didn't work. Also I am using the filter in an array or 2 channels.
-
i tried it myself and with my solution above the waveshaper works, but not the filter. sorry , i am quite sick , so i cant check it on my pc yet
-
@DabDab said in Faust waveshaper:
fi.peak_eq passes 3 parameters. Lfx,fx,B. fi.peak_eq(Lfx,fx,B);
Lfx: level (dB) at fx (boost Lfx>0 or cut Lfx<0)
fx: peak frequency (Hz)
B: bandwidth (B) of peak in HzYou didn't define them.
Yes I've already defined them, if you look further down the code you can see it. :)
fi.peak_eq(preUpGain,preUpFreq,preUpQ)
-
import("stdfaust.lib"); grp (x) = tgroup("PeakEQ", x); //grp_prefltr (x) = grp(hgroup("WaveShaper", x)); //preUpGain = grp_prefltr(vslider("Up Gain [style:knob] [unit:dB]", 0.0, -18.0, 18.0, 0.01)); //preUpFreq = grp_prefltr(vslider("Up Freq [style:knob] [unit:Hz]", 18000.0, 25.0, 20000.0, 0.01)); //preUpQ = grp_prefltr(vslider("Up Q [style:knob] [unit:]", 1.0, 0.1, 8, 0.01)); //drive = grp_prefltr(vslider("Drive [style:knob] [unit:]", 0.5, 0.01, 1, 0.01)); //shaper(x,drive) = ma.tanh(10 * drive * x); B = hslider ( "Level[style:knob]", 0,0,1,0.01); Lfx = hslider ( "BandWidth[style:knob]", 20,0,50,0.1); fx = hslider ( "PeakFreq[style:knob]", 1500,150,2500,1); process = fi.peak_eq(Lfx,fx,B),fi.peak_eq(Lfx,fx,B);
I have bypassed Waveshaper. Only Filter. Just a basic example. Now you can mod/add more math functions.
-
@DabDab @Ben-Catman Thank you so much