GUI: a few more visualizer tweaks

This commit is contained in:
tildearrow 2022-02-22 00:13:32 -05:00
parent 7540f12596
commit 2d90881a55
3 changed files with 20 additions and 1 deletions

View file

@ -2865,6 +2865,7 @@ void FurnaceGUI::doRedo() {
void FurnaceGUI::play(int row) {
e->walkSong(loopOrder,loopRow,loopEnd);
memset(lastIns,-1,sizeof(int)*DIV_MAX_CHANS);
if (row>0) {
e->playToRow(row);
} else {
@ -5797,4 +5798,5 @@ FurnaceGUI::FurnaceGUI():
memset(patChanX,0,sizeof(float)*(DIV_MAX_CHANS+1));
memset(patChanSlideY,0,sizeof(float)*(DIV_MAX_CHANS+1));
memset(lastIns,-1,sizeof(int)*DIV_MAX_CHANS);
}

View file

@ -622,6 +622,7 @@ class FurnaceGUI {
std::deque<UndoStep> redoHist;
float keyHit[DIV_MAX_CHANS];
int lastIns[DIV_MAX_CHANS];
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
void drawFMEnv(unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, const ImVec2& size);

View file

@ -597,7 +597,6 @@ void FurnaceGUI::drawPattern() {
//if (i.cmd==DIV_CMD_NOTE_ON) continue;
if (i.cmd==DIV_CMD_PRE_PORTA) continue;
if (i.cmd==DIV_CMD_PRE_NOTE) continue;
if (i.cmd==DIV_CMD_INSTRUMENT) continue;
if (i.cmd==DIV_CMD_SAMPLE_BANK) continue;
if (i.cmd==DIV_CMD_GET_VOLUME) continue;
if (i.cmd==DIV_ALWAYS_SET_VOLUME) continue;
@ -646,6 +645,23 @@ void FurnaceGUI::drawPattern() {
color=volGrad;
break;
}
case DIV_CMD_INSTRUMENT: {
if (lastIns[i.chan]==i.value) {
num=0;
break;
}
lastIns[i.chan]=i.value;
speedX=0.0f;
speedY=0.0f;
grav=0.0f;
frict=0.98;
spread=30.0f;
life=128.0f;
lifeSpeed=6.0f;
color=insGrad;
num=7+pow(i.value,0.6);
break;
}
case DIV_CMD_PANNING: {
if (i.value==0) {
num=0;