ElectroTechnique / TSynth-Teensy4.1

TSynth for Teensy 4.1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Held note silenced

ElectroTechnique opened this issue · comments

Hold voice 1 and play 12 notes. Instead of taking a no longer held voice, it steals voice1 and silences it.
Originally posted by @biamau962 in #135

VoiceGroup.h

` // Get the oldest free voice, if none free, get the oldest active voice.
Voice *getVoice()
{
Voice *result = nullptr;

    for (uint8_t i = 0; i < voices.size(); i++)
    {
        if (result == nullptr || !voices[i]->on() || result->on())
        {
            if (result == nullptr || voices[i]->timeOn() < result->timeOn())
            {
                result = voices[i];
            }
        }

    }
    return result;
}`

Fixed in V2.36