aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-10 23:39:45 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-10 23:39:45 +0800
commit841eb920676d6c8ac6440c8929e7422e95a9c4c5 (patch)
treec28dd11fb908682e69d5eb6dc953d1e5bf66b5a7 /core
parente0e4f9f84bb8eed6cde71ff4d67286c2e26e4693 (diff)
downloadQMidiPlayer-841eb920676d6c8ac6440c8929e7422e95a9c4c5.tar.xz
The Last Judgement.
Diffstat (limited to 'core')
-rw-r--r--core/qmpmidimapperrtmidi.cpp4
-rw-r--r--core/qmpmidiplay.cpp10
2 files changed, 7 insertions, 7 deletions
diff --git a/core/qmpmidimapperrtmidi.cpp b/core/qmpmidimapperrtmidi.cpp
index adba267..10f830e 100644
--- a/core/qmpmidimapperrtmidi.cpp
+++ b/core/qmpmidimapperrtmidi.cpp
@@ -77,8 +77,8 @@ void qmpMidiMapperRtMidi::pitchBend(int iid,int ch,int val)
{
if(!ports[iid])return;ch&=0x0F;
std::vector<unsigned char>message;
- message.push_back(0xE0|ch);message.push_back(val&0xFF);
- message.push_back(val>>8);ports[iid]->sendMessage(&message);
+ message.push_back(0xE0|ch);message.push_back(val&0x7F);
+ message.push_back(val>>7);ports[iid]->sendMessage(&message);
}
void qmpMidiMapperRtMidi::sysEx(int iid,int length,const char *data)
{
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp
index 4ee812f..2ea0873 100644
--- a/core/qmpmidiplay.cpp
+++ b/core/qmpmidiplay.cpp
@@ -48,7 +48,7 @@ void CMidiPlayer::processEvent(const SEvent *e)
{
case 0x80://Note off
if(mappedoutput[e->type&0x0F])
- mapper->noteOff(mappedoutput[e->type&0x0F]-1,e->type*0x0F,e->p1);
+ mapper->noteOff(mappedoutput[e->type&0x0F]-1,e->type&0x0F,e->p1);
else
fluid_synth_noteoff(synth,e->type&0x0F,e->p1);
break;
@@ -57,7 +57,7 @@ void CMidiPlayer::processEvent(const SEvent *e)
if(solo&&!((solo>>(e->type&0x0F))&1))break;
if(noteOnCB)noteOnCB->callBack(noteOnCBUserData);
if(mappedoutput[e->type&0x0F])
- mapper->noteOn(mappedoutput[e->type&0x0F]-1,e->type*0x0F,e->p1,e->p2);
+ mapper->noteOn(mappedoutput[e->type&0x0F]-1,e->type&0x0F,e->p1,e->p2);
else
fluid_synth_noteon(synth,e->type&0x0F,e->p1,e->p2);
chstate[e->type&0x0F]=1;
@@ -71,19 +71,19 @@ void CMidiPlayer::processEvent(const SEvent *e)
rpnid=rpnval=-1;
}
if(mappedoutput[e->type&0x0F])
- mapper->ctrlChange(mappedoutput[e->type&0x0F]-1,e->type*0x0F,e->p1,e->p2);
+ mapper->ctrlChange(mappedoutput[e->type&0x0F]-1,e->type&0x0F,e->p1,e->p2);
else
fluid_synth_cc(synth,e->type&0x0F,e->p1,e->p2);
break;
case 0xC0://PC
if(mappedoutput[e->type&0x0F])
- mapper->progChange(mappedoutput[e->type&0x0F]-1,e->type*0x0F,e->p1);
+ mapper->progChange(mappedoutput[e->type&0x0F]-1,e->type&0x0F,e->p1);
else
fluid_synth_program_change(synth,e->type&0x0F,e->p1);
break;
case 0xE0://PW
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);
else
fluid_synth_pitch_bend(synth,e->type&0x0F,e->p1);
break;