## use of pow in expr

Dec 1, 2013 at 8:23am

# use of pow in expr

approaching msp tutorial 18 i’m having a bit of difficulty understanding the use of “pow” in various mathematical expressions to produce for example, a frequency change of one octave of any incoming signal or the “dBtoA” sub patch which converts amplitude in decibels to a decimal number between 1 and 0.

I guess i’m wondering why the use of pow, why is it so effective for these various purpose and why can i not grasp this??

#274302
Dec 1, 2013 at 9:14am

Because Fechner. :)

#274305
Dec 1, 2013 at 9:26am

why could we not use something like scale for the (octave) frequency section of the patch? or for example with the dbtoA sub patch, why not just map the y min to 0 and y max to 1, send the generated y values straight to pack instead of creating an expr that uses -80 db to 0db

#274306
Dec 1, 2013 at 1:14pm

you could indeed use a database to translate 127 note numbers to 127 values in Hz, or to translate 100 steps from 0 to -90 dB/A into 100 steps from 0 to .1.

but you will still need to use pow(), log(), and exp() to create such a transition table.

#274321
Dec 1, 2013 at 11:59pm

why not just map the y min to 0 and y max to 1

Is a woman’s beauty found at the top of her head and bottom of her feet?

#274352
Dec 2, 2013 at 11:27am

Since I’m not sure exactly where the source of your uncertainty lies, I think the best thing I can do is point you to some potentially helpful reading. You might want to do some Google research on “Fechner’s law” and “logarithmic vs. linear”. MSP Tutorial 18 discusses mapping MIDI to amplitude, and MSP Tutorials 17 and 19 discuss mapping MIDI to frequency. I also attempt to explain decibel-based control of amplitude in the latter part of this lesson: Fading by means of interpolation. I hope some of that is helpful.
<code>

– Pasted Max Patch, click to expand. –

</code>

#274435
Dec 2, 2013 at 12:50pm

I think it’s less of a math thing than it is a science thing. For whatever reason, we have certain tendencies of perception. The point of those equations is to make it so the distance between the little notches on a control knob or the keys on a piano match perceived differences. Without those equations, we would have instruments that looked like they were designed by Stradivarius on acid.

I assure you though… if you think sound is a mindfuck, take look at color. The ‘simple’ matter of creating a numerical system to describe uniform differences in color ultimately resulted in the conclusion that color is non-euclidean and impossible to accurately represent, even in 3-dimensions. While we can accurately talk about intervals of sound in terms of euclidean distance and use all sorts of fancy math to create tempered intervals, the world of color lacks similar precision. We come close, but if the physics of vibration suddenly had to deal with the same degree of imprecision, the would of music would be turned on it’s head… It would be a crisis of profound proportion.

So ask yourself… is pow really such a problem? :)

#274449

You must be logged in to reply to this topic.