Kurumitsu-8L: change channel volume handling
In order to keep the same modulation output, it now scales with pan instead of envelope
This commit is contained in:
parent
d7984896d8
commit
37b2a058c3
|
@ -118,11 +118,19 @@ void DivPlatformKurumitsu8L::updateWave(int ch) {
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformKurumitsu8L::writePan(int ch) {
|
||||
if (!isMuted[ch] && chan[ch].active) {
|
||||
chWrite(ch,1,VOL_SCALE_LINEAR(chan[ch].panL,chan[ch].vol,255));
|
||||
chWrite(ch,2,VOL_SCALE_LINEAR(chan[ch].panR,chan[ch].vol,255));
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformKurumitsu8L::tick(bool sysTick) {
|
||||
for (int i=0; i<8; i++) {
|
||||
bool panChanged=false;
|
||||
chan[i].std.next();
|
||||
if (chan[i].std.vol.had) {
|
||||
chan[i].outVol=VOL_SCALE_LOG(chan[i].vol,chan[i].std.vol.val,255);
|
||||
chan[i].outVol=chan[i].std.vol.val;
|
||||
if (!isMuted[i] && chan[i].active) {
|
||||
chWrite(i,0,~chan[i].outVol&255);
|
||||
}
|
||||
|
@ -144,15 +152,11 @@ void DivPlatformKurumitsu8L::tick(bool sysTick) {
|
|||
}
|
||||
if (chan[i].std.panL.had) {
|
||||
chan[i].panL=chan[i].std.panL.val;
|
||||
if (!isMuted[i] && chan[i].active) {
|
||||
chWrite(i,1,chan[i].panL);
|
||||
}
|
||||
panChanged=true;
|
||||
}
|
||||
if (chan[i].std.panR.had) {
|
||||
chan[i].panR=chan[i].std.panR.val;
|
||||
if (!isMuted[i] && chan[i].active) {
|
||||
chWrite(i,2,chan[i].panR);
|
||||
}
|
||||
panChanged=true;
|
||||
}
|
||||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
|
@ -196,20 +200,21 @@ void DivPlatformKurumitsu8L::tick(bool sysTick) {
|
|||
}
|
||||
if (chan[i].keyOn || chan[i].keyOff) {
|
||||
if (!chan[i].std.vol.had) {
|
||||
chan[i].outVol=chan[i].vol;
|
||||
chan[i].outVol=255;
|
||||
}
|
||||
if (!isMuted[i] && chan[i].active) {
|
||||
chWrite(i,0,~chan[i].outVol&255);
|
||||
chWrite(i,1,chan[i].panL);
|
||||
chWrite(i,2,chan[i].panR);
|
||||
panChanged=true;
|
||||
} else {
|
||||
chWrite(i,0,255);
|
||||
chWrite(i,1,0);
|
||||
chWrite(i,2,0);
|
||||
panChanged=false;
|
||||
}
|
||||
if (chan[i].keyOn) chan[i].keyOn=false;
|
||||
if (chan[i].keyOff) chan[i].keyOff=false;
|
||||
}
|
||||
if (panChanged) writePan(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,7 +231,7 @@ int DivPlatformKurumitsu8L::dispatch(DivCommand c) {
|
|||
chan[c.chan].keyOn=true;
|
||||
chan[c.chan].macroInit(ins);
|
||||
if (!parent->song.brokenOutVol && !chan[c.chan].std.vol.will) {
|
||||
chan[c.chan].outVol=chan[c.chan].vol;
|
||||
chan[c.chan].outVol=255;
|
||||
if (!isMuted[c.chan] && chan[c.chan].active) {
|
||||
chWrite(c.chan,0,~chan[c.chan].outVol&255);
|
||||
}
|
||||
|
@ -257,19 +262,11 @@ int DivPlatformKurumitsu8L::dispatch(DivCommand c) {
|
|||
case DIV_CMD_VOLUME:
|
||||
if (chan[c.chan].vol!=c.value) {
|
||||
chan[c.chan].vol=c.value;
|
||||
if (!chan[c.chan].std.vol.has) {
|
||||
chan[c.chan].outVol=c.value;
|
||||
if (!isMuted[c.chan] && chan[c.chan].active) {
|
||||
chWrite(c.chan,0,~chan[c.chan].outVol&255);
|
||||
}
|
||||
}
|
||||
writePan(c.chan);
|
||||
}
|
||||
break;
|
||||
case DIV_CMD_GET_VOLUME:
|
||||
if (chan[c.chan].std.vol.has) {
|
||||
return chan[c.chan].vol;
|
||||
}
|
||||
return chan[c.chan].outVol;
|
||||
return chan[c.chan].vol;
|
||||
break;
|
||||
case DIV_CMD_PITCH:
|
||||
chan[c.chan].pitch=c.value;
|
||||
|
@ -306,10 +303,7 @@ int DivPlatformKurumitsu8L::dispatch(DivCommand c) {
|
|||
case DIV_CMD_PANNING: {
|
||||
chan[c.chan].panL=c.value;
|
||||
chan[c.chan].panR=c.value2;
|
||||
if (!isMuted[c.chan] && chan[c.chan].active) {
|
||||
chWrite(c.chan,1,chan[c.chan].panL);
|
||||
chWrite(c.chan,2,chan[c.chan].panR);
|
||||
}
|
||||
writePan(c.chan);
|
||||
break;
|
||||
}
|
||||
case DIV_CMD_LEGATO:
|
||||
|
@ -356,8 +350,7 @@ void DivPlatformKurumitsu8L::muteChannel(int ch, bool mute) {
|
|||
isMuted[ch]=mute;
|
||||
if (!mute && chan[ch].active) {
|
||||
chWrite(ch,0,~chan[ch].outVol&255);
|
||||
chWrite(ch,1,chan[ch].panL);
|
||||
chWrite(ch,2,chan[ch].panR);
|
||||
writePan(ch);
|
||||
} else {
|
||||
chWrite(ch,0,255);
|
||||
chWrite(ch,1,0);
|
||||
|
|
|
@ -45,6 +45,7 @@ class DivPlatformKurumitsu8L: public DivDispatch {
|
|||
char modLabel[8][4];
|
||||
int modData;
|
||||
void updateWave(int ch);
|
||||
void writePan(int ch);
|
||||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
|
|
|
@ -8687,7 +8687,7 @@ void FurnaceGUI::drawInsEdit() {
|
|||
}
|
||||
break;
|
||||
case DIV_INS_KURUMITSU_8L:
|
||||
macroList.push_back(FurnaceGUIMacroDesc(_("Volume"),&ins->std.volMacro,0,255,160,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(_("Envelope"),&ins->std.volMacro,0,255,160,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(_("Arpeggio"),&ins->std.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.arpMacro.val));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(_("Waveform"),&ins->std.waveMacro,0,waveCount,160,uiColors[GUI_COLOR_MACRO_WAVE],false,NULL,NULL,false,NULL));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(_("Panning (left)"),&ins->std.panLMacro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL));
|
||||
|
|
Loading…
Reference in a new issue