mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-31 20:11:29 +00:00
add a little visual to channel names
This commit is contained in:
parent
73dd66b439
commit
d1e166a34e
5 changed files with 24 additions and 2 deletions
|
@ -4911,6 +4911,9 @@ void DivEngine::play() {
|
||||||
} else {
|
} else {
|
||||||
stepPlay=0;
|
stepPlay=0;
|
||||||
}
|
}
|
||||||
|
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||||
|
keyHit[i]=false;
|
||||||
|
}
|
||||||
isBusy.unlock();
|
isBusy.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4921,6 +4924,9 @@ void DivEngine::playToRow(int row) {
|
||||||
sPreview.pos=0;
|
sPreview.pos=0;
|
||||||
freelance=false;
|
freelance=false;
|
||||||
playSub(false,row);
|
playSub(false,row);
|
||||||
|
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||||
|
keyHit[i]=false;
|
||||||
|
}
|
||||||
isBusy.unlock();
|
isBusy.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4929,6 +4935,9 @@ void DivEngine::stepOne(int row) {
|
||||||
if (!isPlaying()) {
|
if (!isPlaying()) {
|
||||||
freelance=false;
|
freelance=false;
|
||||||
playSub(false,row);
|
playSub(false,row);
|
||||||
|
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||||
|
keyHit[i]=false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
stepPlay=2;
|
stepPlay=2;
|
||||||
ticks=1;
|
ticks=1;
|
||||||
|
@ -6322,6 +6331,7 @@ bool DivEngine::init() {
|
||||||
|
|
||||||
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||||
isMuted[i]=0;
|
isMuted[i]=0;
|
||||||
|
keyHit[i]=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
oscBuf[0]=new float[32768];
|
oscBuf[0]=new float[32768];
|
||||||
|
|
|
@ -223,6 +223,7 @@ class DivEngine {
|
||||||
DivSystem sysOfChan[DIV_MAX_CHANS];
|
DivSystem sysOfChan[DIV_MAX_CHANS];
|
||||||
int dispatchOfChan[DIV_MAX_CHANS];
|
int dispatchOfChan[DIV_MAX_CHANS];
|
||||||
int dispatchChanOfChan[DIV_MAX_CHANS];
|
int dispatchChanOfChan[DIV_MAX_CHANS];
|
||||||
|
bool keyHit[DIV_MAX_CHANS];
|
||||||
float* oscBuf[2];
|
float* oscBuf[2];
|
||||||
float oscSize;
|
float oscSize;
|
||||||
|
|
||||||
|
|
|
@ -731,6 +731,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
chan[i].portaNote=chan[i].note;
|
chan[i].portaNote=chan[i].note;
|
||||||
} else if (!chan[i].noteOnInhibit) {
|
} else if (!chan[i].noteOnInhibit) {
|
||||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,chan[i].note,chan[i].volume>>8));
|
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,chan[i].note,chan[i].volume>>8));
|
||||||
|
keyHit[i]=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chan[i].doNote=false;
|
chan[i].doNote=false;
|
||||||
|
@ -871,6 +872,7 @@ bool DivEngine::nextTick(bool noAccum) {
|
||||||
if (note.on) {
|
if (note.on) {
|
||||||
dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,note.channel,note.ins,1));
|
dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,note.channel,note.ins,1));
|
||||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,note.channel,note.note));
|
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,note.channel,note.note));
|
||||||
|
keyHit[note.channel]=true;
|
||||||
chan[note.channel].noteOnInhibit=true;
|
chan[note.channel].noteOnInhibit=true;
|
||||||
} else {
|
} else {
|
||||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,note.channel));
|
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,note.channel));
|
||||||
|
@ -901,6 +903,7 @@ bool DivEngine::nextTick(bool noAccum) {
|
||||||
if (--chan[i].retrigTick<0) {
|
if (--chan[i].retrigTick<0) {
|
||||||
chan[i].retrigTick=chan[i].retrigSpeed-1;
|
chan[i].retrigTick=chan[i].retrigSpeed-1;
|
||||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,DIV_NOTE_NULL));
|
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,DIV_NOTE_NULL));
|
||||||
|
keyHit[i]=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[i].volSpeed!=0) {
|
if (chan[i].volSpeed!=0) {
|
||||||
|
|
|
@ -3061,9 +3061,15 @@ void FurnaceGUI::drawPattern() {
|
||||||
ImVec4 chanHead=muted?uiColors[GUI_COLOR_CHANNEL_MUTED]:uiColors[GUI_COLOR_CHANNEL_FM+e->getChannelType(i)];
|
ImVec4 chanHead=muted?uiColors[GUI_COLOR_CHANNEL_MUTED]:uiColors[GUI_COLOR_CHANNEL_FM+e->getChannelType(i)];
|
||||||
ImVec4 chanHeadActive=chanHead;
|
ImVec4 chanHeadActive=chanHead;
|
||||||
ImVec4 chanHeadHover=chanHead;
|
ImVec4 chanHeadHover=chanHead;
|
||||||
chanHead.x*=0.25; chanHead.y*=0.25; chanHead.z*=0.25;
|
if (e->keyHit[i]) {
|
||||||
|
keyHit[i]=0.2;
|
||||||
|
e->keyHit[i]=false;
|
||||||
|
}
|
||||||
|
chanHead.x*=0.25+keyHit[i]; chanHead.y*=0.25+keyHit[i]; chanHead.z*=0.25+keyHit[i];
|
||||||
chanHeadActive.x*=0.8; chanHeadActive.y*=0.8; chanHeadActive.z*=0.8;
|
chanHeadActive.x*=0.8; chanHeadActive.y*=0.8; chanHeadActive.z*=0.8;
|
||||||
chanHeadHover.x*=0.4; chanHeadHover.y*=0.4; chanHeadHover.z*=0.4;
|
chanHeadHover.x*=0.4+keyHit[i]; chanHeadHover.y*=0.4+keyHit[i]; chanHeadHover.z*=0.4+keyHit[i];
|
||||||
|
keyHit[i]-=0.02;
|
||||||
|
if (keyHit[i]<0) keyHit[i]=0;
|
||||||
ImGui::PushStyleColor(ImGuiCol_Header,chanHead);
|
ImGui::PushStyleColor(ImGuiCol_Header,chanHead);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive,chanHeadActive);
|
ImGui::PushStyleColor(ImGuiCol_HeaderActive,chanHeadActive);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,chanHeadHover);
|
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,chanHeadHover);
|
||||||
|
|
|
@ -342,6 +342,8 @@ class FurnaceGUI {
|
||||||
std::deque<UndoStep> undoHist;
|
std::deque<UndoStep> undoHist;
|
||||||
std::deque<UndoStep> redoHist;
|
std::deque<UndoStep> redoHist;
|
||||||
|
|
||||||
|
float keyHit[DIV_MAX_CHANS];
|
||||||
|
|
||||||
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
|
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);
|
void drawFMEnv(unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, const ImVec2& size);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue