_id
stringlengths
64
64
repository
stringlengths
7
61
name
stringlengths
5
45
content
stringlengths
0
943k
download_url
stringlengths
94
213
language
stringclasses
1 value
comments
stringlengths
0
20.9k
code
stringlengths
0
943k
646c4a929abfbbdf34e1e19d55ad66fdbb66e503448998de33b7c7801f1d9a50
RuolunWeng/ruolunweng.github.io
STunedBar3.dsp
declare name "Three Rack Tuned Bars"; declare author "ER";//From "Tuned Bar" by Romain Michon ([email protected]); /* =========== DESCRIPTION ============= - Three rack tuned bars - Head = Silence/Resonance - Tilt = High frequencies - Front = High + Medium frequencies - Bottom = High + Medium + Low frequencies */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = vgroup("tunedBars",hgroup("[1]",par(i, 3, onerack(i,i,i))):>_); onerack(d,n,e) = hgroup("bar %n", par(i, 5, tunedBar(d,i,e))); tunedBar(d,n,e) = ((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i,freqqy(n,e),gate(d,n))~_)):> + : //Signal Scaling and stereo *(4); //==================== GUI SPECIFICATION ================ gain = 0.8; gate(d,n) = position(d,n) : upfront; position(d,n) = abs(hand(d) - n) < 0.5; upfront(x) = x>x'; hand(0) = vslider("Instrument Hand 0 [acc:1 0 -10 0 14]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); hand(1) = vslider("Instrument Hand 1 [acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); hand(2) = vslider("Instrument Hand 2 [acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); select = 1; //----------------------- Frequency Table -------------------- freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; freqqy(d,e) = freq(d+e*5); //==================== MODAL PARAMETERS ================ preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; //delay lengths in number of samples delayLength(x,f) = delayLengthBase(f)/modes(preset,x); //delay lines delayLine(x,f) = de.delay(4096,delayLength(x,f)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/STunedBar3.dsp
faust
From "Tuned Bar" by Romain Michon ([email protected]); =========== DESCRIPTION ============= - Three rack tuned bars - Head = Silence/Resonance - Tilt = High frequencies - Front = High + Medium frequencies - Bottom = High + Medium + Low frequencies ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up Signal Scaling and stereo ==================== GUI SPECIFICATION ================ ----------------------- Frequency Table -------------------- ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used delay lengths in number of samples delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) ----------------------- Algorithm implementation ---------------------------- One resonance
declare name "Three Rack Tuned Bars"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("tunedBars",hgroup("[1]",par(i, 3, onerack(i,i,i))):>_); onerack(d,n,e) = hgroup("bar %n", par(i, 5, tunedBar(d,i,e))); tunedBar(d,n,e) = ((select-1)*-1) <: par(i,nModes,(resonance(i,freqqy(n,e),gate(d,n))~_)):> + : *(4); gain = 0.8; gate(d,n) = position(d,n) : upfront; position(d,n) = abs(hand(d) - n) < 0.5; upfront(x) = x>x'; hand(0) = vslider("Instrument Hand 0 [acc:1 0 -10 0 14]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); hand(1) = vslider("Instrument Hand 1 [acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); hand(2) = vslider("Instrument Hand 2 [acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); select = 1; freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; freqqy(d,e) = freq(d+e*5); preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; delayLength(x,f) = delayLengthBase(f)/modes(preset,x); delayLine(x,f) = de.delay(4096,delayLength(x,f)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
44c1e73f703349ecd1447528aeafa1a6e3f3dc96d87c2330ceaf66941c4b85db
RuolunWeng/ruolunweng.github.io
SCMajTunedBars.dsp
declare name "C Major Tuned Bars"; declare author "ER";//From "Tuned Bar" by Romain Michon ([email protected]); import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - C Major tuned bars - Left = Low frequencies + slow rhythm/Silence - Right = High frequencies + fast rhythm */ //==================== INSTRUMENT ======================= process = par(i, N, tunedBar(i)):>_; tunedBar(n) = ((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i,freq(n),gate(n))~_)) :> + : //Signal Scaling and stereo *(4); //==================== GUI SPECIFICATION ================ N = 24; gain = 0.8; gate(n) = position(n) : upfront; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); B = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int; position(n) = abs(hand - n) < 0.5; upfront(x) = x>x'; select = 1; nMode(2) = 4; //-------------------- Frequency Table ------------------ freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 174.61; freq(4) = 195.99; freq(5) = 220.00; freq(6) = 246.94; freq(d) = freq(d-7)*2; //==================== MODAL PARAMETERS ================ preset = 2; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; //delay lengths in number of samples delayLength(x,f) = delayLengthBase(f)/modes(preset,x); //delay lines delayLine(x,f) = de.delay(4096,delayLength(x,f)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SCMajTunedBars.dsp
faust
From "Tuned Bar" by Romain Michon ([email protected]); =============== DESCRIPTION ================= : - C Major tuned bars - Left = Low frequencies + slow rhythm/Silence - Right = High frequencies + fast rhythm ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up Signal Scaling and stereo ==================== GUI SPECIFICATION ================ -------------------- Frequency Table ------------------ ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used delay lengths in number of samples delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) ----------------------- Algorithm implementation ---------------------------- One resonance
declare name "C Major Tuned Bars"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = par(i, N, tunedBar(i)):>_; tunedBar(n) = ((select-1)*-1) <: par(i,nModes,(resonance(i,freq(n),gate(n))~_)) :> + : *(4); N = 24; gain = 0.8; gate(n) = position(n) : upfront; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); B = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int; position(n) = abs(hand - n) < 0.5; upfront(x) = x>x'; select = 1; nMode(2) = 4; freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 174.61; freq(4) = 195.99; freq(5) = 220.00; freq(6) = 246.94; freq(d) = freq(d-7)*2; preset = 2; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; delayLength(x,f) = delayLengthBase(f)/modes(preset,x); delayLine(x,f) = de.delay(4096,delayLength(x,f)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
6905e6c0215e45affb3e09a30164c70f591d3392ffd1d68587862f4c96a55153
RuolunWeng/ruolunweng.github.io
SChromaticTunedBars.dsp
declare name "Chromatic Tuned Bars"; declare author "ER";//From "Tuned Bar" by Romain Michon ([email protected]); import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Chromatic tuned bars - Left = Low frequencies + slow rhythm/Silence - Right = High frequencies + fast rhythm */ //==================== INSTRUMENT ======================= process = par(i, N, tunedBar(i)):> fi.lowpass(1,5000); tunedBar(n) = ((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i,freq(n),gate(n))~_)):> + : //Signal Scaling and stereo *(4); //==================== GUI SPECIFICATION ================ N = 24; gain = 0.8; gate(n) = position(n) : upfront; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); B = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int; position(n) = abs(hand - n) < 0.5; upfront(x) = x>x'; select = 1; //-------------------- Frequency Table ------------------ freq(0) = 130.81; freq(1) = 138.59; freq(2) = 146.83; freq(3) = 155.56; freq(4) = 164.81; freq(5) = 174.61; freq(6) = 184.99; freq(7) = 195.99; freq(8) = 207.65; freq(9) = 220.00; freq(10) = 233.08; freq(11) = 246.94; //freq(12) = 261.62; freq(d) = freq(d-12)*2; //==================== MODAL PARAMETERS ================ preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; //delay lengths in number of samples delayLength(x,f) = delayLengthBase(f)/modes(preset,x); //delay lines delayLine(x,f) = de.delay(4096,delayLength(x,f)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SChromaticTunedBars.dsp
faust
From "Tuned Bar" by Romain Michon ([email protected]); =============== DESCRIPTION ================= : - Chromatic tuned bars - Left = Low frequencies + slow rhythm/Silence - Right = High frequencies + fast rhythm ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up Signal Scaling and stereo ==================== GUI SPECIFICATION ================ -------------------- Frequency Table ------------------ freq(12) = 261.62; ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used delay lengths in number of samples delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) ----------------------- Algorithm implementation ---------------------------- One resonance
declare name "Chromatic Tuned Bars"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = par(i, N, tunedBar(i)):> fi.lowpass(1,5000); tunedBar(n) = ((select-1)*-1) <: par(i,nModes,(resonance(i,freq(n),gate(n))~_)):> + : *(4); N = 24; gain = 0.8; gate(n) = position(n) : upfront; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); B = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int; position(n) = abs(hand - n) < 0.5; upfront(x) = x>x'; select = 1; freq(0) = 130.81; freq(1) = 138.59; freq(2) = 146.83; freq(3) = 155.56; freq(4) = 164.81; freq(5) = 174.61; freq(6) = 184.99; freq(7) = 195.99; freq(8) = 207.65; freq(9) = 220.00; freq(10) = 233.08; freq(11) = 246.94; freq(d) = freq(d-12)*2; preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; delayLength(x,f) = delayLengthBase(f)/modes(preset,x); delayLine(x,f) = de.delay(4096,delayLength(x,f)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
e4ddabc6cbab58e12149def6d65e05f0bb20b7fba0f4064d9b85815337d72e58
RuolunWeng/ruolunweng.github.io
SPentatonicFlute.dsp
declare name "Pentatonic Flute"; declare description "Nonlinear WaveGuide Flute"; declare author "ER";// Adapted from "Flute" by Romain Michon ([email protected]); /* =============== DESCRIPTION ================= : - Pentatonic flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Front = long notes - Back = short notes */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = par(i, N, flute(i)):>_; //==================== GUI SPECIFICATION ================ vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; //-------------------- Non-Variable Parameters ----------- N = 14; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; //----------------------- Frequency Table -------------------- freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; //Global envelope env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; //Vibrato Envelope vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 7, 0, N, 1):int: ba.automat(bps, 15, 0.0)// => gate with { bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SPentatonicFlute.dsp
faust
Adapted from "Flute" by Romain Michon ([email protected]); =============== DESCRIPTION ================= : - Pentatonic flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Front = long notes - Back = short notes ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ -------------------- Non-Variable Parameters ----------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope ------------------------- Enveloppe Trigger -------------------------------------------- => gate
declare name "Pentatonic Flute"; declare description "Nonlinear WaveGuide Flute"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = par(i, N, flute(i)):>_; vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; N = 14; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; with { bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; };
7cd40b90b8d9ab0c71fde62971afd9cd25e0c41a1d12548aa9795cf68d8421ca
RuolunWeng/ruolunweng.github.io
SPentatonicBlowBottle.dsp
declare name "Pentatonic BlowBottle"; declare author "ER";//Adapted from Blow Bottle by Romain Michon ([email protected]); /* =========== DESCRITPION ============= - Pentatonic Blow Bottles - Left = Low frequencies/ Silence/ Slow rhythm - Right = High frequencies/ Fast rhythm - Front = Long notes - Back = Short notes */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>*(2)); blow(n)= //differential pressure (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(n),_)~_: !,_: //signal scaling fi.dcblocker*envelopeG(trigger(n))*(0.5) with { baPaF(n) = bandPassFilter(freq(n)); }; //==================== GUI SPECIFICATION ================ N = 15; position(n) = abs(hand - n) < 0.5; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 8, 0, N, 1) : si.smooth(0.999) : min(24) : max(0) :int: ba.automat(bps, 15, 0.0) with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; //--------------------- Non-variable Parameters ------------- gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.05; //----------------------- Frequency Table -------------------- freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 195.99; freq(4) = 220.00; freq(d) = freq(d-5)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //botlle radius bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); //----------------------- Algorithm implementation ---------------------------- //global envelope is of type attack - decay - sustain - release envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); //pressure envelope is also ADSR envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); //vibrato vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); //breat pressure breathPressure(t) = envelope(t) + vibrato(t); //breath no.noise randPressure(t) = noiseGain*no.noise*breathPressure(t) ; //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.2, 0.01)*44100 : min(8820) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SPentatonicBlowBottle.dsp
faust
Adapted from Blow Bottle by Romain Michon ([email protected]); =========== DESCRITPION ============= - Pentatonic Blow Bottles - Left = Low frequencies/ Silence/ Slow rhythm - Right = High frequencies/ Fast rhythm - Front = Long notes - Back = Short notes ==================== INSTRUMENT ======================= differential pressure signal scaling ==================== GUI SPECIFICATION ================ --------------------- Non-variable Parameters ------------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- botlle radius ----------------------- Algorithm implementation ---------------------------- global envelope is of type attack - decay - sustain - release pressure envelope is also ADSR vibrato breat pressure breath no.noise ------------------------- Enveloppe Trigger --------------------------------------------
declare name "Pentatonic BlowBottle"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>*(2)); blow(n)= (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(n),_)~_: !,_: fi.dcblocker*envelopeG(trigger(n))*(0.5) with { baPaF(n) = bandPassFilter(freq(n)); }; N = 15; position(n) = abs(hand - n) < 0.5; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 8, 0, N, 1) : si.smooth(0.999) : min(24) : max(0) :int: ba.automat(bps, 15, 0.0) with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.05; freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 195.99; freq(4) = 220.00; freq(d) = freq(d-5)*2; bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); breathPressure(t) = envelope(t) + vibrato(t); randPressure(t) = noiseGain*no.noise*breathPressure(t) ; trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.2, 0.01)*44100 : min(8820) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); };
0699acbdd4f7c0ab842a146fe509689c158a7d084001aea8dc0cdee1d12a2e53
RuolunWeng/ruolunweng.github.io
Modulations.dsp
declare name "Modulations"; declare author "ER"; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =========== DESCRIPTION ============== - Non Linear Filter Modulators applied to a sinewave - Head = Silence/Revereration/Higher Frequencies - Bottom = Modulation n°3 = FM/ Lower Frequencies - Rocking = Modulating Frequency (low to high) - Front = Modulation n°2 - Left = Modulation n°0 & n°1 - Upward = swing from head/bottom/head (a bit like tennis racket) = interesting */ //======================== INSTRUMENT ============================= process = vgroup("Modulations",oscil <: seq(i, 3, NLFM(i)), NLFM3 :> fi.lowpass(1,2000) *(0.6) *(vol) <: instrReverbMod:*(vool),*(vool)); NLFM(n) = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env(n),freq,typeMod(n),freqMod,nlfOrder) : _; NLFM3 = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env(3),freq,typeMod(3),freqMod,nlfOrder) : _; oscil = os.osci(freq); //======================== GUI SPECIFICATIONS ===================== freq = hslider("h:Instrument/ Frequency [unit:Hz][acc:1 1 -10 0 15]", 330, 100, 1200, 0.1):si.smooth(0.999); freqMod = hslider("h:Instrument/Modulating Frequency[style:knob][unit:Hz][acc:0 0 -10 0 10]", 1200, 900, 1700, 0.1):si.smooth(0.999); vol = (hslider("h:Instrument/ Oscillator Volume[style:knob][acc:1 0 -10 0 10]", 0.5, 0, 1, 0.01)^2):si.smooth(0.999); vool = hslider("h:Instrument/ General Volume[style:knob][acc:1 1 -10 0 10]", 1, 0.75, 4, 0.01):si.smooth(0.999):min(4):max(0.75); gate(0) = hslider("v:Modulations/Play Modulation 0 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:0 0 -30 0 10]", 0,0,1,1); gate(1) = hslider("v:Modulations/Play Modulation 1 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:0 0 -30 0 5]", 0,0,1,1); gate(2) = hslider("v:Modulations/Play Modulation 2 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:2 1 -30 0 10]", 0,0,1,1); gate(3) = hslider("v:Modulations/Play Modulation 3 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:1 0 -10 0 10]", 0,0,1,1); //------------------------ NLFM PARAMETERS ------------------------ nlfOrder = 6; nonlinearity = 0.8; typeMod(n) = n; env(n) = ASR(n); ASR(n) = en.asr(a,s,r,t(n)); a = 3; s = 1; r = 2; t(n) = gate(n); //----------------------- INSTRREVERB ------------------------------- instrReverbMod = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:Reverb/Reverberation Volume(InstrReverb)[acc:1 1 -10 0 10]",0.25,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("v:Reverb/Reverberation Room Size(InstrReverb)[acc:1 1 -10 0 10]", 0.5,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Modulations.dsp
faust
=========== DESCRIPTION ============== - Non Linear Filter Modulators applied to a sinewave - Head = Silence/Revereration/Higher Frequencies - Bottom = Modulation n°3 = FM/ Lower Frequencies - Rocking = Modulating Frequency (low to high) - Front = Modulation n°2 - Left = Modulation n°0 & n°1 - Upward = swing from head/bottom/head (a bit like tennis racket) = interesting ======================== INSTRUMENT ============================= ======================== GUI SPECIFICATIONS ===================== ------------------------ NLFM PARAMETERS ------------------------ ----------------------- INSTRREVERB -------------------------------
declare name "Modulations"; declare author "ER"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Modulations",oscil <: seq(i, 3, NLFM(i)), NLFM3 :> fi.lowpass(1,2000) *(0.6) *(vol) <: instrReverbMod:*(vool),*(vool)); NLFM(n) = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env(n),freq,typeMod(n),freqMod,nlfOrder) : _; NLFM3 = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env(3),freq,typeMod(3),freqMod,nlfOrder) : _; oscil = os.osci(freq); freq = hslider("h:Instrument/ Frequency [unit:Hz][acc:1 1 -10 0 15]", 330, 100, 1200, 0.1):si.smooth(0.999); freqMod = hslider("h:Instrument/Modulating Frequency[style:knob][unit:Hz][acc:0 0 -10 0 10]", 1200, 900, 1700, 0.1):si.smooth(0.999); vol = (hslider("h:Instrument/ Oscillator Volume[style:knob][acc:1 0 -10 0 10]", 0.5, 0, 1, 0.01)^2):si.smooth(0.999); vool = hslider("h:Instrument/ General Volume[style:knob][acc:1 1 -10 0 10]", 1, 0.75, 4, 0.01):si.smooth(0.999):min(4):max(0.75); gate(0) = hslider("v:Modulations/Play Modulation 0 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:0 0 -30 0 10]", 0,0,1,1); gate(1) = hslider("v:Modulations/Play Modulation 1 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:0 0 -30 0 5]", 0,0,1,1); gate(2) = hslider("v:Modulations/Play Modulation 2 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:2 1 -30 0 10]", 0,0,1,1); gate(3) = hslider("v:Modulations/Play Modulation 3 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:1 0 -10 0 10]", 0,0,1,1); nlfOrder = 6; nonlinearity = 0.8; typeMod(n) = n; env(n) = ASR(n); ASR(n) = en.asr(a,s,r,t(n)); a = 3; s = 1; r = 2; t(n) = gate(n); instrReverbMod = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:Reverb/Reverberation Volume(InstrReverb)[acc:1 1 -10 0 10]",0.25,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("v:Reverb/Reverberation Room Size(InstrReverb)[acc:1 1 -10 0 10]", 0.5,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
4263ce312c201946d4d65122df5a46cfc14868be3e558aa6eff2280681c43339
RuolunWeng/ruolunweng.github.io
SPentatonicDryHarp.dsp
declare name "PentatonicDryHarp"; declare author "ER";//Adapted from Harpe by Yann Orlarey; //Modification Grame July 2015 /* =============== DESCRIPTION ================= : - Pentatonic dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Rocking = plucking all strings one by one */ //----------------------------------------------- // Harpe : simple string instrument // (based on Karplus-Strong) // //----------------------------------------------- import("stdfaust.lib"); instrument = library("instruments.lib"); KEY = 60; // basic midi key NCY = 15; // note cycle length CCY = 15; // control cycle length BPS = 360; // general tempo (ba.beat per sec) //-------------------------------Harpe---------------------------------- // Harpe is a simple string instrument. Move the "hand" to play the // various strings //----------------------------------------------------------------------- process = hgroup("harp", h : harpe(C,N,K) :> *(l),*(l)) with { N = 21; // number of strings K = 48; // Midi key of first string h = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 11, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with { bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; l = 0.9; C = 0.5; }; //----------------------------------Harpe-------------------------------- // USAGE: hand : harpe(C,10,60) : _,_; // C is the filter coefficient 0..1 // Build a N (10) strings harpe using a pentatonic scale // based on midi key b (60) // Each string is triggered by a specific // position of the "hand" //----------------------------------------------------------------------- harpe(C,N,b) = _ <: par(i, N, position(i+1) : string(C,Penta(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; //----------------------------------Penta------------------------------- // Pentatonic scale with degree to midi and degree to Hz conversion // USAGE: Penta(60).degree2midi(3) ==> 67 midikey // Penta(60).degree2Hz(4) ==> 440 Hz //----------------------------------------------------------------------- Penta(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+7; degree2midi(4) = key+9; degree2midi(d) = degree2midi(d-5)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; //----------------------------------String------------------------------- // A karplus-strong string. // // USAGE: string(440Hz, 4s, 1.0, button("play")) // or button("play") : string(440Hz, 4s, 1.0) //----------------------------------------------------------------------- string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SPentatonicDryHarp.dsp
faust
Adapted from Harpe by Yann Orlarey; Modification Grame July 2015 =============== DESCRIPTION ================= : - Pentatonic dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Rocking = plucking all strings one by one ----------------------------------------------- Harpe : simple string instrument (based on Karplus-Strong) ----------------------------------------------- basic midi key note cycle length control cycle length general tempo (ba.beat per sec) -------------------------------Harpe---------------------------------- Harpe is a simple string instrument. Move the "hand" to play the various strings ----------------------------------------------------------------------- number of strings Midi key of first string ----------------------------------Harpe-------------------------------- USAGE: hand : harpe(C,10,60) : _,_; C is the filter coefficient 0..1 Build a N (10) strings harpe using a pentatonic scale based on midi key b (60) Each string is triggered by a specific position of the "hand" ----------------------------------------------------------------------- ----------------------------------Penta------------------------------- Pentatonic scale with degree to midi and degree to Hz conversion USAGE: Penta(60).degree2midi(3) ==> 67 midikey Penta(60).degree2Hz(4) ==> 440 Hz ----------------------------------------------------------------------- ----------------------------------String------------------------------- A karplus-strong string. USAGE: string(440Hz, 4s, 1.0, button("play")) or button("play") : string(440Hz, 4s, 1.0) ----------------------------------------------------------------------- attenuation coefficient
declare name "PentatonicDryHarp"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = hgroup("harp", h : harpe(C,N,K) :> *(l),*(l)) with { h = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 11, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with { bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; l = 0.9; C = 0.5; }; harpe(C,N,b) = _ <: par(i, N, position(i+1) : string(C,Penta(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; Penta(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+7; degree2midi(4) = key+9; degree2midi(d) = degree2midi(d-5)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; };
4fa3eb339e3d2c60ab0de41ace8695efc4ace6bff2d67d86145be289ed8d4e05
RuolunWeng/ruolunweng.github.io
SCMajFlute.dsp
declare name "C Major Flute"; declare author "ER";// Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected])"; import("stdfaust.lib"); instrument=library("instruments.lib"); /* =============== DESCRIPTION ================= : - C Major flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Front = long notes - Back = short notes */ //==================== INSTRUMENT ======================= flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = vgroup("C Maj Flute", par(i, N, flute(i)):>_); //==================== GUI SPECIFICATION ================ vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; //-------------------- Non-Variable Parameters ----------- N = 17; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; //----------------------- Frequency Table -------------------- freq(0) = 261.62; freq(1) = 293.66; freq(2) = 329.62; freq(3) = 349.22; freq(4) = 391.99; freq(5) = 440.00; freq(6) = 493.88; freq(d) = freq(d-7)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; //Global envelope env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; //Vibrato Envelope vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("h:[1]/[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; hand = hslider("h:[1]/[1]Instrument Hand[acc:0 1 -12 0 10]", 9, 0, N, 1): ba.automat(bps, 15, 0.0)// => gate with{ bps = hslider("h:[1]/[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SCMajFlute.dsp
faust
Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected])"; =============== DESCRIPTION ================= : - C Major flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Front = long notes - Back = short notes ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ -------------------- Non-Variable Parameters ----------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope ------------------------- Enveloppe Trigger -------------------------------------------- => gate
declare name "C Major Flute"; import("stdfaust.lib"); instrument=library("instruments.lib"); flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = vgroup("C Maj Flute", par(i, N, flute(i)):>_); vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; N = 17; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; freq(0) = 261.62; freq(1) = 293.66; freq(2) = 329.62; freq(3) = 349.22; freq(4) = 391.99; freq(5) = 440.00; freq(6) = 493.88; freq(d) = freq(d-7)*2; feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); trigger(n) = position(n): trig with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("h:[1]/[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; with{ bps = hslider("h:[1]/[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; };
3c7bb27724dbe54efe71322fbf78006aae29dcd0b5d3e844d80deb58f193bb01
RuolunWeng/ruolunweng.github.io
STinkle.dsp
declare name "Tinkle"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; /* ============ DESCRIPTION ============== - Tinkling bowls - Rocking = Ringing all bowls from low to high frequencies */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = hgroup("Tinkle",(((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i)~_))):>+:fi.lowpass(1,5000)*(gain)); //==================== GUI SPECIFICATION ================ freq = hslider("[1]Frequency[unit:Hz][acc:0 1 -10 0 10]", 440,180,780,1); gain = 0.7; gate = 0; select = hslider("[2]Play[style:knob][tooltip:0=Bow; 1=Strike][acc:1 0 -10 0 10]", 1,0,1,1); integrationConstant = 0.01; baseGain = 0.5; //==================== MODAL PARAMETERS ================ preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); delayLengthBase = ma.SR/freq; //delay lengths in number of samples delayLength(x) = delayLengthBase/modes(preset,x); //delay lines delayLine(x) = de.delay(4096,delayLength(x)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x);
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/STinkle.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); ============ DESCRIPTION ============== - Tinkling bowls - Rocking = Ringing all bowls from low to high frequencies ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up ==================== GUI SPECIFICATION ================ ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used delay lengths in number of samples delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) ----------------------- Algorithm implementation ---------------------------- One resonance
declare name "Tinkle"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; import("stdfaust.lib"); instrument = library("instruments.lib"); process = hgroup("Tinkle",(((select-1)*-1) <: par(i,nModes,(resonance(i)~_))):>+:fi.lowpass(1,5000)*(gain)); freq = hslider("[1]Frequency[unit:Hz][acc:0 1 -10 0 10]", 440,180,780,1); gain = 0.7; gate = 0; select = hslider("[2]Play[style:knob][tooltip:0=Bow; 1=Strike][acc:1 0 -10 0 10]", 1,0,1,1); integrationConstant = 0.01; baseGain = 0.5; preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; nModes = nMode(preset); delayLengthBase = ma.SR/freq; delayLength(x) = delayLengthBase/modes(preset,x); delayLine(x) = de.delay(4096,delayLength(x)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x);
f59d1b5b3f9d328e4a2cdbbd23ce10c0c3984753f0089ceb4420fce6077bebb3
RuolunWeng/ruolunweng.github.io
SCMajBlowBottle.dsp
declare name "C Maj BlowBottle"; declare author "ER";//Adapted from Blow Bottle by Romain Michon ([email protected]); /* =========== DESCRITPION ============= - C Major Blow Bottles - Left = Low frequencies/ Silence/ Slow rhythm - Right = High frequencies/ Fast rhythm - Front = Long notes - Back = Short notes */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>*(2)); blow(n)= //differential pressure (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(n),_)~_: !,_: //signal scaling fi.dcblocker*envelopeG(trigger(n))*(0.5) with{ baPaF(n) = bandPassFilter(freq(n)); }; //==================== GUI SPECIFICATION ================ N = 16; position(n) = abs(hand - n) < 0.5; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : si.smooth(0.999) : min(24) : max(0) :int: ba.automat(bps, 15, 0.0) with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; //--------------------- Non-variable Parameters ------------- gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.05; //----------------------- Frequency Table -------------------- freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 174.61; freq(4) = 195.99; freq(5) = 220.00; freq(6) = 246.94; freq(d) = freq(d-7)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //botlle radius bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); //----------------------- Algorithm implementation ---------------------------- //global envelope is of type attack - decay - sustain - release envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); //pressure envelope is also ADSR envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); //vibrato vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); //breat pressure breathPressure(t) = envelope(t) + vibrato(t); //breath no.noise randPressure(t) = noiseGain*no.noise*breathPressure(t) ; //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.2, 0.01)*44100 : min(8820) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SCMajBlowBottle.dsp
faust
Adapted from Blow Bottle by Romain Michon ([email protected]); =========== DESCRITPION ============= - C Major Blow Bottles - Left = Low frequencies/ Silence/ Slow rhythm - Right = High frequencies/ Fast rhythm - Front = Long notes - Back = Short notes ==================== INSTRUMENT ======================= differential pressure signal scaling ==================== GUI SPECIFICATION ================ --------------------- Non-variable Parameters ------------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- botlle radius ----------------------- Algorithm implementation ---------------------------- global envelope is of type attack - decay - sustain - release pressure envelope is also ADSR vibrato breat pressure breath no.noise ------------------------- Enveloppe Trigger --------------------------------------------
declare name "C Maj BlowBottle"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>*(2)); blow(n)= (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(n),_)~_: !,_: fi.dcblocker*envelopeG(trigger(n))*(0.5) with{ baPaF(n) = bandPassFilter(freq(n)); }; N = 16; position(n) = abs(hand - n) < 0.5; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : si.smooth(0.999) : min(24) : max(0) :int: ba.automat(bps, 15, 0.0) with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.05; freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 174.61; freq(4) = 195.99; freq(5) = 220.00; freq(6) = 246.94; freq(d) = freq(d-7)*2; bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); breathPressure(t) = envelope(t) + vibrato(t); randPressure(t) = noiseGain*no.noise*breathPressure(t) ; trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.2, 0.01)*44100 : min(8820) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); };
f069ba9b8b45689cee759d2e1ae7af0141aa3099c73f9a4a485ee521adaf1842
RuolunWeng/ruolunweng.github.io
Kisana.dsp
declare name "Kisana"; declare author "Yann Orlarey"; //Modifications GRAME July 2015 /* ========= DESCRITPION ============= - Kisana : 3-loops string instrument (based on Karplus-Strong) - Head = Silence - Tilt = High frequencies - Front = High + Medium frequencies - Bottom = High + Medium + Low frequencies - Left = Minimum brightness - Right = Maximum birghtness - Front = Long notes - Back = Short notes */ import("stdfaust.lib"); KEY = 60; // basic midi key NCY = 15; // note cycle length CCY = 15; // control cycle length BPS = 360; // general tempo (ba.beat per sec) process = kisana; //-------------------------------kisana---------------------------------- // USAGE: kisana : _,_; // 3-loops string instrument //----------------------------------------------------------------------- kisana = vgroup("Kisana", harpe(C,11,48), harpe(C,11,60), (harpe(C,11,72) : *(1.5), *(1.5)) :>*(l)) with { l = -20 : ba.db2linear;//hslider("[1]Volume",-20, -60, 0, 0.01) : ba.db2linear; C = hslider("[2]Brightness[acc:0 1 -10 0 10]", 0.2, 0, 1, 0.01) : ba.automat(BPS, CCY, 0.0); }; //----------------------------------Harpe-------------------------------- // USAGE: harpe(C,10,60) : _,_; // C is the filter coefficient 0..1 // Build a N (10) strings harpe using a pentatonic scale // based on midi key b (60) // Each string is triggered by a specific // position of the "hand" //----------------------------------------------------------------------- harpe(C,N,b) = hand(b) <: par(i, N, position(i+1) : string(C,Penta(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("[3]Resonance[acc:2 1 -10 0 12]", 4, 0.1, 10, 0.01); hand(48) = vslider("h:[1]Instrument Hands/1 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 0, 0, N, 1) : int : ba.automat(120, CCY, 0.0); hand(60) = vslider("h:[1]Instrument Hands/2 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 2, 0, N, 1) : int : ba.automat(240, CCY, 0.0); hand(72) = vslider("h:[1]Instrument Hands/3 (Note %b)[unit:pk][acc:1 0 -10 0 10]", 4, 0, N, 1) : int : ba.automat(480, CCY, 0.0); //lvl = vslider("h:loop/level", 0, 0, 6, 1) : int : ba.automat(BPS, CCY, 0.0) : -(6) : ba.db2linear; lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; //----------------------------------Penta------------------------------- // Pentatonic scale with degree to midi and degree to Hz conversion // USAGE: Penta(60).degree2midi(3) ==> 67 midikey // Penta(60).degree2Hz(4) ==> 440 Hz //----------------------------------------------------------------------- Penta(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+7; degree2midi(4) = key+9; degree2midi(d) = degree2midi(d-5)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; //----------------------------------String------------------------------- // A karplus-strong string. // // USAGE: string(440Hz, 4s, 1.0, button("play")) // or button("play") : string(440Hz, 4s, 1.0) //----------------------------------------------------------------------- string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient random = +(12345)~*(1103515245); noise = random/2147483647.0; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/Kisana.dsp
faust
Modifications GRAME July 2015 ========= DESCRITPION ============= - Kisana : 3-loops string instrument (based on Karplus-Strong) - Head = Silence - Tilt = High frequencies - Front = High + Medium frequencies - Bottom = High + Medium + Low frequencies - Left = Minimum brightness - Right = Maximum birghtness - Front = Long notes - Back = Short notes basic midi key note cycle length control cycle length general tempo (ba.beat per sec) -------------------------------kisana---------------------------------- USAGE: kisana : _,_; 3-loops string instrument ----------------------------------------------------------------------- hslider("[1]Volume",-20, -60, 0, 0.01) : ba.db2linear; ----------------------------------Harpe-------------------------------- USAGE: harpe(C,10,60) : _,_; C is the filter coefficient 0..1 Build a N (10) strings harpe using a pentatonic scale based on midi key b (60) Each string is triggered by a specific position of the "hand" ----------------------------------------------------------------------- lvl = vslider("h:loop/level", 0, 0, 6, 1) : int : ba.automat(BPS, CCY, 0.0) : -(6) : ba.db2linear; ----------------------------------Penta------------------------------- Pentatonic scale with degree to midi and degree to Hz conversion USAGE: Penta(60).degree2midi(3) ==> 67 midikey Penta(60).degree2Hz(4) ==> 440 Hz ----------------------------------------------------------------------- ----------------------------------String------------------------------- A karplus-strong string. USAGE: string(440Hz, 4s, 1.0, button("play")) or button("play") : string(440Hz, 4s, 1.0) ----------------------------------------------------------------------- attenuation coefficient
declare name "Kisana"; declare author "Yann Orlarey"; import("stdfaust.lib"); process = kisana; kisana = vgroup("Kisana", harpe(C,11,48), harpe(C,11,60), (harpe(C,11,72) : *(1.5), *(1.5)) :>*(l)) with { C = hslider("[2]Brightness[acc:0 1 -10 0 10]", 0.2, 0, 1, 0.01) : ba.automat(BPS, CCY, 0.0); }; harpe(C,N,b) = hand(b) <: par(i, N, position(i+1) : string(C,Penta(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("[3]Resonance[acc:2 1 -10 0 12]", 4, 0.1, 10, 0.01); hand(48) = vslider("h:[1]Instrument Hands/1 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 0, 0, N, 1) : int : ba.automat(120, CCY, 0.0); hand(60) = vslider("h:[1]Instrument Hands/2 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 2, 0, N, 1) : int : ba.automat(240, CCY, 0.0); hand(72) = vslider("h:[1]Instrument Hands/3 (Note %b)[unit:pk][acc:1 0 -10 0 10]", 4, 0, N, 1) : int : ba.automat(480, CCY, 0.0); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; Penta(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+7; degree2midi(4) = key+9; degree2midi(d) = degree2midi(d-5)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; random = +(12345)~*(1103515245); noise = random/2147483647.0; };
54ead1d05a7a380b8c70f3b0fffbf5e04e0eb9653b12c9803c36f945e1328eb1
RuolunWeng/ruolunweng.github.io
SBrassMulti.dsp
declare name "Multiple Brass"; declare description "WaveGuide Brass instrument from STK"; declare author "ER"; //Adapted from Brass by Romain Michon ([email protected]); import("stdfaust.lib"); instrument=library("instruments.lib"); /* ========= DESCRITPION =========== - Triple Brass - Left = Silence - Other positions = interpolating brass voices */ //==================== INSTRUMENT ======================= process = vgroup("Brass Instrument", par(i, 3, brass(i)) :>_); brass(n) = (borePressure <: deltaPressure(pressure(n)),_ : (lipFilter(freq(n)) <: *(mouthPressure(pressure(n))),(1-_)),_ : _, * :> + : fi.dcblocker) ~ (boreDelay(freq(n))) *(gain(n)): fi.lowpass((n+1),((n+1)*1500)); //==================== GUI SPECIFICATION ================ //gate = checkbox(" Play"); gate = hslider(" ON/OFF", 0, 0, 1, 1); freq(0) = hslider("h:Instrument/v:Frequencies/Frequency 1 [unit:Hz][acc:1 1 -10 0 10]",370,280,380, 0.01):si.smooth(0.999); freq(1) = hslider("h:Instrument/v:Frequencies/Frequency 2 [unit:Hz][acc:0 1 -10 0 10]",440,380,550,0.01):si.smooth(0.999); freq(2) = hslider("h:Instrument/v:Frequencies/Frequency 3 [unit:Hz][acc:2 0 -10 0 12]",587.32,550,700,0.01):si.smooth(0.999); gain(0) = hslider("h:Instrument/v:Gain/Volume 1 [style:knob][acc:1 0 -10 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(1) = hslider("h:Instrument/v:Gain/Volume 2 [style:knob][acc:0 0 -10 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(2) = hslider("h:Instrument/v:Gain/Volume 3 [style:knob][acc:2 1 -10 0 10][tooltip:Gain (value between 0 and 1)]",0.5,0,0.5,0.01); pressure(0) = 0.37; pressure(1) = 0.68; pressure(2) = 1.0; lipTension = 0.780; slideLength = 0.041; vibratoFreq = 6; vibratoGain = 0.05; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.1; envelopeAttack = 0.01; envelopeDecay = 0.001; envelopeRelease = 2; //==================== SIGNAL PROCESSING ================ //---------- Synthesis parameters computing and functions declaration ---------- //lips are simulated by a biquad filter whose output is squared and hard-clipped, bandPassH and saturationPos are declared in instrument.lib lipFilterFrequency(f) = f*pow(4,(2*lipTension)-1); lipFilter(f) = *(0.03) : instrument.bandPassH(lipFilterFrequency(f),0.997) <: * : instrument.saturationPos; //delay times in number of samples slideTarget(f) = ((ma.SR/f)*2 + 3)*(0.5 + slideLength); boreDelay(f) = de.fdelay(4096,slideTarget(f)); //----------------------- Algorithm implementation ---------------------------- //vibrato vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); //envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato breathPressure(p) = p*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; mouthPressure(p) = 0.3*breathPressure(p); //scale the delay feedback borePressure = *(0.85); //differencial presure deltaPressure(p) = mouthPressure(p) - _;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SBrassMulti.dsp
faust
Adapted from Brass by Romain Michon ([email protected]); ========= DESCRITPION =========== - Triple Brass - Left = Silence - Other positions = interpolating brass voices ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ gate = checkbox(" Play"); ==================== SIGNAL PROCESSING ================ ---------- Synthesis parameters computing and functions declaration ---------- lips are simulated by a biquad filter whose output is squared and hard-clipped, bandPassH and saturationPos are declared in instrument.lib delay times in number of samples ----------------------- Algorithm implementation ---------------------------- vibrato envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato scale the delay feedback differencial presure
declare name "Multiple Brass"; declare description "WaveGuide Brass instrument from STK"; import("stdfaust.lib"); instrument=library("instruments.lib"); process = vgroup("Brass Instrument", par(i, 3, brass(i)) :>_); brass(n) = (borePressure <: deltaPressure(pressure(n)),_ : (lipFilter(freq(n)) <: *(mouthPressure(pressure(n))),(1-_)),_ : _, * :> + : fi.dcblocker) ~ (boreDelay(freq(n))) *(gain(n)): fi.lowpass((n+1),((n+1)*1500)); gate = hslider(" ON/OFF", 0, 0, 1, 1); freq(0) = hslider("h:Instrument/v:Frequencies/Frequency 1 [unit:Hz][acc:1 1 -10 0 10]",370,280,380, 0.01):si.smooth(0.999); freq(1) = hslider("h:Instrument/v:Frequencies/Frequency 2 [unit:Hz][acc:0 1 -10 0 10]",440,380,550,0.01):si.smooth(0.999); freq(2) = hslider("h:Instrument/v:Frequencies/Frequency 3 [unit:Hz][acc:2 0 -10 0 12]",587.32,550,700,0.01):si.smooth(0.999); gain(0) = hslider("h:Instrument/v:Gain/Volume 1 [style:knob][acc:1 0 -10 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(1) = hslider("h:Instrument/v:Gain/Volume 2 [style:knob][acc:0 0 -10 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(2) = hslider("h:Instrument/v:Gain/Volume 3 [style:knob][acc:2 1 -10 0 10][tooltip:Gain (value between 0 and 1)]",0.5,0,0.5,0.01); pressure(0) = 0.37; pressure(1) = 0.68; pressure(2) = 1.0; lipTension = 0.780; slideLength = 0.041; vibratoFreq = 6; vibratoGain = 0.05; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.1; envelopeAttack = 0.01; envelopeDecay = 0.001; envelopeRelease = 2; lipFilterFrequency(f) = f*pow(4,(2*lipTension)-1); lipFilter(f) = *(0.03) : instrument.bandPassH(lipFilterFrequency(f),0.997) <: * : instrument.saturationPos; slideTarget(f) = ((ma.SR/f)*2 + 3)*(0.5 + slideLength); boreDelay(f) = de.fdelay(4096,slideTarget(f)); vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); breathPressure(p) = p*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; mouthPressure(p) = 0.3*breathPressure(p); borePressure = *(0.85); deltaPressure(p) = mouthPressure(p) - _;
106bf3774e84d93677d29f0e7d7478b7929a8e888810ebd95450262fee550c39
RuolunWeng/ruolunweng.github.io
AtonalSoftHarp.dsp
declare name "Atonal Soft Harp"; declare author "ER"; //Adapted from NLFeks by Julius Smith and Romain Michon; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ======================== : - Soft Atonal Harp - Head = High frequencies + Reverberation - Bottom = Low frequencies / Silence - Swing + Right = Plucking all the strings one by one - Left = Slow rhythm / Silence - Right = Fast rhythm - Front = Short and dry notes - Back = Long and bright notes - Back + horizontal shaking = vibrato */ //==================== INSTRUMENT ======================= process = par(i, N, NFLeks(i)):>_<: instrReverbHarp; NFLeks(n) = filtered_excitation(n+1,P(freq(n)),freq(n)) : stringloop(freq(n)); //==================== GUI SPECIFICATION ================ N = 20; hand = hslider("h:[1]/Instrument Hand[acc:1 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.9; beta = 0.5; // String decay time in seconds: t60 = hslider("h:[2]Reverberation/ Resonance[unit:s][acc:2 0 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) B = 0; L = -10 : ba.db2linear; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 200; freq(1) = 215; freq(2) = 230; freq(3) = 245; freq(4) = 260; freq(5) = 275; freq(d) = freq(d-6)*(2); //==================== SIGNAL PROCESSING ================ //----------------------- noiseburst ------------------------- // White no.noise burst (adapted from Faust's karplus.dsp example) // Requires music.lib (for no.noise) noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; P(f) = ma.SR/f ; // fundamental period in samples Pmax = 4096; // maximum P (for de.delay-line allocation) ppdel(f) = beta*P(f); // pick position de.delay pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain // Original EKS damping filter: b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); // Linear phase FIR3 damping filter: h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); loopfilter(f) = dampingfilter2(f); // or dampingfilter1 filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); //================================ REVERB ============================== instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverberation/Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 12]", 0.1,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverberation/ Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 12]", 0.2,0.05,1.7,0.01) : min(1.7):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/AtonalSoftHarp.dsp
faust
Adapted from NLFeks by Julius Smith and Romain Michon; =============== DESCRIPTION ======================== : - Soft Atonal Harp - Head = High frequencies + Reverberation - Bottom = Low frequencies / Silence - Swing + Right = Plucking all the strings one by one - Left = Slow rhythm / Silence - Right = Fast rhythm - Front = Short and dry notes - Back = Long and bright notes - Back + horizontal shaking = vibrato ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ => gate String decay time in seconds: -60db decay time (sec) ---------------------------------- FREQUENCY TABLE --------------------------- ==================== SIGNAL PROCESSING ================ ----------------------- noiseburst ------------------------- White no.noise burst (adapted from Faust's karplus.dsp example) Requires music.lib (for no.noise) fundamental period in samples maximum P (for de.delay-line allocation) pick position de.delay defined in filter.lib defined in signal.lib multiplies loop-gain Original EKS damping filter: S and 1-S Linear phase FIR3 damping filter: or dampingfilter1 see filter.lib ================================ REVERB ==============================
declare name "Atonal Soft Harp"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = par(i, N, NFLeks(i)):>_<: instrReverbHarp; NFLeks(n) = filtered_excitation(n+1,P(freq(n)),freq(n)) : stringloop(freq(n)); N = 20; with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.9; beta = 0.5; B = 0; L = -10 : ba.db2linear; freq(0) = 200; freq(1) = 215; freq(2) = 230; freq(3) = 245; freq(4) = 260; freq(5) = 275; freq(d) = freq(d-6)*(2); noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverberation/Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 12]", 0.1,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverberation/ Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 12]", 0.2,0.05,1.7,0.01) : min(1.7):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
b792313d8ad33eca0e952330494464f83c708f42206655914474d4a510e56948
RuolunWeng/ruolunweng.github.io
PentatonicSoftHarp.dsp
declare name "Pentatonic Soft Harp"; declare author "ER";//Adapted from "Nonlinear EKS" by Julius Smith and Romain Michon; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= - Reverberated pentatonic soft harp - Left = Lower frequencies/Silence when still - Front = Resonance - Back = No resonance - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one */ //==================== INSTRUMENT ======================= process = par(i, N, NFLeks(i)):>_<: instrReverbHarp; NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); //==================== GUI SPECIFICATION ================ // standard MIDI voice parameters: // NOTE: The labels MUST be "freq", "gain", and "gate" for faust2pd N = 20; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.81; beta = 0.5; t60 = hslider("h:[3]Reverb/[1]Resonance[unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01); // -60db decay time (sec) B = 0; L = -10 : ba.db2linear; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; //==================== SIGNAL PROCESSING ================ //----------------------- noiseburst ------------------------- // White no.noise burst (adapted from Faust's karplus.dsp example) // Requires music.lib (for no.noise) noiseburst(d,e) = no.noise : *(trigger(d,e)) with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; //nlfOrder = 6; P(f) = ma.SR/f ; // fundamental period in samples Pmax = 4096; // maximum P (for de.delay-line allocation) ppdel(f) = beta*P(f); // pick position de.delay pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain // Original EKS damping filter: b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); // Linear phase FIR3 damping filter: h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); loopfilter(f) = dampingfilter2(f); // or dampingfilter1 filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); //================================= REVERB ============================== instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/[1]Reverberation Volume(InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1.7,0.01):min(1.3):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/PentatonicSoftHarp.dsp
faust
Adapted from "Nonlinear EKS" by Julius Smith and Romain Michon; =============== DESCRIPTION ================= - Reverberated pentatonic soft harp - Left = Lower frequencies/Silence when still - Front = Resonance - Back = No resonance - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ standard MIDI voice parameters: NOTE: The labels MUST be "freq", "gain", and "gate" for faust2pd => gate -60db decay time (sec) ---------------------------------- FREQUENCY TABLE --------------------------- ==================== SIGNAL PROCESSING ================ ----------------------- noiseburst ------------------------- White no.noise burst (adapted from Faust's karplus.dsp example) Requires music.lib (for no.noise) nlfOrder = 6; fundamental period in samples maximum P (for de.delay-line allocation) pick position de.delay defined in filter.lib defined in signal.lib multiplies loop-gain Original EKS damping filter: S and 1-S Linear phase FIR3 damping filter: or dampingfilter1 see filter.lib ================================= REVERB ==============================
declare name "Pentatonic Soft Harp"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = par(i, N, NFLeks(i)):>_<: instrReverbHarp; NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); N = 20; with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.81; beta = 0.5; B = 0; L = -10 : ba.db2linear; freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; noiseburst(d,e) = no.noise : *(trigger(d,e)) with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/[1]Reverberation Volume(InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1.7,0.01):min(1.3):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
0b441e02bc7634ea175b0010ffca7c78508a19f1849d400e7c018766eddb9298
RuolunWeng/ruolunweng.github.io
Brass.dsp
declare name "Brass"; declare description "WaveGuide Brass instrument from STK"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "A simple brass instrument waveguide model, a la Cook (TBone, HosePlayer)."; declare reference "https://ccrma.stanford.edu/~jos/pasp/Brasses.html"; //Modification GRAME July 2015 import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Brass instrument - Head = Reverb/Silence - Upward = Higher frequency - Downward = Lower frequency */ //==================== INSTRUMENT ======================= process = vgroup("Brass Instrument", Brass <: InstrReverBrass :>_); Brass = (borePressure <: deltaPressure,_ : (lipFilter <: *(mouthPressure),(1-_)),_ : _, * :> + : fi.dcblocker) ~ (boreDelay) : *(gain)*(2); //==================== GUI SPECIFICATION ================ freq = hslider("h:[1]Instrument/Frequency[1][unit:Hz] [tooltip:Tone frequency][acc:1 1 -10 0 10]", 300,170,700,1):si.smooth(0.999); gain = 0.8; gate = checkbox("h:[1]Instrument/ ON/OFF (ASR Envelope)"); lipTension = 0.780; pressure = 1; slideLength = 0.041; vibratoFreq = hslider("v:[3]Parameters/h:/Vibrato Frequency (Vibrato Envelope)[unit:Hz][style:knob][unit:Hz][acc:0 1 -10 0 10]", 5,1,10,0.01); vibratoGain = 0.05; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.1; envelopeDecay = 0.001; envelopeAttack = 0.005; envelopeRelease = 0.07; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //lips are simulated by a biquad filter whose output is squared and hard-clipped, instrument.bandPassH and instrument.saturationPos are declared in instrument.lib lipFilterFrequency = freq*pow(4,(2*lipTension)-1); lipFilter = *(0.03) : instrument.bandPassH(lipFilterFrequency,0.997) <: * : instrument.saturationPos; //de.delay times in number of samples slideTarget = ((ma.SR/freq)*2 + 3)*(0.5 + slideLength); boreDelay = de.fdelay(4096,slideTarget); //----------------------- Algorithm implementation ---------------------------- //vibrato vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); //envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato breathPressure = pressure*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; mouthPressure = 0.3*breathPressure; //scale the de.delay feedback borePressure = *(0.85); //differencial presure deltaPressure = mouthPressure - _; //-------------------------------- InstrReverb --------------------------------- InstrReverBrass = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("v:[4]Reverb/Reverberation Room Size (InstrReverb)[acc:1 1 -15 0 12]", 0.2,0.05,1.7,0.01) : min(1.7) : max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Brass.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); Modification GRAME July 2015 =============== DESCRIPTION ================= : - Brass instrument - Head = Reverb/Silence - Upward = Higher frequency - Downward = Lower frequency ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- lips are simulated by a biquad filter whose output is squared and hard-clipped, instrument.bandPassH and instrument.saturationPos are declared in instrument.lib de.delay times in number of samples ----------------------- Algorithm implementation ---------------------------- vibrato envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato scale the de.delay feedback differencial presure -------------------------------- InstrReverb ---------------------------------
declare name "Brass"; declare description "WaveGuide Brass instrument from STK"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare description "A simple brass instrument waveguide model, a la Cook (TBone, HosePlayer)."; declare reference "https://ccrma.stanford.edu/~jos/pasp/Brasses.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Brass Instrument", Brass <: InstrReverBrass :>_); Brass = (borePressure <: deltaPressure,_ : (lipFilter <: *(mouthPressure),(1-_)),_ : _, * :> + : fi.dcblocker) ~ (boreDelay) : *(gain)*(2); freq = hslider("h:[1]Instrument/Frequency[1][unit:Hz] [tooltip:Tone frequency][acc:1 1 -10 0 10]", 300,170,700,1):si.smooth(0.999); gain = 0.8; gate = checkbox("h:[1]Instrument/ ON/OFF (ASR Envelope)"); lipTension = 0.780; pressure = 1; slideLength = 0.041; vibratoFreq = hslider("v:[3]Parameters/h:/Vibrato Frequency (Vibrato Envelope)[unit:Hz][style:knob][unit:Hz][acc:0 1 -10 0 10]", 5,1,10,0.01); vibratoGain = 0.05; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.1; envelopeDecay = 0.001; envelopeAttack = 0.005; envelopeRelease = 0.07; lipFilterFrequency = freq*pow(4,(2*lipTension)-1); lipFilter = *(0.03) : instrument.bandPassH(lipFilterFrequency,0.997) <: * : instrument.saturationPos; slideTarget = ((ma.SR/freq)*2 + 3)*(0.5 + slideLength); boreDelay = de.fdelay(4096,slideTarget); vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); breathPressure = pressure*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; mouthPressure = 0.3*breathPressure; borePressure = *(0.85); deltaPressure = mouthPressure - _; InstrReverBrass = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("v:[4]Reverb/Reverberation Room Size (InstrReverb)[acc:1 1 -15 0 12]", 0.2,0.05,1.7,0.01) : min(1.7) : max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
fed7c24adfaa6f55ac2097fe4d68ebbea8fd1da7fa9ba73e7c027f5b4070eeaf
RuolunWeng/ruolunweng.github.io
SBlowhistleBottle.dsp
declare name "Blowhistle Bottle"; declare author "ER"; //From "Blow bottle" by Romain Michon; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "This object implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook)."; /* =============== DESCRIPTION ================= : - Blow bottles with whistling echo. - Left : silence/dying echo. - Front : single blow bottle. - Back : maximum whistling echo - Bottom : bottle + whistling echo - Rocking : changes tone of blow bottle. */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>_); blow(n)= par(i, 2, //differential pressure (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(i,n),_)~_: !,_: //signal scaling fi.dcblocker*envelopeG(trigger(n))*(0.5)<:+(voice(i,n))*resonGain(i)):>_ with{ baPaF(0,n) = bandPassFilter(freq(n)); baPaF(1,n) = bandPassFilter(freq(n)*8); voice(0,n) = 0*n; voice(1,n) = 1*(fi.resonbp(freq(n)*8,Q,gain):echo); resonGain(0) = 1; resonGain(1) =(hslider("v:[1]Instrument/Whistle Volume[acc:2 0 -10 0 10]", 0.07, 0, 0.2, 0.001))^2:si.smooth(0.999); echo = _:+~(@(delayEcho):*(feedback)); delayEcho = 44100; feedback = hslider("h:[2]Echo/Echo Intensity [style:knob][acc:2 0 -10 0 10]", 0.48, 0.2, 0.98, 0.01):si.smooth(0.999):min(0.98):max(0.2); }; //==================== GUI SPECIFICATION ================ N = 10; Q = 30; position(n) = abs(hand - n) < 0.5; hand = hslider("v:[1]Instrument/Instrument Hand[acc:0 1 -10 0 10]", 5, 0, N, 1):int:ba.automat(360, 15, 0.0); envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; //--------------------- Non-variable Parameters ------------- gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.5; //----------------------- Frequency Table -------------------- freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 195.99; freq(4) = 220.00; freq(d) = freq(d-5)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //botlle radius bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); //----------------------- Algorithm implementation ---------------------------- //global envelope is of type attack - decay - sustain - release envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); //pressure envelope is also ADSR envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); //vibrato vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); //breat pressure breathPressure(t) = envelope(t) + vibrato(t); //breath no.noise randPressure(t) = noiseGain*no.noise*breathPressure(t) ; //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); trig = upfront : release(8820) : >(0.0); };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SBlowhistleBottle.dsp
faust
From "Blow bottle" by Romain Michon; Synthesis Tool Kit 4.3 (MIT style license); =============== DESCRIPTION ================= : - Blow bottles with whistling echo. - Left : silence/dying echo. - Front : single blow bottle. - Back : maximum whistling echo - Bottom : bottle + whistling echo - Rocking : changes tone of blow bottle. ==================== INSTRUMENT ======================= differential pressure signal scaling ==================== GUI SPECIFICATION ================ --------------------- Non-variable Parameters ------------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- botlle radius ----------------------- Algorithm implementation ---------------------------- global envelope is of type attack - decay - sustain - release pressure envelope is also ADSR vibrato breat pressure breath no.noise ------------------------- Enveloppe Trigger --------------------------------------------
declare name "Blowhistle Bottle"; declare version "1.0"; declare description "This object implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook)."; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>_); blow(n)= par(i, 2, (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(i,n),_)~_: !,_: fi.dcblocker*envelopeG(trigger(n))*(0.5)<:+(voice(i,n))*resonGain(i)):>_ with{ baPaF(0,n) = bandPassFilter(freq(n)); baPaF(1,n) = bandPassFilter(freq(n)*8); voice(0,n) = 0*n; voice(1,n) = 1*(fi.resonbp(freq(n)*8,Q,gain):echo); resonGain(0) = 1; resonGain(1) =(hslider("v:[1]Instrument/Whistle Volume[acc:2 0 -10 0 10]", 0.07, 0, 0.2, 0.001))^2:si.smooth(0.999); echo = _:+~(@(delayEcho):*(feedback)); delayEcho = 44100; feedback = hslider("h:[2]Echo/Echo Intensity [style:knob][acc:2 0 -10 0 10]", 0.48, 0.2, 0.98, 0.01):si.smooth(0.999):min(0.98):max(0.2); }; N = 10; Q = 30; position(n) = abs(hand - n) < 0.5; hand = hslider("v:[1]Instrument/Instrument Hand[acc:0 1 -10 0 10]", 5, 0, N, 1):int:ba.automat(360, 15, 0.0); envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.5; freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 195.99; freq(4) = 220.00; freq(d) = freq(d-5)*2; bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); breathPressure(t) = envelope(t) + vibrato(t); randPressure(t) = noiseGain*no.noise*breathPressure(t) ; trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); trig = upfront : release(8820) : >(0.0); };
66d47fb2e29d871081ac07abc88b25a1f83cbb44ed4277af3fb822eb73d406dd
RuolunWeng/ruolunweng.github.io
STunedBar6.dsp
declare name "Tuned Bar"; declare description "Nonlinear Banded Waveguide Models"; declare name "Six Rack Tuned Bars"; declare author "ER";//From "Tuned Bar" by Romain Michon ([email protected]); /* =========== DESCRIPTION ============= - Six rack tuned bars - Head = Silence/Resonance - Tilt = High frequencies - Front = High + Medium frequencies - Bottom = High + Medium + Low frequencies */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = vgroup("tunedBars",hgroup("[1]",par(i, 6, onerack(i,i,i))):>_); onerack(h,n,e) = hgroup("Bar %n", par(i, 5, tunedBar(h,i,e))); tunedBar(h,n,e) = ((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i,freqqy(n,e),gate(h,n))~_)) :> + : //Signal Scaling and stereo *(4); //==================== GUI SPECIFICATION ================ gain = 0.8; gate(h,n) = position(h,n) : upfront; hand(0) = vslider("Instrument Hand[acc:1 0 -10 0 18]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); hand(1) = vslider("Instrument Hand[acc:1 0 -10 0 18]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); hand(2) = vslider("Instrument Hand[acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); hand(3) = vslider("Instrument Hand[acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); hand(4) = vslider("Instrument Hand[acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); hand(5) = vslider("Instrument Hand[acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); position(h,n) = abs(hand(h) - n) < 0.5; upfront(x) = x>x'; select = 1; integrationConstant = 0; baseGain = 1; //----------------------- Frequency Table -------------------- freq(0) = 92.49; freq(1) = 103.82; freq(2) = 116.54; freq(3) = 138.59; freq(4) = 155.56; freq(d) = freq(d-5)*2; freqqy(d,e) = freq(d+e*5); //==================== MODAL PARAMETERS ================ preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; //delay lengths in number of samples delayLength(x,f) = delayLengthBase(f)/modes(preset,x); //delay lines delayLine(x,f) = de.delay(4096,delayLength(x,f)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/STunedBar6.dsp
faust
From "Tuned Bar" by Romain Michon ([email protected]); =========== DESCRIPTION ============= - Six rack tuned bars - Head = Silence/Resonance - Tilt = High frequencies - Front = High + Medium frequencies - Bottom = High + Medium + Low frequencies ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up Signal Scaling and stereo ==================== GUI SPECIFICATION ================ ----------------------- Frequency Table -------------------- ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used delay lengths in number of samples delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) ----------------------- Algorithm implementation ---------------------------- One resonance
declare name "Tuned Bar"; declare description "Nonlinear Banded Waveguide Models"; declare name "Six Rack Tuned Bars"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("tunedBars",hgroup("[1]",par(i, 6, onerack(i,i,i))):>_); onerack(h,n,e) = hgroup("Bar %n", par(i, 5, tunedBar(h,i,e))); tunedBar(h,n,e) = ((select-1)*-1) <: par(i,nModes,(resonance(i,freqqy(n,e),gate(h,n))~_)) :> + : *(4); gain = 0.8; gate(h,n) = position(h,n) : upfront; hand(0) = vslider("Instrument Hand[acc:1 0 -10 0 18]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); hand(1) = vslider("Instrument Hand[acc:1 0 -10 0 18]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); hand(2) = vslider("Instrument Hand[acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); hand(3) = vslider("Instrument Hand[acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); hand(4) = vslider("Instrument Hand[acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); hand(5) = vslider("Instrument Hand[acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); position(h,n) = abs(hand(h) - n) < 0.5; upfront(x) = x>x'; select = 1; integrationConstant = 0; baseGain = 1; freq(0) = 92.49; freq(1) = 103.82; freq(2) = 116.54; freq(3) = 138.59; freq(4) = 155.56; freq(d) = freq(d-5)*2; freqqy(d,e) = freq(d+e*5); preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); nlfOrder = 6; nModes = nMode(preset); delayLengthBase(f) = ma.SR/f; delayLength(x,f) = delayLengthBase(f)/modes(preset,x); delayLine(x,f) = de.delay(4096,delayLength(x,f)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
7576ff9aad06a197efb47bf379d565565bc1ac5cbf40de51455f793f3a2655bd
RuolunWeng/ruolunweng.github.io
PentatonicDryHarp.dsp
declare name "PentatonicDryHarp"; declare author "ER";//Adapted from Harpe by Yann Orlarey; //Modification Grame July 2015 /* =============== DESCRIPTION ================= : - Reverberated pentatonic dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one */ //----------------------------------------------- // Harpe : simple string instrument // (based on Karplus-Strong) // //----------------------------------------------- import("stdfaust.lib"); instrument = library("instruments.lib"); KEY = 60; // basic midi key NCY = 15; // note cycle length CCY = 15; // control cycle length BPS = 360; // general tempo (ba.beat per sec) //-------------------------------Harpe---------------------------------- // Harpe is a simple string instrument. Move the "hand" to play the // various strings //----------------------------------------------------------------------- process = vgroup("Harp", h : harpe(C,N,K) :> instrReverbHarp : *(l),*(l)) with { N = 21; // number of strings K = 48; // Midi key of first string h = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 11, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with{ bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; l = 0.9; C = 0.5; }; //----------------------------------Harpe-------------------------------- // USAGE: hand : harpe(C,10,60) : _,_; // C is the filter coefficient 0..1 // Build a N (10) strings harpe using a pentatonic scale // based on midi key b (60) // Each string is triggered by a specific // position of the "hand" //----------------------------------------------------------------------- harpe(C,N,b) = _ <: par(i, N, position(i+1) : string(C,Penta(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; //----------------------------------Penta------------------------------- // Pentatonic scale with degree to midi and degree to Hz conversion // USAGE: Penta(60).degree2midi(3) ==> 67 midikey // Penta(60).degree2Hz(4) ==> 440 Hz //----------------------------------------------------------------------- Penta(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+7; degree2midi(4) = key+9; degree2midi(d) = degree2midi(d-5)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; //----------------------------------String------------------------------- // A karplus-strong string. // // USAGE: string(440Hz, 4s, 1.0, button("play")) // or button("play") : string(440Hz, 4s, 1.0) //----------------------------------------------------------------------- string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient }; //================================= REVERB ============================== instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/[1]Reverberation Volume(InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1.3,0.01):min(1.3):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/PentatonicDryHarp.dsp
faust
Adapted from Harpe by Yann Orlarey; Modification Grame July 2015 =============== DESCRIPTION ================= : - Reverberated pentatonic dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one ----------------------------------------------- Harpe : simple string instrument (based on Karplus-Strong) ----------------------------------------------- basic midi key note cycle length control cycle length general tempo (ba.beat per sec) -------------------------------Harpe---------------------------------- Harpe is a simple string instrument. Move the "hand" to play the various strings ----------------------------------------------------------------------- number of strings Midi key of first string ----------------------------------Harpe-------------------------------- USAGE: hand : harpe(C,10,60) : _,_; C is the filter coefficient 0..1 Build a N (10) strings harpe using a pentatonic scale based on midi key b (60) Each string is triggered by a specific position of the "hand" ----------------------------------------------------------------------- ----------------------------------Penta------------------------------- Pentatonic scale with degree to midi and degree to Hz conversion USAGE: Penta(60).degree2midi(3) ==> 67 midikey Penta(60).degree2Hz(4) ==> 440 Hz ----------------------------------------------------------------------- ----------------------------------String------------------------------- A karplus-strong string. USAGE: string(440Hz, 4s, 1.0, button("play")) or button("play") : string(440Hz, 4s, 1.0) ----------------------------------------------------------------------- attenuation coefficient ================================= REVERB ==============================
declare name "PentatonicDryHarp"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Harp", h : harpe(C,N,K) :> instrReverbHarp : *(l),*(l)) with { h = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 11, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with{ bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; l = 0.9; C = 0.5; }; harpe(C,N,b) = _ <: par(i, N, position(i+1) : string(C,Penta(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; Penta(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+7; degree2midi(4) = key+9; degree2midi(d) = degree2midi(d-5)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; }; instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/[1]Reverberation Volume(InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1.3,0.01):min(1.3):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
cd40a914d5824b3622adbf6ed3f3f815cc55c07a623227bef88abd6ffe3ce053
RuolunWeng/ruolunweng.github.io
CMajSoftHarp.dsp
declare name "C Major Soft Harp"; declare author "ER";//Adapted from Nonlinear EKS by Julius Smith and Romain Michon; declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Reverberated C Major soft harp - Left = Lower frequencies/Silence when still - Front = Resonance - Back = No resonance - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one */ //==================== INSTRUMENT ======================= process = vgroup("Soft Harp - C Major",par(i, N, NFLeks(i)):>_<: instrReverbHarp); NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); //==================== GUI SPECIFICATION ================ N = 24; hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.81; beta = 0.5; t60 = hslider("h:[2]Reverb/ Resonance (InstrReverb)[unit:s][acc:0 0 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) B = 0; L = -10 : ba.db2linear; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 174.61; freq(4) = 195.99; freq(5) = 220.00; freq(6) = 246.94; freq(d) = freq(d-7)*(2); //==================== SIGNAL PROCESSING ================ //----------------------- noiseburst ------------------------- // White no.noise burst (adapted from Faust's karplus.dsp example) // Requires music.lib (for no.noise) noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; P(f) = ma.SR/f ; // fundamental period in samples Pmax = 4096; // maximum P (for de.delay-line allocation) ppdel(f) = beta*P(f); // pick position de.delay pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain // Original EKS damping filter: b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); // Linear phase FIR3 damping filter: h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); loopfilter(f) = dampingfilter2(f); // or dampingfilter1 filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); //================================= REVERB ============================== instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 17]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 16]", 0.72,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/CMajSoftHarp.dsp
faust
Adapted from Nonlinear EKS by Julius Smith and Romain Michon; =============== DESCRIPTION ================= : - Reverberated C Major soft harp - Left = Lower frequencies/Silence when still - Front = Resonance - Back = No resonance - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ => gate -60db decay time (sec) ---------------------------------- FREQUENCY TABLE --------------------------- ==================== SIGNAL PROCESSING ================ ----------------------- noiseburst ------------------------- White no.noise burst (adapted from Faust's karplus.dsp example) Requires music.lib (for no.noise) fundamental period in samples maximum P (for de.delay-line allocation) pick position de.delay defined in filter.lib defined in signal.lib multiplies loop-gain Original EKS damping filter: S and 1-S Linear phase FIR3 damping filter: or dampingfilter1 see filter.lib ================================= REVERB ==============================
declare name "C Major Soft Harp"; declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Soft Harp - C Major",par(i, N, NFLeks(i)):>_<: instrReverbHarp); NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); N = 24; with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.81; beta = 0.5; B = 0; L = -10 : ba.db2linear; freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 174.61; freq(4) = 195.99; freq(5) = 220.00; freq(6) = 246.94; freq(d) = freq(d-7)*(2); noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 17]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 16]", 0.72,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
e2000a420ebf5da41ac3639f768eea4b399e80c0f970dab91b4033cd223c6dfc
RuolunWeng/ruolunweng.github.io
SCMajDryHarp.dsp
declare name "CMajDryHarp"; declare author "ER";//Adapted from Harpe by Yann Orlarey; //Modification Grame July 2015 import("stdfaust.lib"); /* =============== DESCRIPTION ================= : - C Major dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Rocking = plucking all strings one by one */ //----------------------------------------------- // Harpe : simple string instrument // (based on Karplus-Strong) // //----------------------------------------------- KEY = 60; // basic midi key NCY = 15; // note cycle length CCY = 15; // control cycle length BPS = 360; // general tempo (ba.beat per sec) //-------------------------------Harpe---------------------------------- // Harpe is a simple string instrument. Move the "hand" to play the // various strings //----------------------------------------------------------------------- process = vgroup("harpe", h : harpe(C,N,K) :> *(l),*(l)) with { N = 48; // number of strings K = 36; // Midi key of first string h = hslider("[1]Instrument Hand[1] [acc:0 1 -10 0 10]", 24, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with{ bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; //l = vslider("h:parameters/volume [style:knob][unit: dB]", -20, -60, 0, 0.01) : ba.db2linear; l = -10 : ba.db2linear; C = 0.5; }; //----------------------------------Harpe-------------------------------- // USAGE: hand : harpe(C,10,60) : _,_; // C is the filter coefficient 0..1 // Build a N (10) strings harpe using a pentatonic scale // based on midi key b (60) // Each string is triggered by a specific // position of the "hand" //----------------------------------------------------------------------- harpe(C,N,b) = _ <: par(i, N, position(i+1) :string(C,Major(b).degree2Hz(i), att, lvl) //envReader(twig,enveloppe):* : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; //----------------------------------Penta------------------------------- // Pentatonic scale with degree to midi and degree to Hz conversion // USAGE: Penta(60).degree2midi(3) ==> 67 midikey // Penta(60).degree2Hz(4) ==> 440 Hz //----------------------------------------------------------------------- //---------------------------------- Major ------------------------------- // Major scale. // From Pentatonic scale with degree to midi and degree to Hz conversion // USAGE: Penta(60).degree2midi(3) ==> 67 midikey // Penta(60).degree2Hz(4) ==> 440 Hz //----------------------------------------------------------------------- Major(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+5; degree2midi(4) = key+7; degree2midi(5) = key+9; degree2midi(6) = key+11; degree2midi(7) = key+12; degree2midi(d) = degree2midi(d-8)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; //----------------------------------String------------------------------- // A karplus-strong string. // // USAGE: string(440Hz, 4s, 1.0, button("play")) // or button("play") : string(440Hz, 4s, 1.0) //----------------------------------------------------------------------- string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SCMajDryHarp.dsp
faust
Adapted from Harpe by Yann Orlarey; Modification Grame July 2015 =============== DESCRIPTION ================= : - C Major dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Rocking = plucking all strings one by one ----------------------------------------------- Harpe : simple string instrument (based on Karplus-Strong) ----------------------------------------------- basic midi key note cycle length control cycle length general tempo (ba.beat per sec) -------------------------------Harpe---------------------------------- Harpe is a simple string instrument. Move the "hand" to play the various strings ----------------------------------------------------------------------- number of strings Midi key of first string l = vslider("h:parameters/volume [style:knob][unit: dB]", -20, -60, 0, 0.01) : ba.db2linear; ----------------------------------Harpe-------------------------------- USAGE: hand : harpe(C,10,60) : _,_; C is the filter coefficient 0..1 Build a N (10) strings harpe using a pentatonic scale based on midi key b (60) Each string is triggered by a specific position of the "hand" ----------------------------------------------------------------------- envReader(twig,enveloppe):* ----------------------------------Penta------------------------------- Pentatonic scale with degree to midi and degree to Hz conversion USAGE: Penta(60).degree2midi(3) ==> 67 midikey Penta(60).degree2Hz(4) ==> 440 Hz ----------------------------------------------------------------------- ---------------------------------- Major ------------------------------- Major scale. From Pentatonic scale with degree to midi and degree to Hz conversion USAGE: Penta(60).degree2midi(3) ==> 67 midikey Penta(60).degree2Hz(4) ==> 440 Hz ----------------------------------------------------------------------- ----------------------------------String------------------------------- A karplus-strong string. USAGE: string(440Hz, 4s, 1.0, button("play")) or button("play") : string(440Hz, 4s, 1.0) ----------------------------------------------------------------------- attenuation coefficient
declare name "CMajDryHarp"; import("stdfaust.lib"); process = vgroup("harpe", h : harpe(C,N,K) :> *(l),*(l)) with { h = hslider("[1]Instrument Hand[1] [acc:0 1 -10 0 10]", 24, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with{ bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; l = -10 : ba.db2linear; C = 0.5; }; harpe(C,N,b) = _ <: par(i, N, position(i+1) :string(C,Major(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; Major(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+5; degree2midi(4) = key+7; degree2midi(5) = key+9; degree2midi(6) = key+11; degree2midi(7) = key+12; degree2midi(d) = degree2midi(d-8)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; };
ff6b8c9bc10d2bd58e0d7474c936bcaf22a22d7f538bafa4d43872784486dca6
RuolunWeng/ruolunweng.github.io
Meow.dsp
declare name "Meow"; declare description "WaveGuide Brass instrument from STK"; declare author "ER"; //From Brass by Romain Michon ([email protected]); import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Triple brass mimicking mewing cats - Left = silence. - Rocking from top Left to Front/Right : one cat mewing - Rotation = two cats in turn - Back/Front = Tutti */ //==================== INSTRUMENT ======================= process = vgroup("MEOW", par(i, 3, brass(i)) :> crybb); brass(n) = (borePressure <: deltaPressure(pressure(n)),_ : (lipFilter(freq(n)) <: *(mouthPressure(pressure(n))),(1-_)),_ : _, * :> + : fi.dcblocker) ~ (boreDelay(freq(n))) *(gain(n)): fi.lowpass((n+1),((n+1)*1500)); //==================== GUI SPECIFICATION ================ //gate = checkbox(" Play[1]"); gate = hslider(" ON/OFF", 0, 0, 1, 1):int; freq(0) = hslider("h:Instrument/v:Frequencies/Frequency 1 [unit:Hz][acc:1 0 -10 0 10][tooltip:Tone frequency]",370,280,380, 0.01):si.smooth(0.999); freq(1) = hslider("h:Instrument/v:Frequencies/Frequency 2 [unit:Hz][acc:0 0 -10 0 10][tooltip:Tone frequency]",440,380,550,0.01):si.smooth(0.999); freq(2) = hslider("h:Instrument/v:Frequencies/Frequency 3 [unit:Hz][acc:2 1 -10 0 12][tooltip:Tone frequency]",587.32,550,700,0.01):si.smooth(0.999); gain(0) = hslider("h:Instrument/v:Gain/Volume 1 [style:knob][acc:1 1 -12 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(1) = hslider("h:Instrument/v:Gain/Volume 2 [style:knob][acc:0 1 -12 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(2) = hslider("h:Instrument/v:Gain/Volume 3 [style:knob][acc:2 0 -12 0 10][tooltip:Gain (value between 0 and 1)]",0.5,0,0.5,0.01); pressure(0) = 0.37; pressure(1) = 0.68; pressure(2) = 1.0; lipTension = 0.780; slideLength = 0.041; vibratoFreq = 6; vibratoGain = 0.05; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.1; envelopeAttack = 0.01; envelopeDecay = 0.001; envelopeRelease = 2; //==================== SIGNAL PROCESSING ================ crybb = ve.crybaby(wah) with { wah = hslider("Wah Wah[acc:0 0 -15 10 0]", 0.5,0,1,0.01) : ba.automat(360, 15, 0.0); }; //--------- Synthesis parameters computing and functions declaration ----------- //lips are simulated by a biquad filter whose output is squared and hard-clipped, instrument.bandPassH and instrument.saturationPos are declared in instrument.lib lipFilterFrequency(f) = f*pow(4,(2*lipTension)-1); lipFilter(f) = *(0.03) : instrument.bandPassH(lipFilterFrequency(f),0.997) <: * : instrument.saturationPos; //de.delay times in number of samples slideTarget(f) = ((ma.SR/f)*2 + 3)*(0.5 + slideLength); boreDelay(f) = de.fdelay(4096,slideTarget(f)); //----------------------- Algorithm implementation ---------------------------- //vibrato vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); //envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato breathPressure(p) = p*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; mouthPressure(p) = 0.3*breathPressure(p); //scale the de.delay feedback borePressure = *(0.85); //differencial presure deltaPressure(p) = mouthPressure(p) - _;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Meow.dsp
faust
From Brass by Romain Michon ([email protected]); =============== DESCRIPTION ================= : - Triple brass mimicking mewing cats - Left = silence. - Rocking from top Left to Front/Right : one cat mewing - Rotation = two cats in turn - Back/Front = Tutti ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ gate = checkbox(" Play[1]"); ==================== SIGNAL PROCESSING ================ --------- Synthesis parameters computing and functions declaration ----------- lips are simulated by a biquad filter whose output is squared and hard-clipped, instrument.bandPassH and instrument.saturationPos are declared in instrument.lib de.delay times in number of samples ----------------------- Algorithm implementation ---------------------------- vibrato envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato scale the de.delay feedback differencial presure
declare name "Meow"; declare description "WaveGuide Brass instrument from STK"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("MEOW", par(i, 3, brass(i)) :> crybb); brass(n) = (borePressure <: deltaPressure(pressure(n)),_ : (lipFilter(freq(n)) <: *(mouthPressure(pressure(n))),(1-_)),_ : _, * :> + : fi.dcblocker) ~ (boreDelay(freq(n))) *(gain(n)): fi.lowpass((n+1),((n+1)*1500)); gate = hslider(" ON/OFF", 0, 0, 1, 1):int; freq(0) = hslider("h:Instrument/v:Frequencies/Frequency 1 [unit:Hz][acc:1 0 -10 0 10][tooltip:Tone frequency]",370,280,380, 0.01):si.smooth(0.999); freq(1) = hslider("h:Instrument/v:Frequencies/Frequency 2 [unit:Hz][acc:0 0 -10 0 10][tooltip:Tone frequency]",440,380,550,0.01):si.smooth(0.999); freq(2) = hslider("h:Instrument/v:Frequencies/Frequency 3 [unit:Hz][acc:2 1 -10 0 12][tooltip:Tone frequency]",587.32,550,700,0.01):si.smooth(0.999); gain(0) = hslider("h:Instrument/v:Gain/Volume 1 [style:knob][acc:1 1 -12 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(1) = hslider("h:Instrument/v:Gain/Volume 2 [style:knob][acc:0 1 -12 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); gain(2) = hslider("h:Instrument/v:Gain/Volume 3 [style:knob][acc:2 0 -12 0 10][tooltip:Gain (value between 0 and 1)]",0.5,0,0.5,0.01); pressure(0) = 0.37; pressure(1) = 0.68; pressure(2) = 1.0; lipTension = 0.780; slideLength = 0.041; vibratoFreq = 6; vibratoGain = 0.05; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.1; envelopeAttack = 0.01; envelopeDecay = 0.001; envelopeRelease = 2; crybb = ve.crybaby(wah) with { wah = hslider("Wah Wah[acc:0 0 -15 10 0]", 0.5,0,1,0.01) : ba.automat(360, 15, 0.0); }; lipFilterFrequency(f) = f*pow(4,(2*lipTension)-1); lipFilter(f) = *(0.03) : instrument.bandPassH(lipFilterFrequency(f),0.997) <: * : instrument.saturationPos; slideTarget(f) = ((ma.SR/f)*2 + 3)*(0.5 + slideLength); boreDelay(f) = de.fdelay(4096,slideTarget(f)); vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); breathPressure(p) = p*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; mouthPressure(p) = 0.3*breathPressure(p); borePressure = *(0.85); deltaPressure(p) = mouthPressure(p) - _;
938917b089803ede9918934114b1f998e087b2815a55ce9494bc9a46f5f51cb8
RuolunWeng/ruolunweng.github.io
PentatonicFlute.dsp
declare name "Pentatonic Flute"; declare description "Nonlinear WaveGuide Flute"; declare author "ER";// Adapted from "Flute" by Romain Michon ([email protected]); /* =============== DESCRIPTION ================= : - Pentatonic flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Head = Reverberation - Front = long notes - Back = short notes */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = par(i, N, flute(i)):>_<: instrReverbFlute; //==================== GUI SPECIFICATION ================ vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; //-------------------- Non-Variable Parameters ----------- N = 14; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; //----------------------- Frequency Table -------------------- freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; //Global envelope env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; //Vibrato Envelope vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 7, 0, N, 1):int: ba.automat(bps, 15, 0.0)// => gate with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; //----------------------- INSTRREVERB ---------------------------- // GUI for re.zita_rev1_stereo from effect.lib // // USAGE: // _,_ : instrRerveb instrReverbFlute = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[4]Reverb/[1]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[4]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.5,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/PentatonicFlute.dsp
faust
Adapted from "Flute" by Romain Michon ([email protected]); =============== DESCRIPTION ================= : - Pentatonic flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Head = Reverberation - Front = long notes - Back = short notes ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ -------------------- Non-Variable Parameters ----------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope ------------------------- Enveloppe Trigger -------------------------------------------- => gate ----------------------- INSTRREVERB ---------------------------- GUI for re.zita_rev1_stereo from effect.lib USAGE: _,_ : instrRerveb
declare name "Pentatonic Flute"; declare description "Nonlinear WaveGuide Flute"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = par(i, N, flute(i)):>_<: instrReverbFlute; vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; N = 14; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; freq(0) = 184.99; freq(1) = 207.65; freq(2) = 233.08; freq(3) = 277.18; freq(4) = 311.12; freq(d) = freq(d-5)*2; feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); trigger(n) = position(n): trig with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; with{ bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; instrReverbFlute = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[4]Reverb/[1]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[4]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.5,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
d30fe32cf8e4cf92e9ffca1e860104243cd08883949470a498ead7647c07d210
RuolunWeng/ruolunweng.github.io
CMajFlute.dsp
declare name "C Major Flute"; declare author "ER";// Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected])"; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - C Major flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Head = Reverberation - Front = long notes - Back = short notes */ //==================== INSTRUMENT ======================= flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = vgroup("C Maj Flute", par(i, N, flute(i)):>_<: instrReverbFlute); //==================== GUI SPECIFICATION ================ vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; //-------------------- Non-Variable Parameters ----------- N = 17; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; //----------------------- Frequency Table -------------------- freq(0) = 261.62; freq(1) = 293.66; freq(2) = 329.62; freq(3) = 349.22; freq(4) = 391.99; freq(5) = 440.00; freq(6) = 493.88; freq(d) = freq(d-7)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; //Global envelope env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; //Vibrato Envelope vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("h:[1]/[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; hand = hslider("h:[1]/[1]Instrument Hand[acc:0 1 -12 0 10]", 9, 0, N, 1): ba.automat(bps, 15, 0.0)// => gate with { bps = hslider("h:[1]/[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; //----------------------- INSTRREVERB ---------------------------- // GUI for re.zita_rev1_stereo from effect.lib // // USAGE: // _,_ : instrRerveb instrReverbFlute = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverb/[1]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.5,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/CMajFlute.dsp
faust
Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected])"; =============== DESCRIPTION ================= : - C Major flute - Rocking = playing all notes from low to high frequencies - Left = Silence/Slow rhythm - Right = Fast rhythm - Head = Reverberation - Front = long notes - Back = short notes ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ -------------------- Non-Variable Parameters ----------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope ------------------------- Enveloppe Trigger -------------------------------------------- => gate ----------------------- INSTRREVERB ---------------------------- GUI for re.zita_rev1_stereo from effect.lib USAGE: _,_ : instrRerveb
declare name "C Major Flute"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; process = vgroup("C Maj Flute", par(i, N, flute(i)):>_<: instrReverbFlute); vibratoFreq = 2.5; env1Attack = 0.06; env1Release = 1; N = 17; gain = 1; pressure = 0.9; breathAmp = 0.01; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.1; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; freq(0) = 261.62; freq(1) = 293.66; freq(2) = 329.62; freq(3) = 349.22; freq(4) = 391.99; freq(5) = 440.00; freq(6) = 493.88; freq(d) = freq(d-7)*2; feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength(f) = (ma.SR/f)/2-2; boreDelayLength(f) = ma.SR/f-2; embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); breath(t) = no.noise*env1(t); flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); trigger(n) = position(n): trig with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); noteDuration = hslider("h:[1]/[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; trig = upfront : release(noteDuration) : >(0.0); }; position(n) = abs(hand - n) < 0.5; with { bps = hslider("h:[1]/[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; instrReverbFlute = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverb/[1]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.5,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
dc9431b93dfaa663d2add99dd2b016d1a627ea5ee7bcf579443d9b454f985dbe
RuolunWeng/ruolunweng.github.io
ChromaticSoftHarp.dsp
declare name "Chromatic Soft Harp"; declare author "ER";//Adapted from Nonlinear EKS by Julius Smith and Romain Michon; declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= - Reverberated soft chromatic harp - Left = Lower frequencies/Silence when still - Front = Resonance - Back = No resonance - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one */ //==================== INSTRUMENT ======================= process = par(i, N, NFLeks(i)):>_<: instrReverbHarp : *(vol),*(vol); NFLeks(n) = filtered_excitation(n+1,P(freq(n)),freq(n)) : stringloop(freq(n)); //==================== GUI SPECIFICATION ================ // standard MIDI voice parameters: // NOTE: The labels MUST be "freq", "gain", and "gate" for faust2pd N = 24; hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; vol = 2; pickangle = 0.9; beta = 0.5; // String decay time in seconds: t60 = hslider("h:[2]Reverb/[1]Resonance (InstrReverb)[unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) B = 0; L = -10 : ba.db2linear; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 130.81; freq(1) = 138.59; freq(2) = 146.83; freq(3) = 155.56; freq(4) = 164.81; freq(5) = 174.61; freq(6) = 184.99; freq(7) = 195.99; freq(8) = 207.65; freq(9) = 220.00; freq(10) = 233.08; freq(11) = 246.94; freq(d) = freq(d-12)*(2); //==================== SIGNAL PROCESSING ================ //----------------------- noiseburst ------------------------- // White no.noise burst (adapted from Faust's karplus.dsp example) // Requires music.lib (for no.noise) noiseburst(d,e) = no.noise : *(trigger(d,e)) with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; //nlfOrder = 6; P(f) = ma.SR/f ; // fundamental period in samples Pmax = 4096; // maximum P (for de.delay-line allocation) ppdel(f) = beta*P(f); // pick position de.delay pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain // Original EKS damping filter: b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); // Linear phase FIR3 damping filter: h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); loopfilter(f) = dampingfilter2(f); // or dampingfilter1 filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); //================================= REVERB ============================== instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverb/[2]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 17]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverb/[3]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 16]", 0.72,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/ChromaticSoftHarp.dsp
faust
Adapted from Nonlinear EKS by Julius Smith and Romain Michon; =============== DESCRIPTION ================= - Reverberated soft chromatic harp - Left = Lower frequencies/Silence when still - Front = Resonance - Back = No resonance - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ standard MIDI voice parameters: NOTE: The labels MUST be "freq", "gain", and "gate" for faust2pd => gate String decay time in seconds: -60db decay time (sec) ---------------------------------- FREQUENCY TABLE --------------------------- ==================== SIGNAL PROCESSING ================ ----------------------- noiseburst ------------------------- White no.noise burst (adapted from Faust's karplus.dsp example) Requires music.lib (for no.noise) nlfOrder = 6; fundamental period in samples maximum P (for de.delay-line allocation) pick position de.delay defined in filter.lib defined in signal.lib multiplies loop-gain Original EKS damping filter: S and 1-S Linear phase FIR3 damping filter: or dampingfilter1 see filter.lib ================================= REVERB ==============================
declare name "Chromatic Soft Harp"; declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = par(i, N, NFLeks(i)):>_<: instrReverbHarp : *(vol),*(vol); NFLeks(n) = filtered_excitation(n+1,P(freq(n)),freq(n)) : stringloop(freq(n)); N = 24; with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; vol = 2; pickangle = 0.9; beta = 0.5; B = 0; L = -10 : ba.db2linear; freq(0) = 130.81; freq(1) = 138.59; freq(2) = 146.83; freq(3) = 155.56; freq(4) = 164.81; freq(5) = 174.61; freq(6) = 184.99; freq(7) = 195.99; freq(8) = 207.65; freq(9) = 220.00; freq(10) = 233.08; freq(11) = 246.94; freq(d) = freq(d-12)*(2); noiseburst(d,e) = no.noise : *(trigger(d,e)) with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[2]Reverb/[2]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 17]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[2]Reverb/[3]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 16]", 0.72,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
d5e406ea04e10deb4455bbb03c55f619839061abb64bcdd1adc4d8f1a267690c
RuolunWeng/ruolunweng.github.io
SFlute.dsp
declare name "Flute"; declare description "Nonlinear WaveGuide Flute"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "A simple flute based on Smith algorythm: https://ccrma.stanford.edu/~jos/pasp/Flutes_Recorders_Pipe_Organs.html"; //Modifications GRAME July 2015 /* =========== DESCRITPION =========== - Flute - Turn ON flute (0=OFF, 1=ON) - Head = High frequencies/ Silence - Bottom = Low frequencies - Left = No vibrato - Right = Fast vibrato - Front = Full sound - Back = Breathy sound */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = flute; //==================== GUI SPECIFICATION ================ freq = hslider("[1]Frequency[acc:1 1 -10 0 10]", 440,247,1200,1):si.smooth(0.999); pressure = hslider("[2]Pressure[style:knob][acc:1 0 -10 0 10]", 0.96, 0.2, 0.99, 0.01):si.smooth(0.999):min(0.99):max(0.2); breathAmp = hslider("[3]Breath Noise[style:knob][acc:2 0 -10 0 10]", 0.02, 0.01, 0.2, 0.01):si.smooth(0.999):min(0.2):max(0.01); gate = hslider("[0]ON/OFF (ASR Envelope)",0,0,1,1); vibratoFreq = hslider("[4]Vibrato Freq (Vibrato Envelope)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 4,0.5,8,0.1); env1Attack = 0.1;//hslider("h:Parameters/Press_Env_Attack[unit:s][style:knob][acc:1 0 -10 0 10][tooltip:Pressure envelope attack duration]",0.05,0.05,0.2,0.01); //-------------------- Non-Variable Parameters ----------- gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.05; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) envelopeMod = en.asr(nonLinAttack,1,0.1,gate); //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; //Global envelope env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; //Vibrato Envelope vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SFlute.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); Modifications GRAME July 2015 =========== DESCRITPION =========== - Flute - Turn ON flute (0=OFF, 1=ON) - Head = High frequencies/ Silence - Bottom = Low frequencies - Left = No vibrato - Right = Fast vibrato - Front = Full sound - Back = Breathy sound ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ hslider("h:Parameters/Press_Env_Attack[unit:s][style:knob][acc:1 0 -10 0 10][tooltip:Pressure envelope attack duration]",0.05,0.05,0.2,0.01); -------------------- Non-Variable Parameters ----------- ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instrument.lib) nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope
declare name "Flute"; declare description "Nonlinear WaveGuide Flute"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare description "A simple flute based on Smith algorythm: https://ccrma.stanford.edu/~jos/pasp/Flutes_Recorders_Pipe_Organs.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = flute; freq = hslider("[1]Frequency[acc:1 1 -10 0 10]", 440,247,1200,1):si.smooth(0.999); pressure = hslider("[2]Pressure[style:knob][acc:1 0 -10 0 10]", 0.96, 0.2, 0.99, 0.01):si.smooth(0.999):min(0.99):max(0.2); breathAmp = hslider("[3]Breath Noise[style:knob][acc:2 0 -10 0 10]", 0.02, 0.01, 0.2, 0.01):si.smooth(0.999):min(0.2):max(0.01); gate = hslider("[0]ON/OFF (ASR Envelope)",0,0,1,1); vibratoFreq = hslider("[4]Vibrato Freq (Vibrato Envelope)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 4,0.5,8,0.1); gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.05; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; nlfOrder = 6; envelopeMod = en.asr(nonLinAttack,1,0.1,gate); NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato;
b3cb562dddea4f176164b1a77c9bccc5e157fb1876aea9af320ac43621df9aa0
RuolunWeng/ruolunweng.github.io
SRandomFlute.dsp
declare name "Random Flute"; declare author "ER";//Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected]); import("stdfaust.lib"); instrument = library("instruments.lib"); /* ============== DESCRIPTION ================ - Random frequency flute - Left = Slow rhythm/long notes/silence - Right = Fast rhythm/short note */ //==================== INSTRUMENT ======================= flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = flute; //==================== GUI SPECIFICATION ================ pressure = 1; breathAmp = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 10]", 0.02, 0.01, 0.05, 0.0001):si.smooth(0.999):min(0.05):max(0.01); gate = pulsaflute.gate; vibratoFreq = 5; env1Attack = 0.05; //--------------------------- Random Frequency --------------------------- freq = gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(1500)+(100) with { sampleAndhold(t) = select2(t) ~_; sahgate(g) = g : upfront : counter -(3) <=(0); upfront(x) = abs(x-x')>0.5; counter(g) = (+(1):*(1-g))~_; }; //----------------------- Pulsar -------------------------------------- pulsaflute = environment { gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); speed = hslider ("h:[1]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 3,1,6,0.0001):fi.lowpass(1,1); proba = hslider ("h:[1]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,60,100,1) *(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; //-------------------- Non-Variable Parameters ----------- N = 27; gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) envelopeMod = en.asr(nonLinAttack,1,0.1,gate); //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; //Global envelope env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; //Vibrato Envelope vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SRandomFlute.dsp
faust
Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected]); ============== DESCRIPTION ================ - Random frequency flute - Left = Slow rhythm/long notes/silence - Right = Fast rhythm/short note ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ --------------------------- Random Frequency --------------------------- ----------------------- Pulsar -------------------------------------- -------------------- Non-Variable Parameters ----------- ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instrument.lib) nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope
declare name "Random Flute"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = flute; pressure = 1; breathAmp = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 10]", 0.02, 0.01, 0.05, 0.0001):si.smooth(0.999):min(0.05):max(0.01); gate = pulsaflute.gate; vibratoFreq = 5; env1Attack = 0.05; freq = gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(1500)+(100) with { sampleAndhold(t) = select2(t) ~_; sahgate(g) = g : upfront : counter -(3) <=(0); upfront(x) = abs(x-x')>0.5; counter(g) = (+(1):*(1-g))~_; }; pulsaflute = environment { gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); speed = hslider ("h:[1]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 3,1,6,0.0001):fi.lowpass(1,1); proba = hslider ("h:[1]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,60,100,1) *(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; N = 27; gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; nlfOrder = 6; envelopeMod = en.asr(nonLinAttack,1,0.1,gate); NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato;
85057ad282435db7046d26ef04c57ae950948691dda623d75b8feff96d685fc3
RuolunWeng/ruolunweng.github.io
BouncyHarp.dsp
declare name "Bouncy Harp"; declare author "ER"; //From Nonlinear EKS by Julius Smith and Romain Michon; import("stdfaust.lib"); /* =============== DESCRIPTION ================= : Do not hesitate to make swift and abrupt gestures. - Head : Silence/reverb. - Swing : To pluck the strings of the harp. - Fishing rod with abrupt stop in Head position : bouncing string effect. - Frying Pan and Tennis Racket : to pluck a single bouncing string. - LOOPING MODE : ==> Bottom position/Rotation around Bottom = record loop ==> Head = listen to loop ==> Swift mouvements around head = siren/scratched record effect */ //==================== INSTRUMENT ======================= process = par(i, N, NFLeks(i)):>_<: select2(byPass,capture,_) <: instrReverbHarp; NFLeks(n) = filtered_excitation(n,P(octave(n)),octave(n)) : stringloop(octave(n)); capture = _<:capt,_ : select2(B) with{ B = hand > (0.5); // Capture sound while hand plays I = int(B); // convert button signal from float to integer R = (I-I') <= 0; // Reset capture when button is pressed D = (+(I):*(R))~_; // Compute capture duration while button is pressed: 0..NNNN0..MMM capt = *(B) : (+ : de.delay(1048576, D-1)) ~ *(1.0-B) ; }; //==================== GUI SPECIFICATION ================ N = 15; hand = hslider("[1]Instrument Hand (Loop mode: hand>0 = recording, 0 = playback)[acc:1 0 -8 0 11]", 0, 0, N, 1);// => gate gain = 1; byPass = checkbox("[7]Loop Mode ON/OFF (max 20s)") : reverse;//In loop capture mode : hand>0 = recording, 0 = stop recording/playback (Y axis upward) reverse = select2(_, 1, 0); pickangle = 0.9 * hslider("[3]Dry/Soft Strings[acc:2 1 -10 0 10]", 0.45,0,0.9,0.1); beta = hslider("[4]Picking Position [acc:2 1 -10 0 10]", 0.13, 0.02, 0.5, 0.01); t60 = hslider("[5]Resonance (InstrReverb)[acc:1 1 -10 0 10]", 5, 0.5, 10, 0.01); // -60db decay time (sec) B = 0.5; L = -10 : ba.db2linear; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 115; freq(1) = 130; freq(2) = 145; freq(3) = 160; freq(4) = 175; freq(d) = freq(d-5)*(2); octave(d) = freq(d) * hslider("[2]Hight[acc:0 0 -10 0 10]", 3, 1, 6, 0.1) : si.smooth(0.999); //==================== SIGNAL PROCESSING ================ //----------------------- noiseburst ------------------------- // White no.noise burst (adapted from Faust's karplus.dsp example) // Requires music.lib (for no.noise) noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; P(f) = ma.SR/f ; // fundamental period in samples Pmax = 4096; // maximum P (for de.delay-line allocation) ppdel(f) = beta*P(f); // pick position de.delay pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain // Original EKS damping filter: b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); // Linear phase FIR3 damping filter: h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); loopfilter(f) = dampingfilter2(f); // or dampingfilter1 filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:[8]Reverb/ Reverberation Volume (InstrReverb)[acc:1 1 -10 20 0 0.5] ",0.5,0.1,1,0.01) : si.smooth(0.999); roomSize = hslider("v:[8]Reverb/ÒReverberation Room Size (InstrReverb)[acc:1 1 -10 0 25]", 0.72,0.01,2,0.01); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/BouncyHarp.dsp
faust
From Nonlinear EKS by Julius Smith and Romain Michon; =============== DESCRIPTION ================= : Do not hesitate to make swift and abrupt gestures. - Head : Silence/reverb. - Swing : To pluck the strings of the harp. - Fishing rod with abrupt stop in Head position : bouncing string effect. - Frying Pan and Tennis Racket : to pluck a single bouncing string. - LOOPING MODE : ==> Bottom position/Rotation around Bottom = record loop ==> Head = listen to loop ==> Swift mouvements around head = siren/scratched record effect ==================== INSTRUMENT ======================= Capture sound while hand plays convert button signal from float to integer Reset capture when button is pressed Compute capture duration while button is pressed: 0..NNNN0..MMM ==================== GUI SPECIFICATION ================ => gate In loop capture mode : hand>0 = recording, 0 = stop recording/playback (Y axis upward) -60db decay time (sec) ---------------------------------- FREQUENCY TABLE --------------------------- ==================== SIGNAL PROCESSING ================ ----------------------- noiseburst ------------------------- White no.noise burst (adapted from Faust's karplus.dsp example) Requires music.lib (for no.noise) fundamental period in samples maximum P (for de.delay-line allocation) pick position de.delay defined in filter.lib defined in signal.lib multiplies loop-gain Original EKS damping filter: S and 1-S Linear phase FIR3 damping filter: or dampingfilter1 see filter.lib
declare name "Bouncy Harp"; import("stdfaust.lib"); process = par(i, N, NFLeks(i)):>_<: select2(byPass,capture,_) <: instrReverbHarp; NFLeks(n) = filtered_excitation(n,P(octave(n)),octave(n)) : stringloop(octave(n)); capture = _<:capt,_ : select2(B) with{ capt = *(B) : (+ : de.delay(1048576, D-1)) ~ *(1.0-B) ; }; N = 15; gain = 1; reverse = select2(_, 1, 0); pickangle = 0.9 * hslider("[3]Dry/Soft Strings[acc:2 1 -10 0 10]", 0.45,0,0.9,0.1); beta = hslider("[4]Picking Position [acc:2 1 -10 0 10]", 0.13, 0.02, 0.5, 0.01); B = 0.5; L = -10 : ba.db2linear; freq(0) = 115; freq(1) = 130; freq(2) = 145; freq(3) = 160; freq(4) = 175; freq(d) = freq(d-5)*(2); octave(d) = freq(d) * hslider("[2]Hight[acc:0 0 -10 0 10]", 3, 1, 6, 0.1) : si.smooth(0.999); noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:[8]Reverb/ Reverberation Volume (InstrReverb)[acc:1 1 -10 20 0 0.5] ",0.5,0.1,1,0.01) : si.smooth(0.999); roomSize = hslider("v:[8]Reverb/ÒReverberation Room Size (InstrReverb)[acc:1 1 -10 0 25]", 0.72,0.01,2,0.01); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
f8836c6be0ed718f79305e4258fe18cdf874ea7232d467ba787c0c649357bc86
RuolunWeng/ruolunweng.github.io
StalactiteHarp.dsp
declare name "Stalactite Harp"; declare author "ER"; //From Non-linear EKS by Julius Smith and Romain Michon; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Stalactite harp mimicking the sound of drops of water in a cave - Head = Reverberation - Left = Rare drops - Right = Frequent and rapidly falling drops - Back = Harp/Silence */ //==================== INSTRUMENT ======================= process = vgroup("Stalactite Harp",par(i, N, NFLeks(i)):>_<: instrReverbHarp); NFLeks(n) = filtered_excitation(n+1,P(freq(n)),freq(n)) : stringloop(freq(n)) : fi.lowpass(1,8000); //==================== GUI SPECIFICATION ================ N = 14; hand = hslider("[1]Instrument Hand[acc:2 1 -10 0 10]", 8, 0, N, 1) : ba.automat(360, 15, 0.0);// => gate gain = 1; pickangle = 0.81; beta = 0.5; t60 = hslider("h:[3]Reverb/[1]Resonance (InstrReverb)[style:knob][acc:0 1 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) B = 0; L = -10 : ba.db2linear; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 1108.73; freq(1) = 1244.50; freq(2) = 1479.97; freq(3) = 1661.21; freq(4) = 1864.65; freq(d) = freq(d-5)*2; //==================== SIGNAL PROCESSING ================ //----------------------- noiseburst ------------------------- // White no.noise burst (adapted from Faust's karplus.dsp example) // Requires music.lib (for no.noise) noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = select2(position(d),0,pulsaxo.gate) : upfront : release(n) : > (0.0); }; pulsaxo = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); // min > 0 pour eviter division par 0 speed = hslider ("h:[2]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -15 0 8]", 2,0.1,10,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:2 0 -15 0 10]", 95,20,100,1) * (0.01) : fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; P(f) = ma.SR/f ; // fundamental period in samples Pmax = 4096; // maximum P (for de.delay-line allocation) ppdel(f) = beta*P(f); // pick position de.delay pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain // Original EKS damping filter: b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); // Linear phase FIR3 damping filter: h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); loopfilter(f) = dampingfilter2(f); // or dampingfilter1 filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f));// : NLFM(f)); instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/[2]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.2,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/[3]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.72,0.05,1.7,0.01):min(1.7):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/StalactiteHarp.dsp
faust
From Non-linear EKS by Julius Smith and Romain Michon; =============== DESCRIPTION ================= : - Stalactite harp mimicking the sound of drops of water in a cave - Head = Reverberation - Left = Rare drops - Right = Frequent and rapidly falling drops - Back = Harp/Silence ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ => gate -60db decay time (sec) ---------------------------------- FREQUENCY TABLE --------------------------- ==================== SIGNAL PROCESSING ================ ----------------------- noiseburst ------------------------- White no.noise burst (adapted from Faust's karplus.dsp example) Requires music.lib (for no.noise) min > 0 pour eviter division par 0 fundamental period in samples maximum P (for de.delay-line allocation) pick position de.delay defined in filter.lib defined in signal.lib multiplies loop-gain Original EKS damping filter: S and 1-S Linear phase FIR3 damping filter: or dampingfilter1 see filter.lib : NLFM(f));
declare name "Stalactite Harp"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Stalactite Harp",par(i, N, NFLeks(i)):>_<: instrReverbHarp); NFLeks(n) = filtered_excitation(n+1,P(freq(n)),freq(n)) : stringloop(freq(n)) : fi.lowpass(1,8000); N = 14; gain = 1; pickangle = 0.81; beta = 0.5; B = 0; L = -10 : ba.db2linear; freq(0) = 1108.73; freq(1) = 1244.50; freq(2) = 1479.97; freq(3) = 1661.21; freq(4) = 1864.65; freq(d) = freq(d-5)*2; noiseburst(d,e) = no.noise : *(trigger(d,e)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = select2(position(d),0,pulsaxo.gate) : upfront : release(n) : > (0.0); }; pulsaxo = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); speed = hslider ("h:[2]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -15 0 8]", 2,0.1,10,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:2 0 -15 0 10]", 95,20,100,1) * (0.01) : fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/[2]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.2,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/[3]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.72,0.05,1.7,0.01):min(1.7):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
bad9f084d37bb26314c079e3bffd91acbcdeeb59cd0b0950f0817c4b603cf8fc
RuolunWeng/ruolunweng.github.io
SClarinet.dsp
declare name "Clarinet"; declare description "Nonlinear WaveGuide Clarinet"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "A simple clarinet physical model, as discussed by Smith (1986), McIntyre, Schumacher, Woodhouse (1983), and others."; declare reference "https://ccrma.stanford.edu/~jos/pasp/Woodwinds.html"; //Modification Grame July 2015 import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Clarinet responding to vigorous gestures - Turn ON clarinet (0=OFF, 1=ON) - Head = High frequencies/Silence when hold still - Tilt = very soft sound - Bottom = Low frequencies - Right = Breathy clarinet - Fishing rod (vigorous mouvements) : ==> Downward = to reach lower frequencies ==> Upward = To 'through' the sound in the air = vanishes, comes back when Tilt - Rocking = from full sound to breathy sound - Shaking in right position = no.noise impulses */ //==================== INSTRUMENT ======================= process = vgroup("CLARINET", //Commuted Loss Filtering (_,(breathPressure <: _,_) : (filter*-0.95 - _ <: //Non-Linear Scattering *(reedTable)) + _) ~ //Delay with Feedback (delayLine):// : NLFM) : //scaling and stereo *(gain)*1.5); //==================== GUI SPECIFICATION ================ freq = hslider("h:[2]Instrument/Frequency[unit:Hz][tooltip:Tone frequency][acc:1 1 -14 0 10]", 440,110,1300,0.01):si.smooth(0.999); gain = 1; gate = hslider("[1]ON/OFF",0,0,1,1); reedStiffness = hslider("h:[3]Parameters/Instrument Stiffness[style:knob][acc:0 1 -12 0 12]", 0.25,0.01,1,0.01); noiseGain = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 12]", 0.02,0,0.12,0.01); pressure = hslider("h:[3]Parameters/ Pressure[style:knob][acc:1 0 -10 0 10]", 0.8,0.25,1,0.01); vibratoFreq = 5; vibratoGain = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeAttack = 0.1; envelopeDecay = 0.05; envelopeRelease = 0.1; //==================== SIGNAL PROCESSING ====================== //----------------------- Synthesis PARAMETERS computing and functions declaration ---------------------------- //reed table PARAMETERS reedTableOffset = 0.7; reedTableSlope = -0.44 + (0.26*reedStiffness); //the reed function is declared in INSTRUMENT.lib reedTable = instrument.reed(reedTableOffset,reedTableSlope); //delay line with a length adapted in function of the order of nonlinear filter delayLength = ma.SR/freq*0.5 - 1.5;// - (nlfOrder*nonLinearity)*(typeModulation < 2); delayLine = de.fdelay(4096,delayLength); //one zero filter used as a allpass: pole is set to -1 filter = instrument.oneZero0(0.5,0.5); //stereoizer is declared in INSTRUMENT.lib and implement a stereo spacialisation in function of //the frequency period in number of samples //stereo = stereoizerCla(ma.SR/freq); //----------------------- Algorithm implementation ---------------------------- //Breath pressure + vibrato + breath no.noise + envelope (Attack / Decay / Sustain / Release) envelope = en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate)*pressure*0.9; vibrato = os.osc(vibratoFreq)*vibratoGain* instrument.envVibrato(0.1*2*vibratoAttack,0.9*2*vibratoAttack,100,vibratoRelease,gate); breath = envelope + envelope*no.noise*noiseGain; breathPressure = breath + breath*vibrato;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SClarinet.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); Modification Grame July 2015 =============== DESCRIPTION ================= : - Clarinet responding to vigorous gestures - Turn ON clarinet (0=OFF, 1=ON) - Head = High frequencies/Silence when hold still - Tilt = very soft sound - Bottom = Low frequencies - Right = Breathy clarinet - Fishing rod (vigorous mouvements) : ==> Downward = to reach lower frequencies ==> Upward = To 'through' the sound in the air = vanishes, comes back when Tilt - Rocking = from full sound to breathy sound - Shaking in right position = no.noise impulses ==================== INSTRUMENT ======================= Commuted Loss Filtering Non-Linear Scattering Delay with Feedback : NLFM) : scaling and stereo ==================== GUI SPECIFICATION ================ ==================== SIGNAL PROCESSING ====================== ----------------------- Synthesis PARAMETERS computing and functions declaration ---------------------------- reed table PARAMETERS the reed function is declared in INSTRUMENT.lib delay line with a length adapted in function of the order of nonlinear filter - (nlfOrder*nonLinearity)*(typeModulation < 2); one zero filter used as a allpass: pole is set to -1 stereoizer is declared in INSTRUMENT.lib and implement a stereo spacialisation in function of the frequency period in number of samples stereo = stereoizerCla(ma.SR/freq); ----------------------- Algorithm implementation ---------------------------- Breath pressure + vibrato + breath no.noise + envelope (Attack / Decay / Sustain / Release)
declare name "Clarinet"; declare description "Nonlinear WaveGuide Clarinet"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare description "A simple clarinet physical model, as discussed by Smith (1986), McIntyre, Schumacher, Woodhouse (1983), and others."; declare reference "https://ccrma.stanford.edu/~jos/pasp/Woodwinds.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("CLARINET", (_,(breathPressure <: _,_) : (filter*-0.95 - _ <: *(reedTable)) + _) ~ *(gain)*1.5); freq = hslider("h:[2]Instrument/Frequency[unit:Hz][tooltip:Tone frequency][acc:1 1 -14 0 10]", 440,110,1300,0.01):si.smooth(0.999); gain = 1; gate = hslider("[1]ON/OFF",0,0,1,1); reedStiffness = hslider("h:[3]Parameters/Instrument Stiffness[style:knob][acc:0 1 -12 0 12]", 0.25,0.01,1,0.01); noiseGain = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 12]", 0.02,0,0.12,0.01); pressure = hslider("h:[3]Parameters/ Pressure[style:knob][acc:1 0 -10 0 10]", 0.8,0.25,1,0.01); vibratoFreq = 5; vibratoGain = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeAttack = 0.1; envelopeDecay = 0.05; envelopeRelease = 0.1; reedTableOffset = 0.7; reedTableSlope = -0.44 + (0.26*reedStiffness); reedTable = instrument.reed(reedTableOffset,reedTableSlope); delayLine = de.fdelay(4096,delayLength); filter = instrument.oneZero0(0.5,0.5); envelope = en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate)*pressure*0.9; vibrato = os.osc(vibratoFreq)*vibratoGain* instrument.envVibrato(0.1*2*vibratoAttack,0.9*2*vibratoAttack,100,vibratoRelease,gate); breath = envelope + envelope*no.noise*noiseGain; breathPressure = breath + breath*vibrato;
eaa5aff005c6a3078842a1c7693c203d6871d5f558569c54e635f84d48957ad4
RuolunWeng/ruolunweng.github.io
STibetanBowl.dsp
declare name "Tibetan Bowl"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; //Modifications GRAME July 2015 /* ============ DESCRIPTION ============= - Tibetan Bowl - Set the frequency manually - Fishing rod/Front shaking = Ringing the bowl - Right = maximum modulation - Rocking = modulating the sound */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = (((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i)~_))):>+: NLFM :> fi.lowpass(1, 5000); //==================== GUI SPECIFICATION ================ freq = hslider("[1]Frequency[unit:Hz][tooltip:Tone frequency]",440,180,780,1); gain = 0.5; gate = 0; select = hslider("[0]Play[tooltip:0=Bow; 1=Strike] [acc:2 1 -10 0 10]", 0,0,1,1); baseGain = 0.5; typeModulation = 3; nonLinearity = hslider("[2]Modulation[acc:0 1 -10 0 10][tooltip:Nonlinearity factor (value between 0 and 1)]",0.02,0,0.1,0.001):si.smooth(0.999); frequencyMod = hslider("[3]Modulation Frequency[unit:Hz][acc:0 0 -10 0 10]", 220,150,500,0.1):si.smooth(0.999); nonLinAttack = 0.1; //==================== MODAL PARAMETERS ================ preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),1,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); delayLengthBase = ma.SR/freq; //delay lengths in number of samples delayLength(x) = delayLengthBase/modes(preset,x); //delay lines delayLine(x) = de.delay(4096,delayLength(x)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); //One resonance resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x);
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/STibetanBowl.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); Modifications GRAME July 2015 ============ DESCRIPTION ============= - Tibetan Bowl - Set the frequency manually - Fishing rod/Front shaking = Ringing the bowl - Right = maximum modulation - Rocking = modulating the sound ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up ==================== GUI SPECIFICATION ================ ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used delay lengths in number of samples delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) One resonance
declare name "Tibetan Bowl"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; import("stdfaust.lib"); instrument = library("instruments.lib"); process = (((select-1)*-1) <: par(i,nModes,(resonance(i)~_))):>+: NLFM :> fi.lowpass(1, 5000); freq = hslider("[1]Frequency[unit:Hz][tooltip:Tone frequency]",440,180,780,1); gain = 0.5; gate = 0; select = hslider("[0]Play[tooltip:0=Bow; 1=Strike] [acc:2 1 -10 0 10]", 0,0,1,1); baseGain = 0.5; typeModulation = 3; nonLinearity = hslider("[2]Modulation[acc:0 1 -10 0 10][tooltip:Nonlinearity factor (value between 0 and 1)]",0.02,0,0.1,0.001):si.smooth(0.999); frequencyMod = hslider("[3]Modulation Frequency[unit:Hz][acc:0 0 -10 0 10]", 220,150,500,0.1):si.smooth(0.999); nonLinAttack = 0.1; preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; nlfOrder = 6; NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),1,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); nModes = nMode(preset); delayLengthBase = ma.SR/freq; delayLength(x) = delayLengthBase/modes(preset,x); delayLine(x) = de.delay(4096,delayLength(x)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x);
a0958f65433340898ec5f3d400d44753c35da32db6d4ba72431ed598bff3b0b1
RuolunWeng/ruolunweng.github.io
TunedBars.dsp
declare name "Tuned Bars"; declare author "ER";//From "Tuned Bar" by Romain Michon ([email protected]); import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Cascading tuned bars - Head = Reverberation / Silence - Bottom = Chime - Left = Low frequencies + slow rhythm - Right = High frequencies + fast rhythm - Reversed Fishing Rod = start at bottom or left or right and go rapidly up to head then down again - Left/Bottom/Left = Low pitched chime - Right/Bottom/Right = High pitched chime - Back/Front/Geiger counter = Chime */ //==================== INSTRUMENT ======================= process = par(i, N, tunedBar(i)):>_<: drywet(_,echo) <: instrReverbChime : *(2),*(2); tunedBar(n) = ((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i,octave(n),gate(n))~_)):> + : //Signal Scaling and stereo *(4); //==================== GUI SPECIFICATION ================ N = 10; gain = 1; gate(n) = position(n) : upfront; hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); B = hslider("[3]Speed[style:knob][acc:0 1 -10 0 10]", 360, 120, 720, 60): si.smooth(0.99) : min(720) : max(120) : int; hight = hslider("[2]Hight[acc:0 1 -10 0 10]", 4, 0.5, 8, 0.1);//:si.smooth(0.999); octave(d) = freq(d)*(hight); position(n) = abs(hand - n) < 0.5; upfront(x) = x>x'; select = 1; //----------------------- Frequency Table -------------------- freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 184.99; freq(4) = 207.65; freq(5) = 233.08; freq(d) = freq(d-6)*2; //==================== MODAL PARAMETERS ================ preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); //bow table parameters tableOffset = 0; tableSlope = 10 - (9*bowPressure); delayLengthBase(f) = ma.SR/f; //de.delay lengths in number of samples delayLength(x,f) = delayLengthBase(f)/modes(preset,x); //de.delay lines delayLine(x,f) = de.delay(4096,delayLength(x,f)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f); echo = +~(@(22050)*(feedback)); //feedback = hslider("Echo Intensity (Feedback)[acc:1 1 -5 0 12]", 0.1, 0.05, 0.65, 0.01):si.smooth(0.999):min(0.05):max(0.65); feedback = 0.8; drywet(x,y) = (1-c)*x + c*y with { c = hslider("[4]Echo Intensity[style:knob][unit:%][acc:1 1 -8 0 10]", 20,0,99,0.01)*(0.01):si.smooth(0.999):min(0.99):max(0.001); }; //instrReverb from instrument.lib instrReverbChime = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:[5]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 12]", 0.2,0.1,1.7,0.01):min(1.7):max(0.1); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/TunedBars.dsp
faust
From "Tuned Bar" by Romain Michon ([email protected]); =============== DESCRIPTION ================= : - Cascading tuned bars - Head = Reverberation / Silence - Bottom = Chime - Left = Low frequencies + slow rhythm - Right = High frequencies + fast rhythm - Reversed Fishing Rod = start at bottom or left or right and go rapidly up to head then down again - Left/Bottom/Left = Low pitched chime - Right/Bottom/Right = High pitched chime - Back/Front/Geiger counter = Chime ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up Signal Scaling and stereo ==================== GUI SPECIFICATION ================ :si.smooth(0.999); ----------------------- Frequency Table -------------------- ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used bow table parameters de.delay lengths in number of samples de.delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) ----------------------- Algorithm implementation ---------------------------- One resonance feedback = hslider("Echo Intensity (Feedback)[acc:1 1 -5 0 12]", 0.1, 0.05, 0.65, 0.01):si.smooth(0.999):min(0.05):max(0.65); instrReverb from instrument.lib
declare name "Tuned Bars"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = par(i, N, tunedBar(i)):>_<: drywet(_,echo) <: instrReverbChime : *(2),*(2); tunedBar(n) = ((select-1)*-1) <: par(i,nModes,(resonance(i,octave(n),gate(n))~_)):> + : *(4); N = 10; gain = 1; gate(n) = position(n) : upfront; hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); B = hslider("[3]Speed[style:knob][acc:0 1 -10 0 10]", 360, 120, 720, 60): si.smooth(0.99) : min(720) : max(120) : int; octave(d) = freq(d)*(hight); position(n) = abs(hand - n) < 0.5; upfront(x) = x>x'; select = 1; freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 184.99; freq(4) = 207.65; freq(5) = 233.08; freq(d) = freq(d-6)*2; preset = 2; nMode(2) = 4; modes(2,0) = 1; basegains(2,0) = pow(0.999,1); excitation(2,0,g) = 1*gain*g/nMode(2); modes(2,1) = 4.0198391420; basegains(2,1) = pow(0.999,2); excitation(2,1,g) = 1*gain*g/nMode(2); modes(2,2) = 10.7184986595; basegains(2,2) = pow(0.999,3); excitation(2,2,g) = 1*gain*g/nMode(2); modes(2,3) = 18.0697050938; basegains(2,3) = pow(0.999,4); excitation(2,3,g) = 1*gain*g/nMode(2); nModes = nMode(preset); tableOffset = 0; tableSlope = 10 - (9*bowPressure); delayLengthBase(f) = ma.SR/f; delayLength(x,f) = delayLengthBase(f)/modes(preset,x); delayLine(x,f) = de.delay(4096,delayLength(x,f)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f); echo = +~(@(22050)*(feedback)); feedback = 0.8; drywet(x,y) = (1-c)*x + c*y with { c = hslider("[4]Echo Intensity[style:knob][unit:%][acc:1 1 -8 0 10]", 20,0,99,0.01)*(0.01):si.smooth(0.999):min(0.99):max(0.001); }; instrReverbChime = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:[5]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 12]", 0.2,0.1,1.7,0.01):min(1.7):max(0.1); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
92a9d58046103c011247b549e1db14da3a57dff5f2a9c8b1f4312652796cd310
RuolunWeng/ruolunweng.github.io
BlowhistleBottle.dsp
declare name "Blowhistle Bottles"; declare author "ER"; //From "Blow bottle" by Romain Michon; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "This object implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook)."; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Blow bottles with whistling echo. - Left : silence/dying echo. - Head : reverberation - Front : single blow bottle. - Back : maximum whistling echo - Bottom : bottle + whistling echo without reverberation - Rocking : changes tone of blow bottle. - Fishing rod : varying reverberation. */ //==================== INSTRUMENT ======================= process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>_<: instrReverblow: (*(1),*(1))); blow(n)= par(i, 2, //differential pressure (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(i,n),_)~_: !,_: //signal scaling fi.dcblocker*envelopeG(trigger(n))*(0.5)<:+(voice(i,n))*resonGain(i)):>_ with{ baPaF(0,n) = bandPassFilter(freq(n)); baPaF(1,n) = bandPassFilter(freq(n)*8); voice(0,n) = 0*n; voice(1,n) = 1*(fi.resonbp(freq(n)*8,Q,gain):echo); resonGain(0) = 1; resonGain(1) =(hslider("v:[1]Instrument/Whistle Volume[acc:2 0 -10 0 10]", 0.07, 0, 0.2, 0.001))^2:si.smooth(0.999); echo = _:+~(@(delayEcho):*(feedback)); delayEcho = 44100; feedback = hslider("h:[2]Echo/Echo Intensity [style:knob][acc:2 0 -10 0 10]", 0.48, 0.2, 0.98, 0.01):si.smooth(0.999):min(0.98):max(0.2); }; //==================== GUI SPECIFICATION ================ N = 10; Q = 30; position(n) = abs(hand - n) < 0.5; hand = hslider("v:[1]Instrument/Instrument Hand[acc:0 1 -10 0 10]", 5, 0, N, 1):int:ba.automat(360, 15, 0.0); envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; //--------------------- Non-variable Parameters ------------- gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.5; //----------------------- Frequency Table -------------------- freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 195.99; freq(4) = 220.00; freq(d) = freq(d-5)*2; //==================== SIGNAL PROCESSING ================ //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //botlle radius bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); //----------------------- Algorithm implementation ---------------------------- //global envelope is of type attack - decay - sustain - release envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); //pressure envelope is also ADSR envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); //vibrato vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); //breat pressure breathPressure(t) = envelope(t) + vibrato(t); //breath no.noise randPressure(t) = noiseGain*no.noise*breathPressure(t) ; //------------------------- Enveloppe Trigger -------------------------------------------- trigger(n) = position(n): trig with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); trig = upfront : release(8820) : >(0.0); }; //------------------------ InstrReverb ---------------------------------------- //from instrument.lib instrReverblow = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.237,0.137,1,0.01) : si.smooth(0.999); roomSize = hslider("h:[3]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.72,0.4,2,0.01); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/BlowhistleBottle.dsp
faust
From "Blow bottle" by Romain Michon; Synthesis Tool Kit 4.3 (MIT style license); =============== DESCRIPTION ================= : - Blow bottles with whistling echo. - Left : silence/dying echo. - Head : reverberation - Front : single blow bottle. - Back : maximum whistling echo - Bottom : bottle + whistling echo without reverberation - Rocking : changes tone of blow bottle. - Fishing rod : varying reverberation. ==================== INSTRUMENT ======================= differential pressure signal scaling ==================== GUI SPECIFICATION ================ --------------------- Non-variable Parameters ------------- ----------------------- Frequency Table -------------------- ==================== SIGNAL PROCESSING ================ ----------------------- Synthesis parameters computing and functions declaration ---------------------------- botlle radius ----------------------- Algorithm implementation ---------------------------- global envelope is of type attack - decay - sustain - release pressure envelope is also ADSR vibrato breat pressure breath no.noise ------------------------- Enveloppe Trigger -------------------------------------------- ------------------------ InstrReverb ---------------------------------------- from instrument.lib
declare name "Blowhistle Bottles"; declare version "1.0"; declare description "This object implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook)."; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>_<: instrReverblow: (*(1),*(1))); blow(n)= par(i, 2, (-(breathPressure(trigger(n))) <: ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(i,n),_)~_: !,_: fi.dcblocker*envelopeG(trigger(n))*(0.5)<:+(voice(i,n))*resonGain(i)):>_ with{ baPaF(0,n) = bandPassFilter(freq(n)); baPaF(1,n) = bandPassFilter(freq(n)*8); voice(0,n) = 0*n; voice(1,n) = 1*(fi.resonbp(freq(n)*8,Q,gain):echo); resonGain(0) = 1; resonGain(1) =(hslider("v:[1]Instrument/Whistle Volume[acc:2 0 -10 0 10]", 0.07, 0, 0.2, 0.001))^2:si.smooth(0.999); echo = _:+~(@(delayEcho):*(feedback)); delayEcho = 44100; feedback = hslider("h:[2]Echo/Echo Intensity [style:knob][acc:2 0 -10 0 10]", 0.48, 0.2, 0.98, 0.01):si.smooth(0.999):min(0.98):max(0.2); }; N = 10; Q = 30; position(n) = abs(hand - n) < 0.5; hand = hslider("v:[1]Instrument/Instrument Hand[acc:0 1 -10 0 10]", 5, 0, N, 1):int:ba.automat(360, 15, 0.0); envelopeAttack = 0.01; vibratoFreq = 5; vibratoGain = 0.1; gain = 0.5; noiseGain = 0.5; pressure = 1.2; vibratoBegin = 0.05; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeDecay = 0.01; envelopeRelease = 0.5; freq(0) = 130.81; freq(1) = 146.83; freq(2) = 164.81; freq(3) = 195.99; freq(4) = 220.00; freq(d) = freq(d-5)*2; bottleRadius = 0.999; bandPassFilter(f) = instrument.bandPass(f,bottleRadius); envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); breathPressure(t) = envelope(t) + vibrato(t); randPressure(t) = noiseGain*no.noise*breathPressure(t) ; trigger(n) = position(n): trig with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); trig = upfront : release(8820) : >(0.0); }; instrReverblow = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.237,0.137,1,0.01) : si.smooth(0.999); roomSize = hslider("h:[3]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.72,0.4,2,0.01); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
96cbc3f8228c7189c0f660f71ecb23a07819ea580cc0db3f481577bbedb5cbbf
RuolunWeng/ruolunweng.github.io
CMajDryHarp.dsp
declare name "CMajDryHarp"; declare author "ER";//Adapted from Harpe by Yann Orlarey; //Modification Grame July 2015 import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Reverberated C Major dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one */ //----------------------------------------------- // Harpe : simple string instrument // (based on Karplus-Strong) // //----------------------------------------------- KEY = 60; // basic midi key NCY = 15; // note cycle length CCY = 15; // control cycle length BPS = 360; // general tempo (ba.beat per sec) //-------------------------------Harpe---------------------------------- // Harpe is a simple string instrument. Move the "hand" to play the // various strings //----------------------------------------------------------------------- process = vgroup("Harp", h : harpe(C,N,K) : instrReverbHarp : *(l),*(l)) with { N = 48; // number of strings K = 36; // Midi key of first string h = hslider("[1]Instrument Hand[1] [acc:0 1 -10 0 10]", 24, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with{ bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; //l = vslider("h:parameters/volume [style:knob][unit: dB]", -20, -60, 0, 0.01) : ba.db2linear; l = -10 : ba.db2linear; C = 0.5; }; //----------------------------------Harpe-------------------------------- // USAGE: hand : harpe(C,10,60) : _,_; // C is the filter coefficient 0..1 // Build a N (10) strings harpe using a pentatonic scale // based on midi key b (60) // Each string is triggered by a specific // position of the "hand" //----------------------------------------------------------------------- harpe(C,N,b) = _ <: par(i, N, position(i+1) :string(C,Major(b).degree2Hz(i), att, lvl) //envReader(twig,enveloppe):* : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; //----------------------------------Penta------------------------------- // Pentatonic scale with degree to midi and degree to Hz conversion // USAGE: Penta(60).degree2midi(3) ==> 67 midikey // Penta(60).degree2Hz(4) ==> 440 Hz //----------------------------------------------------------------------- //---------------------------------- Major ------------------------------- // Major scale. // From Pentatonic scale with degree to midi and degree to Hz conversion // USAGE: Penta(60).degree2midi(3) ==> 67 midikey // Penta(60).degree2Hz(4) ==> 440 Hz //----------------------------------------------------------------------- Major(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+5; degree2midi(4) = key+7; degree2midi(5) = key+9; degree2midi(6) = key+11; degree2midi(7) = key+12; degree2midi(d) = degree2midi(d-8)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; //----------------------------------String------------------------------- // A karplus-strong string. // // USAGE: string(440Hz, 4s, 1.0, button("play")) // or button("play") : string(440Hz, 4s, 1.0) //----------------------------------------------------------------------- string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient }; //================================= REVERB ============================== instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1.3,0.01):min(1.3):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/CMajDryHarp.dsp
faust
Adapted from Harpe by Yann Orlarey; Modification Grame July 2015 =============== DESCRIPTION ================= : - Reverberated C Major dry harp - Left = Lower frequencies/Silence when still - Front = Resonance (longer notes) - Back = No Resonance (dry notes) - Right = Higher frequencies/Fast rhythm - Head = Reverberation - Rocking = plucking all strings one by one ----------------------------------------------- Harpe : simple string instrument (based on Karplus-Strong) ----------------------------------------------- basic midi key note cycle length control cycle length general tempo (ba.beat per sec) -------------------------------Harpe---------------------------------- Harpe is a simple string instrument. Move the "hand" to play the various strings ----------------------------------------------------------------------- number of strings Midi key of first string l = vslider("h:parameters/volume [style:knob][unit: dB]", -20, -60, 0, 0.01) : ba.db2linear; ----------------------------------Harpe-------------------------------- USAGE: hand : harpe(C,10,60) : _,_; C is the filter coefficient 0..1 Build a N (10) strings harpe using a pentatonic scale based on midi key b (60) Each string is triggered by a specific position of the "hand" ----------------------------------------------------------------------- envReader(twig,enveloppe):* ----------------------------------Penta------------------------------- Pentatonic scale with degree to midi and degree to Hz conversion USAGE: Penta(60).degree2midi(3) ==> 67 midikey Penta(60).degree2Hz(4) ==> 440 Hz ----------------------------------------------------------------------- ---------------------------------- Major ------------------------------- Major scale. From Pentatonic scale with degree to midi and degree to Hz conversion USAGE: Penta(60).degree2midi(3) ==> 67 midikey Penta(60).degree2Hz(4) ==> 440 Hz ----------------------------------------------------------------------- ----------------------------------String------------------------------- A karplus-strong string. USAGE: string(440Hz, 4s, 1.0, button("play")) or button("play") : string(440Hz, 4s, 1.0) ----------------------------------------------------------------------- attenuation coefficient ================================= REVERB ==============================
declare name "CMajDryHarp"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Harp", h : harpe(C,N,K) : instrReverbHarp : *(l),*(l)) with { h = hslider("[1]Instrument Hand[1] [acc:0 1 -10 0 10]", 24, 0, N, 1) : int: ba.automat(bps, 15, 0.0) with{ bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; l = -10 : ba.db2linear; C = 0.5; }; harpe(C,N,b) = _ <: par(i, N, position(i+1) :string(C,Major(b).degree2Hz(i), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); lvl = 1; pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = abs(x - a) < 0.5; }; Major(key) = environment { A4Hz = 440; degree2midi(0) = key+0; degree2midi(1) = key+2; degree2midi(2) = key+4; degree2midi(3) = key+5; degree2midi(4) = key+7; degree2midi(5) = key+9; degree2midi(6) = key+11; degree2midi(7) = key+12; degree2midi(d) = degree2midi(d-8)+12; degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; }; string(coef, freq, t60, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); average(x) = (x*(1+coef)+x'*(1-coef))/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; }; instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[3]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[3]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1.3,0.01):min(1.3):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
933392d183dbe3c6272dc2cdc7a9c2b70b091e3dc35619f442f696a7cc145d77
RuolunWeng/ruolunweng.github.io
SPulsaxophone.dsp
declare name "Solo Pulsaxophone"; declare author "ER"; //From Saxophone by Romain Michon; /* =============== DESCRIPTION ================= : - Pulsing saxophone - Head = High frequencies - Bottom = Low frequencies - Right = Fast - Left = Slow - Head to Right, Head to Left = interesting transitions */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= process = vgroup("PULSAXO", (bodyFilter,breathPressure : instrumentBody) ~ (delay1 : NLFM) : !,_); //==================== GUI SPECIFICATION ================ freq = hslider("h:Instrument/Frequency[unit:Hz][acc:1 1 -12 0 10]", 110,80,880,1):si.smooth(0.9999):min(880):max(80); gate = pulsaxo.gate; pressure = 0.83; reedStiffness = 0.53; blowPosition = 0.43; noiseGain = 0.0001; typeModulation = 4; nonLinearity = 0.36; frequencyMod = 20; nonLinAttack = 0.12; vibratoFreq = hslider("h:Parameters/Vibrato Frequency[style:knob][unit:Hz][acc:0 1 -10 0 10]", 6,1,15,0.1):si.smooth(0.999); vibratoGain = 0.2; vibratoBegin = 0.05; vibratoAttack = 0.03; vibratoRelease = 0.1; envelopeAttack = 0.58; envelopeRelease = 0.1; //==================== SIGNAL PROCESSING ================ //----------------------- Pulsar -------------------------------------- pulsaxo = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); // min > 0 pour eviter division par 0 speed = hslider ("h:[2]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,7,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 88,75,100,1)*(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate); //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //reed table parameters reedTableOffset = 0.7; reedTableSlope = 0.1 + (0.4*reedStiffness); //the reed function is declared in instrument.lib reedTable = instrument.reed(reedTableOffset,reedTableSlope); //Delay lines length in number of samples fdel1 = (1-blowPosition) * (ma.SR/freq - 3); fdel2 = (ma.SR/freq - 3)*blowPosition +1 ; //Delay lines delay1 = de.fdelay(4096,fdel1); delay2 = de.fdelay(4096,fdel2); //Breath pressure is controlled by an attack / sustain / release envelope (en.asr is declared in instrument.lib) envelope = (0.55+pressure*0.3)*en.asr(pressure*envelopeAttack,1,pressure*envelopeRelease,gate); breath = envelope + envelope*noiseGain*no.noise; //instrument.envVibrato is decalred in instrument.lib vibrato = vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*os.osc(vibratoFreq); breathPressure = breath + breath*vibratoGain*os.osc(vibratoFreq); //Body filter is a one zero filter (declared in instrument.lib) bodyFilter = *(gain) : instrument.oneZero1(b0,b1) with { gain = -0.95; b0 = 0.5; b1 = 0.5; }; instrumentBody(delay1FeedBack,breathP) = delay1FeedBack <: -(delay2) <: ((breathP - _ <: breathP - _*reedTable) - delay1FeedBack),_;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SPulsaxophone.dsp
faust
From Saxophone by Romain Michon; =============== DESCRIPTION ================= : - Pulsing saxophone - Head = High frequencies - Bottom = Low frequencies - Right = Fast - Left = Slow - Head to Right, Head to Left = interesting transitions ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ ==================== SIGNAL PROCESSING ================ ----------------------- Pulsar -------------------------------------- min > 0 pour eviter division par 0 ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instrument.lib) nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- reed table parameters the reed function is declared in instrument.lib Delay lines length in number of samples Delay lines Breath pressure is controlled by an attack / sustain / release envelope (en.asr is declared in instrument.lib) instrument.envVibrato is decalred in instrument.lib Body filter is a one zero filter (declared in instrument.lib)
declare name "Solo Pulsaxophone"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("PULSAXO", (bodyFilter,breathPressure : instrumentBody) ~ (delay1 : NLFM) : !,_); freq = hslider("h:Instrument/Frequency[unit:Hz][acc:1 1 -12 0 10]", 110,80,880,1):si.smooth(0.9999):min(880):max(80); gate = pulsaxo.gate; pressure = 0.83; reedStiffness = 0.53; blowPosition = 0.43; noiseGain = 0.0001; typeModulation = 4; nonLinearity = 0.36; frequencyMod = 20; nonLinAttack = 0.12; vibratoFreq = hslider("h:Parameters/Vibrato Frequency[style:knob][unit:Hz][acc:0 1 -10 0 10]", 6,1,15,0.1):si.smooth(0.999); vibratoGain = 0.2; vibratoBegin = 0.05; vibratoAttack = 0.03; vibratoRelease = 0.1; envelopeAttack = 0.58; envelopeRelease = 0.1; pulsaxo = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); speed = hslider ("h:[2]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,7,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 88,75,100,1)*(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; nlfOrder = 6; envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate); NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); reedTableOffset = 0.7; reedTableSlope = 0.1 + (0.4*reedStiffness); reedTable = instrument.reed(reedTableOffset,reedTableSlope); fdel1 = (1-blowPosition) * (ma.SR/freq - 3); fdel2 = (ma.SR/freq - 3)*blowPosition +1 ; delay1 = de.fdelay(4096,fdel1); delay2 = de.fdelay(4096,fdel2); envelope = (0.55+pressure*0.3)*en.asr(pressure*envelopeAttack,1,pressure*envelopeRelease,gate); breath = envelope + envelope*noiseGain*no.noise; vibrato = vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*os.osc(vibratoFreq); breathPressure = breath + breath*vibratoGain*os.osc(vibratoFreq); bodyFilter = *(gain) : instrument.oneZero1(b0,b1) with { gain = -0.95; b0 = 0.5; b1 = 0.5; }; instrumentBody(delay1FeedBack,breathP) = delay1FeedBack <: -(delay2) <: ((breathP - _ <: breathP - _*reedTable) - delay1FeedBack),_;
9b3efb99b60d3f1ebaef5f76a11190176dd16826ff96b8101457d521ec73b05b
RuolunWeng/ruolunweng.github.io
Clarinet.dsp
declare name "Clarinet"; declare description "Nonlinear WaveGuide Clarinet"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "A simple clarinet physical model, as discussed by Smith (1986), McIntyre, Schumacher, Woodhouse (1983), and others."; declare reference "https://ccrma.stanford.edu/~jos/pasp/Woodwinds.html"; //Modification Grame July 2015 import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Clarinet responding to vigorous gestures - Turn ON the Clarinet - Head = High frequencies/Reverberation/Silence when hold still - Tilt = very soft sound - Bottom = Low frequencies - Right = Breathy clarinet - Fishing rod (vigorous mouvements) : ==> Downward = to reach lower frequencies ==> Upward = To 'through' the sound in the air = vanishes, comes back when Tilt - Rocking = from full sound to breathy sound - Shaking in right position = no.noise impulses */ //==================== INSTRUMENT ======================= process = vgroup("CLARINET", //Commuted Loss Filtering (_,(breathPressure <: _,_) : (filter*-0.95 - _ <: //Non-Linear Scattering *(reedTable)) + _) ~ //Delay with Feedback (delayLine):// : NLFM) : //scaling and stereo *(gain)*1.5 <: instrReverbCla); //==================== GUI SPECIFICATION ================ freq = hslider("h:[2]Instrument/Frequency[unit:Hz][tooltip:Tone frequency][acc:1 1 -14 0 12]", 440,110,1300,0.01):si.smooth(0.999); gain = 1; gate = hslider("[1]ON/OFF (ASR Envelope)",0,0,1,1); reedStiffness = hslider("h:[3]Parameters/Instrument Stiffness[style:knob][acc:0 1 -12 0 12]", 0.25,0.01,1,0.01); noiseGain = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -12 0 12]", 0.02,0,0.12,0.01); pressure = hslider("h:[3]Parameters/ Pressure[style:knob][acc:1 0 -5 0 10]", 0.8,0.65,1,0.01); vibratoFreq = 5; vibratoGain = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeAttack = 0.1; envelopeDecay = 0.05; envelopeRelease = 0.1; //==================== SIGNAL PROCESSING ====================== //----------------------- Synthesis PARAMETERS computing and functions declaration ---------------------------- //instrument.reed table PARAMETERS reedTableOffset = 0.7; reedTableSlope = -0.44 + (0.26*reedStiffness); //the instrument.reed function is declared in INSTRUMENT.lib reedTable = instrument.reed(reedTableOffset,reedTableSlope); //de.delay line with a length adapted in function of the order of nonlinear filter delayLength = ma.SR/freq*0.5 - 1.5;// - (nlfOrder*nonLinearity)*(typeModulation < 2); delayLine = de.fdelay(4096,delayLength); //one zero filter used as a allpass: pole is set to -1 filter = instrument.oneZero0(0.5,0.5); //----------------------- Algorithm implementation ---------------------------- //Breath pressure + vibrato + breath no.noise + envelope (Attack / Decay / Sustain / Release) envelope = en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate)*pressure*0.9; vibrato = os.osc(vibratoFreq)*vibratoGain* instrument.envVibrato(0.1*2*vibratoAttack,0.9*2*vibratoAttack,100,vibratoRelease,gate); breath = envelope + envelope*no.noise*noiseGain; breathPressure = breath + breath*vibrato; //----------------------- INSTRREVERB ---------------------------- instrReverbCla = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[4]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -15 0 15]", 0.137,0.05,1,0.01) :si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[4]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -15 0 15]", 0.45,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Clarinet.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); Modification Grame July 2015 =============== DESCRIPTION ================= : - Clarinet responding to vigorous gestures - Turn ON the Clarinet - Head = High frequencies/Reverberation/Silence when hold still - Tilt = very soft sound - Bottom = Low frequencies - Right = Breathy clarinet - Fishing rod (vigorous mouvements) : ==> Downward = to reach lower frequencies ==> Upward = To 'through' the sound in the air = vanishes, comes back when Tilt - Rocking = from full sound to breathy sound - Shaking in right position = no.noise impulses ==================== INSTRUMENT ======================= Commuted Loss Filtering Non-Linear Scattering Delay with Feedback : NLFM) : scaling and stereo ==================== GUI SPECIFICATION ================ ==================== SIGNAL PROCESSING ====================== ----------------------- Synthesis PARAMETERS computing and functions declaration ---------------------------- instrument.reed table PARAMETERS the instrument.reed function is declared in INSTRUMENT.lib de.delay line with a length adapted in function of the order of nonlinear filter - (nlfOrder*nonLinearity)*(typeModulation < 2); one zero filter used as a allpass: pole is set to -1 ----------------------- Algorithm implementation ---------------------------- Breath pressure + vibrato + breath no.noise + envelope (Attack / Decay / Sustain / Release) ----------------------- INSTRREVERB ----------------------------
declare name "Clarinet"; declare description "Nonlinear WaveGuide Clarinet"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare description "A simple clarinet physical model, as discussed by Smith (1986), McIntyre, Schumacher, Woodhouse (1983), and others."; declare reference "https://ccrma.stanford.edu/~jos/pasp/Woodwinds.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("CLARINET", (_,(breathPressure <: _,_) : (filter*-0.95 - _ <: *(reedTable)) + _) ~ *(gain)*1.5 <: instrReverbCla); freq = hslider("h:[2]Instrument/Frequency[unit:Hz][tooltip:Tone frequency][acc:1 1 -14 0 12]", 440,110,1300,0.01):si.smooth(0.999); gain = 1; gate = hslider("[1]ON/OFF (ASR Envelope)",0,0,1,1); reedStiffness = hslider("h:[3]Parameters/Instrument Stiffness[style:knob][acc:0 1 -12 0 12]", 0.25,0.01,1,0.01); noiseGain = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -12 0 12]", 0.02,0,0.12,0.01); pressure = hslider("h:[3]Parameters/ Pressure[style:knob][acc:1 0 -5 0 10]", 0.8,0.65,1,0.01); vibratoFreq = 5; vibratoGain = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.01; envelopeAttack = 0.1; envelopeDecay = 0.05; envelopeRelease = 0.1; reedTableOffset = 0.7; reedTableSlope = -0.44 + (0.26*reedStiffness); reedTable = instrument.reed(reedTableOffset,reedTableSlope); delayLine = de.fdelay(4096,delayLength); filter = instrument.oneZero0(0.5,0.5); envelope = en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate)*pressure*0.9; vibrato = os.osc(vibratoFreq)*vibratoGain* instrument.envVibrato(0.1*2*vibratoAttack,0.9*2*vibratoAttack,100,vibratoRelease,gate); breath = envelope + envelope*no.noise*noiseGain; breathPressure = breath + breath*vibrato; instrReverbCla = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[4]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -15 0 15]", 0.137,0.05,1,0.01) :si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[4]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -15 0 15]", 0.45,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
efc8381e3ffab53ef243bb0dad2151ae3ad488ba7a353cfa84fc26085d66a0dd
RuolunWeng/ruolunweng.github.io
Pulsaxophone.dsp
declare name "Pulsaxophone"; declare author "ER"; //From Saxophone by Romain Michon; import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ================= : - Pulsing saxophone - Head = High frequencies + Reverb - Bottom = Low frequencies - Right = Fast - Left = Slow - Head to Right, Head to Left = interesting transitions */ //==================== INSTRUMENT ======================= process = vgroup("Pulsaxo", (bodyFilter,breathPressure : instrumentBody) ~ (delay1 : NLFM) : !,fi.lowpass(1,1000) //Scaling Output and stereo *(gain) :>_<: instrReverbAccel); //==================== GUI SPECIFICATION ================ freq = hslider("[1]Frequency[unit:Hz][acc:1 1 -12 0 10]", 110,80,880,1):si.smooth(0.9999):min(880):max(80); gain = 0.8; gate = pulsaxo.gate; pressure = 0.83; reedStiffness = 0.53; blowPosition = 0.43; noiseGain = 0.0001; typeModulation = 4; nonLinearity = 0.36; frequencyMod = 20; nonLinAttack = 0.12; vibratoFreq = hslider("[3]Vibrato Frequency[style:knob][unit:Hz][acc:0 1 -10 0 10]", 6,1,15,0.1):si.smooth(0.999); vibratoGain = 0.2; vibratoBegin = 0.05; vibratoAttack = 0.03; vibratoRelease = 0.1; envelopeAttack = 0.58; envelopeRelease = 0.1; //==================== SIGNAL PROCESSING ================ //----------------------- Pulsar -------------------------------------- pulsaxo = environment { gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); // min > 0 pour eviter division par 0 speed = hslider ("h:[2]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,7,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 88,75,100,1)*(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate); //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //instrument.reed table parameters reedTableOffset = 0.7; reedTableSlope = 0.1 + (0.4*reedStiffness); //the instrument.reed function is declared in instrument.lib reedTable = instrument.reed(reedTableOffset,reedTableSlope); //Delay lines length in number of samples fdel1 = (1-blowPosition) * (ma.SR/freq - 3); fdel2 = (ma.SR/freq - 3)*blowPosition +1 ; //Delay lines delay1 = de.fdelay(4096,fdel1); delay2 = de.fdelay(4096,fdel2); //Breath pressure is controlled by an attack / sustain / release envelope (en.asr is declared in instrument.lib) envelope = (0.55+pressure*0.3)*en.asr(pressure*envelopeAttack,1,pressure*envelopeRelease,gate); breath = envelope + envelope*noiseGain*no.noise; //instrument.envVibrato is decalred in instrument.lib vibrato = vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*os.osc(vibratoFreq); breathPressure = breath + breath*vibratoGain*os.osc(vibratoFreq); //Body filter is a one zero filter (declared in instrument.lib) bodyFilter = *(gain) : instrument.oneZero1(b0,b1) with { gain = -0.95; b0 = 0.5; b1 = 0.5; }; instrumentBody(delay1FeedBack,breathP) = delay1FeedBack <: -(delay2) <: ((breathP - _ <: breathP - _*reedTable) - delay1FeedBack),_; instrReverbAccel = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:[4]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -15 0 12]", 0.72,0.1,1.7,0.01):min(1.7):max(0.1); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Pulsaxophone.dsp
faust
From Saxophone by Romain Michon; =============== DESCRIPTION ================= : - Pulsing saxophone - Head = High frequencies + Reverb - Bottom = Low frequencies - Right = Fast - Left = Slow - Head to Right, Head to Left = interesting transitions ==================== INSTRUMENT ======================= Scaling Output and stereo ==================== GUI SPECIFICATION ================ ==================== SIGNAL PROCESSING ================ ----------------------- Pulsar -------------------------------------- min > 0 pour eviter division par 0 ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instrument.lib) nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- instrument.reed table parameters the instrument.reed function is declared in instrument.lib Delay lines length in number of samples Delay lines Breath pressure is controlled by an attack / sustain / release envelope (en.asr is declared in instrument.lib) instrument.envVibrato is decalred in instrument.lib Body filter is a one zero filter (declared in instrument.lib)
declare name "Pulsaxophone"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Pulsaxo", (bodyFilter,breathPressure : instrumentBody) ~ (delay1 : NLFM) : !,fi.lowpass(1,1000) *(gain) :>_<: instrReverbAccel); freq = hslider("[1]Frequency[unit:Hz][acc:1 1 -12 0 10]", 110,80,880,1):si.smooth(0.9999):min(880):max(80); gain = 0.8; gate = pulsaxo.gate; pressure = 0.83; reedStiffness = 0.53; blowPosition = 0.43; noiseGain = 0.0001; typeModulation = 4; nonLinearity = 0.36; frequencyMod = 20; nonLinAttack = 0.12; vibratoFreq = hslider("[3]Vibrato Frequency[style:knob][unit:Hz][acc:0 1 -10 0 10]", 6,1,15,0.1):si.smooth(0.999); vibratoGain = 0.2; vibratoBegin = 0.05; vibratoAttack = 0.03; vibratoRelease = 0.1; envelopeAttack = 0.58; envelopeRelease = 0.1; pulsaxo = environment { gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); speed = hslider ("h:[2]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,7,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 88,75,100,1)*(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; nlfOrder = 6; envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate); NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); reedTableOffset = 0.7; reedTableSlope = 0.1 + (0.4*reedStiffness); reedTable = instrument.reed(reedTableOffset,reedTableSlope); fdel1 = (1-blowPosition) * (ma.SR/freq - 3); fdel2 = (ma.SR/freq - 3)*blowPosition +1 ; delay1 = de.fdelay(4096,fdel1); delay2 = de.fdelay(4096,fdel2); envelope = (0.55+pressure*0.3)*en.asr(pressure*envelopeAttack,1,pressure*envelopeRelease,gate); breath = envelope + envelope*noiseGain*no.noise; vibrato = vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*os.osc(vibratoFreq); breathPressure = breath + breath*vibratoGain*os.osc(vibratoFreq); bodyFilter = *(gain) : instrument.oneZero1(b0,b1) with { gain = -0.95; b0 = 0.5; b1 = 0.5; }; instrumentBody(delay1FeedBack,breathP) = delay1FeedBack <: -(delay2) <: ((breathP - _ <: breathP - _*reedTable) - delay1FeedBack),_; instrReverbAccel = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:[4]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -15 0 12]", 0.72,0.1,1.7,0.01):min(1.7):max(0.1); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
53b6a7e4fdcf4b39886b4fc03dbf9b0cf900e686ed072a6bec0fcc2121d58635
RuolunWeng/ruolunweng.github.io
Flute.dsp
declare name "Flute"; declare description "Nonlinear WaveGuide Flute"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "A simple flute based on Smith algorythm: https://ccrma.stanford.edu/~jos/pasp/Flutes_Recorders_Pipe_Organs.html"; //Modifications GRAME July 2015 /* =========== DESCRITPION =========== - Flute - Turn ON flute (0=OFF, 1=ON) - Head = High frequencies/ Reverberation/ Silence - Bottom = Low frequencies - Left = No vibrato - Right = Fast vibrato - Front = Full sound - Back = Breathy sound */ import("stdfaust.lib"); instrument = library("instruments.lib"); //==================== INSTRUMENT ======================= flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain; process = flute <:instrReverbFlute; //==================== GUI SPECIFICATION ================ freq = hslider("[1]Frequency[acc:1 1 -10 0 10]", 440,247,1200,1):si.smooth(0.999); pressure = hslider("[2]Pressure[style:knob][acc:1 0 -10 0 10]", 0.96, 0.2, 0.99, 0.01):si.smooth(0.999):min(0.99):max(0.2); breathAmp = hslider("[3]Breath Noise[style:knob][acc:2 0 -10 0 10]", 0.02, 0.01, 0.2, 0.01):si.smooth(0.999):min(0.2):max(0.01); gate = hslider("[0]ON/OFF (ASR Envelope)",0,0,1,1); vibratoFreq = hslider("[4]Vibrato Freq (Vibrato Envelope)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 4,0.5,8,0.1); env1Attack = 0.1;//hslider("h:Parameters/Press_Env_Attack[unit:s][style:knob][acc:1 0 -10 0 10][tooltip:Pressure envelope attack duration]",0.05,0.05,0.2,0.01); //-------------------- Non-Variable Parameters ----------- gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.05; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) envelopeMod = en.asr(nonLinAttack,1,0.1,gate); //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; //Global envelope env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; //Vibrato Envelope vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato; //------------------------ InstrReverb ---------------------------------------- instrReverbFlute = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[5]Reverb/[1]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.2,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[5]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.72,0.05,1.7,0.01):min(1.7):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Flute.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); Modifications GRAME July 2015 =========== DESCRITPION =========== - Flute - Turn ON flute (0=OFF, 1=ON) - Head = High frequencies/ Reverberation/ Silence - Bottom = Low frequencies - Left = No vibrato - Right = Fast vibrato - Front = Full sound - Back = Breathy sound ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ hslider("h:Parameters/Press_Env_Attack[unit:s][style:knob][acc:1 0 -10 0 10][tooltip:Pressure envelope attack duration]",0.05,0.05,0.2,0.01); -------------------- Non-Variable Parameters ----------- ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instrument.lib) nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope ------------------------ InstrReverb ----------------------------------------
declare name "Flute"; declare description "Nonlinear WaveGuide Flute"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare description "A simple flute based on Smith algorythm: https://ccrma.stanford.edu/~jos/pasp/Flutes_Recorders_Pipe_Organs.html"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain; process = flute <:instrReverbFlute; freq = hslider("[1]Frequency[acc:1 1 -10 0 10]", 440,247,1200,1):si.smooth(0.999); pressure = hslider("[2]Pressure[style:knob][acc:1 0 -10 0 10]", 0.96, 0.2, 0.99, 0.01):si.smooth(0.999):min(0.99):max(0.2); breathAmp = hslider("[3]Breath Noise[style:knob][acc:2 0 -10 0 10]", 0.02, 0.01, 0.2, 0.01):si.smooth(0.999):min(0.2):max(0.01); gate = hslider("[0]ON/OFF (ASR Envelope)",0,0,1,1); vibratoFreq = hslider("[4]Vibrato Freq (Vibrato Envelope)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 4,0.5,8,0.1); gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.05; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; nlfOrder = 6; envelopeMod = en.asr(nonLinAttack,1,0.1,gate); NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato; instrReverbFlute = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("h:[5]Reverb/[1]Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.2,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); roomSize = hslider("h:[5]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 13]", 0.72,0.05,1.7,0.01):min(1.7):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
50a2a649e9e081b2315e221843bf39c7ad2cf1d3f3a6af1b51cae980e14a1cea
RuolunWeng/ruolunweng.github.io
RandomFlute.dsp
declare name "Random Flute"; declare author "ER";//Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected]); import("stdfaust.lib"); instrument = library("instruments.lib"); /* ============== DESCRIPTION ================ - Random frequency flute - Left = Slow rhythm/long notes/silence - Right = Fast rhythm/short note - Head = Reverberation - Back = Echo */ //==================== INSTRUMENT ======================= flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = flute : echo <: instrReverbFlute; //==================== GUI SPECIFICATION ================ pressure = 1; breathAmp = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 10]", 0.02, 0.01, 0.05, 0.0001):si.smooth(0.999):min(0.05):max(0.01); gate = pulsaflute.gate; vibratoFreq = 5; env1Attack = 0.05; //--------------------------- Random Frequency --------------------------- freq = gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(1500)+(100) with{ sampleAndhold(t) = select2(t) ~_; sahgate(g) = g : upfront : counter -(3) <=(0); upfront(x) = abs(x-x')>0.5; counter(g) = (+(1):*(1-g))~_; }; //----------------------- Echo ---------------------------------------- echo = +~ @(22050) *(feedback); feedback = hslider("h:Parameters/Echo Intensity[style:knob][acc:2 0 -10 0 10]", 0.001, 0.001, 0.65, 0.001):si.smooth(0.999); //----------------------- Pulsar -------------------------------------- pulsaflute = environment { gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); // min > 0 pour eviter division par 0 speed = hslider ("h:[1]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 3,1,6,0.0001):fi.lowpass(1,1); proba = hslider ("h:[1]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,60,100,1) *(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; //-------------------- Non-Variable Parameters ----------- N = 27; gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) envelopeMod = en.asr(nonLinAttack,1,0.1,gate); //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; //Global envelope env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; //Vibrato Envelope vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato; instrReverbFlute = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:Reverb/Reverberation Room Size [style:knob][acc:1 1 -10 0 10]", 0.2,0.01,1.7,0.01); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/RandomFlute.dsp
faust
Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected]); ============== DESCRIPTION ================ - Random frequency flute - Left = Slow rhythm/long notes/silence - Right = Fast rhythm/short note - Head = Reverberation - Back = Echo ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ --------------------------- Random Frequency --------------------------- ----------------------- Echo ---------------------------------------- ----------------------- Pulsar -------------------------------------- min > 0 pour eviter division par 0 -------------------- Non-Variable Parameters ----------- ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instrument.lib) nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope
declare name "Random Flute"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = flute : echo <: instrReverbFlute; pressure = 1; breathAmp = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 10]", 0.02, 0.01, 0.05, 0.0001):si.smooth(0.999):min(0.05):max(0.01); gate = pulsaflute.gate; vibratoFreq = 5; env1Attack = 0.05; freq = gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(1500)+(100) with{ sampleAndhold(t) = select2(t) ~_; sahgate(g) = g : upfront : counter -(3) <=(0); upfront(x) = abs(x-x')>0.5; counter(g) = (+(1):*(1-g))~_; }; echo = +~ @(22050) *(feedback); feedback = hslider("h:Parameters/Echo Intensity[style:knob][acc:2 0 -10 0 10]", 0.001, 0.001, 0.65, 0.001):si.smooth(0.999); pulsaflute = environment { gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); speed = hslider ("h:[1]Pulse/[1]Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 3,1,6,0.0001):fi.lowpass(1,1); proba = hslider ("h:[1]Pulse/[2]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,60,100,1) *(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; N = 27; gain = 1; typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.1; env2Release = 0.1; env1Release = 0.5; nlfOrder = 6; envelopeMod = en.asr(nonLinAttack,1,0.1,gate); NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato; instrReverbFlute = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:Reverb/Reverberation Room Size [style:knob][acc:1 1 -10 0 10]", 0.2,0.01,1.7,0.01); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
bc688dec1a8f903f1d2316b3c8ef6acd02dfb540de983a2c10633f951e037d52
RuolunWeng/ruolunweng.github.io
TibetanBowl.dsp
declare name "Tibetan Bowl"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; //Modification GRAME July 2015 import("stdfaust.lib"); instrument = library("instruments.lib"); /* ============ DESCRIPTION ============= - Tibetan Bowl - Set the frequency manually - Fishing rod/Front shaking = Ringing the bowl - Right = maximum modulation - Rocking = modulating the sound - Head = Reverb */ //==================== INSTRUMENT ======================= process = (((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i)~_))):>+://~par(i,nModes,_) :> + : //Signal Scaling and stereo NLFM : stereo : instrReverbAccel: *(vol),*(vol); //==================== GUI SPECIFICATION ================ vol = 0.8; freq = hslider("[1]Frequency[unit:Hz][tooltip:Tone frequency]",440,180,780,1); gain = 0.5; gate = 0; select = hslider("[0]Play[tooltip:0=Bow; 1=Strike] [acc:2 1 -10 0 10]", 0,0,1,1); baseGain = 0.5; typeModulation = 3; nonLinearity = hslider("[2]Modulation[acc:0 1 -10 0 10][tooltip:Nonlinearity factor (value between 0 and 1)]",0.02,0,0.1,0.001):si.smooth(0.999); frequencyMod = hslider("[3]Modulation Frequency[unit:Hz][acc:0 0 -10 0 10]", 220,150,500,0.1):si.smooth(0.999); nonLinAttack = 0.1; //==================== MODAL PARAMETERS ================ preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),1,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); delayLengthBase = ma.SR/freq; //de.delay lengths in number of samples delayLength(x) = delayLengthBase/modes(preset,x); //de.delay lines delayLine(x) = de.delay(4096,delayLength(x)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); stereoo(periodDuration) = _ <: _,widthdelay : stereopanner with { W = 0.5; A = 0.6; widthdelay = de.delay(4096,W*periodDuration/2); stereopanner = _,_ : *(1.0-A), *(A); }; stereo = stereoo(delayLengthBase); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x); //----------------------- Reverb (ajout accelerometre 05/2015) ---------------- instrReverbAccel = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:[4]Reverb/[1]Reverberation Volume (InstrReverb) [acc:1 1 -10 0 10]",0.2,0.02,1,0.01) : si.smooth(0.999) :min(1):max(0.02); roomSize = hslider("v:[4]Reverb/[2]Reverberation Room Size (InstrReverb)[acc:1 1 -10 0 10]", 0.2,0.02,2,0.01):min(2):max(0.02); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/TibetanBowl.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); Modification GRAME July 2015 ============ DESCRIPTION ============= - Tibetan Bowl - Set the frequency manually - Fishing rod/Front shaking = Ringing the bowl - Right = maximum modulation - Rocking = modulating the sound - Head = Reverb ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up ~par(i,nModes,_) :> + : Signal Scaling and stereo ==================== GUI SPECIFICATION ================ ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used de.delay lengths in number of samples de.delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) ----------------------- Algorithm implementation ---------------------------- One resonance ----------------------- Reverb (ajout accelerometre 05/2015) ----------------
declare name "Tibetan Bowl"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; import("stdfaust.lib"); instrument = library("instruments.lib"); process = (((select-1)*-1) <: NLFM : stereo : instrReverbAccel: *(vol),*(vol); vol = 0.8; freq = hslider("[1]Frequency[unit:Hz][tooltip:Tone frequency]",440,180,780,1); gain = 0.5; gate = 0; select = hslider("[0]Play[tooltip:0=Bow; 1=Strike] [acc:2 1 -10 0 10]", 0,0,1,1); baseGain = 0.5; typeModulation = 3; nonLinearity = hslider("[2]Modulation[acc:0 1 -10 0 10][tooltip:Nonlinearity factor (value between 0 and 1)]",0.02,0,0.1,0.001):si.smooth(0.999); frequencyMod = hslider("[3]Modulation Frequency[unit:Hz][acc:0 0 -10 0 10]", 220,150,500,0.1):si.smooth(0.999); nonLinAttack = 0.1; preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; nlfOrder = 6; NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),1,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); nModes = nMode(preset); delayLengthBase = ma.SR/freq; delayLength(x) = delayLengthBase/modes(preset,x); delayLine(x) = de.delay(4096,delayLength(x)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); stereoo(periodDuration) = _ <: _,widthdelay : stereopanner with { W = 0.5; A = 0.6; widthdelay = de.delay(4096,W*periodDuration/2); stereopanner = _,_ : *(1.0-A), *(A); }; stereo = stereoo(delayLengthBase); resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x); instrReverbAccel = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:[4]Reverb/[1]Reverberation Volume (InstrReverb) [acc:1 1 -10 0 10]",0.2,0.02,1,0.01) : si.smooth(0.999) :min(1):max(0.02); roomSize = hslider("v:[4]Reverb/[2]Reverberation Room Size (InstrReverb)[acc:1 1 -10 0 10]", 0.2,0.02,2,0.01):min(2):max(0.02); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
ac99a90a15d053cdb7e79d388eb01b1bf76a20453074d3ebdc9945bf9f6381e2
RuolunWeng/ruolunweng.github.io
FlappyFlute.dsp
declare name "Flappy Flute"; declare author "ER";// Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected]) import("stdfaust.lib"); instrument = library("instruments.lib"); /* =============== DESCRIPTION ======================== : - Flute turning into a flapping bird - Head = Reverberation / High frequencies - Tilting and jerking = looking for different sounds around head and back - Bottom = Low frequencies - Swing (bottom to head) = glissando (nice when followed with Back) - Back = Echo - Left = Slow rhythm/Silence - Right = Flapping bird */ //==================== INSTRUMENT ======================= flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = vgroup("Flappy Flute", flute : echo <: instrReverbFlute); //==================== GUI SPECIFICATION ================ freq = hslider("[1]Frequency[unit:Hz][tooltip:Tone frequency][acc:1 1 -10 0 10]", 440,247,1200,1):si.smooth(0.999); pressure = hslider("h:[3]Parameters/ Pressure[style:knob][acc:0 0 -10 0 10]", 1, 0.6, 1, 0.01):si.smooth(0.999):min(1):max(0.6); breathAmp = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 10]", 0.01, 0.01, 0.2, 0.01):si.smooth(0.999):min(0.2):max(0.01); gate = pulsaflute.gate; vibratoFreq = 5;//hslider("h:Parameters/Vibrato Frequency[style:knob][unit:Hz]",5,1,15,0.1); env1Attack = 0.05;//hslider("h:Parameters/Envelope Attack[unit:s][style:knob][tooltip:Pressure envelope attack duration]",0.05,0.05,0.2,0.01); //----------------------- Echo ---------------------------------------- echo = +~ @(22050) *(feedback); feedback = hslider("h:[4]Reverberation/Echo Intensity[style:knob][acc:2 0 -10 10 0 0.001] ", 0.001, 0.001, 0.65, 0.001):si.smooth(0.999):min(0.65):max(0.001); //----------------------- Pulsar -------------------------------------- pulsaflute = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); speed = hslider ("h:[2]Instrument/[2]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 4,1,16,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Instrument/[3]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 88,60,100,1) *(0.01) : fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; //-------------------- Non-Variable Parameters ----------- N = 27; gain = hslider("h:[2]Instrument/[1]Volume[style:knob][acc:0 1 -12 0 12]", 1, 0.75, 4, 0.01):min(4):max(0.75); typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.05; env2Release = 0.05; env1Release = 0.05; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) envelopeMod = en.asr(nonLinAttack,1,0.1,gate); //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //Loops feedbacks gains feedBack1 = 0.4; feedBack2 = 0.4; //Delay Lines embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); //Polinomial poly = _ <: _ - _*_*_; //jet filter is a lowwpass filter (declared in filter.lib) reflexionFilter = fi.lowpass(1,2000); //----------------------- Algorithm implementation ---------------------------- //Pressure envelope env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; //Global envelope env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; //Vibrato Envelope vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato; instrReverbFlute = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:[4]Reverberation/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 16]", 0.72,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/FlappyFlute.dsp
faust
Adapted from "Nonlinear WaveGuide Flute" by Romain Michon ([email protected]) =============== DESCRIPTION ======================== : - Flute turning into a flapping bird - Head = Reverberation / High frequencies - Tilting and jerking = looking for different sounds around head and back - Bottom = Low frequencies - Swing (bottom to head) = glissando (nice when followed with Back) - Back = Echo - Left = Slow rhythm/Silence - Right = Flapping bird ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ hslider("h:Parameters/Vibrato Frequency[style:knob][unit:Hz]",5,1,15,0.1); hslider("h:Parameters/Envelope Attack[unit:s][style:knob][tooltip:Pressure envelope attack duration]",0.05,0.05,0.2,0.01); ----------------------- Echo ---------------------------------------- ----------------------- Pulsar -------------------------------------- -------------------- Non-Variable Parameters ----------- ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instrument.lib) nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- Loops feedbacks gains Delay Lines Polinomial jet filter is a lowwpass filter (declared in filter.lib) ----------------------- Algorithm implementation ---------------------------- Pressure envelope Global envelope Vibrato Envelope
declare name "Flappy Flute"; import("stdfaust.lib"); instrument = library("instruments.lib"); flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; process = vgroup("Flappy Flute", flute : echo <: instrReverbFlute); freq = hslider("[1]Frequency[unit:Hz][tooltip:Tone frequency][acc:1 1 -10 0 10]", 440,247,1200,1):si.smooth(0.999); pressure = hslider("h:[3]Parameters/ Pressure[style:knob][acc:0 0 -10 0 10]", 1, 0.6, 1, 0.01):si.smooth(0.999):min(1):max(0.6); breathAmp = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 10]", 0.01, 0.01, 0.2, 0.01):si.smooth(0.999):min(0.2):max(0.01); gate = pulsaflute.gate; echo = +~ @(22050) *(feedback); feedback = hslider("h:[4]Reverberation/Echo Intensity[style:knob][acc:2 0 -10 10 0 0.001] ", 0.001, 0.001, 0.65, 0.001):si.smooth(0.999):min(0.65):max(0.001); pulsaflute = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); speed = hslider ("h:[2]Instrument/[2]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 4,1,16,0.0001):fi.lowpass(1,1); proba = hslider ("h:[2]Instrument/[3]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 88,60,100,1) *(0.01) : fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; N = 27; gain = hslider("h:[2]Instrument/[1]Volume[style:knob][acc:0 1 -12 0 12]", 1, 0.75, 4, 0.01):min(4):max(0.75); typeModulation = 0; nonLinearity = 0; frequencyMod = 220; nonLinAttack = 0.1; vibratoGain = 0.1; vibratoBegin = 0.1; vibratoAttack = 0.5; vibratoRelease = 0.2; pressureEnvelope = 0; env1Decay = 0.2; env2Attack = 0.05; env2Release = 0.05; env1Release = 0.05; nlfOrder = 6; envelopeMod = en.asr(nonLinAttack,1,0.1,gate); NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); feedBack1 = 0.4; feedBack2 = 0.4; embouchureDelayLength = (ma.SR/freq)/2-2; boreDelayLength = ma.SR/freq-2; embouchureDelay = de.fdelay(4096,embouchureDelayLength); boreDelay = de.fdelay(4096,boreDelayLength); poly = _ <: _ - _*_*_; reflexionFilter = fi.lowpass(1,2000); env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; vibrato = os.osc(vibratoFreq)*vibratoEnvelope; breath = no.noise*env1; flow = env1 + breath*breathAmp + vibrato; instrReverbFlute = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { roomSize = hslider("h:[4]Reverberation/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 16]", 0.72,0.05,2,0.01):min(2):max(0.05); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
a57e71383c2493c609a81da5281d6b93fe93d0e6434ed63c0c8ff898abfa308b
RuolunWeng/ruolunweng.github.io
TibetanBowlMulti.dsp
declare name "Tibetan Bowl"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; import("stdfaust.lib"); instrument = library("instruments.lib"); /* ============ DESCRIPTION ============== - Multiple Tibetan Bowls - Head = Note Still/Reverberation - Head + Light circling on the spot/slight rotation = reverberated rolling ball in the bowl - Rocking = Ringing all bowls from low to high frequencies - Back = Modulation - Back + Light circling on the spot/slight rotation = rolling ball in the bowl */ //==================== INSTRUMENT ======================= process = (((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i)~_))):>+://~par(i,nModes,_) :> + : //Signal Scaling and stereo NLFM : stereo : instrReverbAccel: *(vol),*(vol); //==================== GUI SPECIFICATION ================ vol = 0.8; freq = hslider("[1]Frequency[unit:Hz][acc:0 1 -10 0 10]", 440,180,780,1); gain = 0.5; gate = 0; select = hslider("[0]Play[tooltip:0=Bow; 1=Strike][acc:2 1 -10 0 10]", 0,0,1,1); integrationConstant = 0.01; baseGain = 0.5; typeModulation = 3; nonLinearity = hslider("[2]Modulation[acc:2 0 -10 0 15][tooltip:Nonlinearity factor (value between 0 and 1)]",0.02,0,0.1,0.001); frequencyMod = hslider("[3]Modulation Frequency[3][unit:Hz][acc:2 0 -10 0 15]", 220,150,500,0.1); nonLinAttack = 0.1; //==================== MODAL PARAMETERS ================ preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),1,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = nMode(preset); //bow table parameters tableOffset = 0; tableSlope = 10 - (9*bowPressure); delayLengthBase = ma.SR/freq; //de.delay lengths in number of samples delayLength(x) = delayLengthBase/modes(preset,x); //de.delay lines delayLine(x) = de.delay(4096,delayLength(x)); //Filter bank: fi.bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); //Delay lines feedback for bow table lookup control baseGainApp = 0.8999999999999999 + (0.1*baseGain); velocityInputApp = integrationConstant; velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp)) :> +; //Bow velocity is controled by an ADSR envelope maxVelocity = 0.03 + 0.1*gain; bowVelocity = maxVelocity*en.adsr(0.02,0.005,0.9,0.01,gate); stereoo(periodDuration) = _ <: _,widthdelay : stereopanner with{ //W = hslider("v:Spat/spatial width", 0.5, 0, 1, 0.01); W = 0.5; //A = hslider("v:Spat/pan angle", 0.6, 0, 1, 0.01); A = 0.6; widthdelay = de.delay(4096,W*periodDuration/2); stereopanner = _,_ : *(1.0-A), *(A); }; stereo = stereoo(delayLengthBase); //----------------------- Algorithm implementation ---------------------------- //One resonance resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x); //----------------------- Reverb (ajout accelerometre 05/2015) ---------------- instrReverbAccel = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:[4]Reverb/[1]Reverberation Volume (InstrReverb)[acc:1 1 -10 0 10]",0.2,0.02,1,0.01) : si.smooth(0.999):min(1):max(0.02); roomSize = hslider("v:[4]Reverb/[2]Reverberation Room Size (InstrReverb)[acc:1 1 -10 0 10]", 0.2,0.02,1.3,0.01) : min(1.3) : max(0.02); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/TibetanBowlMulti.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); ============ DESCRIPTION ============== - Multiple Tibetan Bowls - Head = Note Still/Reverberation - Head + Light circling on the spot/slight rotation = reverberated rolling ball in the bowl - Rocking = Ringing all bowls from low to high frequencies - Back = Modulation - Back + Light circling on the spot/slight rotation = rolling ball in the bowl ==================== INSTRUMENT ======================= nModes resonances with nModes feedbacks for bow table look-up ~par(i,nModes,_) :> + : Signal Scaling and stereo ==================== GUI SPECIFICATION ================ ==================== MODAL PARAMETERS ================ ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used bow table parameters de.delay lengths in number of samples de.delay lines Filter bank: fi.bandpass filters (declared in instrument.lib) Delay lines feedback for bow table lookup control Bow velocity is controled by an ADSR envelope W = hslider("v:Spat/spatial width", 0.5, 0, 1, 0.01); A = hslider("v:Spat/pan angle", 0.6, 0, 1, 0.01); ----------------------- Algorithm implementation ---------------------------- One resonance ----------------------- Reverb (ajout accelerometre 05/2015) ----------------
declare name "Tibetan Bowl"; declare description "Banded Waveguide Modeld Tibetan Bowl"; declare author "Romain Michon"; declare copyright "Romain Michon ([email protected])"; declare version "1.0"; declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; import("stdfaust.lib"); instrument = library("instruments.lib"); process = (((select-1)*-1) <: NLFM : stereo : instrReverbAccel: *(vol),*(vol); vol = 0.8; freq = hslider("[1]Frequency[unit:Hz][acc:0 1 -10 0 10]", 440,180,780,1); gain = 0.5; gate = 0; select = hslider("[0]Play[tooltip:0=Bow; 1=Strike][acc:2 1 -10 0 10]", 0,0,1,1); integrationConstant = 0.01; baseGain = 0.5; typeModulation = 3; nonLinearity = hslider("[2]Modulation[acc:2 0 -10 0 15][tooltip:Nonlinearity factor (value between 0 and 1)]",0.02,0,0.1,0.001); frequencyMod = hslider("[3]Modulation Frequency[3][unit:Hz][acc:2 0 -10 0 15]", 220,150,500,0.1); nonLinAttack = 0.1; preset = 0; nMode(0) = 12; modes(0,0) = 0.996108344; basegains(0,0) = 0.999925960128219; excitation(0,0) = 11.900357 / 10; modes(0,1) = 1.0038916562; basegains(0,1) = 0.999925960128219; excitation(0,1) = 11.900357 / 10; modes(0,2) = 2.979178; basegains(0,2) = 0.999982774366897; excitation(0,2) = 10.914886 / 10; modes(0,3) = 2.99329767; basegains(0,3) = 0.999982774366897; excitation(0,3) = 10.914886 / 10; modes(0,4) = 5.704452; basegains(0,4) = 1.0; excitation(0,4) = 42.995041 / 10; modes(0,5) = 5.704452; basegains(0,5) = 1.0; excitation(0,5) = 42.995041 / 10; modes(0,6) = 8.9982; basegains(0,6) = 1.0; excitation(0,6) = 40.063034 / 10; modes(0,7) = 9.01549726; basegains(0,7) = 1.0; excitation(0,7) = 40.063034 / 10; modes(0,8) = 12.83303; basegains(0,8) = 0.999965497558225; excitation(0,8) = 7.063034 / 10; modes(0,9) = 12.807382; basegains(0,9) = 0.999965497558225; excitation(0,9) = 7.063034 / 10; modes(0,10) = 17.2808219; basegains(0,10) = 0.9999999999999999999965497558225; excitation(0,10) = 57.063034 / 10; modes(0,11) = 21.97602739726; basegains(0,11) = 0.999999999999999965497558225; excitation(0,11) = 57.063034 / 10; nlfOrder = 6; NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),1,freq, typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); nModes = nMode(preset); tableOffset = 0; tableSlope = 10 - (9*bowPressure); delayLengthBase = ma.SR/freq; delayLength(x) = delayLengthBase/modes(preset,x); delayLine(x) = de.delay(4096,delayLength(x)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); baseGainApp = 0.8999999999999999 + (0.1*baseGain); velocityInputApp = integrationConstant; velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp)) :> +; maxVelocity = 0.03 + 0.1*gain; bowVelocity = maxVelocity*en.adsr(0.02,0.005,0.9,0.01,gate); stereoo(periodDuration) = _ <: _,widthdelay : stereopanner with{ W = 0.5; A = 0.6; widthdelay = de.delay(4096,W*periodDuration/2); stereopanner = _,_ : *(1.0-A), *(A); }; stereo = stereoo(delayLengthBase); resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x); instrReverbAccel = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = hslider("v:[4]Reverb/[1]Reverberation Volume (InstrReverb)[acc:1 1 -10 0 10]",0.2,0.02,1,0.01) : si.smooth(0.999):min(1):max(0.02); roomSize = hslider("v:[4]Reverb/[2]Reverberation Room Size (InstrReverb)[acc:1 1 -10 0 10]", 0.2,0.02,1.3,0.01) : min(1.3) : max(0.02); rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
f69fb158515df4cde82959ec3d9de1816c2f5fcaa0cf7d005f9a0daeed1cd5f3
RuolunWeng/ruolunweng.github.io
SBird.dsp
declare name "bird"; declare author "Pierre Cochard"; //Modifications by Grame July 2014, June 2015; /* =============== DESCRIPTION ================= : - Bird singing generator. - Right = maximum speed of whistles. - Left = minimum speed/Rare birds, nearly silence. */ import("stdfaust.lib"); // PROCESS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - process = hgroup("Bird", mainOsc(noteTrig : rdm(72,94) : mtof , noteTrig) * envWrapper(noteTrig, ampEnv, amp_xp(2510)) : fi.lowpass(1, 2500) *(0.8) <: _,_); // AUTO TRIGGER autoTrig = ba.beat(t) * (abs(no.noise) <= p) : trigger(48) with { t = hslider("[1]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 240, 120, 480, 0.1) : si.smooth(0.999); p = hslider("[2]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 50, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; // BIRD TRIGGER noteTrig = autoTrig; // OSCILLATORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* base */ carrierOsc(freq) = os.osci(freq); modOsc(freq) = os.triangleN(3,freq); /* fm oscillator */ mainOsc(freq,trig) = freq <: +(*(harmRatio <: +(*(envWrapper(trig,harmEnv,harm_xp(1700))))) : modOsc : *(modIndex <: +(*(envWrapper(trig,modIndexEnv,modIndex_xp(550)))))) <: +(*(envWrapper(trig,freqEnv,freq_xp(943)))) : carrierOsc; envWrapper(trig,env,sus) = trig : mstosamps(rdm(100,3000)), sus : hitLength : env; // FIXED PARAMETERS - - - - - - - - - - - - - - - - - - - - - - - - - - - /* fm */ harmRatio = 0.063; modIndex = 3.24; // TIME FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - metro(ms) = (%(+(1),mstosamps(ms))) ~_ : ==(1); mstosamps(ms) = ms : /(1000) * ma.SR : int; rdmInc = _ <: @(1), @(2) : + : *(2994.2313) : int : +(38125); rdm(rdmin,rdmax) = _,(fmod(_,rdmax - rdmin : int) ~ rdmInc : +(rdmin)) : gater : -(1) : abs; gater = (_,_,_ <: !,_,!,_,!,!,!,!,_ : select2) ~_; // MIDI RELATED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* midi pitch */ mtof(midinote) = pow(2,(midinote - 69) / 12) * 440; // ENVELOPPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* envelope "reader" (phaser) */ hitLength(length,sustain) = *((==(length,@(length,1))), +(1))~_ <: gater(<(sustain)); /* amplitude envelope */ ampEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(amp_xp(60.241), 1.) : ba.bpf.point(amp_xp(461.847), 0.) : ba.bpf.point(amp_xp(582.329), 0.928) : ba.bpf.point(amp_xp(682.731), 0.5) : ba.bpf.point(amp_xp(983.936), 0.) : ba.bpf.point(amp_xp(1064.257), 0.) : ba.bpf.point(amp_xp(1345.382), 0.) : ba.bpf.point(amp_xp(1526.105), 0.) : ba.bpf.point(amp_xp(1746.988), 0.) : ba.bpf.point(amp_xp(1827.309), 0.) : ba.bpf.point(amp_xp(2088.353), 0.) : ba.bpf.point(amp_xp(2188.755), 0.) : /* sustain point */ ba.bpf.end(amp_xp(2510.040), 0.); ampEnv = ampEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); amp_xp(x) = x * ma.SR / 1000. * ampEnv_speed; ampEnv_speed = noteTrig : rdm(0,2000) : /(1000); /* freq envelope */ freqEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(freq_xp(147.751), 1.) : ba.bpf.point(freq_xp(193.213), 0.) : ba.bpf.point(freq_xp(318.233), yp) : ba.bpf.point(freq_xp(431.888), 0.) : ba.bpf.point(freq_xp(488.715), 0.434) : ba.bpf.point(freq_xp(613.735), yp) : ba.bpf.point(freq_xp(659.197), 1.) : ba.bpf.point(freq_xp(716.024), yp) : ba.bpf.point(freq_xp(806.948), 1.) : ba.bpf.point(freq_xp(829.679), yp) : /* sustain point */ ba.bpf.end(freq_xp(943.333), 0.); freqEnv = freqEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); freq_xp(x) = x * ma.SR / 1000. * freqEnv_speed; freqEnv_speed = noteTrig : rdm(0,2000) : /(1000); yp = noteTrig : rdm(0,1000) : /(1000); /* harmRatio envelope */ harmEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(harm_xp(863.454), 0.490) : ba.bpf.point(harm_xp(865), 0.) : ba.bpf.point (harm_xp(1305.221), 1.) : ba.bpf.point(harm_xp(1646.586), 0.) : /* sustain point */ ba.bpf.end(harm_xp(1700), 0.); harmEnv = harmEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); harm_xp(x) = x * ma.SR / 1000. * harmEnv_speed; harmEnv_speed = noteTrig : rdm(0,2000) : /(1000); /* modIndex envelope */ modIndexEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(modIndex_xp(240.964), 0.554) : ba.bpf.point(modIndex_xp(502.068), 0.) : /* sustain point */ ba.bpf.end(modIndex_xp(550), 0.); modIndexEnv = modIndexEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); modIndex_xp(x) = x * ma.SR / 1000. * modIndexEnv_speed; modIndexEnv_speed = noteTrig : rdm(0,2000) : /(1000);
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SBird.dsp
faust
Modifications by Grame July 2014, June 2015; =============== DESCRIPTION ================= : - Bird singing generator. - Right = maximum speed of whistles. - Left = minimum speed/Rare birds, nearly silence. PROCESS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AUTO TRIGGER BIRD TRIGGER OSCILLATORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - base fm oscillator FIXED PARAMETERS - - - - - - - - - - - - - - - - - - - - - - - - - - - fm TIME FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - MIDI RELATED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - midi pitch ENVELOPPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - envelope "reader" (phaser) amplitude envelope sustain point freq envelope sustain point harmRatio envelope sustain point modIndex envelope sustain point
declare name "bird"; declare author "Pierre Cochard"; import("stdfaust.lib"); process = hgroup("Bird", mainOsc(noteTrig : rdm(72,94) : mtof , noteTrig) * envWrapper(noteTrig, ampEnv, amp_xp(2510)) : fi.lowpass(1, 2500) *(0.8) <: _,_); autoTrig = ba.beat(t) * (abs(no.noise) <= p) : trigger(48) with { t = hslider("[1]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 240, 120, 480, 0.1) : si.smooth(0.999); p = hslider("[2]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 50, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; noteTrig = autoTrig; carrierOsc(freq) = os.osci(freq); modOsc(freq) = os.triangleN(3,freq); mainOsc(freq,trig) = freq <: +(*(harmRatio <: +(*(envWrapper(trig,harmEnv,harm_xp(1700))))) : modOsc : *(modIndex <: +(*(envWrapper(trig,modIndexEnv,modIndex_xp(550)))))) <: +(*(envWrapper(trig,freqEnv,freq_xp(943)))) : carrierOsc; envWrapper(trig,env,sus) = trig : mstosamps(rdm(100,3000)), sus : hitLength : env; harmRatio = 0.063; modIndex = 3.24; metro(ms) = (%(+(1),mstosamps(ms))) ~_ : ==(1); mstosamps(ms) = ms : /(1000) * ma.SR : int; rdmInc = _ <: @(1), @(2) : + : *(2994.2313) : int : +(38125); rdm(rdmin,rdmax) = _,(fmod(_,rdmax - rdmin : int) ~ rdmInc : +(rdmin)) : gater : -(1) : abs; gater = (_,_,_ <: !,_,!,_,!,!,!,!,_ : select2) ~_; mtof(midinote) = pow(2,(midinote - 69) / 12) * 440; hitLength(length,sustain) = *((==(length,@(length,1))), +(1))~_ <: gater(<(sustain)); ampEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(amp_xp(60.241), 1.) : ba.bpf.point(amp_xp(461.847), 0.) : ba.bpf.point(amp_xp(582.329), 0.928) : ba.bpf.point(amp_xp(682.731), 0.5) : ba.bpf.point(amp_xp(983.936), 0.) : ba.bpf.point(amp_xp(1064.257), 0.) : ba.bpf.point(amp_xp(1345.382), 0.) : ba.bpf.point(amp_xp(1526.105), 0.) : ba.bpf.point(amp_xp(1746.988), 0.) : ba.bpf.point(amp_xp(1827.309), 0.) : ba.bpf.point(amp_xp(2088.353), 0.) : ba.bpf.end(amp_xp(2510.040), 0.); ampEnv = ampEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); amp_xp(x) = x * ma.SR / 1000. * ampEnv_speed; ampEnv_speed = noteTrig : rdm(0,2000) : /(1000); freqEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(freq_xp(147.751), 1.) : ba.bpf.point(freq_xp(193.213), 0.) : ba.bpf.point(freq_xp(318.233), yp) : ba.bpf.point(freq_xp(431.888), 0.) : ba.bpf.point(freq_xp(488.715), 0.434) : ba.bpf.point(freq_xp(613.735), yp) : ba.bpf.point(freq_xp(659.197), 1.) : ba.bpf.point(freq_xp(716.024), yp) : ba.bpf.point(freq_xp(806.948), 1.) : ba.bpf.end(freq_xp(943.333), 0.); freqEnv = freqEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); freq_xp(x) = x * ma.SR / 1000. * freqEnv_speed; freqEnv_speed = noteTrig : rdm(0,2000) : /(1000); yp = noteTrig : rdm(0,1000) : /(1000); harmEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(harm_xp(863.454), 0.490) : ba.bpf.point(harm_xp(865), 0.) : ba.bpf.point (harm_xp(1305.221), 1.) : ba.bpf.end(harm_xp(1700), 0.); harmEnv = harmEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); harm_xp(x) = x * ma.SR / 1000. * harmEnv_speed; harmEnv_speed = noteTrig : rdm(0,2000) : /(1000); modIndexEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(modIndex_xp(240.964), 0.554) : ba.bpf.end(modIndex_xp(550), 0.); modIndexEnv = modIndexEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); modIndex_xp(x) = x * ma.SR / 1000. * modIndexEnv_speed; modIndexEnv_speed = noteTrig : rdm(0,2000) : /(1000);
11787a313434864de1211d25d232336a4352243ce635d8d84669a849f6677b65
RuolunWeng/ruolunweng.github.io
SCameleonKeyboard.dsp
declare name "Cameleon Keyboard"; declare author "ER"; import("stdfaust.lib"); //From John Chowning Turenas envelops /* =============== DESCRIPTION ================= : - Multiple envelope keyboard - Pick an envelope - Rocking = striking across the keyboard from low frequencies (Left) to high frequencies (Right) - Back + Rotation = long notes - Front + Rotation = short notes */ //--------------------------------- INSTRUMENT --------------------------------- marimkey(n) = os.osc(octave(n)) * (0.1) *(trigger(n+1) : envelope : fi.lowpass(1,500)); process = hand <: par(i, 10, marimkey(i)) :> *(3); //---------------------------------- UI ---------------------------------------- hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, 10, 1); hight = hslider("[2]Hight[acc:0 1 -10 0 30]", 5, 1, 10, 0.3) : si.smooth(0.99):min(12):max(1); envsize = hslider("[3]Note Duration (BPF Envelope)[unit:s][acc:2 0 -10 0 10]", 0.2, 0.1, 0.5, 0.01) * (ma.SR) : si.smooth(0.999): min(44100) : max(4410) : int; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 164.81; freq(1) = 174.61; freq(d) = freq(d-2); octave(d) = freq(d)* hight; //------------------------------------ TRIGGER --------------------------------- upfront(x) = x>x'; counter(g)= (+(1):*(1-g))~_; position(a,x) = abs(x - a) < 0.5; trigger(p) = position(p) : upfront : counter; //----------------------------------- ENVELOPPES ------------------------------ /* envelope */ typeEnv = vslider("[4]Envelope Type (BPF Envelope)[style:radio{'f9':0;'f11':1;'f15':2;'f17':3}]",0,0,3,1):int; envelope = _<:sum(i, 4, tabchowning.env(i) * (abs(typeEnv - (i)) < 0.5)); /* Tables Chowning */ tabchowning = environment { // percussives envelops have been smmothed to avoid clicks. corres(x) = int(x*envsize/1024); // f9 0 1024 7 1 248 0.25 259 0.1 259 0.05 258 0 env(0) = f9; f9 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(10), 0.9): ba.bpf.point(corres(248), 0.25): ba.bpf.point(corres(507), 0.1): ba.bpf.point(corres(766), 0.05): ba.bpf.end(corres(1024), 0); /* //f10 0 1024 7 0.5 197 1 310 0.1 259 0.02 258 0 env(1) = f10; f10 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(197), 0.99): ba.bpf.point(corres(507), 0.1): ba.bpf.point(corres(766), 0.02): ba.bpf.end(corres(1024), 0); */ //f11 0 1024 7 0 93 0.02 52 0.1 103 0.5 52 0.95 31 1 538 0.95 52 0.9 52 0.05 51 0 env(1) = f11; f11 = ba.bpf.start(0, 0): ba.bpf.point(corres(93), 0.02): ba.bpf.point(corres(145), 0.1): ba.bpf.point(corres(248), 0.5): ba.bpf.point(corres(300), 0.95): ba.bpf.point(corres(331), 0.99): ba.bpf.point(corres(869), 0.95): ba.bpf.point(corres(921), 0.9): ba.bpf.point(corres(973), 0.05): ba.bpf.end(corres(1024), 0); /* //f12 0 1024 7 0 93 0.02 52 0.1 103 0.5 52 0.95 31 1 693 0.95 env(3) = f12; f12 = ba.bpf.start(0, 0): ba.bpf.point(corres(93), 0.02): ba.bpf.point(corres(145), 0.1): ba.bpf.point(corres(248), 0.5): ba.bpf.point(corres(300), 0.95): ba.bpf.point(corres(331), 0.99): ba.bpf.point(corres(1018), 0.95): ba.bpf.point(corres(1020), 0.25): ba.bpf.point(corres(1022), 0.125): ba.bpf.end(corres(1024), 0); //f13 0 1024 7 0 41 0.5 155 1 310 0.2 259 0.02 259 0 0 env(4) = f13; f13 = ba.bpf.start(0, 0): ba.bpf.point(corres(41), 0.5): ba.bpf.point(corres(196), 0.99): ba.bpf.point(corres(506), 0.2): ba.bpf.point(corres(765), 0.02): ba.bpf.end(corres(1024), 0); //f14 0 1024 7 1 114 0.75 134 1 259 0.25 259 0.05 258 0 env(5) = f14; f14 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(6), 0.99): ba.bpf.point(corres(114), 0.75): ba.bpf.point(corres(248), 0.99): ba.bpf.point(corres(507), 0.25): ba.bpf.point(corres(766), 0.05): ba.bpf.end(corres(1024), 0); */ //f15 0 1024 7 1 41 0.1 52 0.02 155 0 776 0 env(2) = f15; f15 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(6), 0.99): ba.bpf.point(corres(41), 0.1): ba.bpf.point(corres(93), 0.02): ba.bpf.point(corres(248), 0): ba.bpf.end(corres(1024), 0); /* //f16 0 1024 7 0 145 0.1 155 0.5 103 0.95 103 1 103 0.96 103 0.5 155 0.1 157 0 env(7) = f16; f16 = ba.bpf.start(0, 0): ba.bpf.point(corres(145), 0.1): ba.bpf.point(corres(300), 0.5): ba.bpf.point(corres(403), 0.95): ba.bpf.point(corres(506), 0.99): ba.bpf.point(corres(609), 0.96): ba.bpf.point(corres(712), 0.5): ba.bpf.point(corres(867), 0.1): ba.bpf.end(corres(1024), 0); */ //f17 0 1024 7 1 103 0.5 145 0.25 259 0.1 259 0.05 259 0 env(3) = f17; f17 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(6), 0.99): ba.bpf.point(corres(103), 0.5): ba.bpf.point(corres(248), 0.25): ba.bpf.point(corres(403), 0.1): ba.bpf.point(corres(507), 0.05): ba.bpf.point(corres(766), 0): ba.bpf.end(corres(1024), 0); };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SCameleonKeyboard.dsp
faust
From John Chowning Turenas envelops =============== DESCRIPTION ================= : - Multiple envelope keyboard - Pick an envelope - Rocking = striking across the keyboard from low frequencies (Left) to high frequencies (Right) - Back + Rotation = long notes - Front + Rotation = short notes --------------------------------- INSTRUMENT --------------------------------- ---------------------------------- UI ---------------------------------------- ---------------------------------- FREQUENCY TABLE --------------------------- ------------------------------------ TRIGGER --------------------------------- ----------------------------------- ENVELOPPES ------------------------------ envelope Tables Chowning percussives envelops have been smmothed to avoid clicks. f9 0 1024 7 1 248 0.25 259 0.1 259 0.05 258 0 //f10 0 1024 7 0.5 197 1 310 0.1 259 0.02 258 0 env(1) = f10; f10 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(197), 0.99): ba.bpf.point(corres(507), 0.1): ba.bpf.point(corres(766), 0.02): ba.bpf.end(corres(1024), 0); f11 0 1024 7 0 93 0.02 52 0.1 103 0.5 52 0.95 31 1 538 0.95 52 0.9 52 0.05 51 0 //f12 0 1024 7 0 93 0.02 52 0.1 103 0.5 52 0.95 31 1 693 0.95 env(3) = f12; f12 = ba.bpf.start(0, 0): ba.bpf.point(corres(93), 0.02): ba.bpf.point(corres(145), 0.1): ba.bpf.point(corres(248), 0.5): ba.bpf.point(corres(300), 0.95): ba.bpf.point(corres(331), 0.99): ba.bpf.point(corres(1018), 0.95): ba.bpf.point(corres(1020), 0.25): ba.bpf.point(corres(1022), 0.125): ba.bpf.end(corres(1024), 0); //f13 0 1024 7 0 41 0.5 155 1 310 0.2 259 0.02 259 0 0 env(4) = f13; f13 = ba.bpf.start(0, 0): ba.bpf.point(corres(41), 0.5): ba.bpf.point(corres(196), 0.99): ba.bpf.point(corres(506), 0.2): ba.bpf.point(corres(765), 0.02): ba.bpf.end(corres(1024), 0); //f14 0 1024 7 1 114 0.75 134 1 259 0.25 259 0.05 258 0 env(5) = f14; f14 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(6), 0.99): ba.bpf.point(corres(114), 0.75): ba.bpf.point(corres(248), 0.99): ba.bpf.point(corres(507), 0.25): ba.bpf.point(corres(766), 0.05): ba.bpf.end(corres(1024), 0); f15 0 1024 7 1 41 0.1 52 0.02 155 0 776 0 //f16 0 1024 7 0 145 0.1 155 0.5 103 0.95 103 1 103 0.96 103 0.5 155 0.1 157 0 env(7) = f16; f16 = ba.bpf.start(0, 0): ba.bpf.point(corres(145), 0.1): ba.bpf.point(corres(300), 0.5): ba.bpf.point(corres(403), 0.95): ba.bpf.point(corres(506), 0.99): ba.bpf.point(corres(609), 0.96): ba.bpf.point(corres(712), 0.5): ba.bpf.point(corres(867), 0.1): ba.bpf.end(corres(1024), 0); f17 0 1024 7 1 103 0.5 145 0.25 259 0.1 259 0.05 259 0
declare name "Cameleon Keyboard"; declare author "ER"; import("stdfaust.lib"); marimkey(n) = os.osc(octave(n)) * (0.1) *(trigger(n+1) : envelope : fi.lowpass(1,500)); process = hand <: par(i, 10, marimkey(i)) :> *(3); hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, 10, 1); hight = hslider("[2]Hight[acc:0 1 -10 0 30]", 5, 1, 10, 0.3) : si.smooth(0.99):min(12):max(1); envsize = hslider("[3]Note Duration (BPF Envelope)[unit:s][acc:2 0 -10 0 10]", 0.2, 0.1, 0.5, 0.01) * (ma.SR) : si.smooth(0.999): min(44100) : max(4410) : int; freq(0) = 164.81; freq(1) = 174.61; freq(d) = freq(d-2); octave(d) = freq(d)* hight; upfront(x) = x>x'; counter(g)= (+(1):*(1-g))~_; position(a,x) = abs(x - a) < 0.5; trigger(p) = position(p) : upfront : counter; typeEnv = vslider("[4]Envelope Type (BPF Envelope)[style:radio{'f9':0;'f11':1;'f15':2;'f17':3}]",0,0,3,1):int; envelope = _<:sum(i, 4, tabchowning.env(i) * (abs(typeEnv - (i)) < 0.5)); tabchowning = environment { corres(x) = int(x*envsize/1024); env(0) = f9; f9 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(10), 0.9): ba.bpf.point(corres(248), 0.25): ba.bpf.point(corres(507), 0.1): ba.bpf.point(corres(766), 0.05): ba.bpf.end(corres(1024), 0); env(1) = f11; f11 = ba.bpf.start(0, 0): ba.bpf.point(corres(93), 0.02): ba.bpf.point(corres(145), 0.1): ba.bpf.point(corres(248), 0.5): ba.bpf.point(corres(300), 0.95): ba.bpf.point(corres(331), 0.99): ba.bpf.point(corres(869), 0.95): ba.bpf.point(corres(921), 0.9): ba.bpf.point(corres(973), 0.05): ba.bpf.end(corres(1024), 0); env(2) = f15; f15 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(6), 0.99): ba.bpf.point(corres(41), 0.1): ba.bpf.point(corres(93), 0.02): ba.bpf.point(corres(248), 0): ba.bpf.end(corres(1024), 0); env(3) = f17; f17 = ba.bpf.start(0, 0): ba.bpf.point(corres(2), 0.25): ba.bpf.point(corres(4), 0.5): ba.bpf.point(corres(6), 0.99): ba.bpf.point(corres(103), 0.5): ba.bpf.point(corres(248), 0.25): ba.bpf.point(corres(403), 0.1): ba.bpf.point(corres(507), 0.05): ba.bpf.point(corres(766), 0): ba.bpf.end(corres(1024), 0); };
e342634dede97aeb8e5575eecd55391c902c233d674c06d4b07a4c855b791375
RuolunWeng/ruolunweng.github.io
Whistles.dsp
declare name "Whistles"; declare author "ER"; declare version "1.0"; import("stdfaust.lib"); instrument = library("instruments.lib"); /* ============ Description ============== : - 3 triple whistles, one per axis. - Head = reverberation & whistles heard from far away. - Bottom + rotation = proximity of the whistles. - Rapid swings trigger volume increases (fishing rod/rocking/swing). */ //----------------- INSTRUMENT ------------------// process = vgroup("Whistles", nOise.white * (0.5) <: par(f, 3, par(i, 3, whistle(f,i)) )):>_<: frEEvErb.fvb :>_; whistle(f,n) = BP(f,n) : EQ(f,n) : @(10 + (12000*n)) <:Reson(f,0),_*(1.5):> * (vibrato) *(vibratoEnv(f))*(gain(f)); //----------------- NOISES ----------------------// nOise = environment{ // white no.noise generator: random = +(12345)~*(1103515245); white = random/2147483647.0; //pink no.noise filter: p = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; //pink no.noise generator: pink = (white : p); }; //----------------- FILTERS -------------------// //gain = 1 - (Q * 0.1); freq(0) = hslider("[1]Frequency 0[unit:Hz][acc:2 1 -10 0 10]", 110, 50, 220, 0.01):si.smooth(0.999); freq(1) = hslider("[2]Frequency 1[unit:Hz][acc:2 1 -10 0 10]", 400, 220, 660, 0.01):si.smooth(0.999); freq(2) = hslider("[3]Frequency 2[unit:Hz][acc:2 1 -10 0 10]", 820, 660, 1100, 0.01):si.smooth(0.999); gain(n) = hslider("[5]Volume %n[style:knob][acc:%n 0 -10 0 20]", 0.2, 0, 2, 0.001):si.smooth(0.999); hight(f,n) = freq(f)* (n+1); level = 20; Lowf(f,n) = hight(f,n) - Q; Highf(f,n) = hight(f,n) + Q; Q = 2 : si.smooth(0.999);//hslider("Q - Filter Bandwidth[style:knob][unit:Hz][tooltip: Band width = 2 * Frequency]",2.5,1,10,0.0001):si.smooth(0.999); BP(f,n) = fi.bandpass(1, Lowf(f,n), Highf(f,n)); EQ(f,n) = fi.peak_eq(level,hight(f,n),Q) : fi.lowpass(1, 6000); Reson(f,n) = fi.resonbp(hight(f,n),Q,1) : fi.lowpass(1,3000); //----------------- VIBRATO --------------------// vibrato = vibratoGain * os.osc(vibratoFreq) + (1-vibratoGain); vibratoGain = 0.17;//hslider("Vibrato Volume[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.5, 0.01) : si.smooth(0.999); vibratoFreq = vfreq; //hslider("Vibrato Frequency[unit:Hz][acc:0 0 -10 0 12]", 5, 0, 10, 0.001) : si.smooth(0.999); //--------------------------- Random Frequency --------------------------- vfreq = pulsawhistle.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(10) with { sampleAndhold(t) = select2(t) ~_; sahgate(g) = g : upfront : counter -(3) <=(0); upfront(x) = abs(x-x')>0.5; counter(g) = (+(1):*(1-g))~_; }; //----------------------- Pulsar -------------------------------------- pulsawhistle = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); fade = (0.5); // min > 0 pour eviter division par 0 speed = 0.5; proba = 0.9; //hslider ("h:Pulse/Probability[unit:%][style:knob][acc:1 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; //----------------------- Vibrato Envelope ---------------------------- vibratoEnv(n) = (instrument.envVibrato(b,a,s,r,t(n))) with { b = 0.25; a = 0.1; s = 100; r = 0.8; t(n) = hslider("[4]Envelope ON/OFF %n[acc:%n 0 -12 0 2]", 1, 0, 1, 1); }; //------------------------ Freeverb ------------------------------------ frEEvErb = environment{ // Freeverb //--------- fvb = vgroup("[6]Freeverb", fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread))); //====================================================== // // Freeverb // Faster version using fixed delays (20% gain) // //====================================================== // Constant Parameters //-------------------- fixedgain = 0.015; //value of the gain of fxctrl scalewet = 3.0; scaledry = 2.0; scaledamp = 0.4; scaleroom = 0.28; offsetroom = 0.7; initialroom = 0.5; initialdamp = 0.5; initialwet = 1.0/scalewet; initialdry = 0; initialwidth= 1.0; initialmode = 0.0; freezemode = 0.5; stereospread= 23; allpassfeed = 0.5; //feedback of the delays used in allpass filters // Filter Parameters //------------------ combtuningL1 = 1116; combtuningL2 = 1188; combtuningL3 = 1277; combtuningL4 = 1356; combtuningL5 = 1422; combtuningL6 = 1491; combtuningL7 = 1557; combtuningL8 = 1617; allpasstuningL1 = 556; allpasstuningL2 = 441; allpasstuningL3 = 341; allpasstuningL4 = 225; // Control Sliders //-------------------- // Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize) // RoomSize : size of the reverberation room // Dry : original signal // Wet : reverberated signal //dampSlider = hslider("Damp",0.5, 0, 1, 0.025)*scaledamp; dampSlider = 0.7*scaledamp; roomsizeSlider = hslider("[7]Reverberation Room Size (Freeverb)[style:knob][acc:1 1 -10 0 13]", 0.5, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1) *scaleroom + offsetroom; wetSlider = hslider("[6]Reverberation Intensity (Freeverb)[style:knob][acc:1 1 -10 0 15]", 0.3333, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1); combfeed = roomsizeSlider; // Comb and Allpass filters //------------------------- allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_); comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb)); // Reverb components //------------------ monoReverb(fb1, fb2, damp, spread) = _ <: comb(combtuningL1+spread, fb1, damp), comb(combtuningL2+spread, fb1, damp), comb(combtuningL3+spread, fb1, damp), comb(combtuningL4+spread, fb1, damp), comb(combtuningL5+spread, fb1, damp), comb(combtuningL6+spread, fb1, damp), comb(combtuningL7+spread, fb1, damp), comb(combtuningL8+spread, fb1, damp) +> allpass (allpasstuningL1+spread, fb2) : allpass (allpasstuningL2+spread, fb2) : allpass (allpasstuningL3+spread, fb2) : allpass (allpasstuningL4+spread, fb2) ; stereoReverb(fb1, fb2, damp, spread) = + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread); // fxctrl : add an input gain and a wet-dry control to a stereo FX //---------------------------------------------------------------- fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_; };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Whistles.dsp
faust
============ Description ============== : - 3 triple whistles, one per axis. - Head = reverberation & whistles heard from far away. - Bottom + rotation = proximity of the whistles. - Rapid swings trigger volume increases (fishing rod/rocking/swing). ----------------- INSTRUMENT ------------------// ----------------- NOISES ----------------------// white no.noise generator: pink no.noise filter: pink no.noise generator: ----------------- FILTERS -------------------// gain = 1 - (Q * 0.1); hslider("Q - Filter Bandwidth[style:knob][unit:Hz][tooltip: Band width = 2 * Frequency]",2.5,1,10,0.0001):si.smooth(0.999); ----------------- VIBRATO --------------------// hslider("Vibrato Volume[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.5, 0.01) : si.smooth(0.999); hslider("Vibrato Frequency[unit:Hz][acc:0 0 -10 0 12]", 5, 0, 10, 0.001) : si.smooth(0.999); --------------------------- Random Frequency --------------------------- ----------------------- Pulsar -------------------------------------- min > 0 pour eviter division par 0 hslider ("h:Pulse/Probability[unit:%][style:knob][acc:1 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1); ----------------------- Vibrato Envelope ---------------------------- ------------------------ Freeverb ------------------------------------ Freeverb --------- ====================================================== Freeverb Faster version using fixed delays (20% gain) ====================================================== Constant Parameters -------------------- value of the gain of fxctrl feedback of the delays used in allpass filters Filter Parameters ------------------ Control Sliders -------------------- Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize) RoomSize : size of the reverberation room Dry : original signal Wet : reverberated signal dampSlider = hslider("Damp",0.5, 0, 1, 0.025)*scaledamp; Comb and Allpass filters ------------------------- Reverb components ------------------ fxctrl : add an input gain and a wet-dry control to a stereo FX ----------------------------------------------------------------
declare name "Whistles"; declare author "ER"; declare version "1.0"; import("stdfaust.lib"); instrument = library("instruments.lib"); process = vgroup("Whistles", nOise.white * (0.5) <: par(f, 3, par(i, 3, whistle(f,i)) )):>_<: frEEvErb.fvb :>_; whistle(f,n) = BP(f,n) : EQ(f,n) : @(10 + (12000*n)) <:Reson(f,0),_*(1.5):> * (vibrato) *(vibratoEnv(f))*(gain(f)); nOise = environment{ random = +(12345)~*(1103515245); white = random/2147483647.0; p = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; pink = (white : p); }; freq(0) = hslider("[1]Frequency 0[unit:Hz][acc:2 1 -10 0 10]", 110, 50, 220, 0.01):si.smooth(0.999); freq(1) = hslider("[2]Frequency 1[unit:Hz][acc:2 1 -10 0 10]", 400, 220, 660, 0.01):si.smooth(0.999); freq(2) = hslider("[3]Frequency 2[unit:Hz][acc:2 1 -10 0 10]", 820, 660, 1100, 0.01):si.smooth(0.999); gain(n) = hslider("[5]Volume %n[style:knob][acc:%n 0 -10 0 20]", 0.2, 0, 2, 0.001):si.smooth(0.999); hight(f,n) = freq(f)* (n+1); level = 20; Lowf(f,n) = hight(f,n) - Q; Highf(f,n) = hight(f,n) + Q; BP(f,n) = fi.bandpass(1, Lowf(f,n), Highf(f,n)); EQ(f,n) = fi.peak_eq(level,hight(f,n),Q) : fi.lowpass(1, 6000); Reson(f,n) = fi.resonbp(hight(f,n),Q,1) : fi.lowpass(1,3000); vibrato = vibratoGain * os.osc(vibratoFreq) + (1-vibratoGain); vfreq = pulsawhistle.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(10) with { sampleAndhold(t) = select2(t) ~_; sahgate(g) = g : upfront : counter -(3) <=(0); upfront(x) = abs(x-x')>0.5; counter(g) = (+(1):*(1-g))~_; }; pulsawhistle = environment{ gate = phasor_bin(1) :-(0.001):pulsar; ratio_env = (0.5); speed = 0.5; phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); }; vibratoEnv(n) = (instrument.envVibrato(b,a,s,r,t(n))) with { b = 0.25; a = 0.1; s = 100; r = 0.8; t(n) = hslider("[4]Envelope ON/OFF %n[acc:%n 0 -12 0 2]", 1, 0, 1, 1); }; frEEvErb = environment{ fvb = vgroup("[6]Freeverb", fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread))); scalewet = 3.0; scaledry = 2.0; scaledamp = 0.4; scaleroom = 0.28; offsetroom = 0.7; initialroom = 0.5; initialdamp = 0.5; initialwet = 1.0/scalewet; initialdry = 0; initialwidth= 1.0; initialmode = 0.0; freezemode = 0.5; stereospread= 23; combtuningL1 = 1116; combtuningL2 = 1188; combtuningL3 = 1277; combtuningL4 = 1356; combtuningL5 = 1422; combtuningL6 = 1491; combtuningL7 = 1557; combtuningL8 = 1617; allpasstuningL1 = 556; allpasstuningL2 = 441; allpasstuningL3 = 341; allpasstuningL4 = 225; dampSlider = 0.7*scaledamp; roomsizeSlider = hslider("[7]Reverberation Room Size (Freeverb)[style:knob][acc:1 1 -10 0 13]", 0.5, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1) *scaleroom + offsetroom; wetSlider = hslider("[6]Reverberation Intensity (Freeverb)[style:knob][acc:1 1 -10 0 15]", 0.3333, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1); combfeed = roomsizeSlider; allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_); comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb)); monoReverb(fb1, fb2, damp, spread) = _ <: comb(combtuningL1+spread, fb1, damp), comb(combtuningL2+spread, fb1, damp), comb(combtuningL3+spread, fb1, damp), comb(combtuningL4+spread, fb1, damp), comb(combtuningL5+spread, fb1, damp), comb(combtuningL6+spread, fb1, damp), comb(combtuningL7+spread, fb1, damp), comb(combtuningL8+spread, fb1, damp) +> allpass (allpasstuningL1+spread, fb2) : allpass (allpasstuningL2+spread, fb2) : allpass (allpasstuningL3+spread, fb2) : allpass (allpasstuningL4+spread, fb2) ; stereoReverb(fb1, fb2, damp, spread) = + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread); fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_; };
be50ffb5deacc0b959268a3be4e43882a9b3efd1e97d11a1c0da6e5228d43bcc
RuolunWeng/Cage
cage.dsp
import("stdfaust.lib"); switch= en.adsre(0.5,0.1,1,1,checkbox("switch")); switch2= en.adsre(0.5,0.1,1,1,1-checkbox("switch")); process = part_radio,part_dialog :> _,_; part_radio = playerPad, playerVoice :> _*(switch),_*(switch); part_dialog = Ququ , Birds :> _*(switch2),_*(switch2); //////// selectPart(sec,offset) =no.pink_noise: de.delay(ma.SR*sec, offset) :abs:*(100):int:ba.sAndH(ba.pulse(ma.SR*sec))%3; selectPart21(sec,offset) =no.pink_noise: de.delay(ma.SR*sec, offset) :abs:*(500):int:ba.sAndH(ba.pulse(ma.SR*sec))%21; level = hslider("level", 0.5, 0, 1, 0.01); s1 = soundfile("[url:{'RADIO1.wav';'RADIO2.wav';'RADIO3.wav'}]",1); sample1 = so.sound(s1, 0); sample2 = so.sound(s1, 1); sample3 = so.sound(s1, 2); s2 = soundfile("[url:{'dialog1.wav'; 'dialog2.wav'; 'dialog3.wav'; 'lenny.wav'; 'rg3.wav'; 'macron3.wav'; 'macron4.wav'; 'jiaomaidiao1.wav'; 'jiaomaidiao2.wav'; 'jiaomaidiao3.wav'; 'nainai1.wav'; 'nainai2.wav'; 'xinwen1.wav'; 'xinwen2.wav'; 'journal1.wav'; 'journal2.wav'; 'journal3.wav'; 'macron1.wav'; 'macron2.wav'; 'rg1.wav'; 'rg2.wav'}]",1); volume(sec,offset) = ba.pulse(ma.SR*sec):ba.peakholder(ma.SR*sec/2):ba.ramp(18000): de.delay(ma.SR*sec, offset); pad1 = volume(20,0) * select3(selectPart(20,0),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); pad2 = volume(10,ma.SR) * select3(selectPart(10,ma.SR),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); pad3 = volume(12,ma.SR*5) * select3(selectPart(12,ma.SR*5),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); pad4 = volume(16,ma.SR*3) * select3(selectPart(16,ma.SR*3),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); playerPad = pad1 , pad2 , pad3 , pad4 :> _,_ ; voice1 = volume(4,0) * ba.selectmulti(ma.SR/10, par(i, 18, so.sound(s2, i).loop_speed_level(1,0.5)), selectPart21(4,0)) ; voice2 = volume(6,ma.SR) * ba.selectmulti(ma.SR/10, par(i, 18, so.sound(s2, i).loop_speed_level(1,0.5)), selectPart21(6,ma.SR)) ; playerVoice = voice1 , voice2; // Ququ Ququ = hgroup("QUQU", os.osc(freq): ringmod : AsrEnvelop <:volumebird); freq = hslider("Frequency [unit:Hz] ", 4000, 70, 5000, 0.01):si.smooth(0.999); ringmod = _<:_,*(os.oscs(freq)):drywet with { freq = hslider ( "Modulation Frequency[scale:log]", 97,0.001,100,0.001):si.smooth(0.999); drywet(x,y) = (1-c)*x + c*y; c = hslider("Modulation intensity[style:knob][unit:%]", 70,0,100,0.01)*(0.01):si.smooth(0.999); }; autoTrig = ba.beat(t) * (abs(no.noise) <= p) : trigger(4800) with { t = hslider("Speed[style:knob][acc:0 1 -10 0 10]", 250, 120, 480, 0.1) : si.smooth(0.999); p = hslider("Probability[unit:%][style:knob][acc:0 1 -10 0 10]", 90, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; AsrEnvelop = *(en.asr(a,s,r,autoTrig)):_ with { a = hslider("Envelope Attack[unit:s][style:knob]", 0.03, 0.01, 2, 0.01) : si.smooth(0.999); s = 1; r = hslider("Envelope Release[unit:s][style:knob]", 0.04, 0.01, 5, 0.01) : si.smooth(0.999); //t=ba.pulsen(hslider("Envelope Period", 6000, 0, 44100, 1), hslider("Envelope Length", 15000, 0, 44100, 1)); //t = ba.beat (hslider("Speed [style:knob]", 120, 0, 480, 0.1) ); p = hslider("Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 90, 25, 100, 1)*(0.01) : si.smooth(0.999); }; volumebird = par(i,2,*(hslider("Volume", 0.02, 0, 1, 0.01):si.smooth(0.999))); // Birdy from Grame playground Birds = hgroup("Birds", mainOsc(noteTrig : rdm(72,94) : mtof , noteTrig) * envWrapper(noteTrig, ampEnv, amp_xp(2510)) : fi.lowpass(1, 2000) *(0.8) <: _,_, (rdmPanner : panSte) : panConnect : *,* : reverb); // AUTO TRIGGER autoTriger = ba.beat(t) * (abs(no.noise) <= p) : trigger(48) //tempo(2.5*t)) with { t = hslider("[1]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 120, 120, 480, 0.1) : si.smooth(0.999); p = hslider("[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 30, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; // BIRD TRIGGER noteTrig = autoTriger : min(1.0); //noteTrig = autoTrig; // OSCILLATORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* base */ carrierOsc(freq) = os.osci(freq); modOsc(freq) = os.triangleN(3,freq); /* fm oscillator */ mainOsc(freq,trig) = freq <: +(*(harmRatio <: +(*(envWrapper(trig,harmEnv,harm_xp(1700))))) : modOsc : *(modIndex <: +(*(envWrapper(trig,modIndexEnv,modIndex_xp(550)))))) <: +(*(envWrapper(trig,freqEnv,freq_xp(943)))) : carrierOsc; envWrapper(trig,env,sus) = trig : mstosamps(rdm(100,3000)), sus : hitLength : env; // FIXED PARAMETERS - - - - - - - - - - - - - - - - - - - - - - - - - - - /* fm */ harmRatio = 0.063; modIndex = 3.24; // TIME FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - metro(ms) = (%(+(1),mstosamps(ms))) ~_ : ==(1); mstosamps(ms) = ms : /(1000) * ma.SR : int; rdmInc = _ <: @(1), @(2) : + : *(2994.2313) : int : +(38125); rdm(rdmin,rdmax) = _,(fmod(_,rdmax - rdmin : int) ~ rdmInc : +(rdmin)) : gater : -(1) : abs; gater = (_,_,_ <: !,_,!,_,!,!,!,!,_ : select2) ~_; // MIDI RELATED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* midi pitch */ mtof(midinote) = pow(2,(midinote - 69) / 12) * 440; // ENVELOPPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* envelope "reader" (phaser) */ hitLength(length,sustain) = *((==(length,@(length,1))), +(1))~_ <: gater(<(sustain)); /* amplitude envelope */ ampEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(amp_xp(60.241), 1.) : ba.bpf.point(amp_xp(461.847), 0.) : ba.bpf.point(amp_xp(582.329), 0.928) : ba.bpf.point(amp_xp(682.731), 0.5) : ba.bpf.point(amp_xp(983.936), 0.) : ba.bpf.point(amp_xp(1064.257), 0.) : ba.bpf.point(amp_xp(1345.382), 0.) : ba.bpf.point(amp_xp(1526.105), 0.) : ba.bpf.point(amp_xp(1746.988), 0.) : ba.bpf.point(amp_xp(1827.309), 0.) : ba.bpf.point(amp_xp(2088.353), 0.) : ba.bpf.point(amp_xp(2188.755), 0.) : /* sustain point */ ba.bpf.end(amp_xp(2510.040), 0.); ampEnv = ampEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); amp_xp(x) = x * ma.SR / 1000. * ampEnv_speed; ampEnv_speed = noteTrig : rdm(0,2000) : /(1000); /* freq envelope */ freqEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(freq_xp(147.751), 1.) : ba.bpf.point(freq_xp(193.213), 0.) : ba.bpf.point(freq_xp(318.233), yp) : ba.bpf.point(freq_xp(431.888), 0.) : ba.bpf.point(freq_xp(488.715), 0.434) : ba.bpf.point(freq_xp(613.735), yp) : ba.bpf.point(freq_xp(659.197), 1.) : ba.bpf.point(freq_xp(716.024), yp) : ba.bpf.point(freq_xp(806.948), 1.) : ba.bpf.point(freq_xp(829.679), yp) : /* sustain point */ ba.bpf.end(freq_xp(943.333), 0.); freqEnv = freqEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); freq_xp(x) = x * ma.SR / 1000. * freqEnv_speed; freqEnv_speed = noteTrig : rdm(0,2000) : /(1000); yp = noteTrig : rdm(0,1000) : /(1000); /* harmRatio envelope */ harmEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(harm_xp(863.454), 0.490) : ba.bpf.point(harm_xp(865), 0.) : ba.bpf.point (harm_xp(1305.221), 1.) : ba.bpf.point(harm_xp(1646.586), 0.) : /* sustain point */ ba.bpf.end(harm_xp(1700), 0.); harmEnv = harmEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); harm_xp(x) = x * ma.SR / 1000. * harmEnv_speed; harmEnv_speed = noteTrig : rdm(0,2000) : /(1000); /* modIndex envelope */ modIndexEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(modIndex_xp(240.964), 0.554) : ba.bpf.point(modIndex_xp(502.068), 0.) : /* sustain point */ ba.bpf.end(modIndex_xp(550), 0.); modIndexEnv = modIndexEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); modIndex_xp(x) = x * ma.SR / 1000. * modIndexEnv_speed; modIndexEnv_speed = noteTrig : rdm(0,2000) : /(1000); // PANNER STEREO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - panSte = _ <: -(1,_),_ : sqrt,sqrt; rdmPanner = noteTrig : rdm(0,1000) : /(1000); /* cable crosser = 1,3 & 2,4 */ panConnect = _,_,_,_ <: _,!,!,!,!,!,_,!,!,_,!,!,!,!,!,_; // REVERB BASED OF ZITA - - - - - - - - - - - - - - - - - - - - - - - - - - reverb(x,y) = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax,x,y) : out_eq : dry_wet(x,y) : out_level with { fsmax = 48000.0; // highest sampling rate that will be used rdel = 60; f1 = 200; t60dc = 3; t60m = 2; f2 = 6000; out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q); pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt) with { tpbt = wcT/sqrt(max(0,g)); // tan(ma.PI*B/ma.SR), B bw in Hz (Q^2 ~ g/4) wcT = 2*ma.PI*eqf/ma.SR; // peak frequency in rad/sample g = ba.db2linear(eql); // peak gain }; eq1f = 315; eq1l = 0; eq1q = 3; eq2f = 1500; eq2l = 0.0; eq2q = 3.0; //out_group(x) = x; //fdn_group(hgroup("[5] Output", x)); dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y with { wet = 0.5*(drywet+1.0); dry = 1.0-wet; }; presence = hslider("[3]Proximity (InstrReverb)[style:knob][acc:1 0 -15 0 10]", 0.5, 0, 1, 0.01) : si.smooth(0.999); drywet = 1 - 2*presence; out_level = *(gain),*(gain); //gain = vslider("[5]Reverberation Volume[unit:dB][style:knob]", -20, -70, 20, 0.1) gain = -30 : +(6*presence) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/RuolunWeng/Cage/1a3945e3327f2e4654a8b67c48cb68bf1e8ce1fb/cage/cage.dsp
faust
////// Ququ t=ba.pulsen(hslider("Envelope Period", 6000, 0, 44100, 1), hslider("Envelope Length", 15000, 0, 44100, 1)); t = ba.beat (hslider("Speed [style:knob]", 120, 0, 480, 0.1) ); Birdy from Grame playground AUTO TRIGGER tempo(2.5*t)) BIRD TRIGGER noteTrig = autoTrig; OSCILLATORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - base fm oscillator FIXED PARAMETERS - - - - - - - - - - - - - - - - - - - - - - - - - - - fm TIME FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - MIDI RELATED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - midi pitch ENVELOPPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - envelope "reader" (phaser) amplitude envelope sustain point freq envelope sustain point harmRatio envelope sustain point modIndex envelope sustain point PANNER STEREO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cable crosser = 1,3 & 2,4 REVERB BASED OF ZITA - - - - - - - - - - - - - - - - - - - - - - - - - - highest sampling rate that will be used tan(ma.PI*B/ma.SR), B bw in Hz (Q^2 ~ g/4) peak frequency in rad/sample peak gain out_group(x) = x; //fdn_group(hgroup("[5] Output", x)); gain = vslider("[5]Reverberation Volume[unit:dB][style:knob]", -20, -70, 20, 0.1)
import("stdfaust.lib"); switch= en.adsre(0.5,0.1,1,1,checkbox("switch")); switch2= en.adsre(0.5,0.1,1,1,1-checkbox("switch")); process = part_radio,part_dialog :> _,_; part_radio = playerPad, playerVoice :> _*(switch),_*(switch); part_dialog = Ququ , Birds :> _*(switch2),_*(switch2); selectPart(sec,offset) =no.pink_noise: de.delay(ma.SR*sec, offset) :abs:*(100):int:ba.sAndH(ba.pulse(ma.SR*sec))%3; selectPart21(sec,offset) =no.pink_noise: de.delay(ma.SR*sec, offset) :abs:*(500):int:ba.sAndH(ba.pulse(ma.SR*sec))%21; level = hslider("level", 0.5, 0, 1, 0.01); s1 = soundfile("[url:{'RADIO1.wav';'RADIO2.wav';'RADIO3.wav'}]",1); sample1 = so.sound(s1, 0); sample2 = so.sound(s1, 1); sample3 = so.sound(s1, 2); s2 = soundfile("[url:{'dialog1.wav'; 'dialog2.wav'; 'dialog3.wav'; 'lenny.wav'; 'rg3.wav'; 'macron3.wav'; 'macron4.wav'; 'jiaomaidiao1.wav'; 'jiaomaidiao2.wav'; 'jiaomaidiao3.wav'; 'nainai1.wav'; 'nainai2.wav'; 'xinwen1.wav'; 'xinwen2.wav'; 'journal1.wav'; 'journal2.wav'; 'journal3.wav'; 'macron1.wav'; 'macron2.wav'; 'rg1.wav'; 'rg2.wav'}]",1); volume(sec,offset) = ba.pulse(ma.SR*sec):ba.peakholder(ma.SR*sec/2):ba.ramp(18000): de.delay(ma.SR*sec, offset); pad1 = volume(20,0) * select3(selectPart(20,0),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); pad2 = volume(10,ma.SR) * select3(selectPart(10,ma.SR),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); pad3 = volume(12,ma.SR*5) * select3(selectPart(12,ma.SR*5),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); pad4 = volume(16,ma.SR*3) * select3(selectPart(16,ma.SR*3),sample1.loop_speed_level(1,0.3),sample2.loop_speed_level(1, 0.4),sample3.loop_speed_level(1, 0.5)); playerPad = pad1 , pad2 , pad3 , pad4 :> _,_ ; voice1 = volume(4,0) * ba.selectmulti(ma.SR/10, par(i, 18, so.sound(s2, i).loop_speed_level(1,0.5)), selectPart21(4,0)) ; voice2 = volume(6,ma.SR) * ba.selectmulti(ma.SR/10, par(i, 18, so.sound(s2, i).loop_speed_level(1,0.5)), selectPart21(6,ma.SR)) ; playerVoice = voice1 , voice2; Ququ = hgroup("QUQU", os.osc(freq): ringmod : AsrEnvelop <:volumebird); freq = hslider("Frequency [unit:Hz] ", 4000, 70, 5000, 0.01):si.smooth(0.999); ringmod = _<:_,*(os.oscs(freq)):drywet with { freq = hslider ( "Modulation Frequency[scale:log]", 97,0.001,100,0.001):si.smooth(0.999); drywet(x,y) = (1-c)*x + c*y; c = hslider("Modulation intensity[style:knob][unit:%]", 70,0,100,0.01)*(0.01):si.smooth(0.999); }; autoTrig = ba.beat(t) * (abs(no.noise) <= p) : trigger(4800) with { t = hslider("Speed[style:knob][acc:0 1 -10 0 10]", 250, 120, 480, 0.1) : si.smooth(0.999); p = hslider("Probability[unit:%][style:knob][acc:0 1 -10 0 10]", 90, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; AsrEnvelop = *(en.asr(a,s,r,autoTrig)):_ with { a = hslider("Envelope Attack[unit:s][style:knob]", 0.03, 0.01, 2, 0.01) : si.smooth(0.999); s = 1; r = hslider("Envelope Release[unit:s][style:knob]", 0.04, 0.01, 5, 0.01) : si.smooth(0.999); p = hslider("Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 90, 25, 100, 1)*(0.01) : si.smooth(0.999); }; volumebird = par(i,2,*(hslider("Volume", 0.02, 0, 1, 0.01):si.smooth(0.999))); Birds = hgroup("Birds", mainOsc(noteTrig : rdm(72,94) : mtof , noteTrig) * envWrapper(noteTrig, ampEnv, amp_xp(2510)) : fi.lowpass(1, 2000) *(0.8) <: _,_, (rdmPanner : panSte) : panConnect : *,* : reverb); with { t = hslider("[1]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 120, 120, 480, 0.1) : si.smooth(0.999); p = hslider("[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 30, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; noteTrig = autoTriger : min(1.0); carrierOsc(freq) = os.osci(freq); modOsc(freq) = os.triangleN(3,freq); mainOsc(freq,trig) = freq <: +(*(harmRatio <: +(*(envWrapper(trig,harmEnv,harm_xp(1700))))) : modOsc : *(modIndex <: +(*(envWrapper(trig,modIndexEnv,modIndex_xp(550)))))) <: +(*(envWrapper(trig,freqEnv,freq_xp(943)))) : carrierOsc; envWrapper(trig,env,sus) = trig : mstosamps(rdm(100,3000)), sus : hitLength : env; harmRatio = 0.063; modIndex = 3.24; metro(ms) = (%(+(1),mstosamps(ms))) ~_ : ==(1); mstosamps(ms) = ms : /(1000) * ma.SR : int; rdmInc = _ <: @(1), @(2) : + : *(2994.2313) : int : +(38125); rdm(rdmin,rdmax) = _,(fmod(_,rdmax - rdmin : int) ~ rdmInc : +(rdmin)) : gater : -(1) : abs; gater = (_,_,_ <: !,_,!,_,!,!,!,!,_ : select2) ~_; mtof(midinote) = pow(2,(midinote - 69) / 12) * 440; hitLength(length,sustain) = *((==(length,@(length,1))), +(1))~_ <: gater(<(sustain)); ampEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(amp_xp(60.241), 1.) : ba.bpf.point(amp_xp(461.847), 0.) : ba.bpf.point(amp_xp(582.329), 0.928) : ba.bpf.point(amp_xp(682.731), 0.5) : ba.bpf.point(amp_xp(983.936), 0.) : ba.bpf.point(amp_xp(1064.257), 0.) : ba.bpf.point(amp_xp(1345.382), 0.) : ba.bpf.point(amp_xp(1526.105), 0.) : ba.bpf.point(amp_xp(1746.988), 0.) : ba.bpf.point(amp_xp(1827.309), 0.) : ba.bpf.point(amp_xp(2088.353), 0.) : ba.bpf.end(amp_xp(2510.040), 0.); ampEnv = ampEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); amp_xp(x) = x * ma.SR / 1000. * ampEnv_speed; ampEnv_speed = noteTrig : rdm(0,2000) : /(1000); freqEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(freq_xp(147.751), 1.) : ba.bpf.point(freq_xp(193.213), 0.) : ba.bpf.point(freq_xp(318.233), yp) : ba.bpf.point(freq_xp(431.888), 0.) : ba.bpf.point(freq_xp(488.715), 0.434) : ba.bpf.point(freq_xp(613.735), yp) : ba.bpf.point(freq_xp(659.197), 1.) : ba.bpf.point(freq_xp(716.024), yp) : ba.bpf.point(freq_xp(806.948), 1.) : ba.bpf.end(freq_xp(943.333), 0.); freqEnv = freqEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); freq_xp(x) = x * ma.SR / 1000. * freqEnv_speed; freqEnv_speed = noteTrig : rdm(0,2000) : /(1000); yp = noteTrig : rdm(0,1000) : /(1000); harmEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(harm_xp(863.454), 0.490) : ba.bpf.point(harm_xp(865), 0.) : ba.bpf.point (harm_xp(1305.221), 1.) : ba.bpf.end(harm_xp(1700), 0.); harmEnv = harmEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); harm_xp(x) = x * ma.SR / 1000. * harmEnv_speed; harmEnv_speed = noteTrig : rdm(0,2000) : /(1000); modIndexEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(modIndex_xp(240.964), 0.554) : ba.bpf.end(modIndex_xp(550), 0.); modIndexEnv = modIndexEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); modIndex_xp(x) = x * ma.SR / 1000. * modIndexEnv_speed; modIndexEnv_speed = noteTrig : rdm(0,2000) : /(1000); panSte = _ <: -(1,_),_ : sqrt,sqrt; rdmPanner = noteTrig : rdm(0,1000) : /(1000); panConnect = _,_,_,_ <: _,!,!,!,!,!,_,!,!,_,!,!,!,!,!,_; reverb(x,y) = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax,x,y) : out_eq : dry_wet(x,y) : out_level with { rdel = 60; f1 = 200; t60dc = 3; t60m = 2; f2 = 6000; out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q); pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt) with { }; eq1f = 315; eq1l = 0; eq1q = 3; eq2f = 1500; eq2l = 0.0; eq2q = 3.0; dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y with { wet = 0.5*(drywet+1.0); dry = 1.0-wet; }; presence = hslider("[3]Proximity (InstrReverb)[style:knob][acc:1 0 -15 0 10]", 0.5, 0, 1, 0.01) : si.smooth(0.999); drywet = 1 - 2*presence; out_level = *(gain),*(gain); gain = -30 : +(6*presence) : ba.db2linear : si.smooth(0.999); };
bd010418c721f2647897f15f36fabc24f753a7d42d735c461349c9c4dd06f4a1
RuolunWeng/ruolunweng.github.io
Birds.dsp
declare name "bird"; declare author "Pierre Cochard"; /* Modifications by Grame July 2014 */ import("stdfaust.lib"); /* =============== DESCRIPTION ================= : - Bird singing generator. - Head = Reverberation, birds heard from far away. - Bottom = Maximum proximity of the birds. - Right = maximum speed of whistles. - Left = minimum speed, birds rarely heard. */ // PROCESS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - process = hgroup("Birds", mainOsc(noteTrig : rdm(72,94) : mtof , noteTrig) * envWrapper(noteTrig, ampEnv, amp_xp(2510)) : fi.lowpass(1, 2000) *(0.8) <: _,_, (rdmPanner : panSte) : panConnect : *,* : reverb); // AUTO TRIGGER autoTrig = ba.beat(t) * (abs(no.noise) <= p) : trigger(48) //tempo(2.5*t)) with { t = hslider("[1]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 240, 120, 480, 0.1) : si.smooth(0.999); p = hslider("[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 50, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; // BIRD TRIGGER noteTrig = autoTrig : min(1.0); //noteTrig = autoTrig; // OSCILLATORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* base */ carrierOsc(freq) = os.osci(freq); modOsc(freq) = os.triangleN(3,freq); /* fm oscillator */ mainOsc(freq,trig) = freq <: +(*(harmRatio <: +(*(envWrapper(trig,harmEnv,harm_xp(1700))))) : modOsc : *(modIndex <: +(*(envWrapper(trig,modIndexEnv,modIndex_xp(550)))))) <: +(*(envWrapper(trig,freqEnv,freq_xp(943)))) : carrierOsc; envWrapper(trig,env,sus) = trig : mstosamps(rdm(100,3000)), sus : hitLength : env; // FIXED PARAMETERS - - - - - - - - - - - - - - - - - - - - - - - - - - - /* fm */ harmRatio = 0.063; modIndex = 3.24; // TIME FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - metro(ms) = (%(+(1),mstosamps(ms))) ~_ : ==(1); mstosamps(ms) = ms : /(1000) * ma.SR : int; rdmInc = _ <: @(1), @(2) : + : *(2994.2313) : int : +(38125); rdm(rdmin,rdmax) = _,(fmod(_,rdmax - rdmin : int) ~ rdmInc : +(rdmin)) : gater : -(1) : abs; gater = (_,_,_ <: !,_,!,_,!,!,!,!,_ : select2) ~_; // MIDI RELATED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* midi pitch */ mtof(midinote) = pow(2,(midinote - 69) / 12) * 440; // ENVELOPPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* envelope "reader" (phaser) */ hitLength(length,sustain) = *((==(length,@(length,1))), +(1))~_ <: gater(<(sustain)); /* amplitude envelope */ ampEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(amp_xp(60.241), 1.) : ba.bpf.point(amp_xp(461.847), 0.) : ba.bpf.point(amp_xp(582.329), 0.928) : ba.bpf.point(amp_xp(682.731), 0.5) : ba.bpf.point(amp_xp(983.936), 0.) : ba.bpf.point(amp_xp(1064.257), 0.) : ba.bpf.point(amp_xp(1345.382), 0.) : ba.bpf.point(amp_xp(1526.105), 0.) : ba.bpf.point(amp_xp(1746.988), 0.) : ba.bpf.point(amp_xp(1827.309), 0.) : ba.bpf.point(amp_xp(2088.353), 0.) : ba.bpf.point(amp_xp(2188.755), 0.) : /* sustain point */ ba.bpf.end(amp_xp(2510.040), 0.); ampEnv = ampEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); amp_xp(x) = x * ma.SR / 1000. * ampEnv_speed; ampEnv_speed = noteTrig : rdm(0,2000) : /(1000); /* freq envelope */ freqEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(freq_xp(147.751), 1.) : ba.bpf.point(freq_xp(193.213), 0.) : ba.bpf.point(freq_xp(318.233), yp) : ba.bpf.point(freq_xp(431.888), 0.) : ba.bpf.point(freq_xp(488.715), 0.434) : ba.bpf.point(freq_xp(613.735), yp) : ba.bpf.point(freq_xp(659.197), 1.) : ba.bpf.point(freq_xp(716.024), yp) : ba.bpf.point(freq_xp(806.948), 1.) : ba.bpf.point(freq_xp(829.679), yp) : /* sustain point */ ba.bpf.end(freq_xp(943.333), 0.); freqEnv = freqEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); freq_xp(x) = x * ma.SR / 1000. * freqEnv_speed; freqEnv_speed = noteTrig : rdm(0,2000) : /(1000); yp = noteTrig : rdm(0,1000) : /(1000); /* harmRatio envelope */ harmEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(harm_xp(863.454), 0.490) : ba.bpf.point(harm_xp(865), 0.) : ba.bpf.point (harm_xp(1305.221), 1.) : ba.bpf.point(harm_xp(1646.586), 0.) : /* sustain point */ ba.bpf.end(harm_xp(1700), 0.); harmEnv = harmEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); harm_xp(x) = x * ma.SR / 1000. * harmEnv_speed; harmEnv_speed = noteTrig : rdm(0,2000) : /(1000); /* modIndex envelope */ modIndexEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(modIndex_xp(240.964), 0.554) : ba.bpf.point(modIndex_xp(502.068), 0.) : /* sustain point */ ba.bpf.end(modIndex_xp(550), 0.); modIndexEnv = modIndexEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); modIndex_xp(x) = x * ma.SR / 1000. * modIndexEnv_speed; modIndexEnv_speed = noteTrig : rdm(0,2000) : /(1000); // PANNER STEREO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - panSte = _ <: -(1,_),_ : sqrt,sqrt; rdmPanner = noteTrig : rdm(0,1000) : /(1000); /* cable crosser = 1,3 & 2,4 */ panConnect = _,_,_,_ <: _,!,!,!,!,!,_,!,!,_,!,!,!,!,!,_; // REVERB BASED OF ZITA - - - - - - - - - - - - - - - - - - - - - - - - - - reverb(x,y) = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax,x,y) : out_eq : dry_wet(x,y) : out_level with { fsmax = 48000.0; // highest sampling rate that will be used rdel = 60; f1 = 200; t60dc = 3; t60m = 2; f2 = 6000; out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q); pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt) with { tpbt = wcT/sqrt(max(0,g)); // tan(ma.PI*B/ma.SR), B bw in Hz (Q^2 ~ g/4) wcT = 2*ma.PI*eqf/ma.SR; // peak frequency in rad/sample g = ba.db2linear(eql); // peak gain }; eq1f = 315; eq1l = 0; eq1q = 3; eq2f = 1500; eq2l = 0.0; eq2q = 3.0; //out_group(x) = x; //fdn_group(hgroup("[5] Output", x)); dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y with { wet = 0.5*(drywet+1.0); dry = 1.0-wet; }; presence = hslider("[3]Proximity (InstrReverb)[style:knob][acc:1 0 -15 0 10]", 0.5, 0, 1, 0.01) : si.smooth(0.999); drywet = 1 - 2*presence; out_level = *(gain),*(gain); //gain = vslider("[5]Reverberation Volume[unit:dB][style:knob]", -20, -70, 20, 0.1) gain = -10 : +(6*presence) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Birds.dsp
faust
Modifications by Grame July 2014 =============== DESCRIPTION ================= : - Bird singing generator. - Head = Reverberation, birds heard from far away. - Bottom = Maximum proximity of the birds. - Right = maximum speed of whistles. - Left = minimum speed, birds rarely heard. PROCESS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AUTO TRIGGER tempo(2.5*t)) BIRD TRIGGER noteTrig = autoTrig; OSCILLATORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - base fm oscillator FIXED PARAMETERS - - - - - - - - - - - - - - - - - - - - - - - - - - - fm TIME FUNCTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - MIDI RELATED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - midi pitch ENVELOPPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - envelope "reader" (phaser) amplitude envelope sustain point freq envelope sustain point harmRatio envelope sustain point modIndex envelope sustain point PANNER STEREO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cable crosser = 1,3 & 2,4 REVERB BASED OF ZITA - - - - - - - - - - - - - - - - - - - - - - - - - - highest sampling rate that will be used tan(ma.PI*B/ma.SR), B bw in Hz (Q^2 ~ g/4) peak frequency in rad/sample peak gain out_group(x) = x; //fdn_group(hgroup("[5] Output", x)); gain = vslider("[5]Reverberation Volume[unit:dB][style:knob]", -20, -70, 20, 0.1)
declare name "bird"; declare author "Pierre Cochard"; import("stdfaust.lib"); process = hgroup("Birds", mainOsc(noteTrig : rdm(72,94) : mtof , noteTrig) * envWrapper(noteTrig, ampEnv, amp_xp(2510)) : fi.lowpass(1, 2000) *(0.8) <: _,_, (rdmPanner : panSte) : panConnect : *,* : reverb); with { t = hslider("[1]Speed (Granulator)[style:knob][acc:0 1 -10 0 10]", 240, 120, 480, 0.1) : si.smooth(0.999); p = hslider("[2]Probability (Granulator)[unit:%][style:knob][acc:1 0 -10 0 10]", 50, 25, 100, 1)*(0.01) : si.smooth(0.999); trigger(n) = upfront : release(n) : >(0.0) with { upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); }; }; noteTrig = autoTrig : min(1.0); carrierOsc(freq) = os.osci(freq); modOsc(freq) = os.triangleN(3,freq); mainOsc(freq,trig) = freq <: +(*(harmRatio <: +(*(envWrapper(trig,harmEnv,harm_xp(1700))))) : modOsc : *(modIndex <: +(*(envWrapper(trig,modIndexEnv,modIndex_xp(550)))))) <: +(*(envWrapper(trig,freqEnv,freq_xp(943)))) : carrierOsc; envWrapper(trig,env,sus) = trig : mstosamps(rdm(100,3000)), sus : hitLength : env; harmRatio = 0.063; modIndex = 3.24; metro(ms) = (%(+(1),mstosamps(ms))) ~_ : ==(1); mstosamps(ms) = ms : /(1000) * ma.SR : int; rdmInc = _ <: @(1), @(2) : + : *(2994.2313) : int : +(38125); rdm(rdmin,rdmax) = _,(fmod(_,rdmax - rdmin : int) ~ rdmInc : +(rdmin)) : gater : -(1) : abs; gater = (_,_,_ <: !,_,!,_,!,!,!,!,_ : select2) ~_; mtof(midinote) = pow(2,(midinote - 69) / 12) * 440; hitLength(length,sustain) = *((==(length,@(length,1))), +(1))~_ <: gater(<(sustain)); ampEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(amp_xp(60.241), 1.) : ba.bpf.point(amp_xp(461.847), 0.) : ba.bpf.point(amp_xp(582.329), 0.928) : ba.bpf.point(amp_xp(682.731), 0.5) : ba.bpf.point(amp_xp(983.936), 0.) : ba.bpf.point(amp_xp(1064.257), 0.) : ba.bpf.point(amp_xp(1345.382), 0.) : ba.bpf.point(amp_xp(1526.105), 0.) : ba.bpf.point(amp_xp(1746.988), 0.) : ba.bpf.point(amp_xp(1827.309), 0.) : ba.bpf.point(amp_xp(2088.353), 0.) : ba.bpf.end(amp_xp(2510.040), 0.); ampEnv = ampEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); amp_xp(x) = x * ma.SR / 1000. * ampEnv_speed; ampEnv_speed = noteTrig : rdm(0,2000) : /(1000); freqEnvbpf = ba.bpf.start(0, 0) : ba.bpf.point(freq_xp(147.751), 1.) : ba.bpf.point(freq_xp(193.213), 0.) : ba.bpf.point(freq_xp(318.233), yp) : ba.bpf.point(freq_xp(431.888), 0.) : ba.bpf.point(freq_xp(488.715), 0.434) : ba.bpf.point(freq_xp(613.735), yp) : ba.bpf.point(freq_xp(659.197), 1.) : ba.bpf.point(freq_xp(716.024), yp) : ba.bpf.point(freq_xp(806.948), 1.) : ba.bpf.end(freq_xp(943.333), 0.); freqEnv = freqEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); freq_xp(x) = x * ma.SR / 1000. * freqEnv_speed; freqEnv_speed = noteTrig : rdm(0,2000) : /(1000); yp = noteTrig : rdm(0,1000) : /(1000); harmEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(harm_xp(863.454), 0.490) : ba.bpf.point(harm_xp(865), 0.) : ba.bpf.point (harm_xp(1305.221), 1.) : ba.bpf.end(harm_xp(1700), 0.); harmEnv = harmEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); harm_xp(x) = x * ma.SR / 1000. * harmEnv_speed; harmEnv_speed = noteTrig : rdm(0,2000) : /(1000); modIndexEnvbpf = ba.bpf.start(0, 0.) : ba.bpf.point(modIndex_xp(240.964), 0.554) : ba.bpf.end(modIndex_xp(550), 0.); modIndexEnv = modIndexEnvbpf : si.smooth(0.999) : fi.lowpass(1, 3000); modIndex_xp(x) = x * ma.SR / 1000. * modIndexEnv_speed; modIndexEnv_speed = noteTrig : rdm(0,2000) : /(1000); panSte = _ <: -(1,_),_ : sqrt,sqrt; rdmPanner = noteTrig : rdm(0,1000) : /(1000); panConnect = _,_,_,_ <: _,!,!,!,!,!,_,!,!,_,!,!,!,!,!,_; reverb(x,y) = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax,x,y) : out_eq : dry_wet(x,y) : out_level with { rdel = 60; f1 = 200; t60dc = 3; t60m = 2; f2 = 6000; out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q); pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt) with { }; eq1f = 315; eq1l = 0; eq1q = 3; eq2f = 1500; eq2l = 0.0; eq2q = 3.0; dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y with { wet = 0.5*(drywet+1.0); dry = 1.0-wet; }; presence = hslider("[3]Proximity (InstrReverb)[style:knob][acc:1 0 -15 0 10]", 0.5, 0, 1, 0.01) : si.smooth(0.999); drywet = 1 - 2*presence; out_level = *(gain),*(gain); gain = -10 : +(6*presence) : ba.db2linear : si.smooth(0.999); };
d2c266aba9e6cb2579af44b241875e9e7e531618b9812a9aec4843250ab31025
LSSN/2020-01-23-dsp-3a-antoniotestoni
Veri.dsp
// Sintesi sottrattiva significa analizzare attraverso strumenti come spettrogramma, // oscilloscopio e sonogramma il suono o rumore preso in considerazione seconda vari // aspetti. //GS - SOTTRATTIVA, lo dice la parola stessa, significa sottrarre da qualcosa che //GS - abbia uno spettro complesso, per ottenere un prodotto derivato. //GS - è un processo molto simile a quello della scultura, scavare, modellare. // Oscilloscopio è uno strumento che ci permette attraverso il grafico // ampiezza-tempo di vedere i processi di rarefazione e di condensazione di un suono. // Lo spettrogramma ci serve a capire attraverso il grafico freq.-tempo l'intensità di // un suono nel tempo. Il sonogramma ci serve per capire l'altezza di un // Il rumore è un qualcosa che non trasmette informazioni o che non capiamo, // quindi un qualcosa di cui non riusciamo a distinguerne ne la frequenza ne l'ampiezza. // Noi uttilizzando filtri passa-bassa(lowpass) e filtri passa-alta(highpass) possiamo // distinguere questi 2 parametri. Il filtro lowpass si traduce in passabasso, serve ad // attenuare l'ampiezza delle frequenze sopra un punto di taglio. Il filtro highpass // serve a far passare le frequenze alte di un determinato suono o rumore da un punto // di taglio. Nel linguaggio standard di faust il rumore è scritto con il codice no.noise, // il filtro bassa è scritto con il codice fi.lowpass import("stdfaust.lib"); fcut = vslider("cut-off [style:knob][scale:exp]", 1000, 20, 20000, 1); order = 8; process = no.noise : fi.lowpass(order,fcut) : fi.highpass(order,fcut);
https://raw.githubusercontent.com/LSSN/2020-01-23-dsp-3a-antoniotestoni/cce97d07b807f69cbed40a82fccf08079de707de/Veri.dsp
faust
Sintesi sottrattiva significa analizzare attraverso strumenti come spettrogramma, oscilloscopio e sonogramma il suono o rumore preso in considerazione seconda vari aspetti. GS - SOTTRATTIVA, lo dice la parola stessa, significa sottrarre da qualcosa che GS - abbia uno spettro complesso, per ottenere un prodotto derivato. GS - è un processo molto simile a quello della scultura, scavare, modellare. Oscilloscopio è uno strumento che ci permette attraverso il grafico ampiezza-tempo di vedere i processi di rarefazione e di condensazione di un suono. Lo spettrogramma ci serve a capire attraverso il grafico freq.-tempo l'intensità di un suono nel tempo. Il sonogramma ci serve per capire l'altezza di un Il rumore è un qualcosa che non trasmette informazioni o che non capiamo, quindi un qualcosa di cui non riusciamo a distinguerne ne la frequenza ne l'ampiezza. Noi uttilizzando filtri passa-bassa(lowpass) e filtri passa-alta(highpass) possiamo distinguere questi 2 parametri. Il filtro lowpass si traduce in passabasso, serve ad attenuare l'ampiezza delle frequenze sopra un punto di taglio. Il filtro highpass serve a far passare le frequenze alte di un determinato suono o rumore da un punto di taglio. Nel linguaggio standard di faust il rumore è scritto con il codice no.noise, il filtro bassa è scritto con il codice fi.lowpass
import("stdfaust.lib"); fcut = vslider("cut-off [style:knob][scale:exp]", 1000, 20, 20000, 1); order = 8; process = no.noise : fi.lowpass(order,fcut) : fi.highpass(order,fcut);
503cb9ece6ccfaf157c1ccdb7f662fefd8a46e7da66b2013a1221ca90280b371
LSSN/2019-11-29-dsp-camillacongiu
basspand.dsp
import("stdfaust.lib"); process= no.noise :fi.bandpass(10,1000,2000) : *(vslider("gain",0,0,1,0.1)); //cicciona <3scusaaaaa<3<3<3<3<3<3<3 //i numeri che indentificano lo slider sono il valore iniziale, valore minimo, valore massimo e step incrementale. //step incrementale è la precisione di passaggio da uno spettro all'altro //il valore iniziale è il valore che deve assumere il controllo quando azioniamo il programma. //il valore inziale può essere solo tra il valore minimo e il valore massimo. //lo slider in faust può essere sia verticale sia orizzontale, per cambiarlo da verticale (vslider) orizzontale (oslider). //
https://raw.githubusercontent.com/LSSN/2019-11-29-dsp-camillacongiu/4cf80dc9f2c40da1129b5dd2a0bdc3e6bed9c3b6/basspand.dsp
faust
cicciona <3scusaaaaa<3<3<3<3<3<3<3 i numeri che indentificano lo slider sono il valore iniziale, valore minimo, valore massimo e step incrementale. step incrementale è la precisione di passaggio da uno spettro all'altro il valore iniziale è il valore che deve assumere il controllo quando azioniamo il programma. il valore inziale può essere solo tra il valore minimo e il valore massimo. lo slider in faust può essere sia verticale sia orizzontale, per cambiarlo da verticale (vslider) orizzontale (oslider).
import("stdfaust.lib"); process= no.noise :fi.bandpass(10,1000,2000) : *(vslider("gain",0,0,1,0.1));
e4fa87e6a55145431b9b59ef935ecc5b6cf0e96cd17b0ae5d302e8f2d7570c6e
LSSN/2020-01-23-2a-dsp-giulialostia1920
verifica.dsp
//Crea un file di faust in cui esponi, in forma di commento, i principi della sintesi sottrattiva. Realizza un esempio attraverso un filtraggio passa banda. //La sintesi sotrattiva sottrae import("stdfaust.lib"); catof=vslider("cat-of [style:knob]",1000,20,2000,1); process= fi. lowpass (2,catof) : fi.highpass (2,catof);
https://raw.githubusercontent.com/LSSN/2020-01-23-2a-dsp-giulialostia1920/b416f87f60b48c539f23462593f95f6ceedd9b15/verifica.dsp
faust
Crea un file di faust in cui esponi, in forma di commento, i principi della sintesi sottrattiva. Realizza un esempio attraverso un filtraggio passa banda. La sintesi sotrattiva sottrae
import("stdfaust.lib"); catof=vslider("cat-of [style:knob]",1000,20,2000,1); process= fi. lowpass (2,catof) : fi.highpass (2,catof);
1b7e875ec11b67ecef1b26e9e58bfb537928a645418e3fda5e846b985ab023d4
LSSN/2020-01-23-dsp-3a-AlessandraVardeu
verifica.dsp
//per sintesi sottrativa si fa rimento ad modello di sinetsi sonora ancora uitilizzata nella musica elettronica che si occupa del processo di creazione del suono e si divide in tre aspetti: // spettrogramma, sonogramma e forma d'onda. // questo processo si applica attraverso le sorgenti sonore coovvero gli elemnti che generano il suono come i filtri, amplificatori. // filtri sono gli oggeti di base epr la sintesi: //filtro passaalto= fi.highpas //filtro passabasso=fi.lowpass // Nello spettrogramma l'ampiezzza si muove sul dominio della frquenza. //lo spettrogramma è una rappresentazione grafica del suono che si basa su effettive misurazioni del suono in funzione //delle variabili. //nel sonogramma la frequenza si muove sul dominio del tempo. //l sonogramma è una registrazione grafica fornita dal sonografo. //nella forma d'onda ogni punto è osservabile sul dominio temporale., è la rapprsentazione grafica do un segnale, ampiezza e tempo. //Prima di process va sempre scritto fcut e order //ogni riga deve terminare con ; // Elementi: //no.noise=rumore //fcut=frequenza di taglio //vslider= primo modello di pomello //i valori numerici di vlisder sono: //valore di inizializzaione //alore minimo //valore massimo //step=precisione //order=ordine ;più aumenta l'ordine più il filtro è verticale,più l'ordine abbassa più il filtro è normale. //gain=regola il volume //style knob= fa diventare il primo modello di pomello normale ad un pomello circolare //scale exp pomello esponenziale //white noise=rumore bianco che ha tutte le frequenze e tutte le ampiezze(rettangolo completamente colorato),rumore banda larga. //strumento che permette la visione completa delle cose è il microscopio //analisi di un corpo ossia l'analisi della struttura molecolare import ("stdfaust.lib"); fcut=vslider("[01] cut-off [scale:exp][style:knob]", 1000,20,20000,1) ; order=128; // init min max step gain=vslider("[02] gain", -20, -96, 0, 0.1) : ba.db2linear ; process=fi.lowpass(order,fcut) : fi.highpass(order,fcut) : *(gain) ;
https://raw.githubusercontent.com/LSSN/2020-01-23-dsp-3a-AlessandraVardeu/b32ea6b917e6951725f4f2f5672e4aaa3e391040/verifica.dsp
faust
per sintesi sottrativa si fa rimento ad modello di sinetsi sonora ancora uitilizzata nella musica elettronica che si occupa del processo di creazione del suono e si divide in tre aspetti: spettrogramma, sonogramma e forma d'onda. questo processo si applica attraverso le sorgenti sonore coovvero gli elemnti che generano il suono come i filtri, amplificatori. filtri sono gli oggeti di base epr la sintesi: filtro passaalto= fi.highpas filtro passabasso=fi.lowpass Nello spettrogramma l'ampiezzza si muove sul dominio della frquenza. lo spettrogramma è una rappresentazione grafica del suono che si basa su effettive misurazioni del suono in funzione delle variabili. nel sonogramma la frequenza si muove sul dominio del tempo. l sonogramma è una registrazione grafica fornita dal sonografo. nella forma d'onda ogni punto è osservabile sul dominio temporale., è la rapprsentazione grafica do un segnale, ampiezza e tempo. Prima di process va sempre scritto fcut e order ogni riga deve terminare con ; Elementi: no.noise=rumore fcut=frequenza di taglio vslider= primo modello di pomello i valori numerici di vlisder sono: valore di inizializzaione alore minimo valore massimo step=precisione order=ordine ;più aumenta l'ordine più il filtro è verticale,più l'ordine abbassa più il filtro è normale. gain=regola il volume style knob= fa diventare il primo modello di pomello normale ad un pomello circolare scale exp pomello esponenziale white noise=rumore bianco che ha tutte le frequenze e tutte le ampiezze(rettangolo completamente colorato),rumore banda larga. strumento che permette la visione completa delle cose è il microscopio analisi di un corpo ossia l'analisi della struttura molecolare init min max step
import ("stdfaust.lib"); fcut=vslider("[01] cut-off [scale:exp][style:knob]", 1000,20,20000,1) ; order=128; gain=vslider("[02] gain", -20, -96, 0, 0.1) : ba.db2linear ; process=fi.lowpass(order,fcut) : fi.highpass(order,fcut) : *(gain) ;
adeabdd0084923ed5c6a16b8603077f144bb8f9e4b75baff2f7511019dd90166
LSSN/2020-01-25-dsp-4a-camillacongiu
iubgbug.dsp
crea un file di faust in cui esponi, in forma di commento, i principi della sintesi sottrattiva. //la sintesi sottrattiva è un modello di sintesi utilizzata nella musica elettronica dove una sorgente sonora viene filtrata da un punto di visa "spettrale", quindi sottraendo da essa le bande di frequenza. gli aspetti più importanti vengono evidenziati attraverso il processo dinamico, ovvero quando questa operazione di filtraggio si sviluppa durante l'evoluzione temporale del segnale. il principio su cui si basa è un oscillatore che crea delle forme d'onda e attraverso un filtro alcune componenti dell'onda vengono selezionate, le altre escluse. // numeri che indentificano lo slider sono il valore iniziale, valore minimo, valore massimo e step incrementale. //step incrementale è la precisione di passaggio da uno spettro all'altro //il valore iniziale è il valore che deve assumere il controllo quando azioniamo il programma. //il valore inziale può essere solo tra il valore minimo e il valore massimo. //lo slider in faust può essere sia verticale sia orizzontale, per cambiarlo da verticale (vslider) orizzontale (oslider). // il rumore è un suono che non ha ampiezza e non trasmette informazioni. // lo spettroscopio ci mostra il contenuto del suono nel dominio della frequenza, sull'asse delle x le frequenze sull'asse delle y l'ampiezza. //l'oscilloscopio ci mostra il contenuto del suono nel dominio del tempo. sull'asse delle x abbiamo il tempo e sull'asse delle y abbiamo le ampiezze. //lowpass: filtro che vuol dire "passa basso". è tra i più semplici. //dato un punto di taglio il filtro di primo ordine attenua 6 dB per ottava. //la velocità di un filtro è chiamata ordine. //la frequenza di taglio si chiama "cut off" import("stdfaust.lib"); gain = vslider("gain",0,0,1,0.1); process = no.noise : fi.lowpass(8,6000) : fi.highpass(2,6000);
https://raw.githubusercontent.com/LSSN/2020-01-25-dsp-4a-camillacongiu/637fbc69ad093fe1af96f951b49f2c1216ee63e0/iubgbug.dsp
faust
la sintesi sottrattiva è un modello di sintesi utilizzata nella musica elettronica dove una sorgente sonora viene filtrata da un punto di visa "spettrale", quindi sottraendo da essa le bande di frequenza. gli aspetti più importanti vengono evidenziati attraverso il processo dinamico, ovvero quando questa operazione di filtraggio si sviluppa durante l'evoluzione temporale del segnale. numeri che indentificano lo slider sono il valore iniziale, valore minimo, valore massimo e step incrementale. step incrementale è la precisione di passaggio da uno spettro all'altro il valore iniziale è il valore che deve assumere il controllo quando azioniamo il programma. il valore inziale può essere solo tra il valore minimo e il valore massimo. lo slider in faust può essere sia verticale sia orizzontale, per cambiarlo da verticale (vslider) orizzontale (oslider). il rumore è un suono che non ha ampiezza e non trasmette informazioni. lo spettroscopio ci mostra il contenuto del suono nel dominio della frequenza, sull'asse delle x le frequenze sull'asse delle y l'ampiezza. l'oscilloscopio ci mostra il contenuto del suono nel dominio del tempo. sull'asse delle x abbiamo il tempo e sull'asse delle y abbiamo le ampiezze. lowpass: filtro che vuol dire "passa basso". è tra i più semplici. dato un punto di taglio il filtro di primo ordine attenua 6 dB per ottava. la velocità di un filtro è chiamata ordine. la frequenza di taglio si chiama "cut off"
crea un file di faust in cui esponi, in forma di commento, i principi della sintesi sottrattiva. il principio su cui si basa è un oscillatore che crea delle forme d'onda e attraverso un filtro alcune componenti dell'onda vengono selezionate, le altre escluse. import("stdfaust.lib"); gain = vslider("gain",0,0,1,0.1); process = no.noise : fi.lowpass(8,6000) : fi.highpass(2,6000);
a1f0a594c1b86bbdb596aee5d036732fb09c5c61a1fe63b8bc310cd5304b415b
elaforge/karya
guitar.dsp
import("stdfaust.lib"); declare description "Guitar model."; declare control0_gate "Gate."; declare control1_pitch "Pitch signal."; declare control2_dyn "constant:Dynamic signal."; declare control3_pos "constant:Pluck position."; declare flags "impulse-gate"; process(gate, pitch, dyn, pluckPosition) = nylonGuitar(stringLength, pluckPosition, gain, gate) * outGain with { outGain = .75; gain = dyn; stringLength = freq : pm.f2l; freq = ba.midikey2hz(pitch); }; nylonGuitar(stringLength, pluckPosition, gain, trigger) = pm.pluckString(stringLength, 1,1.5, 1, gain, trigger) : nylonGuitarModel(stringLength, pluckPosition); nylonGuitarModel(stringLength, pluckPosition, excitation) = pm.endChain(egChain) with { egChain = pm.chain(guitarNuts(brightness, absorption) : pm.nylonString(stringL, pluckPosition, excitation) : pm.guitarBridge : pm.guitarBody : pm.out); stringL = stringLength - lengthTuning; lengthTuning = 0.11; // brightness = 0.4; // absorption = 0.5; brightness = 0.9; absorption = 0.2; }; guitarNuts(brightness, absorption) = pm.lTermination(0 - pm.bridgeFilter(brightness, absorption), pm.basicBlock); /* pm.bridgeFilter(brightness, absorption) pluckString(stringLength, 1, 1.5, 1, gain, trigger) : nylonGuitarModel(stringLength, pluckPosition); */
https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Synth/Faust/dsp/guitar.dsp
faust
brightness = 0.4; absorption = 0.5; pm.bridgeFilter(brightness, absorption) pluckString(stringLength, 1, 1.5, 1, gain, trigger) : nylonGuitarModel(stringLength, pluckPosition);
import("stdfaust.lib"); declare description "Guitar model."; declare control0_gate "Gate."; declare control1_pitch "Pitch signal."; declare control2_dyn "constant:Dynamic signal."; declare control3_pos "constant:Pluck position."; declare flags "impulse-gate"; process(gate, pitch, dyn, pluckPosition) = nylonGuitar(stringLength, pluckPosition, gain, gate) * outGain with { outGain = .75; gain = dyn; stringLength = freq : pm.f2l; freq = ba.midikey2hz(pitch); }; nylonGuitar(stringLength, pluckPosition, gain, trigger) = pm.pluckString(stringLength, 1,1.5, 1, gain, trigger) : nylonGuitarModel(stringLength, pluckPosition); nylonGuitarModel(stringLength, pluckPosition, excitation) = pm.endChain(egChain) with { egChain = pm.chain(guitarNuts(brightness, absorption) : pm.nylonString(stringL, pluckPosition, excitation) : pm.guitarBridge : pm.guitarBody : pm.out); stringL = stringLength - lengthTuning; lengthTuning = 0.11; brightness = 0.9; absorption = 0.2; }; guitarNuts(brightness, absorption) = pm.lTermination(0 - pm.bridgeFilter(brightness, absorption), pm.basicBlock);
8b2310833810d10dc46b30c6d10384892b87f98a97d0daaf91d7c43e568650dc
elaforge/karya
blow_bottle.dsp
declare name "blowBottle"; declare description "Blown Bottle Instrument"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); declare description "This object implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook)."; import("stdfaust.lib"); inst = library("instruments.lib"); //==================== GUI SPECIFICATION ================ freq = nentry( "h:_Basic/freq [1][unit:Hz] [tooltip:Tone frequency]", 440, 20, 20000,1); gain = nentry( "h:_Basic/gain [1][tooltip:Gain (value between 0 and 1)]", 1, 0, 1, 0.01); gate = button("h:_Basic/gate [1][tooltip:noteOn = 1, noteOff = 0]"); noiseGain = hslider( "h:_Physical_and_Nonlinearity/v:_Physical/noise_gain [2][tooltip:Breath noise gain (value between 0 and 1)]", 0.5, 0, 1, 0.01)*2; pressure = hslider( "h:_Physical_and_Nonlinearity/v:_Physical/pressure [2][tooltip:Breath pressure (value bewteen 0 and 1)]", 1, 0, 1, 0.01); typeModulation = nentry( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/modulation_type [3][tooltip: 0=theta is modulated by the incoming signal; 1=theta is modulated by the averaged incoming signal; 2=theta is modulated by the squared incoming signal; 3=theta is modulated by a sine wave of frequency freqMod; 4=theta is modulated by a sine wave of frequency freq;]", 0, 0, 4, 1); nonLinearity = hslider( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/nonlinearity [3][tooltip:Nonlinearity factor (value between 0 and 1)]", 0, 0, 1, 0.01); frequencyMod = hslider( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/modulation_frequency [3][unit:Hz][tooltip:Frequency of the sine wave for the modulation of theta (works if Modulation Type=3)]", 220, 20, 1000, 0.1); nonLinAttack = hslider( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/nonlinearity_attack [3][unit:s][Attack duration of the nonlinearity]", 0.1, 0, 2, 0.01); envelopeAttack = hslider( "h:_Envelopes_and_Vibrato/v:_Envelope/envelope_attack [5][unit:s][tooltip:Envelope attack duration]", 0.01, 0, 2, 0.01); envelopeDecay = hslider( "h:_Envelopes_and_Vibrato/v:_Envelope/envelope_decay [5][unit:s][tooltip:Envelope decay duration]", 0.01, 0, 2, 0.01); envelopeRelease = hslider( "h:_Envelopes_and_Vibrato/v:_Envelope/envelope_release [5][unit:s][tooltip:Envelope release duration]", 0.5, 0, 2, 0.01); //==================== SIGNAL PROCESSING ================ // Nonlinear filter //nonlinearities are created by the nonlinear passive allpass ladder filter //declared in miscfilter.lib //nonlinear filter order nlfOrder = 6; //attack - sustain - release envelope for nonlinearity (declared in //instruments.lib) envelopeMod = inst.en.asr(nonLinAttack, 1, envelopeRelease, gate); //nonLinearModultor is declared in instruments.lib, it adapts allpassnn from //miscfilter.lib for using it with waveguide instruments nlfm = inst.nonLinearModulator((nonLinearity : si.smoo), envelopeMod, freq, typeModulation, (frequencyMod : si.smoo), nlfOrder); // Synthesis parameters computing and functions declaration //botlle radius bottleRadius = 0.999; stereo = stereoizer(ma.SR / freq); bandPassFilter = inst.bandPass(freq, bottleRadius); // Algorithm implementation //global envelope is of type attack - decay - sustain - release envelopeG = gain * inst.en.adsr( gain * envelopeAttack, envelopeDecay, 1, envelopeRelease, gate); //pressure envelope is also ADSR envelope = pressure * inst.en.adsr(gain*0.02, 0.01, 1, gain * 0.2, gate); // breath pressure breathPressure = envelope; //breath noise randPressure = noiseGain * no.noise * breathPressure; process = // differential pressure (-(breathPressure) <: ((+(1)) * randPressure : +(breathPressure)) - *(inst.jetTable), _ : bandPassFilter,_) ~ nlfm : !, _ //signal scaling : fi.dcblocker * envelopeG * 0.5 : stereo; // : inst.instrReverb; // stereoizer is declared in instruments.lib and implement a stereo // spatialisation in function of the frequency period in number of samples stereoizer(periodDuration) = _ <: _,widthdelay : stereopanner with { W = hslider("v:_Spat/spatial-width", 0.5, 0, 1, 0.01); A = hslider("v:_Spat/pan-angle", 0.6, 0, 1, 0.01); widthdelay = de.delay(4096,W*periodDuration/2); stereopanner = _,_ : *(1.0-A), *(A); };
https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Synth/Faust/dsp/blow_bottle.dsp
faust
Synthesis Tool Kit 4.3 (MIT style license); ==================== GUI SPECIFICATION ================ ==================== SIGNAL PROCESSING ================ Nonlinear filter nonlinearities are created by the nonlinear passive allpass ladder filter declared in miscfilter.lib nonlinear filter order attack - sustain - release envelope for nonlinearity (declared in instruments.lib) nonLinearModultor is declared in instruments.lib, it adapts allpassnn from miscfilter.lib for using it with waveguide instruments Synthesis parameters computing and functions declaration botlle radius Algorithm implementation global envelope is of type attack - decay - sustain - release pressure envelope is also ADSR breath pressure breath noise differential pressure signal scaling : inst.instrReverb; stereoizer is declared in instruments.lib and implement a stereo spatialisation in function of the frequency period in number of samples
declare name "blowBottle"; declare description "Blown Bottle Instrument"; declare author "Romain Michon ([email protected])"; declare copyright "Romain Michon"; declare version "1.0"; declare description "This object implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook)."; import("stdfaust.lib"); inst = library("instruments.lib"); freq = nentry( "h:_Basic/freq [1][unit:Hz] [tooltip:Tone frequency]", 440, 20, 20000,1); gain = nentry( "h:_Basic/gain [1][tooltip:Gain (value between 0 and 1)]", 1, 0, 1, 0.01); gate = button("h:_Basic/gate [1][tooltip:noteOn = 1, noteOff = 0]"); noiseGain = hslider( "h:_Physical_and_Nonlinearity/v:_Physical/noise_gain [2][tooltip:Breath noise gain (value between 0 and 1)]", 0.5, 0, 1, 0.01)*2; pressure = hslider( "h:_Physical_and_Nonlinearity/v:_Physical/pressure [2][tooltip:Breath pressure (value bewteen 0 and 1)]", 1, 0, 1, 0.01); typeModulation = nentry( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/modulation_type [3][tooltip: 0=theta is modulated by the incoming signal; 1=theta is modulated by the averaged incoming signal; 2=theta is modulated by the squared incoming signal; 3=theta is modulated by a sine wave of frequency freqMod; 4=theta is modulated by a sine wave of frequency freq;]", 0, 0, 4, 1); nonLinearity = hslider( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/nonlinearity [3][tooltip:Nonlinearity factor (value between 0 and 1)]", 0, 0, 1, 0.01); frequencyMod = hslider( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/modulation_frequency [3][unit:Hz][tooltip:Frequency of the sine wave for the modulation of theta (works if Modulation Type=3)]", 220, 20, 1000, 0.1); nonLinAttack = hslider( "h:_Physical_and_Nonlinearity/v:_Nonlinear_Filter/nonlinearity_attack [3][unit:s][Attack duration of the nonlinearity]", 0.1, 0, 2, 0.01); envelopeAttack = hslider( "h:_Envelopes_and_Vibrato/v:_Envelope/envelope_attack [5][unit:s][tooltip:Envelope attack duration]", 0.01, 0, 2, 0.01); envelopeDecay = hslider( "h:_Envelopes_and_Vibrato/v:_Envelope/envelope_decay [5][unit:s][tooltip:Envelope decay duration]", 0.01, 0, 2, 0.01); envelopeRelease = hslider( "h:_Envelopes_and_Vibrato/v:_Envelope/envelope_release [5][unit:s][tooltip:Envelope release duration]", 0.5, 0, 2, 0.01); nlfOrder = 6; envelopeMod = inst.en.asr(nonLinAttack, 1, envelopeRelease, gate); nlfm = inst.nonLinearModulator((nonLinearity : si.smoo), envelopeMod, freq, typeModulation, (frequencyMod : si.smoo), nlfOrder); bottleRadius = 0.999; stereo = stereoizer(ma.SR / freq); bandPassFilter = inst.bandPass(freq, bottleRadius); envelopeG = gain * inst.en.adsr( gain * envelopeAttack, envelopeDecay, 1, envelopeRelease, gate); envelope = pressure * inst.en.adsr(gain*0.02, 0.01, 1, gain * 0.2, gate); breathPressure = envelope; randPressure = noiseGain * no.noise * breathPressure; process = (-(breathPressure) <: ((+(1)) * randPressure : +(breathPressure)) - *(inst.jetTable), _ : bandPassFilter,_) ~ nlfm : !, _ stereoizer(periodDuration) = _ <: _,widthdelay : stereopanner with { W = hslider("v:_Spat/spatial-width", 0.5, 0, 1, 0.01); A = hslider("v:_Spat/pan-angle", 0.6, 0, 1, 0.01); widthdelay = de.delay(4096,W*periodDuration/2); stereopanner = _,_ : *(1.0-A), *(A); };
a72a7ca3cbf87e7889760c8f4fdc81fb89a9bdb42999c23c008aa52053f4a5d0
aravind-sadharani/puretones-music-room
tanpura-string.dsp
import("stdfaust.lib"); PureTonesString(coarsefreq,period,finetune,variance,delay) = string(freq*(1+delta)/2,gamma) + string(freq*(1-delta)/2,gamma) : *(gain) with { freq = coarsefreq; delta = vslider("[04]Variance",variance,0,20,0.1)/10000; gamma = 0.5; gate = vgroup("[00]Play String",os.lf_pulsetrainpos(1/period,0.3):@(ma.SR*delay*period)); gain = 10^((vslider("[08]Gain",0,-20,20,0.1)-6) : /(20)); envelope1 = en.adsr(0.1*period,0.3*period,0.2,0.3*period,gate); envelope2 = en.adsr(0.2*period,0.4*period,0.4,0.4*period,gate); envelope3 = en.adsr(0.1*period,0.5*period,0.6,0.5*period,gate); fullstring(f,n1,n2,g) = ((g^(n2+2-n1))*os.osc(f*n2) + os.osc(f*n1) - (g^(n2+1-n1))*os.osc(f*(n2+1)) - g*os.osc(f*(n1-1)))/(1+g^2-2*g*os.osccos(f)); octave1gain = vslider("[11]Octave 1", 5.6,0,10,0.1)*0.04; octave2gain = vslider("[11]Octave 2", 7.8,0,10,0.1)*0.04; octave3gain = vslider("[12]Octave 3", 5.6,0,10,0.1)*0.03; octave4gain = vslider("[13]Octave 4", 1,0,10,0.1)*0.04; octave5gain = vslider("[14]Octave 5", 0.4,0,10,0.1)*0.01; octave6gain = vslider("[15]Octave 6", 0.2,0,10,0.1)*0.003; string1(f,g) = octave6gain*fullstring(f,32,64,g) + octave5gain*fullstring(f,16,32,g) : *(envelope1); string2(f,g) = octave4gain*fullstring(f,8,16,g) + octave3gain*fullstring(f,4,8,g) : *(envelope2); string3(f,g) = octave1gain*(os.osc(f)+1.42*os.osc(2*f)) + octave2gain*fullstring(f,2,4,g) : *(envelope3); string(f,g) = string1(f,g) + string2(f,g) + string3(f,g); }; commonPitch = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",3,3,14,1); fineTune = hslider("Fine_Tune",0,-100,100,1); _voice_1cpitch = 110*(2^(commonPitch/12))*(2^(fineTune/1200))*(2^(0)); period = vslider("[3]Period",7,4,10,0.5); process = hgroup("Motif", PureTonesString(_voice_1cpitch,period,0,5,0)) <: dm.zita_light;
https://raw.githubusercontent.com/aravind-sadharani/puretones-music-room/b237ebc23b7b11d7c018716278c2ed702d374e99/src/posts/tanpuraworking-1/tanpura-string.dsp
faust
import("stdfaust.lib"); PureTonesString(coarsefreq,period,finetune,variance,delay) = string(freq*(1+delta)/2,gamma) + string(freq*(1-delta)/2,gamma) : *(gain) with { freq = coarsefreq; delta = vslider("[04]Variance",variance,0,20,0.1)/10000; gamma = 0.5; gate = vgroup("[00]Play String",os.lf_pulsetrainpos(1/period,0.3):@(ma.SR*delay*period)); gain = 10^((vslider("[08]Gain",0,-20,20,0.1)-6) : /(20)); envelope1 = en.adsr(0.1*period,0.3*period,0.2,0.3*period,gate); envelope2 = en.adsr(0.2*period,0.4*period,0.4,0.4*period,gate); envelope3 = en.adsr(0.1*period,0.5*period,0.6,0.5*period,gate); fullstring(f,n1,n2,g) = ((g^(n2+2-n1))*os.osc(f*n2) + os.osc(f*n1) - (g^(n2+1-n1))*os.osc(f*(n2+1)) - g*os.osc(f*(n1-1)))/(1+g^2-2*g*os.osccos(f)); octave1gain = vslider("[11]Octave 1", 5.6,0,10,0.1)*0.04; octave2gain = vslider("[11]Octave 2", 7.8,0,10,0.1)*0.04; octave3gain = vslider("[12]Octave 3", 5.6,0,10,0.1)*0.03; octave4gain = vslider("[13]Octave 4", 1,0,10,0.1)*0.04; octave5gain = vslider("[14]Octave 5", 0.4,0,10,0.1)*0.01; octave6gain = vslider("[15]Octave 6", 0.2,0,10,0.1)*0.003; string1(f,g) = octave6gain*fullstring(f,32,64,g) + octave5gain*fullstring(f,16,32,g) : *(envelope1); string2(f,g) = octave4gain*fullstring(f,8,16,g) + octave3gain*fullstring(f,4,8,g) : *(envelope2); string3(f,g) = octave1gain*(os.osc(f)+1.42*os.osc(2*f)) + octave2gain*fullstring(f,2,4,g) : *(envelope3); string(f,g) = string1(f,g) + string2(f,g) + string3(f,g); }; commonPitch = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",3,3,14,1); fineTune = hslider("Fine_Tune",0,-100,100,1); _voice_1cpitch = 110*(2^(commonPitch/12))*(2^(fineTune/1200))*(2^(0)); period = vslider("[3]Period",7,4,10,0.5); process = hgroup("Motif", PureTonesString(_voice_1cpitch,period,0,5,0)) <: dm.zita_light;
7ef976725e6761c7483d17e7a7455600e8292e2e5a2a22a37abc769bf5d6b39f
aravind-sadharani/puretones-music-room
Two-close-strings.dsp
import("stdfaust.lib"); commonPitch = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",3,3,14,1); fineTune = hslider("Fine_Tune",0,-100,100,1); String2Tone(f,r,g) = StringModel(pm.f2l(f*r),StringPluck) : *(StringEnv) with { StringPluck = en.adsr(0.00001,cperiod*0.7,0.9,cperiod*0.3,g); StringEnv = en.adsr(0.0001,cperiod*0.7,0.9,cperiod*0.4,g); StringModel(length,excitation) = 2*pm.endChain(egChain) with{ brightness = 0.6/((length)^(1/3)); stiffness = 25*((length)^(1/3)); pluckPosition = 0.61; StringBody(stringL,excitation) = reflectance,transmittance,_ with{ c = (0.375*(stringL^(1/4)) - 0.0825); transmittance = _ <: *(1-c),1*c*fi.resonbp(pm.l2f(stringL),2,1) :> _; reflectance = _; }; StringBridge(brightness) = pm.rTermination(pm.basicBlock,reflectance) : _,transmittance,_ with{ reflectance = (-1)*pm.bridgeFilter(brightness,0); transmittance = _; }; openStringPick(length,stiffness,pluckPosition,excitation) = strChain with{ dispersionFilters = par(i,2,si.smooth(stiffness)),_; maxStringLength = 6; nti = length*pluckPosition; // length of the upper portion of the string itb = length*(1-pluckPosition); // length of the lower portion of the string strChain = pm.chain( pm.stringSegment(maxStringLength,nti) : pm.in(excitation) : dispersionFilters : pm.stringSegment(maxStringLength,itb) ); }; lengthTuning = 13*pm.speedOfSound/ma.SR; stringL = length-lengthTuning; egChain = pm.chain( pm.lStringRigidTermination : openStringPick(stringL,stiffness/1000,pluckPosition,excitation) : StringBridge(brightness) : StringBody(length,excitation) : pm.out ); }; }; freq = 110*(2^(commonPitch/12))*(2^(fineTune/1200)); delta = 0.25; sharpness = 0.5; cperiod = 12; cgain = 0.4; gate = os.lf_pulsetrainpos(1/cperiod,0.1); g1 = gate + (gate : @(ma.SR*cperiod*2/3)); g2 = (gate : @(ma.SR*cperiod/3)) + (gate : @(ma.SR*cperiod*2/3)); env1 = en.adsr(0.01,cperiod/2,0.3,cperiod/8,g1); env2 = en.adsr(0.01,cperiod/2,0.3,cperiod/8,g2); string1 = String2Tone(freq-delta,1,g1) : *(env1) : *(cgain); string2 = String2Tone(freq+delta,1,g2) : *(env2) : *(cgain); mix(l,r) = 0.7*l+0.3*r,0.3*l+0.7*r; process = hgroup("Motif",(string1, string2 : mix)) : @(ma.SR*0.01),@(ma.SR*0.01) : dm.zita_light;
https://raw.githubusercontent.com/aravind-sadharani/puretones-music-room/b237ebc23b7b11d7c018716278c2ed702d374e99/src/posts/tanpuraworking-1/Two-close-strings.dsp
faust
length of the upper portion of the string length of the lower portion of the string
import("stdfaust.lib"); commonPitch = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",3,3,14,1); fineTune = hslider("Fine_Tune",0,-100,100,1); String2Tone(f,r,g) = StringModel(pm.f2l(f*r),StringPluck) : *(StringEnv) with { StringPluck = en.adsr(0.00001,cperiod*0.7,0.9,cperiod*0.3,g); StringEnv = en.adsr(0.0001,cperiod*0.7,0.9,cperiod*0.4,g); StringModel(length,excitation) = 2*pm.endChain(egChain) with{ brightness = 0.6/((length)^(1/3)); stiffness = 25*((length)^(1/3)); pluckPosition = 0.61; StringBody(stringL,excitation) = reflectance,transmittance,_ with{ c = (0.375*(stringL^(1/4)) - 0.0825); transmittance = _ <: *(1-c),1*c*fi.resonbp(pm.l2f(stringL),2,1) :> _; reflectance = _; }; StringBridge(brightness) = pm.rTermination(pm.basicBlock,reflectance) : _,transmittance,_ with{ reflectance = (-1)*pm.bridgeFilter(brightness,0); transmittance = _; }; openStringPick(length,stiffness,pluckPosition,excitation) = strChain with{ dispersionFilters = par(i,2,si.smooth(stiffness)),_; maxStringLength = 6; strChain = pm.chain( pm.stringSegment(maxStringLength,nti) : pm.in(excitation) : dispersionFilters : pm.stringSegment(maxStringLength,itb) ); }; lengthTuning = 13*pm.speedOfSound/ma.SR; stringL = length-lengthTuning; egChain = pm.chain( pm.lStringRigidTermination : openStringPick(stringL,stiffness/1000,pluckPosition,excitation) : StringBridge(brightness) : StringBody(length,excitation) : pm.out ); }; }; freq = 110*(2^(commonPitch/12))*(2^(fineTune/1200)); delta = 0.25; sharpness = 0.5; cperiod = 12; cgain = 0.4; gate = os.lf_pulsetrainpos(1/cperiod,0.1); g1 = gate + (gate : @(ma.SR*cperiod*2/3)); g2 = (gate : @(ma.SR*cperiod/3)) + (gate : @(ma.SR*cperiod*2/3)); env1 = en.adsr(0.01,cperiod/2,0.3,cperiod/8,g1); env2 = en.adsr(0.01,cperiod/2,0.3,cperiod/8,g2); string1 = String2Tone(freq-delta,1,g1) : *(env1) : *(cgain); string2 = String2Tone(freq+delta,1,g2) : *(env2) : *(cgain); mix(l,r) = 0.7*l+0.3*r,0.3*l+0.7*r; process = hgroup("Motif",(string1, string2 : mix)) : @(ma.SR*0.01),@(ma.SR*0.01) : dm.zita_light;
20454a1c81c1343650ef67d27dab802ee47bb563188b7ae8c986fb499ca94d81
aravind-sadharani/puretones
puretones.dsp
// _____ _ _ _ __ __ _ __ __ _ // / ____| | | | (_) | \/ | (_) \ \ / / | | // | (___ __ _ __| | |__ __ _ _ __ __ _ _ __ _ | \ / |_ _ ___ _ ___ \ \ /\ / /__ _ __| | _____ // \___ \ / _` |/ _` | '_ \ / _` | '__/ _` | '_ \| | | |\/| | | | / __| |/ __| \ \/ \/ / _ \| '__| |/ / __| // ____) | (_| | (_| | | | | (_| | | | (_| | | | | | | | | | |_| \__ \ | (__ \ /\ / (_) | | | <\__ \ // |_____/ \__,_|\__,_|_| |_|\__,_|_| \__,_|_| |_|_| |_| |_|\__,_|___/_|\___| \/ \/ \___/|_| |_|\_\___/ // // PureTones Drone Six - Developed by Aravind Iyer and S Balachander, Sadharani Music Works // A Six string version which offers a few more advanced features than puretones-drone.dsp which has four strings // import("stdfaust.lib"); PureTonesString(coarsefreq,period,finetune,ratio,variance,delay) = string(freq*(1+delta)/2,gamma) + string(freq*(1-delta)/2,gamma) : *(gain) with { finecent = vslider("[02]Fine Tune",finetune,-100,100,1); fineratio = 2^(finecent/1200); ultrafinecent = vslider("[03]Ultrafine Tune",0,-100,100,1); ultrafineratio = 2^(ultrafinecent/120000); ratioselector = vslider("[001][style:radio{'SA':0;'Ni^':1;'Ni_':2;'Dha^':3;'Dha_':4;'Pa':5;'Ma^':6;'Ma_':7;'Ga^':8;'Ga_':9;'Re^':10;'Re_':11;'Sa':12}]Select Note",ratio,0,12,1); ratioselected = 2,243/128,16/9,27/16,128/81,3/2,729/512,4/3,81/64,32/27,9/8,256/243,1 : ba.selectn(13,ratioselector); freq = ratioselected*coarsefreq*fineratio*ultrafineratio; delta = ratioselected*vslider("[04]Variance",variance,0,20,0.1)/10000; gamma = 0.5; gate = vgroup("[00]Play String",checkbox("[1]Loop")*os.lf_pulsetrainpos(1/period,0.3):@(ma.SR*delay*period) + button("[0]Once")); gain = 10^((vslider("[08]Gain",0,-20,20,0.1)-18) : /(20))/ratioselected; envelope1 = en.adsr(0.1*period,0.3*period,0.2,0.3*period,gate); envelope2 = en.adsr(0.2*period,0.4*period,0.4,0.4*period,gate); envelope3 = en.adsr(0.1*period,0.5*period,0.6,0.5*period,gate); fullstring(f,n1,n2,g) = ((g^(n2+2-n1))*os.osc(f*n2) + os.osc(f*n1) - (g^(n2+1-n1))*os.osc(f*(n2+1)) - g*os.osc(f*(n1-1)))/(1+g^2-2*g*os.osccos(f)); octave1gain = vslider("[11]Octave 1", 5.6,0,10,0.1)*0.04; octave2gain = vslider("[11]Octave 2", 7.8,0,10,0.1)*0.04; octave3gain = vslider("[12]Octave 3", 5.6,0,10,0.1)*0.03; octave4gain = vslider("[13]Octave 4", 1,0,10,0.1)*0.04; octave5gain = vslider("[14]Octave 5", 0.4,0,10,0.1)*0.01; octave6gain = vslider("[15]Octave 6", 0.2,0,10,0.1)*0.003; string1(f,g) = octave6gain*fullstring(f,32,64,g) + octave5gain*fullstring(f,16,32,g) : *(envelope1); string2(f,g) = octave4gain*fullstring(f,8,16,g) + octave3gain*fullstring(f,4,8,g) : *(envelope2); string3(f,g) = octave1gain*(os.osc(f)+1.42*os.osc(2*f)) + octave2gain*fullstring(f,2,4,g) : *(envelope3); string(f,g) = string1(f,g) + string2(f,g) + string3(f,g); }; PureTones(c,p) = hgroup("[0]",(c,p)) : PureTonesSystem with { string1(c,p) = hgroup("[1]1st String",PureTonesString(c,p-0.2,0,5,5,0)); string2(c,p) = hgroup("[2]2nd String",PureTonesString(c,p-0.2,0,0,5,0.3)); string3(c,p) = hgroup("[3]3rd String",PureTonesString(c,p-0.2,0,12,5,0.6)); string4(c,p) = hgroup("[4]4th String",PureTonesString(c,p+0.2,0,5,5,0.5)); string5(c,p) = hgroup("[5]5th String",PureTonesString(c,p+0.2,0,0,5,0.8)); string6(c,p) = hgroup("[6]6th String",PureTonesString(c,p+0.2,0,12,5,0.1)); PureTonesLeft(c,p) = (c,p) <: _,_,_,_,_,_ : tgroup("[1]",string1,string2,string3) :> _; PureTonesRight(c,p) = (c,p) <: _,_,_,_,_,_ : tgroup("[1]",string4,string5,string6) :> _; PureTonesSystem(c,p) = PureTonesLeft(c,p), PureTonesRight(c,p); }; coarseselector = vslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Common Frequency",11,3,14,1); coarse = 110*(2^(coarseselector/12)); octaveselector = vslider("[1][style:radio{'High':1;'Medium':0;'Low':-1}]Octave Selector",0,-1,1,1); finecent = vslider("[2]Fine Tune",0,-100,100,1); fineratio = 2^(finecent/1200); period = vslider("[3]Period",7,4,10,0.5); process = hgroup("[00]PureTones v1.0", PureTones(coarse*fineratio*(2^octaveselector),period)) <: dm.zita_light;
https://raw.githubusercontent.com/aravind-sadharani/puretones/e605d7e8ff393cae6fd5216888528290c0f71c33/dronewebapp/puretones.dsp
faust
_____ _ _ _ __ __ _ __ __ _ / ____| | | | (_) | \/ | (_) \ \ / / | | | (___ __ _ __| | |__ __ _ _ __ __ _ _ __ _ | \ / |_ _ ___ _ ___ \ \ /\ / /__ _ __| | _____ \___ \ / _` |/ _` | '_ \ / _` | '__/ _` | '_ \| | | |\/| | | | / __| |/ __| \ \/ \/ / _ \| '__| |/ / __| ____) | (_| | (_| | | | | (_| | | | (_| | | | | | | | | | |_| \__ \ | (__ \ /\ / (_) | | | <\__ \ |_____/ \__,_|\__,_|_| |_|\__,_|_| \__,_|_| |_|_| |_| |_|\__,_|___/_|\___| \/ \/ \___/|_| |_|\_\___/ PureTones Drone Six - Developed by Aravind Iyer and S Balachander, Sadharani Music Works A Six string version which offers a few more advanced features than puretones-drone.dsp which has four strings
import("stdfaust.lib"); PureTonesString(coarsefreq,period,finetune,ratio,variance,delay) = string(freq*(1+delta)/2,gamma) + string(freq*(1-delta)/2,gamma) : *(gain) with { finecent = vslider("[02]Fine Tune",finetune,-100,100,1); fineratio = 2^(finecent/1200); ultrafinecent = vslider("[03]Ultrafine Tune",0,-100,100,1); ultrafineratio = 2^(ultrafinecent/120000); ratioselector = vslider("[001][style:radio{'SA':0;'Ni^':1;'Ni_':2;'Dha^':3;'Dha_':4;'Pa':5;'Ma^':6;'Ma_':7;'Ga^':8;'Ga_':9;'Re^':10;'Re_':11;'Sa':12}]Select Note",ratio,0,12,1); ratioselected = 2,243/128,16/9,27/16,128/81,3/2,729/512,4/3,81/64,32/27,9/8,256/243,1 : ba.selectn(13,ratioselector); freq = ratioselected*coarsefreq*fineratio*ultrafineratio; delta = ratioselected*vslider("[04]Variance",variance,0,20,0.1)/10000; gamma = 0.5; gate = vgroup("[00]Play String",checkbox("[1]Loop")*os.lf_pulsetrainpos(1/period,0.3):@(ma.SR*delay*period) + button("[0]Once")); gain = 10^((vslider("[08]Gain",0,-20,20,0.1)-18) : /(20))/ratioselected; envelope1 = en.adsr(0.1*period,0.3*period,0.2,0.3*period,gate); envelope2 = en.adsr(0.2*period,0.4*period,0.4,0.4*period,gate); envelope3 = en.adsr(0.1*period,0.5*period,0.6,0.5*period,gate); fullstring(f,n1,n2,g) = ((g^(n2+2-n1))*os.osc(f*n2) + os.osc(f*n1) - (g^(n2+1-n1))*os.osc(f*(n2+1)) - g*os.osc(f*(n1-1)))/(1+g^2-2*g*os.osccos(f)); octave1gain = vslider("[11]Octave 1", 5.6,0,10,0.1)*0.04; octave2gain = vslider("[11]Octave 2", 7.8,0,10,0.1)*0.04; octave3gain = vslider("[12]Octave 3", 5.6,0,10,0.1)*0.03; octave4gain = vslider("[13]Octave 4", 1,0,10,0.1)*0.04; octave5gain = vslider("[14]Octave 5", 0.4,0,10,0.1)*0.01; octave6gain = vslider("[15]Octave 6", 0.2,0,10,0.1)*0.003; string1(f,g) = octave6gain*fullstring(f,32,64,g) + octave5gain*fullstring(f,16,32,g) : *(envelope1); string2(f,g) = octave4gain*fullstring(f,8,16,g) + octave3gain*fullstring(f,4,8,g) : *(envelope2); string3(f,g) = octave1gain*(os.osc(f)+1.42*os.osc(2*f)) + octave2gain*fullstring(f,2,4,g) : *(envelope3); string(f,g) = string1(f,g) + string2(f,g) + string3(f,g); }; PureTones(c,p) = hgroup("[0]",(c,p)) : PureTonesSystem with { string1(c,p) = hgroup("[1]1st String",PureTonesString(c,p-0.2,0,5,5,0)); string2(c,p) = hgroup("[2]2nd String",PureTonesString(c,p-0.2,0,0,5,0.3)); string3(c,p) = hgroup("[3]3rd String",PureTonesString(c,p-0.2,0,12,5,0.6)); string4(c,p) = hgroup("[4]4th String",PureTonesString(c,p+0.2,0,5,5,0.5)); string5(c,p) = hgroup("[5]5th String",PureTonesString(c,p+0.2,0,0,5,0.8)); string6(c,p) = hgroup("[6]6th String",PureTonesString(c,p+0.2,0,12,5,0.1)); PureTonesLeft(c,p) = (c,p) <: _,_,_,_,_,_ : tgroup("[1]",string1,string2,string3) :> _; PureTonesRight(c,p) = (c,p) <: _,_,_,_,_,_ : tgroup("[1]",string4,string5,string6) :> _; PureTonesSystem(c,p) = PureTonesLeft(c,p), PureTonesRight(c,p); }; coarseselector = vslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Common Frequency",11,3,14,1); coarse = 110*(2^(coarseselector/12)); octaveselector = vslider("[1][style:radio{'High':1;'Medium':0;'Low':-1}]Octave Selector",0,-1,1,1); finecent = vslider("[2]Fine Tune",0,-100,100,1); fineratio = 2^(finecent/1200); period = vslider("[3]Period",7,4,10,0.5); process = hgroup("[00]PureTones v1.0", PureTones(coarse*fineratio*(2^octaveselector),period)) <: dm.zita_light;
cd0e031fb807af2b6a74ab7623baffe3035a294e9295ad065ab8d1a8f36fce4e
aravind-sadharani/puretones
musicscale.dsp
// _____ _ _ _ __ __ _ __ __ _ // / ____| | | | (_) | \/ | (_) \ \ / / | | // | (___ __ _ __| | |__ __ _ _ __ __ _ _ __ _ | \ / |_ _ ___ _ ___ \ \ /\ / /__ _ __| | _____ // \___ \ / _` |/ _` | '_ \ / _` | '__/ _` | '_ \| | | |\/| | | | / __| |/ __| \ \/ \/ / _ \| '__| |/ / __| // ____) | (_| | (_| | | | | (_| | | | (_| | | | | | | | | | |_| \__ \ | (__ \ /\ / (_) | | | <\__ \ // |_____/ \__,_|\__,_|_| |_|\__,_|_| \__,_|_| |_|_| |_| |_|\__,_|___/_|\___| \/ \/ \___/|_| |_|\_\___/ // // PureTones Keys - Developed by Aravind Iyer and S Balachander, Sadharani Music Works // A tunable keyboard to be used with puretones-drone.dsp or puretones-drone-six.dsp // import("stdfaust.lib"); coarseselector = vslider("[000][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",11,3,14,1); coarse = 110*(2^(coarseselector/12)); octaveselector = vslider("[001][style:radio{'High':1;'Medium':0;'Low':-1;'Lowest':-2}]Octave",0,-2,1,1); finecent = vslider("[002]Fine Tune",0,-100,100,1); fineratio = 2^(finecent/1200); commonfreq = coarse*fineratio*(2^octaveselector); period = 2^(vslider("[003]Period",2,0,3,0.1)); note(freq,ratio,period) = string(freq,tunedratio)*rolloffenv with { n = 32; g = 0.6; amplitude = 0.4*(1-g)/(1-g^(n+1)); ToneStringModel(f) = ((g^(n+1))*os.osc(f*n) - (g^n)*os.osc(f*(n+1)) + os.osc(f))/((1-g)^2+4*g*os.osc(f/2)*os.osc(f/2)) : *(amplitude); variance = vslider("[000]Variance",2,0,10,0.1)/10000; string(f,r) = ToneStringModel(f*r*(1+variance)) + ToneStringModel(f*r*(1-variance)); c = checkbox("Play") : si.smoo; b = button("Pluck") ; cent = vslider("[00]Cent", 0,-100,100,1); ratio10 = 2^(cent/1200); pointOonecent = vslider("[01]0.01 Cent", 0,-100,100,1); ratio00 = 2^(pointOonecent/120000); shakeselector = checkbox("[02]Gamaka"); delta1cent = vslider("[03]Starting Cent", 0,-220,220,1); delta1pointOonecent = vslider("[04]Starting 0.01 Cent", 0,-100,100,1); delta1 = (2^(delta1cent/1200))*(2^(delta1pointOonecent/120000))-1; delta2cent = vslider("[05]Ending Cent", 0,-220,220,1); delta2pointOonecent = vslider("[06]Ending 0.01 Cent", 0,-100,100,1); delta2 = (2^(delta2cent/1200))*(2^(delta2pointOonecent/120000))-1; rate = 2^(vslider("[07]Rate",17,-5,25,0.1)/10); number = vslider("[08]Number",3.5,0,10,0.01); phasor(f) = (+(f/ma.SR) ~ ma.decimal); cphasedcos(x) = phasor(x) - (phasor(x) : ba.latch(gate(period))) : *(2*ma.PI) : cos; bphasedcos(x) = phasor(x) - (phasor(x) : ba.latch(b)) : *(2*ma.PI) : cos; ramp(x) = +(x/ma.SR) ~ _; clockedramp(x) = ramp(x) - (ramp(x) : ba.latch(gate(period))); blockedramp(x) = ramp(x) - (ramp(x) : ba.latch(b)); shake(d1,d2,r,n,p) = shakeselector*c*(1+((d1+d2)/2+(d1-d2)*cphasedcos(r)/2)*(clockedramp(r) < n)) + shakeselector*(1-c)*(1+((d1+d2)/2+(d1-d2)*bphasedcos(r)/2)*(blockedramp(r) < n))+ (1-shakeselector); gate(p) = os.lf_pulsetrainpos(1/p,0.3); env(p) = 4*en.adsr(0.0001,p-1,0.5,p-1,gate(p)); benv = 3.5*en.adsr(0.0001,1,0.8,1,b); pluck = (period) : env; tunedratio = ratio*ratio10*ratio00*(delta1,delta2,rate,number,period : shake); rolloffenv = en.adsr(0.001,period*0.6,0.8,period*0.5,c*gate(period)) + en.adsr(0.0001,0.2,0.8,0.1,b); }; scale(c,e) = tgroup("[05]12 Note Scale", string01+string02+string03+string04+string05+string06+string07+string08+string09+string10+string11+string12+string13) with { string01 = hgroup("[01] Sa ", (c,1,e : note)); string02 = hgroup("[02] re ", (c,256/243,e : note)); string03 = hgroup("[03] Re ", (c,9/8,e : note)); string04 = hgroup("[04] ga ", (c,32/27,e : note)); string05 = hgroup("[05] Ga ", (c,81/64,e : note)); string06 = hgroup("[06] ma ", (c,4/3,e : note)); string07 = hgroup("[07] Ma ", (c,729/512,e : note)); string08 = hgroup("[08] Pa ", (c,3/2,e : note)); string09 = hgroup("[09] dha ", (c,128/81,e : note)); string10 = hgroup("[10] Dha ", (c,27/16,e : note)); string11 = hgroup("[11] ni ", (c,16/9,e : note)); string12 = hgroup("[12] Ni ", (c,243/128,e : note)); string13 = hgroup("[13] SA ", (c,2,e : note)); }; process = hgroup("[0000]Common Parameters",(commonfreq,period) : scale) <: dm.zita_light;
https://raw.githubusercontent.com/aravind-sadharani/puretones/9799d01cd664fcb3b383c6559ffdf9ece8dbfba9/scalewebapp/musicscale.dsp
faust
_____ _ _ _ __ __ _ __ __ _ / ____| | | | (_) | \/ | (_) \ \ / / | | | (___ __ _ __| | |__ __ _ _ __ __ _ _ __ _ | \ / |_ _ ___ _ ___ \ \ /\ / /__ _ __| | _____ \___ \ / _` |/ _` | '_ \ / _` | '__/ _` | '_ \| | | |\/| | | | / __| |/ __| \ \/ \/ / _ \| '__| |/ / __| ____) | (_| | (_| | | | | (_| | | | (_| | | | | | | | | | |_| \__ \ | (__ \ /\ / (_) | | | <\__ \ |_____/ \__,_|\__,_|_| |_|\__,_|_| \__,_|_| |_|_| |_| |_|\__,_|___/_|\___| \/ \/ \___/|_| |_|\_\___/ PureTones Keys - Developed by Aravind Iyer and S Balachander, Sadharani Music Works A tunable keyboard to be used with puretones-drone.dsp or puretones-drone-six.dsp
import("stdfaust.lib"); coarseselector = vslider("[000][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",11,3,14,1); coarse = 110*(2^(coarseselector/12)); octaveselector = vslider("[001][style:radio{'High':1;'Medium':0;'Low':-1;'Lowest':-2}]Octave",0,-2,1,1); finecent = vslider("[002]Fine Tune",0,-100,100,1); fineratio = 2^(finecent/1200); commonfreq = coarse*fineratio*(2^octaveselector); period = 2^(vslider("[003]Period",2,0,3,0.1)); note(freq,ratio,period) = string(freq,tunedratio)*rolloffenv with { n = 32; g = 0.6; amplitude = 0.4*(1-g)/(1-g^(n+1)); ToneStringModel(f) = ((g^(n+1))*os.osc(f*n) - (g^n)*os.osc(f*(n+1)) + os.osc(f))/((1-g)^2+4*g*os.osc(f/2)*os.osc(f/2)) : *(amplitude); variance = vslider("[000]Variance",2,0,10,0.1)/10000; string(f,r) = ToneStringModel(f*r*(1+variance)) + ToneStringModel(f*r*(1-variance)); c = checkbox("Play") : si.smoo; b = button("Pluck") ; cent = vslider("[00]Cent", 0,-100,100,1); ratio10 = 2^(cent/1200); pointOonecent = vslider("[01]0.01 Cent", 0,-100,100,1); ratio00 = 2^(pointOonecent/120000); shakeselector = checkbox("[02]Gamaka"); delta1cent = vslider("[03]Starting Cent", 0,-220,220,1); delta1pointOonecent = vslider("[04]Starting 0.01 Cent", 0,-100,100,1); delta1 = (2^(delta1cent/1200))*(2^(delta1pointOonecent/120000))-1; delta2cent = vslider("[05]Ending Cent", 0,-220,220,1); delta2pointOonecent = vslider("[06]Ending 0.01 Cent", 0,-100,100,1); delta2 = (2^(delta2cent/1200))*(2^(delta2pointOonecent/120000))-1; rate = 2^(vslider("[07]Rate",17,-5,25,0.1)/10); number = vslider("[08]Number",3.5,0,10,0.01); phasor(f) = (+(f/ma.SR) ~ ma.decimal); cphasedcos(x) = phasor(x) - (phasor(x) : ba.latch(gate(period))) : *(2*ma.PI) : cos; bphasedcos(x) = phasor(x) - (phasor(x) : ba.latch(b)) : *(2*ma.PI) : cos; ramp(x) = +(x/ma.SR) ~ _; clockedramp(x) = ramp(x) - (ramp(x) : ba.latch(gate(period))); blockedramp(x) = ramp(x) - (ramp(x) : ba.latch(b)); shake(d1,d2,r,n,p) = shakeselector*c*(1+((d1+d2)/2+(d1-d2)*cphasedcos(r)/2)*(clockedramp(r) < n)) + shakeselector*(1-c)*(1+((d1+d2)/2+(d1-d2)*bphasedcos(r)/2)*(blockedramp(r) < n))+ (1-shakeselector); gate(p) = os.lf_pulsetrainpos(1/p,0.3); env(p) = 4*en.adsr(0.0001,p-1,0.5,p-1,gate(p)); benv = 3.5*en.adsr(0.0001,1,0.8,1,b); pluck = (period) : env; tunedratio = ratio*ratio10*ratio00*(delta1,delta2,rate,number,period : shake); rolloffenv = en.adsr(0.001,period*0.6,0.8,period*0.5,c*gate(period)) + en.adsr(0.0001,0.2,0.8,0.1,b); }; scale(c,e) = tgroup("[05]12 Note Scale", string01+string02+string03+string04+string05+string06+string07+string08+string09+string10+string11+string12+string13) with { string01 = hgroup("[01] Sa ", (c,1,e : note)); string02 = hgroup("[02] re ", (c,256/243,e : note)); string03 = hgroup("[03] Re ", (c,9/8,e : note)); string04 = hgroup("[04] ga ", (c,32/27,e : note)); string05 = hgroup("[05] Ga ", (c,81/64,e : note)); string06 = hgroup("[06] ma ", (c,4/3,e : note)); string07 = hgroup("[07] Ma ", (c,729/512,e : note)); string08 = hgroup("[08] Pa ", (c,3/2,e : note)); string09 = hgroup("[09] dha ", (c,128/81,e : note)); string10 = hgroup("[10] Dha ", (c,27/16,e : note)); string11 = hgroup("[11] ni ", (c,16/9,e : note)); string12 = hgroup("[12] Ni ", (c,243/128,e : note)); string13 = hgroup("[13] SA ", (c,2,e : note)); }; process = hgroup("[0000]Common Parameters",(commonfreq,period) : scale) <: dm.zita_light;
576f2a0dd038f3f36526feb23a9b15f6c09fd1efecd9651cb4d825fce4768775
aravind-sadharani/puretones-music-room
16harmonics.dsp
import("stdfaust.lib"); commonPitch = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",3,3,14,1); fineTune = hslider("Fine_Tune",0,-100,100,1); cperiod = 2^(vslider("[01]Motif Tempo",1.0,-2,4,0.1) - 3); cgain = 10^(vslider("[02]Motif Gain",0,-20,20,0.1) - 6 : /(20)) : /(sqrt(_voice_1noteratio)); delta = vslider("[04]Shake Variance", 10,0,120,1); rate = vslider("[05]Shake Rate",11.5,10,25,0.1); c2v(d) = 2^(d/1200)-1; l2l(r) = 2^(r/10); number = vslider("[06]Shake Number",3.4,1,10,0.1); phasor(f) = ba.period(ma.SR/f) : *(f/ma.SR); ramp(x) = ba.time : *(x); fullstring(f,n1,n2,g) = ((g^(n2+2-n1))*os.osc(f*n2) + os.osc(f*n1) - (g^(n2+1-n1))*os.osc(f*(n2+1)) - g*os.osc(f*(n1-1)))/(1+g^2-2*g*os.osccos(f)); envelope(trigger) = en.adsr(0.001,cperiod/3,0.4,cperiod/8,trigger); _voice_1noteindex = cperiod : _voice_1motifnotes; _voice_1cpitch = 110*(2^(commonPitch/12))*(2^(fineTune/1200))*(2^(-1)); _voice_1ratio_0 = 1;//(1) * (1/2) * (2^(0/1200)); //Sa' _voice_1ratio_1 = 2;//(1) * (1) * (2^(0/1200)); //Sa _voice_1ratio_2 = 3;//(3/2) * (1) * (2^(0/1200)); //Pa _voice_1ratio_3 = 4;//(1) * (2) * (2^(0/1200)); //Sa" _voice_1ratio_4 = 5;//(81/64) * (2) * (2^(0/1200)); //Ga" _voice_1ratio_5 = 6;//(3/2) * (2) * (2^(0/1200)); //Pa" _voice_1ratio_6 = 7;//(16/9) * (2) * (2^(0/1200)); //ni" _voice_1ratio_7 = 8;//(2) * (2) * (2^(0/1200)); //SA" _voice_1ratio_8 = 9;//(9/8) * (2) * (2^(0/1200)); //Re" _voice_1ratio_9 = 10;//(81/64) * (1) * (2^(0/1200)); //Ga _voice_1ratio_10 = 11;//(4/3) * (2) * (2^(0/1200)); //ma" _voice_1ratio_11 = 12;//(3/2) * (1/2) * (2^(0/1200)); //Pa' _voice_1ratio_12 = 13;//(128/81) * (2) * (2^(0/1200)); //dha" _voice_1ratio_13 = 14;//(16/9) * (1) * (2^(0/1200)); //ni _voice_1ratio_14 = 15;//(243/128) * (2) * (2^(0/1200)); //Ni" _voice_1ratio_15 = 16;//(2) * (1) * (2^(0/1200)); //SA _voice_1noteratio = _voice_1ratio_0,_voice_1ratio_1,_voice_1ratio_2,_voice_1ratio_3,_voice_1ratio_4,_voice_1ratio_5,_voice_1ratio_6,_voice_1ratio_7,_voice_1ratio_8,_voice_1ratio_9,_voice_1ratio_10,_voice_1ratio_11,_voice_1ratio_12,_voice_1ratio_13,_voice_1ratio_14,_voice_1ratio_15 : ba.selectn(16,_voice_1noteindex); _voice_1gatewaveform = waveform{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0}; _voice_1gate(p) = _voice_1gatewaveform,int(2*ba.period(256*p*ma.SR)/(p*ma.SR)) : rdtable; _voice_1motif = waveform{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; _voice_1motifnotes(p) = _voice_1motif,int(2*ba.period(256*p*ma.SR)/(p*ma.SR)) : rdtable; _voice_1notes = fullstring(_voice_1cpitch,_voice_1noteratio,_voice_1noteratio+1,0.5) : *(envelope(_voice_1gate(cperiod))) : @(ma.SR*0.1); _voice_2notes = 0; _voice_3notes = 0; mix(a,b) = 0.7*a+0.3*b,0.3*a+0.7*b; concert = hgroup("[00]Motif",2*cgain*(0.7*_voice_1notes + 0.9*_voice_2notes),2*cgain*(0.7*_voice_1notes + 0.9*_voice_3notes)); process = concert : mix : dm.zita_light;
https://raw.githubusercontent.com/aravind-sadharani/puretones-music-room/b237ebc23b7b11d7c018716278c2ed702d374e99/src/posts/tanpuraworking-1/16harmonics.dsp
faust
(1) * (1/2) * (2^(0/1200)); //Sa' (1) * (1) * (2^(0/1200)); //Sa (3/2) * (1) * (2^(0/1200)); //Pa (1) * (2) * (2^(0/1200)); //Sa" (81/64) * (2) * (2^(0/1200)); //Ga" (3/2) * (2) * (2^(0/1200)); //Pa" (16/9) * (2) * (2^(0/1200)); //ni" (2) * (2) * (2^(0/1200)); //SA" (9/8) * (2) * (2^(0/1200)); //Re" (81/64) * (1) * (2^(0/1200)); //Ga (4/3) * (2) * (2^(0/1200)); //ma" (3/2) * (1/2) * (2^(0/1200)); //Pa' (128/81) * (2) * (2^(0/1200)); //dha" (16/9) * (1) * (2^(0/1200)); //ni (243/128) * (2) * (2^(0/1200)); //Ni" (2) * (1) * (2^(0/1200)); //SA
import("stdfaust.lib"); commonPitch = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Pitch",3,3,14,1); fineTune = hslider("Fine_Tune",0,-100,100,1); cperiod = 2^(vslider("[01]Motif Tempo",1.0,-2,4,0.1) - 3); cgain = 10^(vslider("[02]Motif Gain",0,-20,20,0.1) - 6 : /(20)) : /(sqrt(_voice_1noteratio)); delta = vslider("[04]Shake Variance", 10,0,120,1); rate = vslider("[05]Shake Rate",11.5,10,25,0.1); c2v(d) = 2^(d/1200)-1; l2l(r) = 2^(r/10); number = vslider("[06]Shake Number",3.4,1,10,0.1); phasor(f) = ba.period(ma.SR/f) : *(f/ma.SR); ramp(x) = ba.time : *(x); fullstring(f,n1,n2,g) = ((g^(n2+2-n1))*os.osc(f*n2) + os.osc(f*n1) - (g^(n2+1-n1))*os.osc(f*(n2+1)) - g*os.osc(f*(n1-1)))/(1+g^2-2*g*os.osccos(f)); envelope(trigger) = en.adsr(0.001,cperiod/3,0.4,cperiod/8,trigger); _voice_1noteindex = cperiod : _voice_1motifnotes; _voice_1cpitch = 110*(2^(commonPitch/12))*(2^(fineTune/1200))*(2^(-1)); _voice_1noteratio = _voice_1ratio_0,_voice_1ratio_1,_voice_1ratio_2,_voice_1ratio_3,_voice_1ratio_4,_voice_1ratio_5,_voice_1ratio_6,_voice_1ratio_7,_voice_1ratio_8,_voice_1ratio_9,_voice_1ratio_10,_voice_1ratio_11,_voice_1ratio_12,_voice_1ratio_13,_voice_1ratio_14,_voice_1ratio_15 : ba.selectn(16,_voice_1noteindex); _voice_1gatewaveform = waveform{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0}; _voice_1gate(p) = _voice_1gatewaveform,int(2*ba.period(256*p*ma.SR)/(p*ma.SR)) : rdtable; _voice_1motif = waveform{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; _voice_1motifnotes(p) = _voice_1motif,int(2*ba.period(256*p*ma.SR)/(p*ma.SR)) : rdtable; _voice_1notes = fullstring(_voice_1cpitch,_voice_1noteratio,_voice_1noteratio+1,0.5) : *(envelope(_voice_1gate(cperiod))) : @(ma.SR*0.1); _voice_2notes = 0; _voice_3notes = 0; mix(a,b) = 0.7*a+0.3*b,0.3*a+0.7*b; concert = hgroup("[00]Motif",2*cgain*(0.7*_voice_1notes + 0.9*_voice_2notes),2*cgain*(0.7*_voice_1notes + 0.9*_voice_3notes)); process = concert : mix : dm.zita_light;
875a75e92b058e24d5a30c03fa1142dbf1721be569e85d21fba8f2b0e7e5499a
aravind-sadharani/puretones-music-room
musicscale.dsp
import("stdfaust.lib"); freq = hslider("freq",200,50,1000,0.01); bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-6,6,0.01)) : si.polySmooth(gate,0.999,1); gain = hslider("gain",0.5,0,1,0.01); gate = button("gate") : en.adsr(0,0,1,0.01); cperiod = hslider("Common_Parameters/Period",2,0,3,0.1); midiKey = ba.hz2midikey(freq); rootKey = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Common_Parameters/Pitch",3,3,14,1) - 3; octave = hslider("Common_Parameters/Octave",0,-2,2,1); noteId = (midiKey + octave*12 - rootKey) : %(12); fineTune = hslider("Common_Parameters/Fine_Tune",0,-100,100,1); offsetSa = 0 + hslider("Common_Parameters/12_Note_Scale/Sa/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Sa/0.01_Cent",0,-100,100,1); offsetre = -9.78 + hslider("Common_Parameters/12_Note_Scale/re/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/re/0.01_Cent",0,-100,100,1); offsetRe = 3.91 + hslider("Common_Parameters/12_Note_Scale/Re/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Re/0.01_Cent",0,-100,100,1); offsetga = -5.87 + hslider("Common_Parameters/12_Note_Scale/ga/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/ga/0.01_Cent",0,-100,100,1); offsetGa = 7.82 + hslider("Common_Parameters/12_Note_Scale/Ga/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Ga/0.01_Cent",0,-100,100,1); offsetma = -1.96 + hslider("Common_Parameters/12_Note_Scale/ma/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/ma/0.01_Cent",0,-100,100,1); offsetMa = 11.73 + hslider("Common_Parameters/12_Note_Scale/Ma/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Ma/0.01_Cent",0,-100,100,1); offsetPa = 1.96 + hslider("Common_Parameters/12_Note_Scale/Pa/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Pa/0.01_Cent",0,-100,100,1); offsetdha = -7.82 + hslider("Common_Parameters/12_Note_Scale/dha/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/dha/0.01_Cent",0,-100,100,1); offsetDha = 5.87 + hslider("Common_Parameters/12_Note_Scale/Dha/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Dha/0.01_Cent",0,-100,100,1); offsetni = -3.91 + hslider("Common_Parameters/12_Note_Scale/ni/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/ni/0.01_Cent",0,-100,100,1); offsetNi = 9.78 + hslider("Common_Parameters/12_Note_Scale/Ni/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Ni/0.01_Cent",0,-100,100,1); noteOffset = offsetSa,offsetre,offsetRe,offsetga,offsetGa,offsetma,offsetMa,offsetPa,offsetdha,offsetDha,offsetni,offsetNi : ba.selectn(12,noteId); realFreq = bend*freq*(2^(noteOffset/1200))*(2^(fineTune/1200)); String1Tone(f,g) = StringModel(pm.f2l(f*(1+variance)),0.63,10*StringPluck,0.7,0,40) + StringModel(pm.f2l(f*(1-variance)),0.63,10*StringPluck,0.7,0,40) : *(StringEnv) with { variance = hslider("[00]Variance",2,0,4,0.1)/10000; StringPluck = en.adsr(0.00001,cperiod*0.7,0.9,cperiod*0.3,g); StringEnv = en.adsr(0.0001,cperiod*0.6,0.5,cperiod*0.5,g); StringModel(length,pluckPosition,excitation,brightness,damping,stiffness) = 0.1*pm.endChain(egChain) with{ openStringPick(length,stiffness,pluckPosition,excitation) = strChain with{ dispersionFilters = par(i,2,si.smooth(stiffness)),_; maxStringLength = 6; nti = length*pluckPosition; // length of the upper portion of the string itb = length*(1-pluckPosition); // length of the lower portion of the string strChain = pm.chain( pm.stringSegment(maxStringLength,nti) : pm.in(excitation) : pm.out : dispersionFilters : pm.stringSegment(maxStringLength,itb) ); }; lengthTuning = 14*pm.speedOfSound/ma.SR; stringL = length-lengthTuning; egChain = pm.chain( pm.lStringRigidTermination : openStringPick(stringL,stiffness/1000,pluckPosition,excitation) : pm.rTermination(pm.basicBlock,(-1)*pm.bridgeFilter(brightness,damping)) ); }; }; process = String1Tone(realFreq,gate)*gain*gate : fi.lowpass(3,4000) <: _,_; effect = dm.zita_light;
https://raw.githubusercontent.com/aravind-sadharani/puretones-music-room/b237ebc23b7b11d7c018716278c2ed702d374e99/src/data/musicscale.dsp
faust
length of the upper portion of the string length of the lower portion of the string
import("stdfaust.lib"); freq = hslider("freq",200,50,1000,0.01); bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-6,6,0.01)) : si.polySmooth(gate,0.999,1); gain = hslider("gain",0.5,0,1,0.01); gate = button("gate") : en.adsr(0,0,1,0.01); cperiod = hslider("Common_Parameters/Period",2,0,3,0.1); midiKey = ba.hz2midikey(freq); rootKey = hslider("[0][style:radio{'B':14;'A#':13;'A':12;'G#':11;'G':10;'F#':9;'F':8;'E':7;'D#':6;'D':5;'C#':4;'C':3}]Common_Parameters/Pitch",3,3,14,1) - 3; octave = hslider("Common_Parameters/Octave",0,-2,2,1); noteId = (midiKey + octave*12 - rootKey) : %(12); fineTune = hslider("Common_Parameters/Fine_Tune",0,-100,100,1); offsetSa = 0 + hslider("Common_Parameters/12_Note_Scale/Sa/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Sa/0.01_Cent",0,-100,100,1); offsetre = -9.78 + hslider("Common_Parameters/12_Note_Scale/re/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/re/0.01_Cent",0,-100,100,1); offsetRe = 3.91 + hslider("Common_Parameters/12_Note_Scale/Re/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Re/0.01_Cent",0,-100,100,1); offsetga = -5.87 + hslider("Common_Parameters/12_Note_Scale/ga/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/ga/0.01_Cent",0,-100,100,1); offsetGa = 7.82 + hslider("Common_Parameters/12_Note_Scale/Ga/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Ga/0.01_Cent",0,-100,100,1); offsetma = -1.96 + hslider("Common_Parameters/12_Note_Scale/ma/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/ma/0.01_Cent",0,-100,100,1); offsetMa = 11.73 + hslider("Common_Parameters/12_Note_Scale/Ma/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Ma/0.01_Cent",0,-100,100,1); offsetPa = 1.96 + hslider("Common_Parameters/12_Note_Scale/Pa/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Pa/0.01_Cent",0,-100,100,1); offsetdha = -7.82 + hslider("Common_Parameters/12_Note_Scale/dha/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/dha/0.01_Cent",0,-100,100,1); offsetDha = 5.87 + hslider("Common_Parameters/12_Note_Scale/Dha/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Dha/0.01_Cent",0,-100,100,1); offsetni = -3.91 + hslider("Common_Parameters/12_Note_Scale/ni/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/ni/0.01_Cent",0,-100,100,1); offsetNi = 9.78 + hslider("Common_Parameters/12_Note_Scale/Ni/Cent",0,-220,220,1) + 0.01*hslider("Common_Parameters/12_Note_Scale/Ni/0.01_Cent",0,-100,100,1); noteOffset = offsetSa,offsetre,offsetRe,offsetga,offsetGa,offsetma,offsetMa,offsetPa,offsetdha,offsetDha,offsetni,offsetNi : ba.selectn(12,noteId); realFreq = bend*freq*(2^(noteOffset/1200))*(2^(fineTune/1200)); String1Tone(f,g) = StringModel(pm.f2l(f*(1+variance)),0.63,10*StringPluck,0.7,0,40) + StringModel(pm.f2l(f*(1-variance)),0.63,10*StringPluck,0.7,0,40) : *(StringEnv) with { variance = hslider("[00]Variance",2,0,4,0.1)/10000; StringPluck = en.adsr(0.00001,cperiod*0.7,0.9,cperiod*0.3,g); StringEnv = en.adsr(0.0001,cperiod*0.6,0.5,cperiod*0.5,g); StringModel(length,pluckPosition,excitation,brightness,damping,stiffness) = 0.1*pm.endChain(egChain) with{ openStringPick(length,stiffness,pluckPosition,excitation) = strChain with{ dispersionFilters = par(i,2,si.smooth(stiffness)),_; maxStringLength = 6; strChain = pm.chain( pm.stringSegment(maxStringLength,nti) : pm.in(excitation) : pm.out : dispersionFilters : pm.stringSegment(maxStringLength,itb) ); }; lengthTuning = 14*pm.speedOfSound/ma.SR; stringL = length-lengthTuning; egChain = pm.chain( pm.lStringRigidTermination : openStringPick(stringL,stiffness/1000,pluckPosition,excitation) : pm.rTermination(pm.basicBlock,(-1)*pm.bridgeFilter(brightness,damping)) ); }; }; process = String1Tone(realFreq,gate)*gain*gate : fi.lowpass(3,4000) <: _,_; effect = dm.zita_light;
c4ff6f577bfc05093d7a4de848871f38f03086cfebc1f349a54d5e639fdd149c
ossia/score-user-library
cryBaby.dsp
declare name "cryBaby"; declare description "Application demonstrating the CryBaby wah pedal emulation"; import("stdfaust.lib"); process = dm.crybaby_demo;
https://raw.githubusercontent.com/ossia/score-user-library/1de4c36f179105f1728e72b02e96f68d1c9130c2/Presets/Faust/filtering/cryBaby.dsp
faust
declare name "cryBaby"; declare description "Application demonstrating the CryBaby wah pedal emulation"; import("stdfaust.lib"); process = dm.crybaby_demo;
7b2210fdaa6c5c322265070cbb1f2eac0f74f5b990fdad6f78479cf5317e785c
ossia/score-user-library
parametricEqualizer.dsp
declare name "parametricEqualizer"; declare description "Exercise and compare Parametric Equalizer sections on test signals"; import("stdfaust.lib"); process = dm.parametric_eq_demo;
https://raw.githubusercontent.com/ossia/score-user-library/1de4c36f179105f1728e72b02e96f68d1c9130c2/Presets/Faust/filtering/parametricEqualizer.dsp
faust
declare name "parametricEqualizer"; declare description "Exercise and compare Parametric Equalizer sections on test signals"; import("stdfaust.lib"); process = dm.parametric_eq_demo;
e71900fc412def3651c6fc72a5528a5b34aaa4a956b45432503e210d828b16ee
hatchjaw/teensy-wfs
WFS.dsp
declare name "Distributed WFS"; declare description "Basic WFS for a distributed setup consisting of modules that each handle two output channels."; import("stdfaust.lib"); import("WFS_Params.lib"); // Set which speakers to control. moduleID = hslider("moduleID", 0, 0, (N_SPEAKERS / SPEAKERS_PER_MODULE) - 1, 1); // Simulate distance by changing gain and applying a lowpass as a function // of distance distanceSim(distance) = *(dGain) : fi.lowpass(2, fc) with{ // Use inverse square law; I_2/I_1 = (d_1/d_2)^2 // Assume sensible listening distance of 5 m from array. i1 = 1.; // Intensity 1... d1 = 5.; // ...at distance 5 m d2 = d1 + distance; i2 = i1 * (d1/d2)^2; // dGain = i2; // dGain = (MAX_Y_DIST - distance*.5)/(MAX_Y_DIST); fc = dGain*15000 + 5000; }; // Create a speaker array *perspective* for one source // i.e. give each source a distance simulation and a delay // relative to each speaker. speakerArray(x, y) = _ <: par(i, SPEAKERS_PER_MODULE, distanceSim(hypotenuse(i)) : de.fdelay(MAX_DELAY, smallDelay(i))) with{ // y (front-to-back) is always just y, the longitudinal // distance of the source from the array. // Get x between the source and specific speaker in the array // E.g. for 16 speakers (8 modules), with a spacing, s, of .25 m, // array width, w = (16-1)*.25 = 3.75, // let module m = 2 (third module in array) // let speaker j = 0 (first speaker in module) // let x = 2.25 (m, relative to left edge of array) // cx = x - s*(m*2 + j) // = 2.25 - .25*(2*2 + 0) // = 1.25 // // let m = 7, j = 1, x = 2.25 // cx = 2.25 - .25*(7*2 + 1) = -1.5 // // let m = 0, j = 0, x = 2.25 // cx = 2.25 - .25*(0*2 + 0) = 2.25 cathetusX(k) = x - (SPEAKER_DIST*(k + moduleID*2)); hypotenuse(j) = cathetusX(j)^2 + y^2 : sqrt; smallDelay(j) = (hypotenuse(j) - y)*SAMPLES_PER_METRE; }; // Take each source... sourcesArray(s) = par(i, ba.count(s), ba.take(i + 1, s) : // ...and distribute it across the speaker array for this module. speakerArray(x(i), y(i))) // Merge onto the output speakers. :> par(i, SPEAKERS_PER_MODULE, _) with{ // Use normalised input co-ordinate space; scale to dimensions. // X position lies on the width of the speaker array // x(p) = hslider("%p/x", 0, 0, 1, 0.001) : si.smoo : *(SPEAKER_DIST*N_SPEAKERS); x(p) = hslider("%p/x", 0, 0, 1, 0.001) : *(SPEAKER_DIST*N_SPEAKERS); // Y position is from zero (on the array) to a quasi-arbitrary maximum. // y(p) = hslider("%p/y", 0, 0, 1, 0.001) : si.smoo : *(MAX_Y_DIST); y(p) = hslider("%p/y", 0, 0, 1, 0.001) : *(MAX_Y_DIST); }; // Distribute input channels (i.e. sources) across the sources array. process = sourcesArray(par(i, N_SOURCES, _));
https://raw.githubusercontent.com/hatchjaw/teensy-wfs/9d3a67f5bf9d5c26f4b7a389eb912ae7f2542269/src/faust/WFS.dsp
faust
Set which speakers to control. Simulate distance by changing gain and applying a lowpass as a function of distance Use inverse square law; I_2/I_1 = (d_1/d_2)^2 Assume sensible listening distance of 5 m from array. Intensity 1... ...at distance 5 m dGain = (MAX_Y_DIST - distance*.5)/(MAX_Y_DIST); Create a speaker array *perspective* for one source i.e. give each source a distance simulation and a delay relative to each speaker. y (front-to-back) is always just y, the longitudinal distance of the source from the array. Get x between the source and specific speaker in the array E.g. for 16 speakers (8 modules), with a spacing, s, of .25 m, array width, w = (16-1)*.25 = 3.75, let module m = 2 (third module in array) let speaker j = 0 (first speaker in module) let x = 2.25 (m, relative to left edge of array) cx = x - s*(m*2 + j) = 2.25 - .25*(2*2 + 0) = 1.25 let m = 7, j = 1, x = 2.25 cx = 2.25 - .25*(7*2 + 1) = -1.5 let m = 0, j = 0, x = 2.25 cx = 2.25 - .25*(0*2 + 0) = 2.25 Take each source... ...and distribute it across the speaker array for this module. Merge onto the output speakers. Use normalised input co-ordinate space; scale to dimensions. X position lies on the width of the speaker array x(p) = hslider("%p/x", 0, 0, 1, 0.001) : si.smoo : *(SPEAKER_DIST*N_SPEAKERS); Y position is from zero (on the array) to a quasi-arbitrary maximum. y(p) = hslider("%p/y", 0, 0, 1, 0.001) : si.smoo : *(MAX_Y_DIST); Distribute input channels (i.e. sources) across the sources array.
declare name "Distributed WFS"; declare description "Basic WFS for a distributed setup consisting of modules that each handle two output channels."; import("stdfaust.lib"); import("WFS_Params.lib"); moduleID = hslider("moduleID", 0, 0, (N_SPEAKERS / SPEAKERS_PER_MODULE) - 1, 1); distanceSim(distance) = *(dGain) : fi.lowpass(2, fc) with{ d2 = d1 + distance; dGain = i2; fc = dGain*15000 + 5000; }; speakerArray(x, y) = _ <: par(i, SPEAKERS_PER_MODULE, distanceSim(hypotenuse(i)) : de.fdelay(MAX_DELAY, smallDelay(i))) with{ cathetusX(k) = x - (SPEAKER_DIST*(k + moduleID*2)); hypotenuse(j) = cathetusX(j)^2 + y^2 : sqrt; smallDelay(j) = (hypotenuse(j) - y)*SAMPLES_PER_METRE; }; sourcesArray(s) = par(i, ba.count(s), ba.take(i + 1, s) : speakerArray(x(i), y(i))) :> par(i, SPEAKERS_PER_MODULE, _) with{ x(p) = hslider("%p/x", 0, 0, 1, 0.001) : *(SPEAKER_DIST*N_SPEAKERS); y(p) = hslider("%p/y", 0, 0, 1, 0.001) : *(MAX_Y_DIST); }; process = sourcesArray(par(i, N_SOURCES, _));
ed877654488508b6aa7a418acbca4c4b88266764834728535cf9107d7feffe06
hatchjaw/springamajig
SpringGrain.dsp
import("stdfaust.lib"); NUMGRAINS = 10; MAXGRAINDURATION = .75; TSIZE = 48000 * 2; grainStart = hslider("Grain start", 754, 0, TSIZE, 1 ); grainSize = hslider("Grain length (s)", .001, .001, MAXGRAINDURATION, .001); grainSpeed = hslider("Grain speed",1, -3, 3, 0.01); grainDensity = hslider("Grain density", 2, .1, 25, .1); grainRegularity = hslider("Rhythm", 0, 0, 1, 0.01); freezeWrite = checkbox("Freeze"); // Envelopes for gating grains //------------------------------------------------------------ envTri(d, t) = en.ar(d/2, d/2, t); //------------------------------------------------------------ envSin(d, t) = (envTri(d, t)*ma.PI/2) : sin; //------------------------------------------------------------ envSqrt(d, t) = envTri(d, t) : sqrt; //------------------------------------------------------------ envHann(d, t) = (1-cos(ma.PI*envTri(d, t)))/2; // Modulo that handles negative numbers modulo(b, a) = a : %(b) : +(b) : %(b); //-------------`(sparsePeriodicTrigger)`----------------- // Emits +1 impulses ("trigger events") at an average frequency, // with the distribution adjustable from purely periodic to purely random. // // ### Usage // ``` // sparsePeriodicTrigger(f0, periodicity, pnoise) : _ // ``` // // Where: // // * `f0`: average number of triggers per second. // * `periodicity`: coefficient of distribution noise. 0 <= periodicity <= 1. 0 = random distribution, 1 = regularly spaced pulses. // * `pnoise`: random source of probability. Pure white noise is good. // // Courtesy of https://github.com/myklemykle/weather_organ/blob/master/weatherorgan.dsp //---------------------------- sparsePeriodicTrigger(f0, periodicity, noise) = ( +(rate) // add the rate; <: _, >=(1) // if greater than 1 ... : _, *(1+w*noise) : - // ... subtract 1+(w*noise) ) ~ _ <: _, _' : < // emit 1 if the value decreased, 0 otherwise. with { w = max(0, min(1, 1 - periodicity)); rate = f0/ma.SR; }; sparseTrigger(noiseIndex) = sparsePeriodicTrigger(grainDensity, grainRegularity, no.noises(NUMGRAINS, noiseIndex)); // A grain generator is a lookup table of samples. grain(trigger, instance, signal) = rwtable(TSIZE, 0., int(writeIndex), signal, int(readIndex)) // It is windowed. : *(envHann(duration, trigger)) with { duration = grainSize; // Constantly write input to the table... writePos = _ ~ +(1) : %(TSIZE); // ...unless 'Freeze' is true. writeIndex = ba.if(freezeWrite, 0, writePos); // Convert grain size from seconds to samples grainLengthSamps = duration * ma.SR; // The clock starts when the trigger is not zero, and counts down for the length of the grain. clock = max(grainLengthSamps * (trigger != 0)) ~ (-(1) : max(0)); // Prevent retriggering while the clock is running. // uniqueTrigger = ba.if(clock == 0, trigger, 0); // Constantly update the read position, within the bounds of the grain size and table size... // Set a per-lookup offset. grainOffset = int(instance*TSIZE/NUMGRAINS); // Add a bit of inter-grain wobble to the sample increment. sampleIncrement = grainSpeed * (1 + (instance - (NUMGRAINS/2))/85); readPos = _ ~ +(sampleIncrement) : modulo(grainSize * ma.SR) : +(grainStart) : +(grainOffset) : modulo(TSIZE); // ...but only update the read poisition if the clock is running. readIndex = ba.if(clock > 0, readPos, 0); }; process = _ <: par(i, NUMGRAINS, grain(sparseTrigger(i), i)) :> _;
https://raw.githubusercontent.com/hatchjaw/springamajig/e6e350531b7988deb7bff987d589c87c3a59513a/faust/SpringGrain.dsp
faust
Envelopes for gating grains ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ Modulo that handles negative numbers -------------`(sparsePeriodicTrigger)`----------------- Emits +1 impulses ("trigger events") at an average frequency, with the distribution adjustable from purely periodic to purely random. ### Usage ``` sparsePeriodicTrigger(f0, periodicity, pnoise) : _ ``` Where: * `f0`: average number of triggers per second. * `periodicity`: coefficient of distribution noise. 0 <= periodicity <= 1. 0 = random distribution, 1 = regularly spaced pulses. * `pnoise`: random source of probability. Pure white noise is good. Courtesy of https://github.com/myklemykle/weather_organ/blob/master/weatherorgan.dsp ---------------------------- add the rate; if greater than 1 ... ... subtract 1+(w*noise) emit 1 if the value decreased, 0 otherwise. A grain generator is a lookup table of samples. It is windowed. Constantly write input to the table... ...unless 'Freeze' is true. Convert grain size from seconds to samples The clock starts when the trigger is not zero, and counts down for the length of the grain. Prevent retriggering while the clock is running. uniqueTrigger = ba.if(clock == 0, trigger, 0); Constantly update the read position, within the bounds of the grain size and table size... Set a per-lookup offset. Add a bit of inter-grain wobble to the sample increment. ...but only update the read poisition if the clock is running.
import("stdfaust.lib"); NUMGRAINS = 10; MAXGRAINDURATION = .75; TSIZE = 48000 * 2; grainStart = hslider("Grain start", 754, 0, TSIZE, 1 ); grainSize = hslider("Grain length (s)", .001, .001, MAXGRAINDURATION, .001); grainSpeed = hslider("Grain speed",1, -3, 3, 0.01); grainDensity = hslider("Grain density", 2, .1, 25, .1); grainRegularity = hslider("Rhythm", 0, 0, 1, 0.01); freezeWrite = checkbox("Freeze"); envTri(d, t) = en.ar(d/2, d/2, t); envSin(d, t) = (envTri(d, t)*ma.PI/2) : sin; envSqrt(d, t) = envTri(d, t) : sqrt; envHann(d, t) = (1-cos(ma.PI*envTri(d, t)))/2; modulo(b, a) = a : %(b) : +(b) : %(b); sparsePeriodicTrigger(f0, periodicity, noise) = ( ) ~ _ with { w = max(0, min(1, 1 - periodicity)); rate = f0/ma.SR; }; sparseTrigger(noiseIndex) = sparsePeriodicTrigger(grainDensity, grainRegularity, no.noises(NUMGRAINS, noiseIndex)); grain(trigger, instance, signal) = rwtable(TSIZE, 0., int(writeIndex), signal, int(readIndex)) : *(envHann(duration, trigger)) with { duration = grainSize; writePos = _ ~ +(1) : %(TSIZE); writeIndex = ba.if(freezeWrite, 0, writePos); grainLengthSamps = duration * ma.SR; clock = max(grainLengthSamps * (trigger != 0)) ~ (-(1) : max(0)); grainOffset = int(instance*TSIZE/NUMGRAINS); sampleIncrement = grainSpeed * (1 + (instance - (NUMGRAINS/2))/85); readPos = _ ~ +(sampleIncrement) : modulo(grainSize * ma.SR) : +(grainStart) : +(grainOffset) : modulo(TSIZE); readIndex = ba.if(clock > 0, readPos, 0); }; process = _ <: par(i, NUMGRAINS, grain(sparseTrigger(i), i)) :> _;
d20268953ea88e5487dfe56e883f10394a205933be96177c2923bd4b275f603b
agraef/pd-remote
amp.dsp
/* Stereo amplifier stage with bass, treble, gain and balance controls and a dB meter. */ declare name "amp"; declare description "stereo amplifier stage"; declare author "Albert Graef"; declare version "2.0"; import("stdfaust.lib"); /* Fixed bass and treble frequencies. You might want to tune these for your setup. */ bass_freq = 300; treble_freq = 1200; /* Smoothing (lowpass) filter from signals.lib. We use this for the gain and balance controls to avoid zipper noise. */ smooth = si.smooth(0.99); /* Bass and treble gain controls in dB. The range of +/-20 corresponds to a boost/cut factor of 10. */ bass_gain = nentry("[1] bass [midi:ctrl 16] [unit:dB]", 0, -20, 20, 0.1); treble_gain = nentry("[2] treble [midi:ctrl 17] [unit:dB]", 0, -20, 20, 0.1); /* Gain and balance controls. */ gain = smooth(ba.db2linear(g)) with { g = nentry("[3] gain [midi:ctrl 7] [unit:dB]", 0, -60, 10, 0.1); }; bal = smooth(b) with { b = hslider("balance [midi:ctrl 8]", 0, -1, 1, 0.001); }; /* Balance a stereo signal using the constant power pan rule. Note that this will attenuate the signal by 3 dB in the center position. If you prefer, you can just apply a makeup gain of sqrt(2) to have unity gain in the center position, but this will also boost the signal by the same amount (possibly causing distortion) when panning hard left or right. */ balance = *(l), *(r) with { p = ma.PI*(bal+1)/4; l = cos(p); r = sin(p); }; /* Generic biquad filter. */ filter(b0,b1,b2,a0,a1,a2) = f : (+ ~ g) with { f(x) = (b0/a0)*x+(b1/a0)*x'+(b2/a0)*x''; g(y) = 0-(a1/a0)*y-(a2/a0)*y'; }; /* Low and high shelf filters, straight from Robert Bristow-Johnson's "Audio EQ Cookbook", see http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt. f0 is the shelf midpoint frequency, g the desired gain in dB. S is the shelf slope parameter, we always set that to 1 here. */ low_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2) with { S = 1; A = pow(10,g/40); w0 = 2*ma.PI*f0/ma.SR; alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 ); b0 = A*( (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha ); b1 = 2*A*( (A-1) - (A+1)*cos(w0) ); b2 = A*( (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha ); a0 = (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha; a1 = -2*( (A-1) + (A+1)*cos(w0) ); a2 = (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha; }; high_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2) with { S = 1; A = pow(10,g/40); w0 = 2*ma.PI*f0/ma.SR; alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 ); b0 = A*( (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha ); b1 = -2*A*( (A-1) + (A+1)*cos(w0) ); b2 = A*( (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha ); a0 = (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha; a1 = 2*( (A-1) - (A+1)*cos(w0) ); a2 = (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha; }; /* The tone control. We simply run a low and a high shelf in series here. */ tone = low_shelf(bass_freq,bass_gain) : high_shelf(treble_freq,treble_gain); /* Envelop follower. This is basically a 1 pole LP with configurable attack/ release time. The result is converted to dB. You have to set the desired attack/release time in seconds using the t parameter below. */ t = 0.1; // attack/release time in seconds g = exp(-1/(ma.SR*t)); // corresponding gain factor env = abs : *(1-g) : + ~ *(g) : ba.linear2db; /* Use this if you want the RMS instead. Note that this doesn't really calculate an RMS value (you'd need an FIR for that), but in practice our simple 1 pole IIR filter works just as well. */ rms = sqr : *(1-g) : + ~ *(g) : sqrt : ba.linear2db; sqr(x) = x*x; /* The dB meters for left and right channel. These are passive controls. */ left_meter(x) = attach(x, env(x) : hbargraph("left [midi:ctrl 18] [osc:/left -60 10] [unit:dB]", -60, 10)); right_meter(x) = attach(x, env(x) : hbargraph("right [midi:ctrl 19] [osc:/right -60 10] [unit:dB]", -60, 10)); /* The main program. */ process = hgroup("[1]", (tone, tone) : (_*gain, _*gain)) : vgroup("[2]", balance) : vgroup("[3]", (left_meter, right_meter));
https://raw.githubusercontent.com/agraef/pd-remote/4fede0b70ac5f9544a783dd45ddcf4643a29bc63/examples/dsp/amp.dsp
faust
Stereo amplifier stage with bass, treble, gain and balance controls and a dB meter. Fixed bass and treble frequencies. You might want to tune these for your setup. Smoothing (lowpass) filter from signals.lib. We use this for the gain and balance controls to avoid zipper noise. Bass and treble gain controls in dB. The range of +/-20 corresponds to a boost/cut factor of 10. Gain and balance controls. Balance a stereo signal using the constant power pan rule. Note that this will attenuate the signal by 3 dB in the center position. If you prefer, you can just apply a makeup gain of sqrt(2) to have unity gain in the center position, but this will also boost the signal by the same amount (possibly causing distortion) when panning hard left or right. Generic biquad filter. Low and high shelf filters, straight from Robert Bristow-Johnson's "Audio EQ Cookbook", see http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt. f0 is the shelf midpoint frequency, g the desired gain in dB. S is the shelf slope parameter, we always set that to 1 here. The tone control. We simply run a low and a high shelf in series here. Envelop follower. This is basically a 1 pole LP with configurable attack/ release time. The result is converted to dB. You have to set the desired attack/release time in seconds using the t parameter below. attack/release time in seconds corresponding gain factor Use this if you want the RMS instead. Note that this doesn't really calculate an RMS value (you'd need an FIR for that), but in practice our simple 1 pole IIR filter works just as well. The dB meters for left and right channel. These are passive controls. The main program.
declare name "amp"; declare description "stereo amplifier stage"; declare author "Albert Graef"; declare version "2.0"; import("stdfaust.lib"); bass_freq = 300; treble_freq = 1200; smooth = si.smooth(0.99); bass_gain = nentry("[1] bass [midi:ctrl 16] [unit:dB]", 0, -20, 20, 0.1); treble_gain = nentry("[2] treble [midi:ctrl 17] [unit:dB]", 0, -20, 20, 0.1); gain = smooth(ba.db2linear(g)) with { g = nentry("[3] gain [midi:ctrl 7] [unit:dB]", 0, -60, 10, 0.1); }; bal = smooth(b) with { b = hslider("balance [midi:ctrl 8]", 0, -1, 1, 0.001); }; balance = *(l), *(r) with { p = ma.PI*(bal+1)/4; l = cos(p); r = sin(p); }; filter(b0,b1,b2,a0,a1,a2) = f : (+ ~ g) with { f(x) = (b0/a0)*x+(b1/a0)*x'+(b2/a0)*x''; g(y) = 0-(a1/a0)*y-(a2/a0)*y'; }; low_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2) with { S = 1; A = pow(10,g/40); w0 = 2*ma.PI*f0/ma.SR; alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 ); b0 = A*( (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha ); b1 = 2*A*( (A-1) - (A+1)*cos(w0) ); b2 = A*( (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha ); a0 = (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha; a1 = -2*( (A-1) + (A+1)*cos(w0) ); a2 = (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha; }; high_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2) with { S = 1; A = pow(10,g/40); w0 = 2*ma.PI*f0/ma.SR; alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 ); b0 = A*( (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha ); b1 = -2*A*( (A-1) + (A+1)*cos(w0) ); b2 = A*( (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha ); a0 = (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha; a1 = 2*( (A-1) - (A+1)*cos(w0) ); a2 = (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha; }; tone = low_shelf(bass_freq,bass_gain) : high_shelf(treble_freq,treble_gain); env = abs : *(1-g) : + ~ *(g) : ba.linear2db; rms = sqr : *(1-g) : + ~ *(g) : sqrt : ba.linear2db; sqr(x) = x*x; left_meter(x) = attach(x, env(x) : hbargraph("left [midi:ctrl 18] [osc:/left -60 10] [unit:dB]", -60, 10)); right_meter(x) = attach(x, env(x) : hbargraph("right [midi:ctrl 19] [osc:/right -60 10] [unit:dB]", -60, 10)); process = hgroup("[1]", (tone, tone) : (_*gain, _*gain)) : vgroup("[2]", balance) : vgroup("[3]", (left_meter, right_meter));
3d597511b3ed2c80d54a2f7d684fc0560a93380b310a18a3afddd3509be66cb7
tonal-glyph/faustus
tp0.dsp
import("stdfaust.lib"); process = 0,_~+(1):soundfile("son[url:{'tango.wav'}]",2):!,!,_,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/tests/soundfile/tp0.dsp
faust
import("stdfaust.lib"); process = 0,_~+(1):soundfile("son[url:{'tango.wav'}]",2):!,!,_,_;
00492b9697017118c2edd8dfd20b50619398ae6d38e51e752a959518fc129089
tonal-glyph/faustus
filterBank.dsp
declare name "filterBank"; declare description "Graphic Equalizer consisting of a filter-bank driving a bank of faders"; import("stdfaust.lib"); process = dm.filterbank_demo;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/filtering/filterBank.dsp
faust
declare name "filterBank"; declare description "Graphic Equalizer consisting of a filter-bank driving a bank of faders"; import("stdfaust.lib"); process = dm.filterbank_demo;
008139be97257f7bd5e555d5a4896eb1bf8e017bc1a33ec25550c91a6358ac0c
tonal-glyph/faustus
wahPedal.dsp
declare name "wahPedal"; declare description "Demonstrate the Fourth-Order Wah pedal (similar to the Moog VCF)"; import("stdfaust.lib"); process = dm.wah4_demo;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/filtering/wahPedal.dsp
faust
declare name "wahPedal"; declare description "Demonstrate the Fourth-Order Wah pedal (similar to the Moog VCF)"; import("stdfaust.lib"); process = dm.wah4_demo;
ac90eb891cfde62e2c62f07c0383dac3b17416dba0275170c19270bc571df3d9
tonal-glyph/faustus
spectralTilt.dsp
declare name "spectralTilt"; declare description "Demonstrate the Spectral Tilt effect on test signals"; import("stdfaust.lib"); O = 2; // filter order process = dm.spectral_tilt_demo(2);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/filtering/spectralTilt.dsp
faust
filter order
declare name "spectralTilt"; declare description "Demonstrate the Spectral Tilt effect on test signals"; import("stdfaust.lib"); process = dm.spectral_tilt_demo(2);
09423aa851e966a347fcd8213828efb2f145fce8ecd4342ff4586fb1d5eba895
tonal-glyph/faustus
effects.dsp
// All effects used by minimoog.dsp import("stdfaust.lib"); import("layout2.dsp"); process = _,_ : + : component("echo.dsp") : component("flanger.dsp") : component("chorus.dsp") : component("freeverb.dsp");
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/effects/effects.dsp
faust
All effects used by minimoog.dsp
import("stdfaust.lib"); import("layout2.dsp"); process = _,_ : + : component("echo.dsp") : component("flanger.dsp") : component("chorus.dsp") : component("freeverb.dsp");
e1bd3c704e2a49218db2dcab7f9a96a6c2bb40c7f89bba1e5f27eb2f84e8a277
tonal-glyph/faustus
flute.dsp
declare name "Flute"; declare description "Simple flute physical model with physical parameters."; declare license "MIT"; declare copyright "(c)Romain Michon, CCRMA (Stanford University), GRAME"; import("stdfaust.lib"); process = pm.flute_ui <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/physicalModeling/flute.dsp
faust
declare name "Flute"; declare description "Simple flute physical model with physical parameters."; declare license "MIT"; declare copyright "(c)Romain Michon, CCRMA (Stanford University), GRAME"; import("stdfaust.lib"); process = pm.flute_ui <: _,_;
752974d9cc112ca78663c2de3e24fb64a3846ad29b2b7222d8f665d9989acab7
tonal-glyph/faustus
clarinet.dsp
declare name "Clarinet"; declare description "Simple clarinet physical model with physical parameters."; declare license "MIT"; declare copyright "(c)Romain Michon, CCRMA (Stanford University), GRAME"; import("stdfaust.lib"); process = pm.clarinet_ui <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/physicalModeling/clarinet.dsp
faust
declare name "Clarinet"; declare description "Simple clarinet physical model with physical parameters."; declare license "MIT"; declare copyright "(c)Romain Michon, CCRMA (Stanford University), GRAME"; import("stdfaust.lib"); process = pm.clarinet_ui <: _,_;
f3f0354b24c5f289c5695f1e9082a476c9cbc5247c8c260f98349a085ea4b09a
tonal-glyph/faustus
volume.dsp
//--------------------------------------------------------- // Volume control in dB with MIDI control (CC-1, modWheel) //--------------------------------------------------------- import("stdfaust.lib"); gain = vslider("Volume[midi:ctrl 2] [tooltip CC-1]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo; process = _,_: *(gain), *(gain);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/volume/volume.dsp
faust
--------------------------------------------------------- Volume control in dB with MIDI control (CC-1, modWheel) ---------------------------------------------------------
import("stdfaust.lib"); gain = vslider("Volume[midi:ctrl 2] [tooltip CC-1]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo; process = _,_: *(gain), *(gain);
4809b2fe432a5d026d4f61ba8a9545ac00ab3bc5a16bb6ed3c5aa8c35f7f9e34
tonal-glyph/faustus
sine_synth.dsp
// tosc.dsp - test simple oscillator + MIDI bindings import("stdfaust.lib"); process = g * a * os.oscrs(f*b) <: _,_; a = hslider("gain [midi:ctrl 7]",1,0,1,0.001); f = hslider("freq",392.0,200.0,450.0,0.01); b = hslider("bend [midi:pitchwheel]",1,0.1,10,0.001); g = button("gate");
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/sine_synth/sine_synth.dsp
faust
tosc.dsp - test simple oscillator + MIDI bindings
import("stdfaust.lib"); process = g * a * os.oscrs(f*b) <: _,_; a = hslider("gain [midi:ctrl 7]",1,0,1,0.001); f = hslider("freq",392.0,200.0,450.0,0.01); b = hslider("bend [midi:pitchwheel]",1,0.1,10,0.001); g = button("gate");
2ac67558ab40c4efc1acf32effdedd45380fb676790bdc31e593791108332b35
tonal-glyph/faustus
virtualAnalogLab.dsp
declare name "virtualAnalogLab"; import("stdfaust.lib"); process = vgroup("[1]", dm.virtual_analog_oscillator_demo) : vgroup("[2]", dm.moog_vcf_demo) : vgroup("[3]", dm.spectral_level_demo) // See also: vgroup("[3]", dm.fft_spectral_level_demo(32)) <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/generator/virtualAnalogLab.dsp
faust
See also: vgroup("[3]", dm.fft_spectral_level_demo(32))
declare name "virtualAnalogLab"; import("stdfaust.lib"); process = vgroup("[1]", dm.virtual_analog_oscillator_demo) : vgroup("[2]", dm.moog_vcf_demo) : vgroup("[3]", dm.spectral_level_demo) <: _,_;
90f793ac2bdb9e9d6e9967b76ff7a4256cf19d838c1db11b805bc0f56ce717d2
tonal-glyph/faustus
filteredSawtooth.dsp
import("stdfaust.lib"); freq = nentry("freq",50,200,1000,0.01) ; gain = nentry("gain",0.5,0,1,0.01) : si.smoo; gate = button("gate") : si.smoo; cutoff = nentry("cutoff",10000,50,10000,0.01) : si.smoo; process = os.sawtooth(freq)*gain*gate : fi.lowpass(3,cutoff) <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/documentation/faust-manual/misc/juce/filteredSawtooth.dsp
faust
import("stdfaust.lib"); freq = nentry("freq",50,200,1000,0.01) ; gain = nentry("gain",0.5,0,1,0.01) : si.smoo; gate = button("gate") : si.smoo; cutoff = nentry("cutoff",10000,50,10000,0.01) : si.smoo; process = os.sawtooth(freq)*gain*gate : fi.lowpass(3,cutoff) <: _,_;
a5d16294274fc10d2941c4a963a0252e740fee5080005badecd4bff431acfbc9
tonal-glyph/faustus
reverbDesigner.dsp
declare name "reverbDesigner"; import("stdfaust.lib"); N = 16; // Feedback Delay Network (FDN) order (power of 2, 2 to 16) NB = 5; // Number of T60-controlled frequency-bands (3 or more) BSO = 3; // Order of each lowpass/highpass bandsplit (odd positive integer) process = dm.fdnrev0_demo(N,NB,BSO);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/reverb/reverbDesigner.dsp
faust
Feedback Delay Network (FDN) order (power of 2, 2 to 16) Number of T60-controlled frequency-bands (3 or more) Order of each lowpass/highpass bandsplit (odd positive integer)
declare name "reverbDesigner"; import("stdfaust.lib"); process = dm.fdnrev0_demo(N,NB,BSO);
781e9af137503075b79bdbe210e5b44cb0f17c5b009bc7a88a09403a68268fb5
tonal-glyph/faustus
graphicEqLab.dsp
declare name "graphicEqLab"; declare description "Signal generators through a filter bank with spectrum analysis display"; import("stdfaust.lib"); process = // ol.sawtooth_demo : fl.filterbank_demo : fl.spectral_level_demo <: _,_; vgroup("[1]",dm.sawtooth_demo) : vgroup("[2]",dm.filterbank_demo) : vgroup("[3]",dm.spectral_level_demo) <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/filtering/graphicEqLab.dsp
faust
ol.sawtooth_demo : fl.filterbank_demo : fl.spectral_level_demo <: _,_;
declare name "graphicEqLab"; declare description "Signal generators through a filter bank with spectrum analysis display"; import("stdfaust.lib"); process = vgroup("[1]",dm.sawtooth_demo) : vgroup("[2]",dm.filterbank_demo) : vgroup("[3]",dm.spectral_level_demo) <: _,_;
d37f31515cf4cb46e8cb4957a00ca5b7943634932ef198a4eb85712ae5e2cc49
tonal-glyph/faustus
sawtooth_synth.dsp
import("stdfaust.lib"); normMIDI(mv) = mv/127.0; vol = normMIDI(hslider("Ctrl Value IN (Ctrl 1) [midi:ctrl 1]", 60, 0, 127, 1)) ; f = nentry("freq",200,40,2000,0.01); bend = nentry("bend",1,0,10,0.01) : si.polySmooth(t,0.999,1); g = nentry("gain",1,0,1,0.01); t = button("gate"); freq = f*bend; envelope = t*g*vol : si.smoo; process = os.sawtooth(freq)*envelope <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/sawtooth_synth/sawtooth_synth.dsp
faust
import("stdfaust.lib"); normMIDI(mv) = mv/127.0; vol = normMIDI(hslider("Ctrl Value IN (Ctrl 1) [midi:ctrl 1]", 60, 0, 127, 1)) ; f = nentry("freq",200,40,2000,0.01); bend = nentry("bend",1,0,10,0.01) : si.polySmooth(t,0.999,1); g = nentry("gain",1,0,1,0.01); t = button("gate"); freq = f*bend; envelope = t*g*vol : si.smoo; process = os.sawtooth(freq)*envelope <: _,_;
9a811666c849d5057ad5f51f8e743d6237469d6641717b656d2154490ee6677a
tonal-glyph/faustus
parametricEqLab.dsp
declare name "parametricEqLab"; declare description "Demonstrate the Parametric Equalizer sections on test signals with spectrum analysis display"; import("stdfaust.lib"); //process = ol.sawtooth_demo : fl.parametric_eq_demo : // fl.mth_octave_spectral_level_demo(2) <: _,_; process = vgroup("[1]", dm.sawtooth_demo) : vgroup("[2]", dm.parametric_eq_demo) : vgroup("[3]", dm.mth_octave_spectral_level_demo(2)) <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/filtering/parametricEqLab.dsp
faust
process = ol.sawtooth_demo : fl.parametric_eq_demo : fl.mth_octave_spectral_level_demo(2) <: _,_;
declare name "parametricEqLab"; declare description "Demonstrate the Parametric Equalizer sections on test signals with spectrum analysis display"; import("stdfaust.lib"); process = vgroup("[1]", dm.sawtooth_demo) : vgroup("[2]", dm.parametric_eq_demo) : vgroup("[3]", dm.mth_octave_spectral_level_demo(2)) <: _,_;
796fb0888ad0640692cca2b624ba966caa62d5fe5b23320ecc322b40d7740eb2
tonal-glyph/faustus
rain.dsp
//----------------------`rain`-------------------------- // A very simple rain simulator // // #### Usage // // ``` // rain(d,l) : _,_ // ``` // // Where: // // * `d`: is the density of the rain: between 0 and 1 // * `l`: is the level (volume) of the rain: between 0 and 1 // //---------------------------------------------------------- import("stdfaust.lib"); rain(density,level) = no.multinoise(2) : par(i, 2, drop) : par(i, 2, *(level)) with { drop = _ <: @(1), (abs < density) : *; }; process = rain ( hslider("v:rain/density", 300, 0, 1000, 1) / 1000, hslider("v:rain/volume", 0.5, 0, 1, 0.01) );
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/gameaudio/rain.dsp
faust
----------------------`rain`-------------------------- A very simple rain simulator #### Usage ``` rain(d,l) : _,_ ``` Where: * `d`: is the density of the rain: between 0 and 1 * `l`: is the level (volume) of the rain: between 0 and 1 ----------------------------------------------------------
import("stdfaust.lib"); rain(density,level) = no.multinoise(2) : par(i, 2, drop) : par(i, 2, *(level)) with { drop = _ <: @(1), (abs < density) : *; }; process = rain ( hslider("v:rain/density", 300, 0, 1000, 1) / 1000, hslider("v:rain/volume", 0.5, 0, 1, 0.01) );
f7b0f9d346cc946fe8b7ac920d2d87155e7b9fd9d25b253242f9c2265189259a
tonal-glyph/faustus
vcfWahLab.dsp
import("stdfaust.lib"); declare description "Demonstrate competing variable-lowpass-filter effects on test signals with spectrum analysis display"; declare name "vcfWahLab"; // process = ol.sawtooth_demo : // el.crybaby_demo : el.moog_vcf_demo : el.wah4_demo : // fl.spectral_level_demo <: _,_; process = vgroup("[1]", dm.sawtooth_demo) : vgroup("[2]", dm.crybaby_demo) : vgroup("[3]", dm.wah4_demo) : vgroup("[4]", dm.moog_vcf_demo) : vgroup("[5]", dm.spectral_level_demo) <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/filtering/vcfWahLab.dsp
faust
process = ol.sawtooth_demo : el.crybaby_demo : el.moog_vcf_demo : el.wah4_demo : fl.spectral_level_demo <: _,_;
import("stdfaust.lib"); declare description "Demonstrate competing variable-lowpass-filter effects on test signals with spectrum analysis display"; declare name "vcfWahLab"; process = vgroup("[1]", dm.sawtooth_demo) : vgroup("[2]", dm.crybaby_demo) : vgroup("[3]", dm.wah4_demo) : vgroup("[4]", dm.moog_vcf_demo) : vgroup("[5]", dm.spectral_level_demo) <: _,_;
dc5fd39dc3615f6e083c77796759c94191b3bc9dfe4d1969b8c601f75a3a72c3
tonal-glyph/faustus
sound.dsp
import("stdfaust.lib"); so_loop_speed(s, part, speed) = (part, reader(s)) : outs(s) with { length(s) = part,0 : s : _,si.block(outputs(s)-1); srate(s) = part,0 : s : !,_,si.block(outputs(s)-2); outs(s) = s : si.block(2), si.bus(outputs(s)-2); reader(s) = float(speed*srate(s))/ma.SR : (+,length(s):fmod)~_ : int; }; part = nentry("file", 0, 0, 10, 1); speed = hslider("speed", 1, 0, 4, 0.01); process = so_loop_speed(soundfile("s1.wav",1), part, speed), so_loop_speed(soundfile("s2.wav",1), part, speed) : dm.freeverb_demo;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/tests/architecture-tests/sound.dsp
faust
import("stdfaust.lib"); so_loop_speed(s, part, speed) = (part, reader(s)) : outs(s) with { length(s) = part,0 : s : _,si.block(outputs(s)-1); srate(s) = part,0 : s : !,_,si.block(outputs(s)-2); outs(s) = s : si.block(2), si.bus(outputs(s)-2); reader(s) = float(speed*srate(s))/ma.SR : (+,length(s):fmod)~_ : int; }; part = nentry("file", 0, 0, 10, 1); speed = hslider("speed", 1, 0, 4, 0.01); process = so_loop_speed(soundfile("s1.wav",1), part, speed), so_loop_speed(soundfile("s2.wav",1), part, speed) : dm.freeverb_demo;
e15bf34652b4d0ec016cdd1b45d22a2dd51a54c95368d4c9f9ef020435dfe72d
tonal-glyph/faustus
organ.dsp
// Simple Organ declare nvoices "8"; import("stdfaust.lib"); // Midi interface midigate = button ("gate"); // MIDI keyon-keyoff midifreq = hslider("freq[unit:Hz]", 440, 20, 20000, 1); // MIDI keyon key midigain = hslider("gain", 0.5, 0, 10, 0.01); // MIDI keyon velocity process = voice(midigate, midigain, midifreq) * hslider("volume", 0.5, 0, 1, 0.01); // Implementation phasor(f) = f/ma.SR : (+,1.0:fmod) ~ _ ; osc(f) = phasor(f) * 6.28318530718 : sin; timbre(freq) = osc(freq) + 0.5 * osc(2.0*freq) + 0.25 * osc(3.0*freq); envelop(gate, gain) = gate * gain : smooth(0.9995) with { smooth(c) = * (1-c) : + ~ * (c) ; } ; voice(gate, gain, freq) = envelop(gate, gain) * timbre(freq);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/tests/architecture-tests/organ.dsp
faust
Simple Organ Midi interface MIDI keyon-keyoff MIDI keyon key MIDI keyon velocity Implementation
declare nvoices "8"; import("stdfaust.lib"); process = voice(midigate, midigain, midifreq) * hslider("volume", 0.5, 0, 1, 0.01); phasor(f) = f/ma.SR : (+,1.0:fmod) ~ _ ; osc(f) = phasor(f) * 6.28318530718 : sin; timbre(freq) = osc(freq) + 0.5 * osc(2.0*freq) + 0.25 * osc(3.0*freq); envelop(gate, gain) = gate * gain : smooth(0.9995) with { smooth(c) = * (1-c) : + ~ * (c) ; } ; voice(gate, gain, freq) = envelop(gate, gain) * timbre(freq);
71074380f21a6ccddd9bd33d944ee0adaaf558d485a25d91bdd92d2048c90da9
tonal-glyph/faustus
tp1.dsp
import("stdfaust.lib"); part = nentry("file", 0, 0, 10, 1); speed = hslider("speed", 1, 0, 4, 0.01); level = hslider("level", 0.5, 0, 1, 0.01); //process = (part, +(1)~_) : soundfile("files [url: {'RnB.wav';'tango.wav';'levot.wav'}]",2) :(!,!,_,_); //process = so.loop(soundfile("files [url: {'/Documents/faust-github-faust2/tests/soundfile/RnB.wav';'/Documents/faust-github-faust2/tests/soundfile/tango.wav';'/Documents/faust-github-faust2/tests/soundfile/levot.wav'}]",2), part); //process = so.loop_speed(soundfile("files [url: {'RnB.wav';'tango.wav';'levot.wav'}]",2), part, speed); process = so.loop_speed_level(soundfile("files [url: {'RnB.wav';'tango.wav';'levot.wav'}]",2), part, speed, level);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/tests/soundfile/tp1.dsp
faust
process = (part, +(1)~_) : soundfile("files [url: {'RnB.wav';'tango.wav';'levot.wav'}]",2) :(!,!,_,_); process = so.loop(soundfile("files [url: {'/Documents/faust-github-faust2/tests/soundfile/RnB.wav';'/Documents/faust-github-faust2/tests/soundfile/tango.wav';'/Documents/faust-github-faust2/tests/soundfile/levot.wav'}]",2), part); process = so.loop_speed(soundfile("files [url: {'RnB.wav';'tango.wav';'levot.wav'}]",2), part, speed);
import("stdfaust.lib"); part = nentry("file", 0, 0, 10, 1); speed = hslider("speed", 1, 0, 4, 0.01); level = hslider("level", 0.5, 0, 1, 0.01); process = so.loop_speed_level(soundfile("files [url: {'RnB.wav';'tango.wav';'levot.wav'}]",2), part, speed, level);
dd7c13304e8396454e80133294aa64693b86194ddbb312b00b71f911b1eb07f5
tonal-glyph/faustus
harpe.dsp
//----------------------------------------------- // Basic harpe simulation with OSC control // (based on Karplus-Strong) // //----------------------------------------------- declare name "harpe"; declare author "Grame"; import("stdfaust.lib"); process = harpe(11); // an 11 strings harpe //----------------------------------------------- // String simulation //----------------------------------------------- string(freq, att, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d, a) = (+ : @(d-1)) ~ (average : *(1.0-a)); average(x) = (x+x')/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; }; //----------------------------------------------- // Build a N strings harpe // Each string is triggered by a specific // position [0..1] of the "hand" //----------------------------------------------- harpe(N) = hand <: par(i, N, position((i+0.5)/N) : string( 440 * 2.0^(i/5.0), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { lvl = hslider("level [unit:f][osc:/accxyz/0 -10 10]", 0.5, 0, 1, 0.01)^2; att = hslider("attenuation [osc:/1/fader3]", 0.005, 0, 0.01, 0.001); hand = hslider("hand[osc:/accxyz/1 0 20]", 0, 0, 1, 0.01):smooth(0.9); pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = (min(x,x') < a) & (a < max(x, x')); smooth(c) = *(1.0-c) : + ~ *(c); };
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/physicalModeling/old/harpe.dsp
faust
----------------------------------------------- Basic harpe simulation with OSC control (based on Karplus-Strong) ----------------------------------------------- an 11 strings harpe ----------------------------------------------- String simulation ----------------------------------------------- ----------------------------------------------- Build a N strings harpe Each string is triggered by a specific position [0..1] of the "hand" -----------------------------------------------
declare name "harpe"; declare author "Grame"; import("stdfaust.lib"); string(freq, att, level, trig) = no.noise*level : *(trig : trigger(freq2samples(freq))) : resonator(freq2samples(freq), att) with { resonator(d, a) = (+ : @(d-1)) ~ (average : *(1.0-a)); average(x) = (x+x')/2; trigger(n) = upfront : + ~ decay(n) : >(0.0); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; freq2samples(f) = 44100.0/f; }; harpe(N) = hand <: par(i, N, position((i+0.5)/N) : string( 440 * 2.0^(i/5.0), att, lvl) : pan((i+0.5)/N) ) :> _,_ with { lvl = hslider("level [unit:f][osc:/accxyz/0 -10 10]", 0.5, 0, 1, 0.01)^2; att = hslider("attenuation [osc:/1/fader3]", 0.005, 0, 0.01, 0.001); hand = hslider("hand[osc:/accxyz/1 0 20]", 0, 0, 1, 0.01):smooth(0.9); pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); position(a,x) = (min(x,x') < a) & (a < max(x, x')); smooth(c) = *(1.0-c) : + ~ *(c); };
b33c51e76a6d267e235caa47c1af6dac18ec722c9ba98aee6649150b3183c4ea
tonal-glyph/faustus
AdditiveSynth.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // Additive synthesizer, must be used with OSC message to program sound. // It as 8 harmonics. Each have it's own volume envelope. // /////////////////////////////////////////////////////////////////////////////////////////////////// // // OSC messages (see BELA console for precise adress) // For each harmonics (%rang indicate harmonic number, starting at 0) : // vol%rang : General Volume (vol0 control the volume of the fundamental) // A%rang : Attack // D%rang : Decay // S%rang : Sustain // R%rang : Release // /////////////////////////////////////////////////////////////////////////////////////////////////// // GENERAL midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 10, 0.01); // pitchwheel pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; partiel(rang) = os.oscrs(gFreq*(rang+1))*volume with { // UI vol = hslider("vol%rang", 1, 0, 1, 0.001); a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001); d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001); s = hslider("S%rang", 1, 0, 1, 0.001); r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001); volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1); }; process = par(i, 8, partiel(i)) :> / (8);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/AdditiveSynth.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Additive synthesizer, must be used with OSC message to program sound. It as 8 harmonics. Each have it's own volume envelope. ///////////////////////////////////////////////////////////////////////////////////////////////// OSC messages (see BELA console for precise adress) For each harmonics (%rang indicate harmonic number, starting at 0) : vol%rang : General Volume (vol0 control the volume of the fundamental) A%rang : Attack D%rang : Decay S%rang : Sustain R%rang : Release ///////////////////////////////////////////////////////////////////////////////////////////////// GENERAL pitchwheel UI
import("stdfaust.lib"); midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 10, 0.01); pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; partiel(rang) = os.oscrs(gFreq*(rang+1))*volume with { vol = hslider("vol%rang", 1, 0, 1, 0.001); a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001); d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001); s = hslider("S%rang", 1, 0, 1, 0.001); r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001); volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1); }; process = par(i, 8, partiel(i)) :> / (8);
7ef7f76dbf84659fbee18748855df1e00f395518866446105a21c70a70406f9d
tonal-glyph/faustus
AdditiveSynth_Analog.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // Additive synthesizer, must be used with OSC message to program sound. // It as 8 harmonics. Each have it's own volume envelope. // /////////////////////////////////////////////////////////////////////////////////////////////////// // ANALOG IMPLEMENTATION: // // ANALOG_0 : vol0 (volum of fundamental) // ANALOG_1 : vol1 // ... // ANALOG_7 : vol7 // // OSC messages (see BELA console for precise adress) // For each harmonics (%rang indicate harmonic number, starting at 0) : // A%rang : Attack // D%rang : Decay // S%rang : Sustain // R%rang : Release // /////////////////////////////////////////////////////////////////////////////////////////////////// // GENERAL midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 10, 0.01); // pitchwheel pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; partiel(rang) = os.oscrs(gFreq*(rang+1))*volume with { // UI vol = hslider("vol%rang[BELA: ANALOG_%rang]", 1, 0, 1, 0.001); a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001); d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001); s = hslider("S%rang", 1, 0, 1, 0.001); r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001); volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1); }; process = par(i, 8, partiel(i)) :> / (8);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/AdditiveSynth_Analog.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Additive synthesizer, must be used with OSC message to program sound. It as 8 harmonics. Each have it's own volume envelope. ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IMPLEMENTATION: ANALOG_0 : vol0 (volum of fundamental) ANALOG_1 : vol1 ... ANALOG_7 : vol7 OSC messages (see BELA console for precise adress) For each harmonics (%rang indicate harmonic number, starting at 0) : A%rang : Attack D%rang : Decay S%rang : Sustain R%rang : Release ///////////////////////////////////////////////////////////////////////////////////////////////// GENERAL pitchwheel UI
import("stdfaust.lib"); midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 10, 0.01); pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; partiel(rang) = os.oscrs(gFreq*(rang+1))*volume with { vol = hslider("vol%rang[BELA: ANALOG_%rang]", 1, 0, 1, 0.001); a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001); d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001); s = hslider("S%rang", 1, 0, 1, 0.001); r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001); volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1); }; process = par(i, 8, partiel(i)) :> / (8);
4e90a725d62a7be47d6398e5da457b856699e4f19a94ad75de555af15a80978c
tonal-glyph/faustus
chorus.dsp
import("stdfaust.lib"); import("layout2.dsp"); voices = 8; // MUST BE EVEN process = ba.bypass1to2(cbp,chorus_mono(dmax,curdel,rate,sigma,do2,voices)); dmax = 8192; curdel = dmax * ckg(vslider("[0] Delay [midi:ctrl 55] [style:knob]", 0.5, 0, 1, 1)) : si.smooth(0.999); rateMax = 7.0; // Hz rateMin = 0.01; rateT60 = 0.15661; rate = ckg(vslider("[1] Rate [midi:ctrl 56] [unit:Hz] [style:knob]", 0.5, rateMin, rateMax, 0.0001)) : si.smooth(ba.tau2pole(rateT60/6.91)); depth = ckg(vslider("[4] Depth [midi:ctrl 57] [style:knob]", 0.5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; delayPerVoice = 0.5*curdel/voices; sigma = delayPerVoice * ckg(vslider("[6] Deviation [midi:ctrl 58] [style:knob]",0.5,0,1,0.001)) : si.smooth(0.999); periodic = 1; do2 = depth; // use when depth=1 means "multivibrato" effect (no original => all are modulated) cbp = 1-int(csg(vslider("[0] Enable [midi:ctrl 103][style:knob]",0,0,1,1))); chorus_mono(dmax,curdel,rate,sigma,do2,voices) = _ <: (*(1-do2)<:_,_),(*(do2) <: par(i,voices,voice(i)) :> _,_) : ro.interleave(2,2) : +,+ with { angle(i) = 2*ma.PI*(i/2)/voices + (i%2)*ma.PI/2; voice(i) = de.fdelay(dmax,min(dmax,del(i))) * cos(angle(i)); del(i) = curdel*(i+1)/voices + dev(i); rates(i) = rate/float(i+1); dev(i) = sigma * os.oscp(rates(i),i*2*ma.PI/voices); };
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/effects/chorus.dsp
faust
MUST BE EVEN Hz use when depth=1 means "multivibrato" effect (no original => all are modulated)
import("stdfaust.lib"); import("layout2.dsp"); process = ba.bypass1to2(cbp,chorus_mono(dmax,curdel,rate,sigma,do2,voices)); dmax = 8192; curdel = dmax * ckg(vslider("[0] Delay [midi:ctrl 55] [style:knob]", 0.5, 0, 1, 1)) : si.smooth(0.999); rateMin = 0.01; rateT60 = 0.15661; rate = ckg(vslider("[1] Rate [midi:ctrl 56] [unit:Hz] [style:knob]", 0.5, rateMin, rateMax, 0.0001)) : si.smooth(ba.tau2pole(rateT60/6.91)); depth = ckg(vslider("[4] Depth [midi:ctrl 57] [style:knob]", 0.5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; delayPerVoice = 0.5*curdel/voices; sigma = delayPerVoice * ckg(vslider("[6] Deviation [midi:ctrl 58] [style:knob]",0.5,0,1,0.001)) : si.smooth(0.999); periodic = 1; cbp = 1-int(csg(vslider("[0] Enable [midi:ctrl 103][style:knob]",0,0,1,1))); chorus_mono(dmax,curdel,rate,sigma,do2,voices) = _ <: (*(1-do2)<:_,_),(*(do2) <: par(i,voices,voice(i)) :> _,_) : ro.interleave(2,2) : +,+ with { angle(i) = 2*ma.PI*(i/2)/voices + (i%2)*ma.PI/2; voice(i) = de.fdelay(dmax,min(dmax,del(i))) * cos(angle(i)); del(i) = curdel*(i+1)/voices + dev(i); rates(i) = rate/float(i+1); dev(i) = sigma * os.oscp(rates(i),i*2*ma.PI/voices); };
6688003c78a23f044d494ab5b0ca3ca6908beb2d10c67ba1d17d0049f3ad7df0
tonal-glyph/faustus
chorus.dsp
import("stdfaust.lib"); import("layout2.dsp"); voices = 8; // MUST BE EVEN process = ba.bypass1to2(cbp,chorus_mono(dmax,curdel,rate,sigma,do2,voices)); dmax = 8192; curdel = dmax * ckg(vslider("[0] Delay [midi:ctrl 4] [style:knob]", 0.5, 0, 1, 1)) : si.smooth(0.999); rateMax = 7.0; // Hz rateMin = 0.01; rateT60 = 0.15661; rate = ckg(vslider("[1] Rate [midi:ctrl 2] [unit:Hz] [style:knob]", 0.5, rateMin, rateMax, 0.0001)) : si.smooth(ba.tau2pole(rateT60/6.91)); depth = ckg(vslider("[4] Depth [midi:ctrl 3] [style:knob]", 0.5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; delayPerVoice = 0.5*curdel/voices; sigma = delayPerVoice * ckg(vslider("[6] Deviation [midi:ctrl 58] [style:knob]",0.5,0,1,0.001)) : si.smooth(0.999); periodic = 1; do2 = depth; // use when depth=1 means "multivibrato" effect (no original => all are modulated) cbp = 1-int(csg(vslider("[0] Enable [midi:ctrl 105][style:knob]",0,0,1,1))); chorus_mono(dmax,curdel,rate,sigma,do2,voices) = _ <: (*(1-do2)<:_,_),(*(do2) <: par(i,voices,voice(i)) :> _,_) : ro.interleave(2,2) : +,+ with { angle(i) = 2*ma.PI*(i/2)/voices + (i%2)*ma.PI/2; voice(i) = de.fdelay(dmax,min(dmax,del(i))) * cos(angle(i)); del(i) = curdel*(i+1)/voices + dev(i); rates(i) = rate/float(i+1); dev(i) = sigma * os.oscp(rates(i),i*2*ma.PI/voices); };
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/chorus/chorus.dsp
faust
MUST BE EVEN Hz use when depth=1 means "multivibrato" effect (no original => all are modulated)
import("stdfaust.lib"); import("layout2.dsp"); process = ba.bypass1to2(cbp,chorus_mono(dmax,curdel,rate,sigma,do2,voices)); dmax = 8192; curdel = dmax * ckg(vslider("[0] Delay [midi:ctrl 4] [style:knob]", 0.5, 0, 1, 1)) : si.smooth(0.999); rateMin = 0.01; rateT60 = 0.15661; rate = ckg(vslider("[1] Rate [midi:ctrl 2] [unit:Hz] [style:knob]", 0.5, rateMin, rateMax, 0.0001)) : si.smooth(ba.tau2pole(rateT60/6.91)); depth = ckg(vslider("[4] Depth [midi:ctrl 3] [style:knob]", 0.5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; delayPerVoice = 0.5*curdel/voices; sigma = delayPerVoice * ckg(vslider("[6] Deviation [midi:ctrl 58] [style:knob]",0.5,0,1,0.001)) : si.smooth(0.999); periodic = 1; cbp = 1-int(csg(vslider("[0] Enable [midi:ctrl 105][style:knob]",0,0,1,1))); chorus_mono(dmax,curdel,rate,sigma,do2,voices) = _ <: (*(1-do2)<:_,_),(*(do2) <: par(i,voices,voice(i)) :> _,_) : ro.interleave(2,2) : +,+ with { angle(i) = 2*ma.PI*(i/2)/voices + (i%2)*ma.PI/2; voice(i) = de.fdelay(dmax,min(dmax,del(i))) * cos(angle(i)); del(i) = curdel*(i+1)/voices + dev(i); rates(i) = rate/float(i+1); dev(i) = sigma * os.oscp(rates(i),i*2*ma.PI/voices); };
99446d214604d52e4bd98b1da99d37f4b0b293ef28f2a574d3318b2f8292bbf4
tonal-glyph/faustus
trumpet.dsp
//################################### trumpet.dsp ##################################### // A simple trumpet app... (for large screens). // // ## Compilation Instructions // // This Faust code will compile fine with any of the standard Faust targets. However // it was specifically designed to be used with `faust2smartkeyb`. For best results, // we recommend to use the following parameters to compile it: // // ``` // faust2smartkeyb [-ios/-android] -effect reverb.dsp trumpet.dsp // ``` // // ## Version/Licence // // Version 0.0, Feb. 2017 // Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017 // MIT Licence: https://opensource.org/licenses/MIT //######################################################################################## import("stdfaust.lib"); declare interface "SmartKeyboard{ 'Number of Keyboards':'5', 'Max Keyboard Polyphony':'1', 'Mono Mode':'1', 'Keyboard 0 - Number of Keys':'13', 'Keyboard 1 - Number of Keys':'13', 'Keyboard 2 - Number of Keys':'13', 'Keyboard 3 - Number of Keys':'13', 'Keyboard 4 - Number of Keys':'13', 'Keyboard 0 - Lowest Key':'77', 'Keyboard 1 - Lowest Key':'72', 'Keyboard 2 - Lowest Key':'67', 'Keyboard 3 - Lowest Key':'62', 'Keyboard 4 - Lowest Key':'57', 'Rounding Mode':'2', 'Keyboard 0 - Send Y':'1', 'Keyboard 1 - Send Y':'1', 'Keyboard 2 - Send Y':'1', 'Keyboard 3 - Send Y':'1', 'Keyboard 4 - Send Y':'1', }"; // standard parameters f = hslider("freq",300,50,2000,0.01); bend = hslider("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1); gain = hslider("gain",1,0,1,0.01); s = hslider("sustain[midi:ctrl 64]",0,0,1,1); // for sustain pedal t = button("gate"); y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo; // fomating parameters gate = t+s : min(1); freq = f*bend; cutoff = y*4000+50; envelope = gate*gain : si.smoo; process = os.sawtooth(freq)*envelope : fi.lowpass(3,cutoff) <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/smartKeyboard/trumpet.dsp
faust
################################### trumpet.dsp ##################################### A simple trumpet app... (for large screens). ## Compilation Instructions This Faust code will compile fine with any of the standard Faust targets. However it was specifically designed to be used with `faust2smartkeyb`. For best results, we recommend to use the following parameters to compile it: ``` faust2smartkeyb [-ios/-android] -effect reverb.dsp trumpet.dsp ``` ## Version/Licence Version 0.0, Feb. 2017 Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017 MIT Licence: https://opensource.org/licenses/MIT ######################################################################################## standard parameters for sustain pedal fomating parameters
import("stdfaust.lib"); declare interface "SmartKeyboard{ 'Number of Keyboards':'5', 'Max Keyboard Polyphony':'1', 'Mono Mode':'1', 'Keyboard 0 - Number of Keys':'13', 'Keyboard 1 - Number of Keys':'13', 'Keyboard 2 - Number of Keys':'13', 'Keyboard 3 - Number of Keys':'13', 'Keyboard 4 - Number of Keys':'13', 'Keyboard 0 - Lowest Key':'77', 'Keyboard 1 - Lowest Key':'72', 'Keyboard 2 - Lowest Key':'67', 'Keyboard 3 - Lowest Key':'62', 'Keyboard 4 - Lowest Key':'57', 'Rounding Mode':'2', 'Keyboard 0 - Send Y':'1', 'Keyboard 1 - Send Y':'1', 'Keyboard 2 - Send Y':'1', 'Keyboard 3 - Send Y':'1', 'Keyboard 4 - Send Y':'1', }"; f = hslider("freq",300,50,2000,0.01); bend = hslider("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1); gain = hslider("gain",1,0,1,0.01); t = button("gate"); y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo; gate = t+s : min(1); freq = f*bend; cutoff = y*4000+50; envelope = gate*gain : si.smoo; process = os.sawtooth(freq)*envelope : fi.lowpass(3,cutoff) <: _,_;
859230cb58be7636f486769bbba2f9d9f2c4353f1ca18579ed90d677230d62e0
tonal-glyph/faustus
flanger.dsp
// Created from flange.dsp 2015/06/21 import("stdfaust.lib"); import("layout2.dsp"); flanger_mono(dmax,curdel,depth,fb,invert,lfoshape) = _ <: _, (-:de.fdelay(dmax,curdel)) ~ *(fb) : _, *(select2(invert,depth,0-depth)) : + : *(1/(1+depth)); // ideal for dc and reinforced sinusoids (in-phase summed signals) process = ba.bypass1(fbp,flanger_mono_gui); // Kill the groups to save vertical space: meter_group(x) = flsg(x); ctl_group(x) = flkg(x); del_group(x) = flkg(x); lvl_group(x) = flkf(x); flangeview = lfo(freq); flanger_mono_gui = attach(flangeview) : flanger_mono(dmax,curdel,depth,fb,invert,lfoshape); sinlfo(freq) = (1 + os.oscrs(freq))/2; trilfo(freq) = 1.0-abs(os.saw1(freq)); lfo(f) = (lfoshape * trilfo(f)) + ((1-lfoshape) * sinlfo(f)); dmax = 2048; odflange = 44; // ~1 ms at 44.1 kHz = min delay dflange = ((dmax-1)-odflange)*del_group(vslider("[1] Delay [midi:ctrl 50][style:knob]", 0.22, 0, 1, 1)); freq = ctl_group(vslider("[1] Rate [midi:ctrl 2] [unit:Hz] [style:knob]", 0.5, 0, 10, 0.01)) : si.smooth(ba.tau2pole(freqT60/6.91)); freqT60 = 0.15661; depth = ctl_group(vslider("[3] Depth [midi:ctrl 3] [style:knob]", .75, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; fb = ctl_group(vslider("[5] Feedback [midi:ctrl 4] [style:knob]", 0, -0.995, 0.99, 0.001)) : si.smooth(ba.tau2pole(fbT60/6.91)); fbT60 = 0.15661; lfoshape = ctl_group(vslider("[7] Waveshape [midi:ctrl 54] [style:knob]", 0, 0, 1, 0.001)); curdel = odflange+dflange*lfo(freq); fbp = 1-int(flsg(vslider("[0] Enable [midi:ctrl 105][style:knob]",0,0,1,1))); invert = flsg(vslider("[1] Invert [midi:ctrl 49][style:knob]",0,0,1,1):int);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/flanger/flanger.dsp
faust
Created from flange.dsp 2015/06/21 ideal for dc and reinforced sinusoids (in-phase summed signals) Kill the groups to save vertical space: ~1 ms at 44.1 kHz = min delay
import("stdfaust.lib"); import("layout2.dsp"); flanger_mono(dmax,curdel,depth,fb,invert,lfoshape) = _ <: _, (-:de.fdelay(dmax,curdel)) ~ *(fb) : _, *(select2(invert,depth,0-depth)) process = ba.bypass1(fbp,flanger_mono_gui); meter_group(x) = flsg(x); ctl_group(x) = flkg(x); del_group(x) = flkg(x); lvl_group(x) = flkf(x); flangeview = lfo(freq); flanger_mono_gui = attach(flangeview) : flanger_mono(dmax,curdel,depth,fb,invert,lfoshape); sinlfo(freq) = (1 + os.oscrs(freq))/2; trilfo(freq) = 1.0-abs(os.saw1(freq)); lfo(f) = (lfoshape * trilfo(f)) + ((1-lfoshape) * sinlfo(f)); dmax = 2048; dflange = ((dmax-1)-odflange)*del_group(vslider("[1] Delay [midi:ctrl 50][style:knob]", 0.22, 0, 1, 1)); freq = ctl_group(vslider("[1] Rate [midi:ctrl 2] [unit:Hz] [style:knob]", 0.5, 0, 10, 0.01)) : si.smooth(ba.tau2pole(freqT60/6.91)); freqT60 = 0.15661; depth = ctl_group(vslider("[3] Depth [midi:ctrl 3] [style:knob]", .75, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; fb = ctl_group(vslider("[5] Feedback [midi:ctrl 4] [style:knob]", 0, -0.995, 0.99, 0.001)) : si.smooth(ba.tau2pole(fbT60/6.91)); fbT60 = 0.15661; lfoshape = ctl_group(vslider("[7] Waveshape [midi:ctrl 54] [style:knob]", 0, 0, 1, 0.001)); curdel = odflange+dflange*lfo(freq); fbp = 1-int(flsg(vslider("[0] Enable [midi:ctrl 105][style:knob]",0,0,1,1))); invert = flsg(vslider("[1] Invert [midi:ctrl 49][style:knob]",0,0,1,1):int);
ae7ab641ed7e9e8549d7409c1a121d43c996aaea2fa8189a729a52989b42f6a2
tonal-glyph/faustus
granulator.dsp
// FROM FAUST DEMO // Designed to use the Analog Input for parameters contrôles. // /////////////////////////////////////////////////////////////////////////////////////////////////// // // ANALOG IN: // ANALOG 0 : Grain Size // ANALOG 1 : Speed // ANALOG 2 : Probability // (others analog inputs are not used) // /////////////////////////////////////////////////////////////////////////////////////////////////// process = vgroup("Granulator", environment { declare name "Granulator"; declare author "Adapted from sfIter by Christophe Lebreton"; /* =========== DESCRIPTION ============= - The granulator takes very small parts of a sound, called GRAINS, and plays them at a varying speed - Front = Medium size grains - Back = short grains - Left Slow rhythm - Right = Fast rhythm - Bottom = Regular occurrences - Head = Irregular occurrences */ import("stdfaust.lib"); process = hgroup("Granulator", *(excitation : ampf)); excitation = noiseburst(gate,P) * (gain); ampf = an.amp_follower_ud(duree_env,duree_env); //----------------------- NOISEBURST ------------------------- noiseburst(gate,P) = no.noise : *(gate : trigger(P)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : > (0.0); }; //------------------------------------------------------------- P = freq; // fundamental period in samples freq = hslider("[1]GrainSize[BELA: ANALOG_0]", 200,5,2205,1); // la frequence donne la largeur de bande extraite du bruit blanc Pmax = 4096; // maximum P (for de.delay-line allocation) // PHASOR_BIN ////////////////////////////// phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); gate = phasor_bin(1) :-(0.001):pulsar; gain = 1; // PULSAR ////////////////////////////// //Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba). pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); speed = hslider ("[2]Speed[BELA: ANALOG_1]", 10,1,20,0.0001):fi.lowpass(1,1); ratio_env = 0.5; fade = (0.5); // min > 0 pour eviter division par 0 proba = hslider ("[3]Probability[BELA: ANALOG_2]", 70,50,100,1) * (0.01):fi.lowpass(1,1); duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); }.process);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/granulator.dsp
faust
FROM FAUST DEMO Designed to use the Analog Input for parameters contrôles. ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IN: ANALOG 0 : Grain Size ANALOG 1 : Speed ANALOG 2 : Probability (others analog inputs are not used) ///////////////////////////////////////////////////////////////////////////////////////////////// =========== DESCRIPTION ============= - The granulator takes very small parts of a sound, called GRAINS, and plays them at a varying speed - Front = Medium size grains - Back = short grains - Left Slow rhythm - Right = Fast rhythm - Bottom = Regular occurrences - Head = Irregular occurrences ----------------------- NOISEBURST ------------------------- ------------------------------------------------------------- fundamental period in samples la frequence donne la largeur de bande extraite du bruit blanc maximum P (for de.delay-line allocation) PHASOR_BIN ////////////////////////////// PULSAR ////////////////////////////// Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba). min > 0 pour eviter division par 0
process = vgroup("Granulator", environment { declare name "Granulator"; declare author "Adapted from sfIter by Christophe Lebreton"; import("stdfaust.lib"); process = hgroup("Granulator", *(excitation : ampf)); excitation = noiseburst(gate,P) * (gain); ampf = an.amp_follower_ud(duree_env,duree_env); noiseburst(gate,P) = no.noise : *(gate : trigger(P)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : > (0.0); }; freq = hslider("[1]GrainSize[BELA: ANALOG_0]", 200,5,2205,1); phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); gate = phasor_bin(1) :-(0.001):pulsar; gain = 1; pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); speed = hslider ("[2]Speed[BELA: ANALOG_1]", 10,1,20,0.0001):fi.lowpass(1,1); ratio_env = 0.5; proba = hslider ("[3]Probability[BELA: ANALOG_2]", 70,50,100,1) * (0.01):fi.lowpass(1,1); duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); }.process);
f9847c4cdf74a9566e90701febd338bb5d35ffdb9c30f93c97747f2386a23c24
tonal-glyph/faustus
WaveSynth_Analog.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables. // It's possible to add more tables step. // /////////////////////////////////////////////////////////////////////////////////////////////////// // ANALOG IMPLEMENTATION: // // ANALOG_0 : Wave travelling // ANALOG_1 : LFO Frequency // ANALOG_2 : LFO Depth (wave travel modulation) // ANALOG_3 : Release // // MIDI: // CC 73 : Attack // CC 76 : Decay // CC 77 : Sustain // /////////////////////////////////////////////////////////////////////////////////////////////////// // GENERAL midigate = button ("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 1, 0.01); waveTravel = hslider("waveTravel[BELA: ANALOG_0]",0,0,1,0.01); // pitchwheel pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; // LFO lfoDepth = hslider("lfoDepth[BELA: ANALOG_2]",0,0.,1,0.001):si.smoo; lfoFreq = hslider("lfoFreq[BELA: ANALOG_1]",0.1,0.01,10,0.001):si.smoo; moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0); volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01); volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01); volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01); volR = hslider("R[BELA: ANALOG_3]",0.8,0.01,8,0.01); envelop = en.adsre(volA,volD,volS,volR,midigate); // Out Amplitude vol = envelop * midigain; WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.; // 4 WF maxi with this version: scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0) with { coef = 3.14159 * ((nb-1)*0.5); soustraction = select2( position>0, 0, (position/(nb-1)) ); }; wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1))) + (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3))) with { tablesize = 1024; wt1 = WF(tablesize, 16); wt2 = WF(tablesize, 8); wt3 = WF(tablesize, 6); wt4 = WF(tablesize, 4); faze = int(os.phasor(tablesize,freq)); }; process = wfosc(gFreq) * vol;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/WaveSynth_Analog.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables. It's possible to add more tables step. ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IMPLEMENTATION: ANALOG_0 : Wave travelling ANALOG_1 : LFO Frequency ANALOG_2 : LFO Depth (wave travel modulation) ANALOG_3 : Release MIDI: CC 73 : Attack CC 76 : Decay CC 77 : Sustain ///////////////////////////////////////////////////////////////////////////////////////////////// GENERAL pitchwheel LFO Out Amplitude 4 WF maxi with this version:
import("stdfaust.lib"); midigate = button ("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 1, 0.01); waveTravel = hslider("waveTravel[BELA: ANALOG_0]",0,0,1,0.01); pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; lfoDepth = hslider("lfoDepth[BELA: ANALOG_2]",0,0.,1,0.001):si.smoo; lfoFreq = hslider("lfoFreq[BELA: ANALOG_1]",0.1,0.01,10,0.001):si.smoo; moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0); volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01); volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01); volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01); volR = hslider("R[BELA: ANALOG_3]",0.8,0.01,8,0.01); envelop = en.adsre(volA,volD,volS,volR,midigate); vol = envelop * midigain; WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.; scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0) with { coef = 3.14159 * ((nb-1)*0.5); soustraction = select2( position>0, 0, (position/(nb-1)) ); }; wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1))) + (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3))) with { tablesize = 1024; wt1 = WF(tablesize, 16); wt2 = WF(tablesize, 8); wt3 = WF(tablesize, 6); wt4 = WF(tablesize, 4); faze = int(os.phasor(tablesize,freq)); }; process = wfosc(gFreq) * vol;
1484a867ae6ccb43b580d12ade65f11fd83be63bf04313dee3734daa5a58afca
tonal-glyph/faustus
flanger.dsp
// Created from flange.dsp 2015/06/21 import("stdfaust.lib"); import("layout2.dsp"); flanger_mono(dmax,curdel,depth,fb,invert,lfoshape) = _ <: _, (-:de.fdelay(dmax,curdel)) ~ *(fb) : _, *(select2(invert,depth,0-depth)) : + : *(1/(1+depth)); // ideal for dc and reinforced sinusoids (in-phase summed signals) process = ba.bypass1(fbp,flanger_mono_gui); // Kill the groups to save vertical space: meter_group(x) = flsg(x); ctl_group(x) = flkg(x); del_group(x) = flkg(x); lvl_group(x) = flkf(x); flangeview = lfo(freq); flanger_mono_gui = attach(flangeview) : flanger_mono(dmax,curdel,depth,fb,invert,lfoshape); sinlfo(freq) = (1 + os.oscrs(freq))/2; trilfo(freq) = 1.0-abs(os.saw1(freq)); lfo(f) = (lfoshape * trilfo(f)) + ((1-lfoshape) * sinlfo(f)); dmax = 2048; odflange = 44; // ~1 ms at 44.1 kHz = min delay dflange = ((dmax-1)-odflange)*del_group(vslider("[1] Delay [midi:ctrl 50][style:knob]", 0.22, 0, 1, 1)); freq = ctl_group(vslider("[1] Rate [midi:ctrl 51] [unit:Hz] [style:knob]", 0.5, 0, 10, 0.01)) : si.smooth(ba.tau2pole(freqT60/6.91)); freqT60 = 0.15661; depth = ctl_group(vslider("[3] Depth [midi:ctrl 52] [style:knob]", .75, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; fb = ctl_group(vslider("[5] Feedback [midi:ctrl 53] [style:knob]", 0, -0.995, 0.99, 0.001)) : si.smooth(ba.tau2pole(fbT60/6.91)); fbT60 = 0.15661; lfoshape = ctl_group(vslider("[7] Waveshape [midi:ctrl 54] [style:knob]", 0, 0, 1, 0.001)); curdel = odflange+dflange*lfo(freq); fbp = 1-int(flsg(vslider("[0] Enable [midi:ctrl 102][style:knob]",0,0,1,1))); invert = flsg(vslider("[1] Invert [midi:ctrl 49][style:knob]",0,0,1,1):int);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/effects/flanger.dsp
faust
Created from flange.dsp 2015/06/21 ideal for dc and reinforced sinusoids (in-phase summed signals) Kill the groups to save vertical space: ~1 ms at 44.1 kHz = min delay
import("stdfaust.lib"); import("layout2.dsp"); flanger_mono(dmax,curdel,depth,fb,invert,lfoshape) = _ <: _, (-:de.fdelay(dmax,curdel)) ~ *(fb) : _, *(select2(invert,depth,0-depth)) process = ba.bypass1(fbp,flanger_mono_gui); meter_group(x) = flsg(x); ctl_group(x) = flkg(x); del_group(x) = flkg(x); lvl_group(x) = flkf(x); flangeview = lfo(freq); flanger_mono_gui = attach(flangeview) : flanger_mono(dmax,curdel,depth,fb,invert,lfoshape); sinlfo(freq) = (1 + os.oscrs(freq))/2; trilfo(freq) = 1.0-abs(os.saw1(freq)); lfo(f) = (lfoshape * trilfo(f)) + ((1-lfoshape) * sinlfo(f)); dmax = 2048; dflange = ((dmax-1)-odflange)*del_group(vslider("[1] Delay [midi:ctrl 50][style:knob]", 0.22, 0, 1, 1)); freq = ctl_group(vslider("[1] Rate [midi:ctrl 51] [unit:Hz] [style:knob]", 0.5, 0, 10, 0.01)) : si.smooth(ba.tau2pole(freqT60/6.91)); freqT60 = 0.15661; depth = ctl_group(vslider("[3] Depth [midi:ctrl 52] [style:knob]", .75, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91)); depthT60 = 0.15661; fb = ctl_group(vslider("[5] Feedback [midi:ctrl 53] [style:knob]", 0, -0.995, 0.99, 0.001)) : si.smooth(ba.tau2pole(fbT60/6.91)); fbT60 = 0.15661; lfoshape = ctl_group(vslider("[7] Waveshape [midi:ctrl 54] [style:knob]", 0, 0, 1, 0.001)); curdel = odflange+dflange*lfo(freq); fbp = 1-int(flsg(vslider("[0] Enable [midi:ctrl 102][style:knob]",0,0,1,1))); invert = flsg(vslider("[1] Invert [midi:ctrl 49][style:knob]",0,0,1,1):int);
7dd062317e9c78f008804bb296ac26e1190fe3269c2852c8b526f1bd30496622
tonal-glyph/faustus
simpleFX.dsp
import("stdfaust.lib"); // /////////////////////////////////////////////////////////////////////////////////////////////////// // // Simple FX chaine build for a mono synthesizer. // It controle general volume and pan. // FX Chaine is: // Drive // Flanger // Reverberation // /////////////////////////////////////////////////////////////////////////////////////////////////// // MIDI IMPLEMENTATION: // (All are available by OSC) // // CC 7 : Volume // CC 10 : Pan // // CC 92 : Distortion Drive // // CC 13 : Flanger Delay // CC 93 : Flanger Dry/Wet // CC 94 : Flanger Feedback // // CC 12 : Reverberation Room size // CC 91 : Reverberation Dry/Wet // CC 95 : Reverberation Damp // CC 90 : Reverberation Stereo Width // /////////////////////////////////////////////////////////////////////////////////////////////////// // VOLUME: vol = hslider ("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm. // EFFECTS ///////////////////////////////////////////// drive = hslider ("drive[midi:ctrl 92]",0.3,0,1,0.001); // Flanger curdel = hslider ("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider ("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider ("dryWetFlang[midi:ctrl 93]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; // Panoramique: panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; // REVERB (from freeverb_demo) reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[midi:ctrl 12]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[midi:ctrl 91]", 0.4, 0, 1, 0.001); // (g = Dry/Wet) }; // Dry-Wet (from C. LEBRETON) dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; // ALL effets = _ *(vol) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb; process = effets;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/simpleFX.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Simple FX chaine build for a mono synthesizer. It controle general volume and pan. FX Chaine is: Drive Flanger Reverberation ///////////////////////////////////////////////////////////////////////////////////////////////// MIDI IMPLEMENTATION: (All are available by OSC) CC 7 : Volume CC 10 : Pan CC 92 : Distortion Drive CC 13 : Flanger Delay CC 93 : Flanger Dry/Wet CC 94 : Flanger Feedback CC 12 : Reverberation Room size CC 91 : Reverberation Dry/Wet CC 95 : Reverberation Damp CC 90 : Reverberation Stereo Width ///////////////////////////////////////////////////////////////////////////////////////////////// VOLUME: Should be 7 according to MIDI CC norm. EFFECTS ///////////////////////////////////////////// Flanger Panoramique: REVERB (from freeverb_demo) (g = Dry/Wet) Dry-Wet (from C. LEBRETON) ALL
import("stdfaust.lib"); drive = hslider ("drive[midi:ctrl 92]",0.3,0,1,0.001); curdel = hslider ("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider ("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider ("dryWetFlang[midi:ctrl 93]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[midi:ctrl 12]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[midi:ctrl 91]", 0.4, 0, 1, 0.001); }; dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; effets = _ *(vol) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb; process = effets;
ed79d37b0bac3a0f18c44173772d7f9c369d22f17a2647357bd337bb04dea146
tonal-glyph/faustus
WaveSynth.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables. // It's possible to add more tables step. // /////////////////////////////////////////////////////////////////////////////////////////////////// // MIDI IMPLEMENTATION: // // CC 1 : LFO Depth (wave travel modulation) // CC 14 : LFO Frequency // CC 70 : Wave travelling // // CC 73 : Attack // CC 76 : Decay // CC 77 : Sustain // CC 72 : Release // /////////////////////////////////////////////////////////////////////////////////////////////////// // GENERAL midigate = button ("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 1, 0.01); waveTravel = hslider("waveTravel [midi:ctrl ]",0,0,1,0.01); // pitchwheel pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; // LFO lfoDepth = hslider ("lfoDepth[midi:ctrl 1]",0,0.,1,0.001):si.smoo; lfoFreq = hslider ("lfoFreq[midi:ctrl 14]",0.1,0.01,10,0.001):si.smoo; moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0); volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01); volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01); volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01); volR = hslider("R[midi:ctrl 72]",0.8,0.01,8,0.01); envelop = en.adsre(volA,volD,volS,volR,midigate); // Out Amplitude vol = envelop * midigain ; WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.; // 4 WF maxi with this version: scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0) with{ coef = 3.14159 * ((nb-1)*0.5); soustraction = select2( position>0, 0, (position/(nb-1)) ); }; wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1))) + (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3))) with { tablesize = 1024; wt1 = WF(tablesize, 16); wt2 = WF(tablesize, 8); wt3 = WF(tablesize, 6); wt4 = WF(tablesize, 4); faze = int(os.phasor(tablesize,freq)); }; process = wfosc(gFreq) * vol;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/WaveSynth.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables. It's possible to add more tables step. ///////////////////////////////////////////////////////////////////////////////////////////////// MIDI IMPLEMENTATION: CC 1 : LFO Depth (wave travel modulation) CC 14 : LFO Frequency CC 70 : Wave travelling CC 73 : Attack CC 76 : Decay CC 77 : Sustain CC 72 : Release ///////////////////////////////////////////////////////////////////////////////////////////////// GENERAL pitchwheel LFO Out Amplitude 4 WF maxi with this version:
import("stdfaust.lib"); midigate = button ("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 1, 0.01); waveTravel = hslider("waveTravel [midi:ctrl ]",0,0,1,0.01); pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); gFreq = midifreq * pitchwheel; lfoDepth = hslider ("lfoDepth[midi:ctrl 1]",0,0.,1,0.001):si.smoo; lfoFreq = hslider ("lfoFreq[midi:ctrl 14]",0.1,0.01,10,0.001):si.smoo; moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0); volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01); volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01); volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01); volR = hslider("R[midi:ctrl 72]",0.8,0.01,8,0.01); envelop = en.adsre(volA,volD,volS,volR,midigate); vol = envelop * midigain ; WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.; scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0) with{ coef = 3.14159 * ((nb-1)*0.5); soustraction = select2( position>0, 0, (position/(nb-1)) ); }; wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1))) + (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3))) with { tablesize = 1024; wt1 = WF(tablesize, 16); wt2 = WF(tablesize, 8); wt3 = WF(tablesize, 6); wt4 = WF(tablesize, 4); faze = int(os.phasor(tablesize,freq)); }; process = wfosc(gFreq) * vol;
da2f7bfb69ad975035f8135cd7c98684be8834cbaca9c127f69afd0e7d022be8
tonal-glyph/faustus
frog.dsp
//################################### frog.dsp ##################################### // A simple smart phone abstract instrument than can be controlled using the touch // screen and the accelerometers of the device. // // ## `SmartKeyboard` Use Strategy // // The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just // creating one keyboard with on key and by retrieving the X and Y position on that single // key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that // the color of the pad doesn't change when it is pressed. // // ## Compilation Instructions // // This Faust code will compile fine with any of the standard Faust targets. However // it was specifically designed to be used with `faust2smartkeyb`. For best results, // we recommend to use the following parameters to compile it: // // ``` // faust2smartkeyb [-ios/-android] frog.dsp // ``` // // ## Version/Licence // // Version 0.0, Feb. 2017 // Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017 // MIT Licence: https://opensource.org/licenses/MIT //######################################################################################## declare name "frog"; import("stdfaust.lib"); //========================= Smart Keyboard Configuration ================================= // (1 keyboards with 1 key configured as a pad. //======================================================================================== declare interface "SmartKeyboard{ 'Number of Keyboards':'1', 'Keyboard 0 - Number of Keys':'1', 'Keyboard 0 - Piano Keyboard':'0', 'Keyboard 0 - Static Mode':'1', 'Keyboard 0 - Send X':'1', 'Keyboard 0 - Send Y':'1' }"; //================================ Instrument Parameters ================================= // Creates the connection between the synth and the mobile device //======================================================================================== // SmartKeyboard X parameter x = hslider("x",0,0,1,0.01); // SmartKeyboard Y parameter y = hslider("y",0,0,1,0.01); // SmartKeyboard gate parameter gate = button("gate"); // the cutoff frequency of the filter is controlled with the x axis of the accelerometer cutoff = hslider("cutoff[acc: 0 0 -10 0 10]",2500,50,5000,0.01); //=================================== Parameters Mapping ================================= //======================================================================================== maxFreq = 100; minFreq = 1; freq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,1); maxQ = 40; minQ = 1; q = (1-y)*(maxQ-minQ) + minQ : si.smoo; filterCutoff = cutoff : si.smoo; //============================================ DSP ======================================= //======================================================================================== process = sy.dubDub(freq,filterCutoff,q,gate) <: _,_;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/smartKeyboard/frog.dsp
faust
################################### frog.dsp ##################################### A simple smart phone abstract instrument than can be controlled using the touch screen and the accelerometers of the device. ## `SmartKeyboard` Use Strategy The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just creating one keyboard with on key and by retrieving the X and Y position on that single key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that the color of the pad doesn't change when it is pressed. ## Compilation Instructions This Faust code will compile fine with any of the standard Faust targets. However it was specifically designed to be used with `faust2smartkeyb`. For best results, we recommend to use the following parameters to compile it: ``` faust2smartkeyb [-ios/-android] frog.dsp ``` ## Version/Licence Version 0.0, Feb. 2017 Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017 MIT Licence: https://opensource.org/licenses/MIT ######################################################################################## ========================= Smart Keyboard Configuration ================================= (1 keyboards with 1 key configured as a pad. ======================================================================================== ================================ Instrument Parameters ================================= Creates the connection between the synth and the mobile device ======================================================================================== SmartKeyboard X parameter SmartKeyboard Y parameter SmartKeyboard gate parameter the cutoff frequency of the filter is controlled with the x axis of the accelerometer =================================== Parameters Mapping ================================= ======================================================================================== ============================================ DSP ======================================= ========================================================================================
declare name "frog"; import("stdfaust.lib"); declare interface "SmartKeyboard{ 'Number of Keyboards':'1', 'Keyboard 0 - Number of Keys':'1', 'Keyboard 0 - Piano Keyboard':'0', 'Keyboard 0 - Static Mode':'1', 'Keyboard 0 - Send X':'1', 'Keyboard 0 - Send Y':'1' }"; x = hslider("x",0,0,1,0.01); y = hslider("y",0,0,1,0.01); gate = button("gate"); cutoff = hslider("cutoff[acc: 0 0 -10 0 10]",2500,50,5000,0.01); maxFreq = 100; minFreq = 1; freq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,1); maxQ = 40; minQ = 1; q = (1-y)*(maxQ-minQ) + minQ : si.smoo; filterCutoff = cutoff : si.smoo; process = sy.dubDub(freq,filterCutoff,q,gate) <: _,_;
91a750d46aaf1669029d0959fba254836e436a3095d20ca8f95f8de4b7cb5dce
tonal-glyph/faustus
simpleFX_Analog.dsp
import("stdfaust.lib"); // /////////////////////////////////////////////////////////////////////////////////////////////////// // // Simple FX chaine build for a mono synthesizer. // It controle general volume and pan. // FX Chaine is: // Drive // Flanger // Reverberation // // This version use ANALOG IN to controle some of the parameters. // Other parameters continue to be available by MIDI or OSC. // /////////////////////////////////////////////////////////////////////////////////////////////////// // ANALOG IMPLEMENTATION: // // ANALOG_4 : Distortion Drive // ANALOG_5 : Flanger Dry/Wet // ANALOG_6 : Reverberation Dry/Wet // ANALOG_7 : Reverberation Room size // // MIDI: // CC 7 : Volume // CC 10 : Pan // // CC 13 : Flanger Delay // CC 13 : Flanger Delay // CC 94 : Flanger Feedback // // CC 95 : Reverberation Damp // CC 90: Reverberation Stereo Width // /////////////////////////////////////////////////////////////////////////////////////////////////// // VOLUME: vol = hslider("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm. // EFFECTS ///////////////////////////////////////////// drive = hslider ("drive[BELA: ANALOG_4]",0.3,0,1,0.001); // Flanger curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; // Pannoramique: panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; // REVERB (from freeverb_demo) reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001); // (g = Dry/Wet) }; // Dry-Wet (from C. LEBRETON) dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; // ALL effets = _ *(vol) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb; process = effets;
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/simpleFX_Analog.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Simple FX chaine build for a mono synthesizer. It controle general volume and pan. FX Chaine is: Drive Flanger Reverberation This version use ANALOG IN to controle some of the parameters. Other parameters continue to be available by MIDI or OSC. ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IMPLEMENTATION: ANALOG_4 : Distortion Drive ANALOG_5 : Flanger Dry/Wet ANALOG_6 : Reverberation Dry/Wet ANALOG_7 : Reverberation Room size MIDI: CC 7 : Volume CC 10 : Pan CC 13 : Flanger Delay CC 13 : Flanger Delay CC 94 : Flanger Feedback CC 95 : Reverberation Damp CC 90: Reverberation Stereo Width ///////////////////////////////////////////////////////////////////////////////////////////////// VOLUME: Should be 7 according to MIDI CC norm. EFFECTS ///////////////////////////////////////////// Flanger Pannoramique: REVERB (from freeverb_demo) (g = Dry/Wet) Dry-Wet (from C. LEBRETON) ALL
import("stdfaust.lib"); drive = hslider ("drive[BELA: ANALOG_4]",0.3,0,1,0.001); curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001); }; dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; effets = _ *(vol) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb; process = effets;
2cfbf0390befc308c125b8943cc4b3be1525dd15a555f0d105584024fd47a343
tonal-glyph/faustus
16_channel_volume.dsp
//----------------------------------------------- // MIDI controlled 16 channel volume control in db //----------------------------------------------- import("stdfaust.lib"); import("layout.dsp"); channel01 = v01(vslider("Volume-01 [midi:ctrl 1] [tooltip CC-1]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel02 = v02(vslider("Volume-02 [midi:ctrl 2] [tooltip CC-2]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel03 = v03(vslider("Volume-03 [midi:ctrl 3] [tooltip CC-3]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel04 = v04(vslider("Volume-04 [midi:ctrl 4] [tooltip CC-4]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel05 = v05(vslider("Volume-05 [midi:ctrl 5] [tooltip CC-5]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel06 = v06(vslider("Volume-06 [midi:ctrl 6] [tooltip CC-6]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel07 = v07(vslider("Volume-07 [midi:ctrl 7] [tooltip CC-7]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel08 = v08(vslider("Volume-08 [midi:ctrl 8] [tooltip CC-8]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel09 = v09(vslider("Volume-09 [midi:ctrl 9] [tooltip CC-9]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel10 = v10(vslider("Volume-10 [midi:ctrl 10] [tooltip CC-10]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel11 = v11(vslider("Volume-11 [midi:ctrl 11] [tooltip CC-11]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel12 = v12(vslider("Volume-12 [midi:ctrl 12] [tooltip CC-12]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel13 = v13(vslider("Volume-13 [midi:ctrl 13] [tooltip CC-13]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel14 = v14(vslider("Volume-14 [midi:ctrl 14] [tooltip CC-14]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel15 = v15(vslider("Volume-15 [midi:ctrl 15] [tooltip CC-15]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel16 = v16(vslider("Volume-16 [midi:ctrl 16] [tooltip CC-16]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); process = *(channel01), *(channel02), *(channel03), *(channel04), *(channel05), *(channel06), *(channel07), *(channel08), *(channel09), *(channel10), *(channel11), *(channel12), *(channel13), *(channel14), *(channel15), *(channel16);
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/SAM/16_channel_volume/16_channel_volume.dsp
faust
----------------------------------------------- MIDI controlled 16 channel volume control in db -----------------------------------------------
import("stdfaust.lib"); import("layout.dsp"); channel01 = v01(vslider("Volume-01 [midi:ctrl 1] [tooltip CC-1]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel02 = v02(vslider("Volume-02 [midi:ctrl 2] [tooltip CC-2]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel03 = v03(vslider("Volume-03 [midi:ctrl 3] [tooltip CC-3]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel04 = v04(vslider("Volume-04 [midi:ctrl 4] [tooltip CC-4]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel05 = v05(vslider("Volume-05 [midi:ctrl 5] [tooltip CC-5]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel06 = v06(vslider("Volume-06 [midi:ctrl 6] [tooltip CC-6]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel07 = v07(vslider("Volume-07 [midi:ctrl 7] [tooltip CC-7]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel08 = v08(vslider("Volume-08 [midi:ctrl 8] [tooltip CC-8]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel09 = v09(vslider("Volume-09 [midi:ctrl 9] [tooltip CC-9]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel10 = v10(vslider("Volume-10 [midi:ctrl 10] [tooltip CC-10]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel11 = v11(vslider("Volume-11 [midi:ctrl 11] [tooltip CC-11]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel12 = v12(vslider("Volume-12 [midi:ctrl 12] [tooltip CC-12]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel13 = v13(vslider("Volume-13 [midi:ctrl 13] [tooltip CC-13]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel14 = v14(vslider("Volume-14 [midi:ctrl 14] [tooltip CC-14]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel15 = v15(vslider("Volume-15 [midi:ctrl 15] [tooltip CC-15]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); channel16 = v16(vslider("Volume-16 [midi:ctrl 16] [tooltip CC-16]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo); process = *(channel01), *(channel02), *(channel03), *(channel04), *(channel05), *(channel06), *(channel07), *(channel08), *(channel09), *(channel10), *(channel11), *(channel12), *(channel13), *(channel14), *(channel15), *(channel16);
a8bedcfc17eec147a52fad6ba38e07bb6926c09656335d717a73ff5ce602a095
tonal-glyph/faustus
crossDelay2.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // Stereo Delay with feedback and crossfeedback (L to R and R to L feedback). // And pitch shifting on feedback. // A pre-delay without feedback is added for a wider stereo effect. // // Designed to use the Analog Input for parameters controls. // /////////////////////////////////////////////////////////////////////////////////////////////////// // // ANALOG IN: // ANALOG 0 : Pre-Delay L // ANALOG 1 : Pre-Delay R // ANALOG 2 : Delay L // ANALOG 3 : Delay R // ANALOG 4 : Cross feedback // ANALOG 5 : Feedback // ANALOG 6 : Pitchshifter L // ANALOG 7 : Pitchshifter R // // Available by OSC : (see BELA console for precise adress) // Feedback filter: // crossLF : Crossfeedback Lowpass // crossHF : Crossfeedback Highpass // feedbLF : Feedback Lowpass // feedbHF : Feedback Highpass // /////////////////////////////////////////////////////////////////////////////////////////////////// preDelL = ba.sec2samp(hslider("delR[BELA: ANALOG_0]", 1,0,2,0.001)):si.smoo; preDelR = ba.sec2samp(hslider("delR[BELA: ANALOG_1]", 1,0,2,0.001)):si.smoo; delL = ba.sec2samp(hslider("delL[BELA: ANALOG_2]", 1,0,2,0.001)):si.smoo; delR = ba.sec2samp(hslider("delR[BELA: ANALOG_3]", 1,0,2,0.001)):si.smoo; crossLF = hslider("crossLF", 12000, 20, 20000, 0.001); crossHF = hslider("crossLF", 60, 20, 20000, 0.001); feedbLF = hslider("feedbLF", 12000, 20, 20000, 0.001); feedbHF = hslider("feedbHF", 60, 20, 20000, 0.001); CrossFeedb = hslider("CrossFeedb[BELA: ANALOG_4]", 0.0, 0., 1, 0.001):si.smoo; feedback = hslider("feedback[BELA: ANALOG_5]", 0.0, 0., 1, 0.001):si.smoo; pitchL = hslider("shiftL[BELA: ANALOG_6]", 0,-12,12,0.001):si.smoo; pitchR = hslider("shiftL[BELA: ANALOG_7]", 0,-12,12,0.001):si.smoo; routeur(a,b,c,d) = ((a*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((b*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+c, ((b*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((a*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+d; process = (de.sdelay(65536, 512,preDelL),de.sdelay(65536, 512,preDelR)):(routeur : de.sdelay(65536, 512,delL) , de.sdelay(65536, 512,delR))~(ef.transpose(512, 256, pitchL) , ef.transpose(512, 256, pitchR));
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/bela/crossDelay2.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Stereo Delay with feedback and crossfeedback (L to R and R to L feedback). And pitch shifting on feedback. A pre-delay without feedback is added for a wider stereo effect. Designed to use the Analog Input for parameters controls. ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IN: ANALOG 0 : Pre-Delay L ANALOG 1 : Pre-Delay R ANALOG 2 : Delay L ANALOG 3 : Delay R ANALOG 4 : Cross feedback ANALOG 5 : Feedback ANALOG 6 : Pitchshifter L ANALOG 7 : Pitchshifter R Available by OSC : (see BELA console for precise adress) Feedback filter: crossLF : Crossfeedback Lowpass crossHF : Crossfeedback Highpass feedbLF : Feedback Lowpass feedbHF : Feedback Highpass /////////////////////////////////////////////////////////////////////////////////////////////////
import("stdfaust.lib"); preDelL = ba.sec2samp(hslider("delR[BELA: ANALOG_0]", 1,0,2,0.001)):si.smoo; preDelR = ba.sec2samp(hslider("delR[BELA: ANALOG_1]", 1,0,2,0.001)):si.smoo; delL = ba.sec2samp(hslider("delL[BELA: ANALOG_2]", 1,0,2,0.001)):si.smoo; delR = ba.sec2samp(hslider("delR[BELA: ANALOG_3]", 1,0,2,0.001)):si.smoo; crossLF = hslider("crossLF", 12000, 20, 20000, 0.001); crossHF = hslider("crossLF", 60, 20, 20000, 0.001); feedbLF = hslider("feedbLF", 12000, 20, 20000, 0.001); feedbHF = hslider("feedbHF", 60, 20, 20000, 0.001); CrossFeedb = hslider("CrossFeedb[BELA: ANALOG_4]", 0.0, 0., 1, 0.001):si.smoo; feedback = hslider("feedback[BELA: ANALOG_5]", 0.0, 0., 1, 0.001):si.smoo; pitchL = hslider("shiftL[BELA: ANALOG_6]", 0,-12,12,0.001):si.smoo; pitchR = hslider("shiftL[BELA: ANALOG_7]", 0,-12,12,0.001):si.smoo; routeur(a,b,c,d) = ((a*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((b*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+c, ((b*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((a*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+d; process = (de.sdelay(65536, 512,preDelL),de.sdelay(65536, 512,preDelR)):(routeur : de.sdelay(65536, 512,delL) , de.sdelay(65536, 512,delR))~(ef.transpose(512, 256, pitchL) , ef.transpose(512, 256, pitchR));