diff --git a/dsp/analog.dsp b/dsp/analog.dsp index f56966cd..864ab160 100644 --- a/dsp/analog.dsp +++ b/dsp/analog.dsp @@ -25,6 +25,9 @@ # THE FILTER IS 24 dB AN OCTAVE: two filt::svf low-passes in series, # the resonance on the second, the cutoff opened by its own envelope and # by velocity, and tracking the keyboard by `Key Track'. +# +# `Bend' is the pitch wheel, in semitones and slewed over 40 ms: a piece +# rides it with a chanarg sink (`chanarg = "bend"'). name "Analog"; author "Misha Nasledov"; @@ -99,6 +102,13 @@ category "Leads and stabs"; @drift.label = "Drift (cents)"; @drift.group = "Warmth"; + @bend = 0; + @bend.widget = 1; + @bend.min = -12; + @bend.max = 12; + @bend.label = "Bend (semitones)"; + @bend.group = "Oscillators"; + @cutoff = 1200; @cutoff.widget = 1; @cutoff.min = 40; @@ -190,10 +200,20 @@ node ionode { play = env->play; }; -node freq misc::midi2freq { +node pitch misc::midi2freq { note = ionode->note; }; +node bend misc::slew { + in = @bend; + time = 40 ms; +}; + +node freq math::mul { + in0 = pitch->out; + in1 = exp2(bend->out / 12); +}; + # One wanderer per oscillator, in cents, and one for the cutoff. node driftc misc::drift { rate = 0.3; depth = @drift; seed = ionode->note; }; node driftl misc::drift { rate = 0.37; depth = @drift; seed = ionode->note + 1000; }; diff --git a/dsp/guitar.dsp b/dsp/guitar.dsp index 462f1372..5bd910c2 100644 --- a/dsp/guitar.dsp +++ b/dsp/guitar.dsp @@ -32,6 +32,13 @@ # Velocity is in the burst's level and in the damping, so a hard pick # starts brighter and settles to where a soft one started -- a string # does that, and an envelope on a filter only pretends to. +# +# `Bend' is in semitones and is the channel's, like a pitch wheel: a +# piece drives it with a chanarg sink (`chanarg = "bend"') from a +# gen::steps row, which is a lead guitarist's bend on a single line. It +# moves the loop's length and not its decay, and it is slewed over 40 ms +# so a step in the row is a push rather than a jump. At 0 the string is +# exactly as it was. name "Guitar"; author "Misha Nasledov"; @@ -94,6 +101,12 @@ category "Plucked"; @a.max = 100ms; @a.label = "Attack"; + @bend = 0; + @bend.widget = 1; + @bend.min = -2; + @bend.max = 2; + @bend.label = "Bend (semitones)"; + @r = 100 ms; @r.widget = 1; @r.min = 5ms; @@ -112,6 +125,11 @@ node freq misc::midi2freq { note = ionode->note; }; +node bend misc::slew { + in = @bend; + time = 40 ms; +}; + node noise osc::noise { color = 0; amp = 1; @@ -146,7 +164,7 @@ node pos filt::svf { # guitar has. node string filt::comb { in = pos->out_band; - freq = freq->out; + freq = freq->out * exp2(bend->out / 12); feedback = clamp(pow(10, -3 / (@decay * @mute * freq->out)), 0, 0.9995); damp = clamp(@tone - ionode->velocity * @bright, 0, 0.9); size = 100 ms;