SingenBD2 - Feedback bug
Closed this issue · 4 comments
Hi,
I've noticed this "bug" using an oscillator with 0 pitchdiff and higher feedback (i.e. steady signal):
https://github.com/ryukau/UhhyouWebSynthesizers/blob/main/oldsynth/SingenBD2/index.js#L115
Since this.pitchDiff = 0
, 0^x
will always be the same, so feedback (i.e. mod var) will do nothing, but it should, since feedback is not related with pitch envelope (i just got a steady signal, without feedback influence). Right?
Curious about your pitch env modelling: which kind of envelope is pitch = diff ^ env
?
Thanks for any tips
Okay, I basically forgot how I made SingenBD2. Also note that the code was written when I had no clue about DSP.
It seems like the unit of this.pitchDiff
is frequency in Hz. So the pow
in question is moving that frequency in log scale, like octaves and semitones. I'm pretty sure the value of pitchEnv
moves from 1 to 0. So to formulate:
where:
-
$t$ is time in seconds. -
$f$ is frequency in Hz. -
$f_l$ isthis._pitchEnd
in code. Defined asPitchEnd - 1
. -
$f_d$ isthis.pitchDiff
in code. Defined asPitchStart - PitchEnd
. -
$E$ ispitchEnv
that is an decaying envelope. -
$M$ is modulator signal, which isHead
oscillator in SingenBD2.
For your expected result, the formula should be changed like following:
You can get the modulation in octave by solving
My conclusion is that the modulation is just a variation of "musical" tuning. I quoted the word musical, because it's clearly a mistake, but nobody was hurt. Also, I'd like to leave it as is, because those subtle difference might provide musical value, or a character.
I personally stopped using pow
in more recent code, as exp2
is faster and it's sufficient most of times.
Ah, the definition of
Yeah of course. Its clear the params.
What I'm trying to say is that given a 0 pitchdiff, the feedback has no effect on signal in fm mode (which should, since its a fm feedback).
I added a few other FM options. The name of original tuning is changed to "Muffled FM". Also, let me know if you have a concrete code for modulation tuning. I'll add it. Or you can open PR for that.
I also recommend to try the subsequent synths like Singen0.2 ("Bassdrum" randomization) and SingenBD3 ("Dry BD" randomization).
Updated UI looks ugly, but I wouldn't like to spend too much time dealing with the code in oldsynth
. If you really care, patches are welcome. The best way is to port the synth to new style of code, but it's not my priority.