alt text

Hi,

I use PlugData v0.6.2 based on Pd-0.52.2 to create a patch for Bela(v0.3.8f, 4 Jan 2022, pd 0.51.4) to control the pitch bend slider of a third party software(Ample guitar SC).
From the help file bendout object takes values from -8192 to 8191 and to my knowledge output values from 0 to 16383.

Test 1 : PlugData via loopmidi vs MidiView and Ample guitar SC

Bendout input ----- MidiView -----------Ample guitar
-8192 -------------------- 0 ------------------------- 0%
0 ---------------------------8192 -------------------- 50%
8191 ---------------------16383 ------------------- 100%

So with PlugData bendout does exactly what it should in both MidiView and Ample guitar SC.

Test 2 : Bela via midi function vs MidiView and Ample guitar SC.

Potentiometer -------- MidiView ----------------------Ample guitar SC
0kΩ ------------------------- 8192 -------------------------------- 50%
5kΩ ------------------------ 16383 ------------------------------- 100%
Tipping point
5kΩ ------------------------- 0 ------------------------------------- 0%
10kΩ ----------------------- 8191 -------------------------------- 50%

With Bela bendout does not work as it should in both MidiView and Ample guitar SC

Does any one knows what could cause this?

Thanks!

right, can you try the following change?

diff --git a/core/default_libpd_render.cpp b/core/default_libpd_render.cpp
index d6dc84fd..1096c5e1 100644
--- a/core/default_libpd_render.cpp
+++ b/core/default_libpd_render.cpp
@@ -255,7 +255,7 @@ void Bela_MidiOutPitchBend(int channel, int value) {
        unsigned int port = getPortChannel(&channel);
        if(gMidiVerbose >= kMidiVerbosePrintLevel)
                rt_printf("bendout _ port: %d, channel: %d, value: %d\n", port, channel, value);
-       port < midi.size() && midi[port]->writePitchBend(channel, value);
+       port < midi.size() && midi[port]->writePitchBend(channel, value + 8192);
 }

 void Bela_MidiOutAftertouch(int channel, int pressure){

i.e.: on the board, edit /root/Bela/core/default_libpd_render.cpp to apply the change above.

If you are not comfortable with the terminal, run this in the console at the bottom of the IDE and then edit the .cpp file that appears in your project:

cp /root/Bela/core/default_libpd_render.cpp projects/MYPROJECT/render.cpp

if it works fine , then you can copy that file back to overwrite the default one:

mv projects/MYPROJECT/render.cpp /root/Bela/core/default_libpd_render.cpp

in both cases, replace MYPROJECT with the name of your project

That was it! Thanks a bunch giuliomoro. Now works like a treat .... yeaaahhh!!!!!

great, I am going to push that change to the dev branch. Thanks for raising the issue.