void UpdateNote()
{
int priority = 0;
_activeChannel = null;
for (var i = 0; i < 6; ++i)
{
if (_channels[i]._allocated && _channels[i]._out.active != 0 && _channels[i]._priority >= priority)
{
priority = _channels[i]._priority;
_activeChannel = _channels[i];
}
}
if (_activeChannel == null || _activeChannel._tl == 0)
{
_pcSpk.Stop();
_lastActiveChannel = null;
_lastActiveOut = 0;
}
else
{
Output((ushort)(_activeChannel._pitchBend + (_activeChannel._out.note << 7)));
}
}