diff --git a/src/gui/chanOsc.cpp b/src/gui/chanOsc.cpp index 8e421d23b..b298f3dd1 100644 --- a/src/gui/chanOsc.cpp +++ b/src/gui/chanOsc.cpp @@ -928,9 +928,16 @@ void FurnaceGUI::drawChanOsc() { } case 'n': { DivChannelState* chanState=e->getChanState(ch); - if (chanState==NULL || !(chanState->keyOn)) break; - // no more conversion necessary after the note/octave unification :> - text+=fmt::sprintf("%s",noteName(chanState->note+60)); + // ik its pretty hacky but it works + // the templated stuff is after the member we need to access so it shouldnt matter + // and no segfaults should occur + SharedChannel* chan=(SharedChannel*)e->getDispatchChanState(ch); + if (chanState==NULL || chan==NULL || !chan->active) { + text+="---"; + } else { + // no more conversion necessary after the note/octave unification :> + text+=fmt::sprintf("%s",noteName(chanState->note+60)); + } break; } case 'l': diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index 65f45cb0c..b152a4f87 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -675,9 +675,9 @@ void FurnaceGUI::drawPattern() { } if (settings.channelFeedbackStyle==2 && e->isRunning()) { float amount=((float)(e->getChanState(i)->volume>>8)/(float)e->getMaxVolumeChan(i)); - if (!e->getChanState(i)->keyOn) amount=0.0f; + if (e->getChanState(i)->keyOff) amount=0.0f; keyHit[i]=amount*0.2f; - if (!muted) { + if (!muted && e->getChanState(i)->keyOn) { int note=e->getChanState(i)->note+60; if (note>=0 && note<180) { pianoKeyHit[note].value=amount; @@ -696,9 +696,9 @@ void FurnaceGUI::drawPattern() { } } else if (settings.channelFeedbackStyle==4 && e->isRunning()) { float amount=powf(chanOscVol[i],settings.channelFeedbackGamma); - if (!e->getChanState(i)->keyOn) amount=0.0f; + if (e->getChanState(i)->keyOff) amount=0.0f; keyHit[i]=amount*0.2f; - if (!muted) { + if (!muted && e->getChanState(i)->keyOn) { int note=e->getChanState(i)->note+60; if (note>=0 && note<180) { pianoKeyHit[note].value=amount;