Here is what I suspect to happened when I receive a Program Change with value 0
int progidx=mevt->midiData[1] => 0
plainParamToNormalized -> [0, 1] => 0
so the check (val != (double)progidx) fail.
Then, the progCnt is 0 on my side, and I go to the error case.
There is 2 issues:
- I should change progCnt on my side to ensure the progCnt is not null.
- I should not pass in 2 differents cases when value is 0 and value is !=0, I think you should change the first check
|