aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/qmpmidiplay.cpp6
-rw-r--r--core/qmpmidiplay.hpp3
2 files changed, 9 insertions, 0 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp
index 5021640..bb09e4a 100644
--- a/core/qmpmidiplay.cpp
+++ b/core/qmpmidiplay.cpp
@@ -75,6 +75,7 @@ void CMidiPlayer::processEvent(const SEvent *e)
if(~rpnid&&~rpnval)
{
if(rpnid==0)fluid_synth_pitch_wheel_sens(synth,e->type&0x0F,rpnval);
+ pbr[e->type&0x0F]=rpnval;
rpnid=rpnval=-1;
}
chstatus[e->type&0x0F][e->p1]=e->p2;
@@ -91,6 +92,7 @@ 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;
if(mappedoutput[e->type&0x0F])
mapper->pitchBend(mappedoutput[e->type&0x0F]-1,e->type&0x0F,e->p1);
else
@@ -328,6 +330,7 @@ void CMidiPlayer::playerInit()
{
ctempo=0x7A120;ctsn=4;ctsd=4;cks=0;dpt=ctempo*1000/divs;
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;rpnid=rpnval=-1;memset(chstatus,0,sizeof(chstatus));
for(int i=0;i<16;++i)
chstatus[i][7]=100,chstatus[i][11]=127,
@@ -405,6 +408,7 @@ double CMidiPlayer::getTempo(){return 60./(ctempo/1e6);}
uint32_t CMidiPlayer::getTick(){return ct;}
uint32_t CMidiPlayer::getRawTempo(){return ctempo;}
uint32_t CMidiPlayer::getDivision(){return divs;}
+double CMidiPlayer::getPitchBend(int ch){return((int)pbv[ch]-8192)/8192.*pbr[ch];}
uint32_t CMidiPlayer::getTCpaused(){return tcpaused;}
void CMidiPlayer::setTCpaused(uint32_t ps){tcpaused=ps;}
uint32_t CMidiPlayer::isFinished(){return finished;}
@@ -457,6 +461,8 @@ void CMidiPlayer::setMute(int ch,bool m)
{setBit(mute,ch,m?1:0);}
void CMidiPlayer::setSolo(int ch,bool s)
{setBit(solo,ch,s?1:0);}
+bool CMidiPlayer::getChannelMask(int ch)
+{return((mute>>ch)&1)||(solo&&!((solo>>ch)&1));}
int CMidiPlayer::getCC(int ch,int id)
{
int ret=0;
diff --git a/core/qmpmidiplay.hpp b/core/qmpmidiplay.hpp
index 96dfd12..0587cf2 100644
--- a/core/qmpmidiplay.hpp
+++ b/core/qmpmidiplay.hpp
@@ -75,6 +75,7 @@ class CMidiPlayer
//thread control
uint32_t tceptr,tcpaused,tcstop,ct;
uint32_t finished,resumed;
+ uint32_t pbr[16],pbv[16];
qmpMidiMapperRtMidi *mapper;
int mappedoutput[16],deviceusage[16],deviceiid[128];
uint8_t chstate[16],chstatus[16][130];//0..127: cc 128: pc
@@ -126,6 +127,7 @@ class CMidiPlayer
uint32_t getTick();
uint32_t getRawTempo();
uint32_t getDivision();
+ double getPitchBend(int ch);
const char* getTitle();
const char* getCopyright();
@@ -139,6 +141,7 @@ class CMidiPlayer
void getChannelPreset(int ch,int *b,int *p,char *name);
void setMute(int ch,bool m);
void setSolo(int ch,bool s);
+ bool getChannelMask(int ch);
int getCC(int ch,int id);
void setCC(int ch,int id,int val);
void getReverbPara(double *r,double *d,double *w,double *l);