void Zerberus::allNotesOff(int channel) { busy = true; for (Voice* v = activeVoices; v; v = v->next()) { if (channel == -1 || (v->channel()->idx() == channel)) v->stop(); } busy = false; }
void Zerberus::processNoteOn(Channel* cp, int key, int velo) { for (Voice* v = activeVoices; v; v = v->next()) { if (v->channel() == cp && v->key() == key) { if (v->isSustained()) { // if (v->isPlaying()) // printf("retrigger (stop) %p\n", v); v->stop(100); // fast stop } } } trigger(cp, key, velo, Trigger::ATTACK); }
void Zerberus::processNoteOff(Channel* cp, int key) { for (Voice* v = activeVoices; v; v = v->next()) { if ((v->channel() == cp) && (v->key() == key) && (v->loopMode() != LoopMode::ONE_SHOT) ) { if (cp->sustain() < 0x40) { v->stop(); trigger(cp, key, v->velocity(), Trigger::RELEASE); } else { if (v->isPlaying()) v->sustained(); } } } }