diff --git a/dev/src/dsp-definitions/36-wizard-delay.ts b/dev/src/dsp-definitions/36-wizard-delay.ts index 455691a..8859dda 100644 --- a/dev/src/dsp-definitions/36-wizard-delay.ts +++ b/dev/src/dsp-definitions/36-wizard-delay.ts @@ -6,7 +6,7 @@ import("stdfaust.lib"); delay_max = ma.SR * 5; wet_param = 0.4; -dry_param = 0.0; +dry_param = 0.4; fb_param = 0.3; time_param = 1.0; @@ -16,7 +16,7 @@ mod = 1.0 - ((os.osc(mod_speed_param) * 0.5 + 0.5) * mod_depth_param); modx = mod * (os.lf_sawpos(time_param * (1 / 3)) + 0.001); -delay(time, fb, x) = x + fb : de.fdelay(delay_max, time * modx) : fi.highpass(2, 200.0) : fi.lowpass(2, 20000.0); +delay(time, fb, x) = x + fb : de.fdelay(delay_max, time * mod) : fi.highpass(2, 200.0) : fi.lowpass(2, 20000.0); fb = *(fb_param); echo(time) = delay(time) ~ fb; diff --git a/dev/src/dsp-definitions/37-filter-bank.ts b/dev/src/dsp-definitions/37-filter-bank.ts new file mode 100644 index 0000000..d8dee6b --- /dev/null +++ b/dev/src/dsp-definitions/37-filter-bank.ts @@ -0,0 +1,29 @@ +import type { DspDefinition } from "../types"; + +const dsp = ` +import("stdfaust.lib"); + +wet_param = 1.6; +dry_param = 0.4; + +noise = no.pink_noise : fi.highpass(2, 800.0) : fi.lowpass(2, 3000.0); + +wet = _ : co.compressor_mono(8.0,-24.0,0.001,0.1) : ve.vocoder(16,0.001,0.2,2.0,_,noise) : *(wet_param) <: _,_; + +// wet = _ : an.amp_follower_ar(0.0,0.1) * noise <: _,_; + +dry = *(dry_param); +process = _ <: (dry <: _,_),wet :> _,_; +`; + +const dspDefinition: DspDefinition = { + id: "filter-bank", + name: "Filter bank", + description: "Playing with filter banks, vocoders, panning, EQ", + dsp, + type: "live", + inputFile: "/audio/freesound/584282__yellowtree__clean-guitar-loop.wav", + loopLength: 20, +}; + +export default dspDefinition; diff --git a/dev/src/dsp-definitions/38-cloudify.ts b/dev/src/dsp-definitions/38-cloudify.ts new file mode 100644 index 0000000..450cd32 --- /dev/null +++ b/dev/src/dsp-definitions/38-cloudify.ts @@ -0,0 +1,65 @@ +import type { DspDefinition } from "../types"; + +const dsp = ` +import("stdfaust.lib"); + +// +// synth +// + +tune1 = waveform{65,-1,-1,68,-1,-1,-1,-1,65,-1,-1,66,-1,-1,-1,-1}; +tune2 = waveform{-1,-70,-1,-1,-1,-1,-1,-1,-1,-70,-1,-1,-1,-1,-1,-1}; +tune3 = waveform{-1,-1,-72,-1,-1,-1,-1,-1,-1,-1,-72,-1,-1,-1,-1,-1}; +tune4 = waveform{53,-1,-1,-1,56,-1,-1,-1,53,-1,-1,-1,51,-1,-1,-1}; + +tunePlayer(tune) = tuneAmp,tuneFreq +with { + tuneNow = tune,int(os.phasor(16,0.15)) : rdtable; + tuneGate = tuneNow > 0 : ba.sAndH(tuneNow != 0); + tuneAmp = en.adsre(0.0001,1.0,0.0001,3.0,tuneGate); + tuneFreq = tuneNow : ba.sAndH(tuneNow > 0); +}; + +vibrato = +(os.osc(4.0) * 0.1); + +synthVoice(gate) = vibrato : ba.midikey2hz : os.osc : *(gate) : *(0.1); + + +voice1 = tunePlayer(tune1) : synthVoice; +voice2 = tunePlayer(tune2) : synthVoice; +voice3 = tunePlayer(tune3) : synthVoice; +voice4 = tunePlayer(tune4) : synthVoice; + +synth = voice1 + voice2 + voice3 + voice4 <: _,_; + +// +// noise +// + +noise = no.pink_noise : fi.highpass(2, 3200.0) : fi.lowpass(2, 12800.0); + +// +// program +// + +total = 2; +each(i) = _ : de.delay(ma.SR * 1.0, ma.SR * 1.0 * ((i + 1) / total)) : sp.panner(i * (total - 1)) : _,_; +delays = _ <: par(i, total, each(i)) :> _,_; +noiseMaker = ve.vocoder(16,0.001,0.2,2.0,_,noise) : *(1.0) <: _,_; +noiseMakerWithDry = _ <: _,noiseMaker :> _; + +wet = _ : noiseMakerWithDry : delays : _,_; +dry = *(1.0); +process = synth <: (dry <: _,_),wet :> _,_; +`; + +const dspDefinition: DspDefinition = { + id: "cloudify", + name: "Cloudify", + description: + "Adds a set of panned delay lines fading in and out and mixes in sound effects from a secondary input", + dsp, + type: "live", +}; + +export default dspDefinition; diff --git a/dev/src/dsp-definitions/all.ts b/dev/src/dsp-definitions/all.ts index 970f6a1..2207360 100644 --- a/dev/src/dsp-definitions/all.ts +++ b/dev/src/dsp-definitions/all.ts @@ -36,6 +36,8 @@ import pitchtracker3 from "./33-pitchtracker-3"; import additiveSynth from "./34-additive-synth"; import recordedGuitar from "./35-recorded-guitar"; import wizardDelay from "./36-wizard-delay"; +import filterBank from "./37-filter-bank"; +import cloudify from "./38-cloudify"; export const all: DspDefinition[] = [ sineWave, @@ -74,4 +76,6 @@ export const all: DspDefinition[] = [ additiveSynth, recordedGuitar, wizardDelay, + filterBank, + cloudify, ];