Filters in Hz, not 0-127

Anything about the Scope modular synths

Moderators: valis, garyb

Post Reply
User avatar
kensuguro
Posts: 4434
Joined: Sun Jul 08, 2001 4:00 pm
Location: BPM 60 to somewhere around 150
Contact:

Post by kensuguro »

I'm wondering... how do you tune the cutoff of a filter in Hz? It seems to me, working with 0-127 (and I'm suspecting it's not a linear transition) is very tedious, especially because it seems like you can go into decimals. Is there a way to do all this in Hz?
Connecting the constant frequency to the cutoff control doesn't seem to work either. There must be a way to convert between 0-127 and Hz. If only it was linear, then I'd just have to divide 22050 by 127 and I'd get what 1 unit stands for.. But the numbers seem to be in exponential relationship.
Any suggestions?

<font size=-1>[ This Message was edited by: kensuguro on 2002-02-02 12:18 ]</font>
User avatar
kensuguro
Posts: 4434
Joined: Sun Jul 08, 2001 4:00 pm
Location: BPM 60 to somewhere around 150
Contact:

Post by kensuguro »

I spent tho whooole night trying to figure out what the exponential curve is.. with no success. Can any math experts help me out on this? I've got some numbers that may help.

(MIDI value, frequency)
23 , 68.50
33 , 123.70
43 , 221.60
53 , 389.80
63 , 678.40
73 , 1174.50
83 , 2026.60
93 , 3491.10
103 , 6006.80
I got these numbers by using a 127 Q self oscilating 24db/oct bandpass filter, tuned against a sinwave controlled by a constant frequency module. (so I can see the actual numbers in Hz) But I did it with my ear so these aren't EXACT numbers. Plus, I'm not diligent enough to wait for a beat to occur once every 30 seconds, so when the beating wend under, say 0.2Hz, I went ahead to the next frequency.

Also, after I did the tests, I found out that when you enter, say 63 into the cutoff frequency field on the filter, the number is actually 63.5, so add another 0.5 to all the number above. The filters have an internal precision down to 1 decimal point. So you'd find a cross over point (like from 63 to 64), and then tap the arrow keys to do a 64.2 etc. People probably know this already, but a useful finding nonetheless.

So this is definitely a Y=a*exp(X*b) curve, I just can't figure out what. Maybe I'm missing some fundamental music mathematics? I'm wondering if there's a "regular" curve that people use, cuz there should be some sort of standard with these things.
Anyway, it would be great if we could find an equation so we can implement more accurate filter frequencies don't you think? Every time I try to do something in Mod2, this reeeally gets on my nerves.
User avatar
kensuguro
Posts: 4434
Joined: Sun Jul 08, 2001 4:00 pm
Location: BPM 60 to somewhere around 150
Contact:

Post by kensuguro »

By the way, if anyone even tried figuring it out.. I had one very good guess, which didn't work. The equation was (originally was implemented in c):
base = (440/64) * e^[log2*(3/12)]
frequency = base * e^[log2*(X/12)]
where X is the cutoff frequency in mod2.

So that was an attempt to implement note numbers to hertz, but that wasn't it. The rate of change was totally off. Anyway, back to some more experimenting.
User avatar
kensuguro
Posts: 4434
Joined: Sun Jul 08, 2001 4:00 pm
Location: BPM 60 to somewhere around 150
Contact:

Post by kensuguro »

Here's another try that got very, VERY close. But still, there are some other variables involved that I can't figure out.
Y=(2^((X+12)/12))*(440/64)
This is another octave to freq domain conversion, this time using the 12th root of 2 rule.. almost the same as the previous attempt..

The problem is, I found out that the mod2 cutoffs aren't really chromatic.. like 62 isn't exactly an octave higher than 50. It's ALMOST an octave, but not quite. Worse yet, the higher you go, the flatter an octave becomes.. I wonder who was the bozo that invented such a tuning scheme... Sort of a weighted equal temperament scale?

Sigh, my 5th day of JUST tuning filters to sin waves.. and graphing equations... I need to get a life.. but I GOTTA KNOW! I've already invested too much time on this little project.
User avatar
spacef
Posts: 3235
Joined: Sun Jun 17, 2001 4:00 pm
Contact:

Post by spacef »

