gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit c877bc5acfa8efeab169630d4e9f0c90dbfd1540
parent ce1bf6dbde98e66a7b6f960f973a24b266b12dc1
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sat, 16 Nov 2024 23:08:29 +0100

use existing function to determine midi packet length

Diffstat:
Msource/virusLib/hdi08MidiQueue.cpp | 20+++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/source/virusLib/hdi08MidiQueue.cpp b/source/virusLib/hdi08MidiQueue.cpp @@ -5,6 +5,8 @@ #include "dsp56kEmu/types.h" +#include "synthLib/midiBufferParser.h" + namespace virusLib { Hdi08MidiQueue::Hdi08MidiQueue(DspSingle& _dsp, Hdi08Queue& _output, const bool _useEsaiBasedTiming, const bool _isTI) : m_output(_output), m_esai(_dsp.getAudio()), m_useEsaiBasedTiming(_useEsaiBasedTiming), m_isTI(_isTI) @@ -53,21 +55,13 @@ namespace virusLib m_output.writeRX(&word, 1); }; - const auto command = (_a & 0xf0); - - if(command == 0xf0) - { - // single-byte status message - sendMIDItoDSP(_a); - } - else - { + const auto len = synthLib::MidiBufferParser::lengthFromStatusByte(_a); + if (len >= 1) sendMIDItoDSP(_a); + if (len >= 2) sendMIDItoDSP(_b); - - if(command != synthLib::M_AFTERTOUCH) - sendMIDItoDSP(_c); - } + if (len >= 3) + sendMIDItoDSP(_c); } void Hdi08MidiQueue::onAudioWritten()