[yoshimi] Re: SVFilter uses wrong frequency?

  • From: Will Godfrey <willgodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Fri, 2 Dec 2016 18:24:50 +0000

On Fri, 02 Dec 2016 18:50:27 +0100
Jörn Eichler <joerneichler@xxxxxxx> wrote:

I noticed, that a high q value "whistle" sound created using Analog BPF2 and 
SV 1BPF filters on white noise, both set to the same frequency, differ a lot. 
SV 
1BPF sounds almost a minor sixth lower than Analog BPF2.

I looked at the code to see, if the freq passed on to the filters differed. 
It 
does not. However, I found an interesting difference in how the two filters 
use 
the freq they get:

Analog BPF2 does this (file AnalogFilter.cpp line 189):

   omega = TWOPI * freq / synth->samplerate_f;

while SV 1BPF does this (file SVFilter.cpp line 69):

   par.f = freq / synth->samplerate_f * 4.0f;

Note the different factors (2*PI for Analog, 4 for SV).

Two notes with frequencies f1=4*f0 and f2=2*PI*f0 differ by 783 cents, which 
is 
almost a minor sixth and also pretty much matches the frequency difference my 
phone app showed for some tests.

Is this behavior of SV 1BPF intended?

I would think it was intended. It's always been that, although I'm not entirely
clear on how state variable filters are supposed to work.

Should the tooltip window account for this difference and simply show the 
"effective" frequency SVFilter seems to use instead of what it is actually 
passed?

Good question :)

My first thought is that it should show what it *seems* to be to the user.
However, it's early in the month and I haven't even started to use up December's
quota of mistakes :p

-- 
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.
Yoshimi source code is available from either: 
http://sourceforge.net/projects/yoshimi
Or: https://github.com/Yoshimi/yoshimi
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx

Other related posts: