Trouble with [pak] and [bendin]

Maja Karlsson's icon

I am trying to use [pak] and [list.sum] to get the midi pitch + pitch bend as a float. But if I perform any operation, like [div] on the pitchbend (to use hires and variable pb range) the [list.sum] outputs only the pitchbend information without summing with the original note value.

Now suddenly I got it to work, but not in the rnbo-subpatcher I am working on, only in this fresh snippet, So I don't know if this question makes sense, but if anyone recognizing this problem, let me know.

[edit] I noticed the console gives me "list index out of range"

Max Patch
Copy patch and select New From Clipboard in Max.

riccardo dapelo's icon

You are using <pak f f> so the div should be initialized with a float (127.) Here runs, also in rnbo.

Max Patch
Copy patch and select New From Clipboard in Max.

Maja Karlsson's icon

Oh, thank you, I quickly got in the habit of discarding the int/float distinction after reading that everything is floats in rnbo. Facepalm.

Source Audio's icon

in rnbo objects like div, pak, expr etc make no difference if input is

int or float.

you can pak note and bendin inputs into list

and route to expr in1 + in2 / 127

in plain max expr needs float divider

expr $i1 + $i2 / 127.

by the way , one should use pbend as offset from pitch center.

you do something else by adding pbend to note

Maja Karlsson's icon

What is the different between pbend as offset and simply adding?

Adding seemed like a simple solution, and if my pb range is 1 adding a normalised full pb to pitch gives me next note, and mtof accepting float pitches makes the bending smooth. To my ears this sounds like a correct pitch bend.

Roman Thilenius's icon

because 1.) between pitchbend data and the frequency of a generator there is usually a multiplier which says how semitones the wheel should change, and 2.) because you usually divide by 8192 for <=0 and by 8191 for >0

Source Audio's icon

"Adding seemed like a simple solution"

Solution to what ?

pbend at it's center describes note without any bend.

depending on your needs, you could also use bendmode -1. ~ 1.

Maja Karlsson's icon

@roman:

1) yes, I did not include the pitchbend range in my question because it was not relevant, but in my full patch there is a multiplier before adding bend to the midi pitch

2) that 0,00012 difference in pitch does not worry me

@source: solution to having my instrument respond to pitch bend.