aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-03-18 10:32:30 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-03-18 10:32:30 +0800
commitd2b00a80c237c1c3d8bc9551966cf781292525e6 (patch)
tree6434e0b6a220c2355f7bf06124dda5a579be2ccc /core
parentcf15fde2aa2bcbb244fdfdc46debf457451079f7 (diff)
downloadQMidiPlayer-d2b00a80c237c1c3d8bc9551966cf781292525e6.tar.xz
Fixed initial preset selection in XG mode.
Diffstat (limited to 'core')
-rw-r--r--core/qmpmidioutfluid.cpp17
-rw-r--r--core/qmpmidiplay.cpp17
2 files changed, 19 insertions, 15 deletions
diff --git a/core/qmpmidioutfluid.cpp b/core/qmpmidioutfluid.cpp
index 8055421..ab0ab9d 100644
--- a/core/qmpmidioutfluid.cpp
+++ b/core/qmpmidioutfluid.cpp
@@ -30,15 +30,6 @@ void qmpMidiOutFluid::deviceInit()
}
fluid_synth_set_chorus(synth,3,2.0,0.3,8.0,
FLUID_CHORUS_MOD_SINE);
- /*if(midiFile->std==4)
- fluid_synth_set_channel_type(synth,9,CHANNEL_TYPE_MELODIC);
- else if(midiFile->std==1)
- fluid_synth_set_channel_type(synth,9,CHANNEL_TYPE_DRUM);
- else
- {
- fluid_synth_set_channel_type(synth,9,CHANNEL_TYPE_DRUM);
- fluid_synth_bank_select(synth,9,128);
- }*/
}
void qmpMidiOutFluid::deviceDeinit(){deviceDeinit(false);}
void qmpMidiOutFluid::deviceDeinit(bool freshsettings)
@@ -108,12 +99,16 @@ void qmpMidiOutFluid::panic(uint8_t ch)
void qmpMidiOutFluid::reset(uint8_t ch)
{
this->panic(ch);
- fluid_synth_cc(synth,ch,0,0);
+ for(int i=0;i<128;++i)
+ fluid_synth_cc(synth,ch,i,0);
+ if(ch==9)
+ fluid_synth_cc(synth,ch,0,127);
+ else
+ fluid_synth_cc(synth,ch,0,0);
fluid_synth_cc(synth,ch,7,100);
fluid_synth_cc(synth,ch,8,64);
fluid_synth_cc(synth,ch,10,64);
fluid_synth_cc(synth,ch,11,127);
- fluid_synth_cc(synth,ch,32,0);
fluid_synth_pitch_wheel_sens(synth,ch,2);
}
void qmpMidiOutFluid::onMapped(uint8_t,int)
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp
index 58c344e..84561ae 100644
--- a/core/qmpmidiplay.cpp
+++ b/core/qmpmidiplay.cpp
@@ -221,7 +221,8 @@ void CMidiPlayer::fileTimer2Pass()
ccc[i][76]=64;ccc[i][77]=64;ccc[i][78]=64;
ccc[i][131]=ctempo;ccc[i][132]=0x04021808;
ccc[i][133]=0;ccc[i][134]=2;
- }if(midiFile->std!=4)ccc[9][0]=128;
+ }
+ ccc[9][0]=127;
for(int i=0;i<16;++i)for(int j=0;j<135;++j)
ccstamps[0][i][j]=ccc[i][j];
for(uint32_t eptr=0,ct=getEvent(0)->time;eptr<ecnt;)
@@ -263,10 +264,12 @@ CMidiPlayer::CMidiPlayer()
mididev[0].refcnt=16;
memset(chstatus,0,sizeof(chstatus));
for(int i=0;i<16;++i)
- chstatus[i][7]=100,chstatus[i][11]=127,
+ {
+ chstatus[i][7]=100;chstatus[i][11]=127;
chstatus[i][10]=chstatus[i][71]=chstatus[i][72]=
chstatus[i][73]=chstatus[i][74]=chstatus[i][75]=
chstatus[i][76]=chstatus[i][77]=chstatus[i][78]=64;
+ }
#ifdef _WIN32
QueryPerformanceFrequency((LARGE_INTEGER*)&pf);
#endif
@@ -325,11 +328,17 @@ void CMidiPlayer::playerInit()
tceptr=0;tcstop=0;tcpaused=0;finished=0;mute=solo=0;
for(int i=0;i<16;++i)pbr[i]=2,pbv[i]=8192;
sendSysEx=true;memset(rpnid,0xFF,sizeof(rpnid));memset(rpnval,0xFF,sizeof(rpnval));
- memset(chstatus,0,sizeof(chstatus));for(int i=0;i<16;++i)
- chstatus[i][7]=100,chstatus[i][11]=127,
+ memset(chstatus,0,sizeof(chstatus));
+ chstatus[9][0]=127;
+ for(int i=0;i<16;++i)
+ {
+ chstatus[i][7]=100;chstatus[i][11]=127;
chstatus[i][10]=chstatus[i][71]=chstatus[i][72]=
chstatus[i][73]=chstatus[i][74]=chstatus[i][75]=
chstatus[i][76]=chstatus[i][77]=chstatus[i][78]=64;
+ for(int cc=0;cc<127;++cc)
+ mididev[mappedoutput[i]].dev->basicMessage(0xB0|i,cc,chstatus[i][cc]);
+ }
}
void CMidiPlayer::playerDeinit()
{