## Removing acceleration while sweeping frequencies

Jan 21 2007 | 2:52 am
I have created a frequency sweep modulating the center frequency of a BP filter. Right now, the output of the modulating oscillator maps onto the values 50Hz-22.05kHz. Obviously, this creates a sweep that spends a long time in the high end, and only a very short moment in the bottom end. It seems to me that the proper map would flip the exponential curve that frequency lies on, thereby reversing the acceleration. Audibly, this would sound like a linear sweep from high to low, no?
Nonetheless, I'm lost. I have searched and searched the forum and don't seem to find a thread that addresses this exactly. I can understand the math if you give it to me in small bites... Please help!
Beyond this, I'd like a way to do this that is changeable. In other words, I'd like to dynamically change the frequency values that are mapped onto (so, move from a sweep between 50Hz-22.05kHz to a sweep between 440Hz-2kHz.) Does anyone have an object for this? I've been looking at lp.scampf, but it doesn't seem to serve my purpose. Isn't this just a sort of alternate for zmap? If I'm missing something--like a particular scaling factor that I should use--please let me know.
Many thanks, Brennon

• Jan 21 2007 | 4:08 am
If someone is able to explain the mathematics behind this as well, it would be helpful. I'd like to be able to implement this in different ways, and understanding the math will help me do this.
Thanks again, Brennon
• Jan 21 2007 | 5:37 am
Have you looked at scale? It has a very nice and easy input labled "exponential base value" which lets one define a curve. You could also check out curve~ which can do this sort of thing in the signal domain - but would need some twisting to get it to do what you want. Finally, you could try running the input into mtof which will take care of the math for you (or expr for that matter - check out the .help for expr). Clearly I don't know the math either, but boy do those objects help me out a lot.
Quote: brennon@brennonbortz.com wrote on Sat, 20 January 2007 18:52 ---------------------------------------------------- > Does anyone have an object for this? ----------------------------------------------------
• Jan 21 2007 | 7:22 am
Yes, I can get scale to work...sort of. Except, I have no clue how the exponential base value works. Is there a specific value to use here to accomplish what I am trying to do?
--BB
• Jan 21 2007 | 11:22 am
On 21 Jan 2007, at 05:08, Brennon wrote:
> > If someone is able to explain the mathematics behind this as well, > it would be helpful. I'd like to be able to implement this in > different ways, and understanding the math will help me do this.
here is one way to do it - with the maths exposed...
the idea is to take the ratio of the two frequencies, raise it to the power of x (where x is between 0 and 1) and use that to scale (multiply with) freqA.
you can easily make an abstraction out of it. hope that helps. volker.
• Jan 21 2007 | 11:25 pm
Works perfectly--thank you! I just wish I new how... :(
I understand what you are doing mathematically, but I'm not sure why this works. Can anyone enlighten me?
Thanks!
• Jan 22 2007 | 3:10 am
Yeah, that's pretty cool and could be very useful!
Best I can say is that the scaler takes advantage of the fact that anything to the 0 power is 1, and anything to the 1 power is itself... so anything in between... take the ratio of your two numbers... multiply by the denominator again, you get the desired log-based frequency.
or something.
-C
p.s. the expr object can be tricky to read and to get it to work sometimes, but it's great. also look up vexpr if you want to work with lists and calculations. don't forget the scalarmode 1 command if you do use vexpr.
• Jan 22 2007 | 10:27 am
On 21 janv. 07, at 03:52, Brennon wrote:
> > I have created a frequency sweep modulating the center frequency of a > BP filter. Right now, the output of the modulating oscillator maps > onto the values 50Hz-22.05kHz. Obviously, this creates a sweep that > spends a long time in the high end, and only a very short moment in > the bottom end. It seems to me that the proper map would flip the > exponential curve that frequency lies on, thereby reversing the > acceleration. Audibly, this would sound like a linear sweep from high > to low, no?
You can also make your modulator sweeping from MIDI note 0. to 136.7 (in floats!!) and convert the notes to frequencies with [mtof 0.]
p
_____________________________ Patrick Delges
Centre de Recherches et de Formation Musicales de Wallonie asbl http://users.skynet.be/crfmw/max
• Jan 22 2007 | 7:54 pm
IS there any way to do this beyond this range? Or am I limited from 0-136.7?
• Jan 22 2007 | 8:10 pm
On 22-janv.-07, at 20:54, Brennon wrote:
> > IS there any way to do this beyond this range? Or am I limited from > 0-136.7?
This range maps more or less the full spectrum at 44100Hz but mtof works with negative numbers, and with very big numbers. Just try!
p
• Jan 24 2007 | 6:54 pm
Brennon wrote: > IS there any way to do this beyond this range? Or am I limited from > 0-136.7?
Why not? but you won't hear it or get nice aliasing frequencies (depending on sample rate and basic material) The hearing range is ca. 10 octaves, and its actually Midi roughly 15 to 135 for 20Hz to 20000 Hz the 0-136.8 is the theoretic range for a sampling frequnecy of 44.1 KHz. But Midi 0 is only 8.175 Hz, you can go down to -288 to hit 0... That means you have a pitch range from -288 to 136.8 with 44.1 kHz...
Stefan
-- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com