From 361066f3c3fac156523bb7a9b7a37b6b26b4916e Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 17 Jan 2022 11:27:10 +0100 Subject: [PATCH] Adding stubs for SysEx processing. --- src/dexed.cpp | 16 +++++++++++++--- src/dexed.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/dexed.cpp b/src/dexed.cpp index 0c21176..d51a229 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -1,5 +1,4 @@ -/** - * +/* * Copyright (c) 2016-2017 Holger Wirtz * * This program is free software; you can redistribute it and/or modify @@ -547,6 +546,10 @@ void Dexed::GetSamples(uint32_t n_samples, float* buffer) } } +bool Dexed::ProcessSysEx(const uint8_t *buf, uint32_t buf_size) { + ; +} + bool Dexed::ProcessMidiMessage(const uint8_t *buf, uint32_t buf_size) { TRACE("Hi"); @@ -624,7 +627,14 @@ bool Dexed::ProcessMidiMessage(const uint8_t *buf, uint32_t buf_size) { TRACE("MIDI pitchbend 0xe0 event: %d %d",buf[1],buf[2]); controllers.values_[kControllerPitch] = buf[1] | (buf[2] << 7); break; - + case 0xf0 : + // sysex + TRACE("MIDI sysex event: cmd=%d, size=%d",buf[0],size); + if(buf[1]==0x43) + ProcessSysEx(buf, size); + else + TRACE("Ignoring MIDI sysex ID (ID=%d): unknwon",buf[1]); + break; default: TRACE("MIDI event unknown: cmd=%d, val1=%d, val2=%d",buf[0],buf[1],buf[2]); break; diff --git a/src/dexed.h b/src/dexed.h index 30a1f42..885efa7 100644 --- a/src/dexed.h +++ b/src/dexed.h @@ -92,6 +92,7 @@ class Dexed : public lvtk::Synth VoiceStatus voiceStatus; protected: + bool ProcessSysEx(const uint8_t *buf, uint32_t buf_size); bool ProcessMidiMessage(const uint8_t *buf, uint32_t buf_size); void onParam(uint8_t param_num,float param_val); void keyup(uint8_t pitch);