Hi Kensuguro,
It is possible i don't understand all the problem, but May be the precision problem of the tuning knobs or value displays comes from the fact that you are trying to express values of 1/20000 (frequency) with a display that only has 127 diffrent values....
for example, if you type 64, is it equal to 10.000 Hz? 980 Hz? 10.035 ? 999hz? etc... ?
May be that's why you don't find an exact formula, because the results that are displayed may not be relevant to analyze frequency, but only to control midi controllers... I guess.
As a developper, i can tell you that there are 5 different curves (linear, expon, logaryth, exp/log, log/exp).
well, you know what kind filters i would advise you to use to protect your nervous system against frequency display mania frustration :smile:
mt
http://www.spacef.com

<font size=-1>[ This Message was edited by: spacef on 2002-02-07 01:12 ]</font>
User avatar
kensuguro
Posts: 4434
Joined: Sun Jul 08, 2001 4:00 pm
Location: BPM 60 to somewhere around 150
Contact:

Post by kensuguro »

Well, it would be easier if I could use your devices within Mod2 and animate them with envelopes...
Anyway, of the 5 types you listed, is it possible for you to give me the equation for th exp/log and the log/exp curve? I've looked at a bunch of curves, and I think I sort of know which one you're pointing to.. but just to make sure.
Also, the analysis shouldn't be wrong because even when comparing a 60.0 and a 72.0 (which wouldn't be an integer, in Hz) as long as it's 12 semitones, it should be an octave.. or so I thought. And the size of the octaves decrease at an obvious 1-3Hz per octave. I still need to get some more data on this.

You can tell, this is almost becoming an obsession.. hehe. It's also because I'm leaving for a month long trip in a few days and I want to get this cleared before I leave. Ya know how these things are. :smile:

<font size=-1>[ This Message was edited by: kensuguro on 2002-02-07 02:22 ]</font>
User avatar
spacef
Posts: 3235
Joined: Sun Jun 17, 2001 4:00 pm
Contact:

Post by spacef »

The 4th and 5th curves i listed are new in DP 3 : the scope user doesn't have acces to an equation, but to different parameters to control the curve response (that's called intensity, which is from 2 to 999 : on displays, a badly configured display curve intensity will make the displayed values totally wrong. However i don't think this is the case in Modular II (values display should be Linear curves in general)

I can't help you on the math equation, and I think you are torturing yourself with this :smile:

I'm doing a Mod Filter upgrade that will sync LFO to audio In (see Moonizer). I'm trying to see how it can sync to enveloppes (Moonizer does it already but i'm not satisfied with it, i'm looking for a better way).

Sorry i can't help you much on this.
User avatar
kensuguro
Posts: 4434
Joined: Sun Jul 08, 2001 4:00 pm
Location: BPM 60 to somewhere around 150
Contact:

Post by kensuguro »

I just had a new notion today.... why is parametric eq (that cannot be controlled by external modules) controlled in hertz, and not any other filters that have cutoff req modulation??

I think, it's because if the ones that have cutoff freq modulation can be controlled in hertz, they can be used in conjunction with an oscilator, and put an envelope follower in between.... you've got a vocoder!! That means, to make a 24 band vocoder (or however many bands it had) like creamware's new vocodizer, it would be possible to do it in mod2.

Anyway, that's not going to work for too long... because I've found an equation that roughly converts hertz to 0-127 units. But, you have to set filter cutoff to 0, and then connect a constand value module to the cutoff freq modulation, in order to get accurate results. The equation goes:
frequency is the aimed hertz
midinumber is the number you put into the constant value module

midinumber=(log(frequency/440)/log(2))*12+65-0.8

Or the other way around,

frequency=((440)*2^((midinumber-65+0.8)/12))

I'll add that 10 is the base for the logs. I'm still going to work on the equations a bit, but these are pretty damn close. You can still implement formants, etc. using this equation, provided you've got a good analysis of your data. (expect some minor errors tho)
While I work on the equation a bit, I'm looking into Delphi to see if I can make me a program to convert freq to midinumber, and vice versa. I'll let ya all know when I complete it. Most likely, it'll be sometime in May or early June.

<font size=-1>[ This Message was edited by: kensuguro on 2002-02-08 13:37 ]</font>
User avatar
spacef
Posts: 3235
Joined: Sun Jun 17, 2001 4:00 pm
Contact:

Post by spacef »

:lol:

<font size=-1>[ This Message was edited by: spacef on 2002-02-08 15:10 ]</font>
User avatar
at0m
Posts: 4743
Joined: Sat Jun 30, 2001 4:00 pm
Location: Bubble Metropolis
Contact:

Post by at0m »

Hi,

That's an interesting idea, Ken. I've been thinking about it myself too lately.

