diff options
author | Chris Xiong <chirs241097@gmail.com> | 2017-02-10 23:56:09 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2017-02-10 23:56:09 +0800 |
commit | acf466561f17bf0eb6c19ea0467b27f5392aeb36 (patch) | |
tree | e2a2eb7c87e99a47d2536c10abcee6e3b50cdded /core | |
parent | 70f0007154992c0bc89e11af4fe7dcc2c493aac3 (diff) | |
download | QMidiPlayer-acf466561f17bf0eb6c19ea0467b27f5392aeb36.tar.xz |
Road to standardize: use two parameters for pitchbend.
Documentation.
Minor bug fix.
Diffstat (limited to 'core')
-rw-r--r-- | core/qmpmidiplay.cpp | 15 | ||||
-rw-r--r-- | core/qmpmidiread.cpp | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 0bb73f9..ec9f059 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -75,8 +75,11 @@ void CMidiPlayer::processEvent(const SEvent *e) if(e->p1==6)rpnval[e->type&0x0F]=e->p2; if(~rpnid[e->type&0x0F]&&~rpnval[e->type&0x0F]) { - if(rpnid[e->type&0x0F]==0)fluid_synth_pitch_wheel_sens(synth,e->type&0x0F,rpnval[e->type&0x0F]); - pbr[e->type&0x0F]=rpnval[e->type&0x0F]; + if(rpnid[e->type&0x0F]==0) + { + fluid_synth_pitch_wheel_sens(synth,e->type&0x0F,rpnval[e->type&0x0F]); + pbr[e->type&0x0F]=rpnval[e->type&0x0F]; + } rpnid[e->type&0x0F]=rpnval[e->type&0x0F]=-1; } chstatus[e->type&0x0F][e->p1]=e->p2; @@ -93,11 +96,11 @@ void CMidiPlayer::processEvent(const SEvent *e) fluid_synth_program_change(synth,e->type&0x0F,e->p1); break; case 0xE0://PW - pbv[e->type&0x0F]=e->p1; + pbv[e->type&0x0F]=(e->p1|(e->p2<<7))&0x3FFF;; if(mappedoutput[e->type&0x0F]) - mapper->pitchBend(mappedoutput[e->type&0x0F]-1,e->type&0x0F,e->p1); + mapper->pitchBend(mappedoutput[e->type&0x0F]-1,e->type&0x0F,(e->p1|(e->p2<<7))&0x3FFF); else - fluid_synth_pitch_bend(synth,e->type&0x0F,e->p1); + fluid_synth_pitch_bend(synth,e->type&0x0F,(e->p1|(e->p2<<7))&0x3FFF); break; case 0xF0://Meta/SysEx if((e->type&0x0F)==0x0F) @@ -154,7 +157,7 @@ void CMidiPlayer::processEventStub(const SEvent *e) ccc[e->type&0x0F][129]=e->p1; break; case 0xE0://PW - ccc[e->type&0x0F][130]=e->p1; + ccc[e->type&0x0F][130]=(e->p1|(e->p2<<7))&0x3FFF; break; case 0xF0://Meta/SysEx if((e->type&0x0F)==0x0F) diff --git a/core/qmpmidiread.cpp b/core/qmpmidiread.cpp index 92573d2..478ec82 100644 --- a/core/qmpmidiread.cpp +++ b/core/qmpmidiread.cpp @@ -82,7 +82,7 @@ int CSMFReader::eventReader()//returns 0 if End of Track encountered break; case 0xE0://Pitch wheel p1=fgetc(f);p2=fgetc(f);byteread+=2; - ret->eventList.push_back(SEvent(curid,curt,type,(p1|(p2<<7))&0x3FFF,0)); + ret->eventList.push_back(SEvent(curid,curt,type,p1,p2)); break; case 0xF0: if((type&0x0F)==0x0F)//Meta Event |