Fluxamasynth Pitch Bend problem (I found solution)

Making your program work.
lexplexus
Posts: 2
Joined: Thu May 18, 2017 3:19 pm

Fluxamasynth Pitch Bend problem (I found solution)

Post by lexplexus »

While testing my new Fluxamasynth last week, I noticed some strange responses to pitch bend instructions: only pitchbend numbers divisible by 16 are properly executed in both directions (up and down). Last night I was studying MIDI and learned about MSB and LSB (most significant bit, least significant bit), and the code to separate an instruction into those two bits, which includes bits of text which look something like this: "& 0x7f" and ">> 7" which are something to do with "bitwise and" and "shift". This clue led me to investigate the Fluxamasynth.cpp file, which has an ERROR!

The incorrect line in Fluxamasynth.cpp reads:
byte command[3] = { 0xe0 | (channel & 0x0f), byte(v & 0x00ef), byte(v >> 7) };

the hex number 0x00ef should be 0x7f, so the corrected line looks like:
byte command[3] = { 0xe0 | (channel & 0x0f), byte(v & 0x7f), byte(v >> 7) };

Sure enough, I retested and now the pitchBend instructions are fully understood.

Next, I am hoping to access Portamento control via creating a new line in the same file.

I am so happy I could figure this out, I'm new at MIDI hex number stuff.
VICTORY :D