There's roughly 3 way's of adapting Cutoff Freq to the signal.
° With midi instruments and notes, it's quite easy to achieve. Just make a Filter Key Follower, who will do the job after some fine tuning.
° When you want to stream audio, it get's harder. Afaik, there's no such thing as a usefull audio frequency analyzer. :eek:
° But I think Ken my last option. Imagine having setup a Project with full midi remote. You start writing in the sequencer, put down some sounds (any, from guitar and dsp synth to Rewire track) to a Remote controlled Filter. It's resonance will create harmonics at the cutoff frequency.
Now, what value do I send via midi or do I manually set my knob to? :lol:
Ken, I think the Key follower is still the best option, try doubling your vocal/guitar notes to midi.
I really like Moonizer's setup, but the filter sound kinda weak. The Moonizer can be used as Following to Amp In or a note triggering an ADSR. SpaceF could put the ADSP a key follower as extra to the ADSR note triggering. (if he's not done it already).

But then again, how do we get these harmonics right? Pulsar could contain the solution in itself. It's faders and knobs are mostly displayed like 0-127 values, but as you might have seen there's way more values for a knob or a fader possible. Some text interface's allow you to input more precise data entry though. Right now I'm looking for one... yup, ie. the SSB Phaser's Range value. You can enter ANY value between 0.00001 and 1.

Got to go, DSP's are waiting. :wink:

atomic.
User avatar
spacef
Posts: 3235
Joined: Sun Jun 17, 2001 4:00 pm
Contact:

Post by spacef »

in fact i think the solution is to mail to CW to ask them to include F/Hz display on the filters and not 0-127 :smile:
no?

For the moonizer, i have something to add to the enveloppe trigger (and change the filters of course :smile: but the key follower was not scheduled (may be if i find the time to experiment but that will be for around june like kensuguro).

<font size=-1>[ This Message was edited by: spacef on 2002-02-11 04:55 ]</font>
User avatar
at0m
Posts: 4743
Joined: Sat Jun 30, 2001 4:00 pm
Location: Bubble Metropolis
Contact:

Post by at0m »

If it's Creamware who deceides on what we see under the filter knobs, it would be very kind of the to at least provide that option to developers. EQ's work fith frequencies, but filter's don't :???:

A key follower is something that can be used to exactly simulate that. Thanks for your understanding, SpaceF :smile:

atom.
User avatar
spacef
Posts: 3235
Joined: Sun Jun 17, 2001 4:00 pm
Contact:

Post by spacef »

Oh well, it's not necessarily a decision of creamware "not" to make it available, but may be it's closer to what exist in the real hardwares, or to match your midi controllers values (or they didn't think someone would have real mathemetaphysical problems with this , hehe :smile:
User avatar
at0m
Posts: 4743
Joined: Sat Jun 30, 2001 4:00 pm
Location: Bubble Metropolis
Contact:

Post by at0m »

I understand Creamware's choosen not to show the real Hz values, but their midi values which are also commonly used in hardware.
Can developers change these standard read-outs?

I'm note quite sure yet if that will improve my songs :grin: but I know for sure that I'll try to get the right (or preferred) harmonics.
Maybe we should all just trust our ears, like in the real analog world. To me it's like notes, the cutoff frequency and reso. If I can get them right, I will :lol:
castol
Posts: 323
Joined: Wed Oct 03, 2001 4:00 pm

Post by castol »

excuse me if this isn't allready obvious.

i can hover my pointer over some parameters and am presented with a very accurate real number value...say db for a gain control or ms for envelope or delay parameters.

this behaviour just doesn't seem to be very consistent though. like....i can get a pop up for all envelope times except sustain. and at times nothing will pop up a value, for whatever reason. the same goes for db value in the rm242, sometimes i get a pop up value, other times no.

i've been working on porting a patch from the mod1 and believe it or not the 4 pole hp filter module in this particular patch actually does display a value window in hz....down to the thousandth value i think it was. the patch is "personality of a blue fish".

but, the other 4 filters and their frequencies don't display a pop up value. i could have sworn i've encountered filters in the mod2 that have poped up values, but they aren't doing it for me now.

also on some frequency and db outputs if you hold your pointer over them your displayed the out value in hz or db.....this behavior is subject to the same anomalies as above though.

i'll email cw about this....because it clearly makes no sense and is entirely possible.
User avatar
Neutron
Posts: 2274
Joined: Sun Apr 29, 2001 4:00 pm
Location: Great white north eh
Contact:

Post by Neutron »

It is easy enough for developers to use frequency instead of 0-127 they just have to use a different kind of "range text"
or even have both kinds there. they decided not to in modular.

The properties of each knob can be different, the developer can choose any amount of "exponentialness" as well as the upper and lower limit.
Post Reply