Hello, what is the input range of the [bendout] object? bendout-help in pd-extended says "0..127", but several lines later "14-bit-value". Trying in Ubuntu with alsa-midi, [bendout] accepts values -8191 to 8192, but sends other data bytes than I (and my MIDI-to-DMX-Interface) expected. (fine 0, coarse 0 to fine 127 coarse 63 for inputs 0 to 8191, fine 0 coarse 64 to fine 127 coarse 127 for input -8192 to -1). Signed/unsigned-problem?
L.Willkomm Noise Watchers Unlimited Philharmonie de Luxembourg Luxembourg
Laurent WILLKOMM wrote:
Hello, what is the input range of the [bendout] object? bendout-help in pd-extended says "0..127", but several lines later "14-bit-value". Trying in Ubuntu with alsa-midi, [bendout] accepts values -8191 to 8192, but sends other data bytes than I (and my MIDI-to-DMX-Interface) expected. (fine 0, coarse 0 to fine 127 coarse 63 for inputs 0 to 8191, fine 0 coarse 64 to fine 127 coarse 127 for input -8192 to -1). Signed/unsigned-problem?
As nobody replied to this, I made some "research" myself. [bendout] takes values -8191..+8192; if given values below/above these limits it will send the same MIDI messages as on the limits. So the pddp-Helppatch is wrong when it tells us 0..127.
The MIDI messages generated: 0 -> [bendout 0] gives E0 00 40 1 -> [bendout 0] gives E0 01 40 -1 -> [bendout 0] gives E0 7F 3F on WinXP, MacOSX and Linux-RawMidi, but
0 -> [bendout 0] gives E0 00 00 1 -> [bendout 0] gives E0 01 00 -1 -> [bendout 0] gives E0 7F 7F on Linux-AlsaMidi
So AlsaMidi tries to send the 14bit value as signed integer instead of unsigned int centered at 0x2000. Sending these messages to a sound module makes it jump to the pitchbend limits.
(Pd was 0.41.4 extended, MIDI monitored by Midiox on a second computer.)
L.Willkomm