Problem with multiplication


#1

Excuse me for my English
In your opinion is correct behavior of this patch.
Thank


#2

In order to see better what's going on, it's best to use dials of the same type. You'll notice in the screenshot that the dial p objects are positive-only signals, and the dial b objects can have positive + negative values.

Another thing you need to keep in mind is execution order. The placement of the objects will define how your patch works. Axoloti works from left to right, top to bottom. In your screenshot, the muls 64 object is closest to the top of the window, so its code will be executed first. If you place it lower than the **math/*** object, you might get different results.

Hope this helps.


#3

the problem is that the multiplication 0.50 x 10:00 results in 0.08


#4

the maths/multiply are correct.

the issue is your trying to literally interpret the numbers as integers, which they are not...

the best way to understand this is to view things as percentages.

so 0..64 is 0..100% , or better 0 to 1,

so as an example, if you see 32 on a dial which goes from 0..64, then this is 50% , or 0.5 of the 'full range' - so now imagine 32 * 32 = 0.5 *0.5 = 0.25 = 16

so 0.5 x 10

0.5 = 0.5/64 = 0.0078125
10 = 10/64 = 0.15625

0.15625 x 0.0078125 = 0.0012207 * 64 = 0.078125,
rounded display = 0.08 (note internally its more accurate)

its perhaps confusing at first, but using 64, makes sense due to the way midi maps to 7 bits.
i.e. one 'increment' of a CC = .5 for unipolar or 1 for bipolar (due to double range)

also becareful when using the oneliner, these are not integers, they are using Q27 format, there are some notes on this elsewhere on the website... (I think a recent topic in the helpdesk covers this now)


#5

Yes, good explanation @thetechnobear !
It's possible to see the Q27 value with disp/hex object.
You can also use math/*c object in place of math/muls and ctrl/dial p object.

And, in the oneliner object, "+1" before "/64" is not a good idea, because you use Q27 fixed point integer.

Sorry for my bad english too :slight_smile: