## multiplying vs. dividing in audio domain

Feb 14 2008 | 9:17 am
I am perhaps an incredible idiot, and am overlooking something obvious, but I'm getting a rather odd response from some of the math objects. I have a simple patch to scale the file position output of sfplay~ to 0.-1. for window driving purposes. Offset and multiply, the scaler's mantra. Well, dividing by 1000. works fine, but, multiplying by .001 generates crazy numbers. Sitting on my mother's knee, she told me that dividing by 1000. was the same as multiplying by 0.001, but something seems a bit of here. I assume I'm whacking a limit on the number size, but why with mult & not divide? If I throw it together in straight max, btw,either of them work fine.

• Feb 14 2008 | 9:59 am
in your patch you are not multiplying by 0.001 you are dividing by .001 this is mostly the cause of your confusion. Also you have the '2' message triggering 1000 into the - object on the left but on the right it's not connected. This will also mess you up.
• Feb 14 2008 | 9:59 am
1- your right-hand trigger is not plugged 2- your right-hand *~ is actually a /~...
pa
• Feb 14 2008 | 10:42 am
Also note that your mother's knee assumed you were working with infinite precision decimal numbers.
Your computer is working with finite precision binary. There are some surprises in there. Google the list on, say 'floating-point precision' for numerous discussions. Peter Elsea has a helpful tutorial for a more structured explanation.
Also, the fine-print of the documentation for /~ points out that the object internally multiplies by the inverse when the divisor is constant. Your mother probably didn't tell you that floating point division is typically about 4-5 times more CPU load than mult.
-- P.
• Feb 14 2008 | 3:44 pm
Aside form the fact that I had not had enough coffee when I threw the example together, I was right in principle....
And my mother did tell me about the efficiency of mult vs. div - thus while I was trying to to use mult. Nice to know it's built in.....
thanks,
M
On Feb 14, 2008, at 11:42, Peter Castine wrote:
> > Also note that your mother's knee assumed you were working with > infinite precision decimal numbers. > > Your computer is working with finite precision binary. There are > some surprises in there. Google the list on, say 'floating-point > precision' for numerous discussions. Peter Elsea has a helpful > tutorial for a more structured explanation. > > Also, the fine-print of the documentation for /~ points out that the > object internally multiplies by the inverse when the divisor is > constant. Your mother probably didn't tell you that floating point > division is typically about 4-5 times more CPU load than mult. > > -- P. > > > -- > ---- > Peter Castine > Litter Power: > iCE Tools: >