From d2b00a80c237c1c3d8bc9551966cf781292525e6 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 18 Mar 2019 10:32:30 +0800 Subject: Fixed initial preset selection in XG mode. --- ChangeLog | 3 +++ core/qmpmidioutfluid.cpp | 17 ++++++----------- core/qmpmidiplay.cpp | 17 +++++++++++++---- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b733e7..d7490c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2019-03-18 0.8.6 alpha +Fixed initial preset selection in XG mode. + 2019-03-13 0.8.6 alpha Set preset bank correctly in XG mode. Removed High DPI handling code. Good luck to Windows users out there. 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;eptrbasicMessage(0xB0|i,cc,chstatus[i][cc]); + } } void CMidiPlayer::playerDeinit() { -- cgit v1.2.3