From 23a3730d5099c7e592d302820e043fa8f78fb873 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 22 Apr 2025 19:03:05 +0200 Subject: [PATCH 1/6] NetworkSyslogEnabled and minor network related fixes (#876) Add `NetworkSyslogEnabled=1` to `minidexed.ini`, increase vebosity, add `syslogserver.py` --- src/config.cpp | 2 +- src/mididevice.cpp | 1 + src/minidexed.cpp | 9 +++++++ src/minidexed.ini | 1 + src/net/mdnspublisher.cpp | 6 +++++ submod.sh | 8 +++--- syslogserver.py | 57 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 syslogserver.py diff --git a/src/config.cpp b/src/config.cpp index 672d7cc..00d4d2d 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -209,7 +209,7 @@ void CConfig::Load (void) m_INetworkIPAddress = m_Properties.GetIPAddress("NetworkIPAddress") != 0; m_INetworkSubnetMask = m_Properties.GetIPAddress("NetworkSubnetMask") != 0; m_INetworkDefaultGateway = m_Properties.GetIPAddress("NetworkDefaultGateway") != 0; - m_bSyslogEnabled = m_Properties.GetNumber ("SyslogEnabled", 0) != 0; + m_bSyslogEnabled = m_Properties.GetNumber ("NetworkSyslogEnabled", 0) != 0; m_INetworkDNSServer = m_Properties.GetIPAddress("NetworkDNSServer") != 0; const u8 *pSyslogServerIP = m_Properties.GetIPAddress ("NetworkSyslogServerIPAddress"); diff --git a/src/mididevice.cpp b/src/mididevice.cpp index e13709f..c5e23ae 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -265,6 +265,7 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign else { // Ignore any other CC messages at this time + LOGNOTE("Ignoring CC %d (%d) on Performance Select Channel %d\n", pMessage[1], pMessage[2], nPerfCh); } } } diff --git a/src/minidexed.cpp b/src/minidexed.cpp index cbed9f9..7664e99 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -2307,6 +2307,7 @@ void CMiniDexed::UpdateNetwork() if (m_pConfig->GetSyslogEnabled()) { + LOGNOTE ("Syslog server is enabled in configuration"); CIPAddress ServerIP = m_pConfig->GetNetworkSyslogServerIPAddress(); if (ServerIP.IsSet () && !ServerIP.IsNull ()) { @@ -2318,6 +2319,14 @@ void CMiniDexed::UpdateNetwork() new CSysLogDaemon (m_pNet, ServerIP, usServerPort); } + else + { + LOGNOTE ("Syslog server IP not set"); + } + } + else + { + LOGNOTE ("Syslog server is not enabled in configuration"); } m_bNetworkReady = true; } diff --git a/src/minidexed.ini b/src/minidexed.ini index 2291f4f..d7de8ce 100644 --- a/src/minidexed.ini +++ b/src/minidexed.ini @@ -161,6 +161,7 @@ NetworkIPAddress=0 NetworkSubnetMask=0 NetworkDefaultGateway=0 NetworkDNSServer=0 +NetworkSyslogEnabled=1 NetworkSyslogServerIPAddress=0 # Performance diff --git a/src/net/mdnspublisher.cpp b/src/net/mdnspublisher.cpp index 23052db..fbeb549 100644 --- a/src/net/mdnspublisher.cpp +++ b/src/net/mdnspublisher.cpp @@ -117,10 +117,13 @@ boolean CmDNSPublisher::UnpublishService (const char *pServiceName) return FALSE; } LOGDBG ("Unpublish service %s", (const char *) pService->ServiceName); + SendResponse (pService, FALSE); + /* if (!SendResponse (pService, TRUE)) { LOGWARN ("Send failed"); } + */ for (unsigned i = 0; i < pService->nTextRecords; i++) { delete pService->ppText[i]; @@ -172,10 +175,13 @@ void CmDNSPublisher::Run (void) TService *pService = static_cast (CPtrList::GetPtr (pElement)); assert (pService); + SendResponse (pService, FALSE); + /* if (!SendResponse (pService, FALSE)) { LOGWARN ("Send failed"); } + */ pElement = m_ServiceList.GetNext (pElement); } m_Mutex.Release (); diff --git a/submod.sh b/submod.sh index 6685bef..f9d3251 100755 --- a/submod.sh +++ b/submod.sh @@ -2,13 +2,13 @@ set -ex # Update top-level modules as a baseline -git submodule update --init --recursive +git submodule update --init --recursive -f # Use fixed master branch of circle-stdlib then re-update cd circle-stdlib/ git reset --hard -git checkout 1111eee # Matches Circle Step49 -git submodule update --init --recursive +git checkout 1111eee -f # Matches Circle Step49 +git submodule update --init --recursive -f cd - # Optional update submodules explicitly @@ -23,5 +23,5 @@ cd - # Use fixed master branch of Synth_Dexed cd Synth_Dexed/ git reset --hard -git checkout c9f5274 +git checkout c9f5274 -f cd - diff --git a/syslogserver.py b/syslogserver.py new file mode 100644 index 0000000..c07c1ea --- /dev/null +++ b/syslogserver.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Syslog server to receive and display syslog messages from MiniDexed. +""" + +import socket +import time +import threading + +class SyslogServer: + def __init__(self, host='0.0.0.0', port=8514): + self.host = host + self.port = port + self.server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + self.server.bind((self.host, self.port)) + self.start_time = None + self.running = True + + def start(self): + ip_address = socket.gethostbyname(socket.gethostname()) + print(f"Syslog server listening on {ip_address}:{self.port}") + input_thread = threading.Thread(target=self.wait_for_input) + input_thread.daemon = True + input_thread.start() + while self.running: + try: + data, address = self.server.recvfrom(1024) + self.handle_message(data) + except KeyboardInterrupt: + self.running = False + + def handle_message(self, data): + message = data[2:].decode('utf-8').strip() + + if self.start_time is None: + self.start_time = time.time() + relative_time = "0:00:00.000" + else: + elapsed_time = time.time() - self.start_time + hours = int(elapsed_time // 3600) + minutes = int((elapsed_time % 3600) // 60) + seconds = int(elapsed_time % 60) + milliseconds = int((elapsed_time % 1) * 1000) + relative_time = f"{hours:02d}:{minutes:02d}:{seconds:02d}.{milliseconds:03d}" + + print(f"{relative_time} {message}") + + def wait_for_input(self): + input("Press any key to exit...") + self.running = False + +if __name__ == "__main__": + server = SyslogServer() + server.start() + print("Syslog server stopped.") \ No newline at end of file From c0d73e362976f1d6d3363be23e03d8e49134f585 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 22 Apr 2025 19:05:46 +0200 Subject: [PATCH 2/6] NetworkSyslogEnabled=0 by default [ci skip] --- src/minidexed.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/minidexed.ini b/src/minidexed.ini index d7de8ce..7d0fd31 100644 --- a/src/minidexed.ini +++ b/src/minidexed.ini @@ -161,7 +161,7 @@ NetworkIPAddress=0 NetworkSubnetMask=0 NetworkDefaultGateway=0 NetworkDNSServer=0 -NetworkSyslogEnabled=1 +NetworkSyslogEnabled=0 NetworkSyslogServerIPAddress=0 # Performance From 22a7d54251b10d7311f730ae7a7417915ef58e69 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 22 Apr 2025 19:51:08 +0200 Subject: [PATCH 3/6] Put all files into 64bit artifact (#873) Closes https://github.com/probonopd/MiniDexed/discussions/869#discussioncomment-12905515 --- .github/workflows/build.yml | 67 +++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a17d88d..5248d4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,8 @@ -# Build 32-bit and 64-bit separately - name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_INFO: "" on: push: @@ -19,14 +18,16 @@ jobs: artifact-path: ${{ steps.upload64.outputs.artifact-path }} steps: - uses: actions/checkout@v2 + - name: Compute Git Info for Artifact Name + run: echo "GIT_INFO=$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Get specific commits of git submodules run: sh -ex ./submod.sh - name: Create sdcard directory run: mkdir -p ./sdcard/ - name: Put git hash in startup message run: | - sed -i "s/Loading.../$(date +%Y%m%d)-$(git rev-parse --short HEAD)/g" src/userinterface.cpp - + sed -i "s/Loading.../${{ env.GIT_INFO }}/g" src/userinterface.cpp + # Install 64-bit toolchain (aarch64) - name: Install 64-bit toolchain run: | @@ -65,15 +66,30 @@ jobs: cd - cp -r ./circle-stdlib/libs/circle/boot/* sdcard rm -rf sdcard/config*.txt sdcard/README sdcard/Makefile sdcard/armstub sdcard/COPYING.linux - cp ./src/config.txt ./src/minidexed.ini ./src/*img ./src/performance.ini sdcard/ + cp ./src/config.txt ./src/minidexed.ini ./src/performance.ini sdcard/ cp ./getsysex.sh sdcard/ echo "usbspeed=full" > sdcard/cmdline.txt - + # Performances + git clone https://github.com/Banana71/Soundplantage --depth 1 # depth 1 means only the latest commit + cp -r ./Soundplantage/performance ./Soundplantage/*.pdf ./sdcard/ + # Hardware configuration + cd hwconfig + sh -ex ./customize.sh + cd - + mkdir -p ./sdcard/hardware/ + cp -r ./hwconfig/minidexed_* ./sdcard/minidexed.ini ./sdcard/hardware/ + # WLAN firmware + mkdir -p sdcard/firmware + cp circle-stdlib/libs/circle/addon/wlan/sample/hello_wlan/wpa_supplicant.conf sdcard/ + cd sdcard/firmware + make -f ../../circle-stdlib/libs/circle/addon/wlan/firmware/Makefile + cd - + - name: Upload 64-bit artifacts id: upload64 uses: actions/upload-artifact@v4 with: - name: build64-artifacts + name: MiniDexed_${{ github.run_number }}_${{ env.GIT_INFO }}_64bit path: sdcard/* build32: @@ -83,14 +99,16 @@ jobs: artifact-path: ${{ steps.upload32.outputs.artifact-path }} steps: - uses: actions/checkout@v2 + - name: Compute Git Info for Artifact Name + run: echo "GIT_INFO=$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Get specific commits of git submodules run: sh -ex ./submod.sh - name: Create sdcard directory run: mkdir -p ./sdcard/ - name: Put git hash in startup message run: | - sed -i "s/Loading.../$(date +%Y%m%d)-$(git rev-parse --short HEAD)/g" src/userinterface.cpp - + sed -i "s/Loading.../${{ env.GIT_INFO }}/g" src/userinterface.cpp + # Install 32-bit toolchain (arm-none-eabi) - name: Install 32-bit toolchain run: | @@ -116,7 +134,7 @@ jobs: id: upload32 uses: actions/upload-artifact@v4 with: - name: build32-artifacts + name: MiniDexed_${{ github.run_number }}_${{ env.GIT_INFO }}_32bit path: sdcard/* combine: @@ -124,32 +142,23 @@ jobs: runs-on: ubuntu-22.04 needs: [ build64, build32 ] steps: - - name: Download 64-bit artifacts - uses: actions/download-artifact@v4 - with: - name: build64-artifacts - path: combined - - name: Download 32-bit artifacts + - name: Download artifacts uses: actions/download-artifact@v4 with: - name: build32-artifacts + pattern: MiniDexed_* + merge-multiple: true path: combined - name: Create combined ZIP file run: | cd combined - zip -r ../MiniDexed_${GITHUB_RUN_NUMBER}_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD).zip . + zip -r ../MiniDexed_${{ github.run_number }}_${{ env.GIT_INFO }}.zip . cd .. - - name: Upload combined ZIP artifact - uses: actions/upload-artifact@v4 - with: - name: combined-artifact - path: MiniDexed_${GITHUB_RUN_NUMBER}_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD).zip - name: Upload to GitHub Releases (only when building from main branch) if: ${{ github.ref == 'refs/heads/main' }} run: | - set -ex - export UPLOADTOOL_ISPRERELEASE=true - export UPLOADTOOL_PR_BODY="This is a continuous build. Feedback is appreciated." - export UPLOADTOOL_BODY="This is a continuous build. Feedback is appreciated." - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - bash ./upload.sh ./MiniDexed*.zip + set -ex + export UPLOADTOOL_ISPRERELEASE=true + export UPLOADTOOL_PR_BODY="This is a continuous build. Feedback is appreciated." + export UPLOADTOOL_BODY="This is a continuous build. Feedback is appreciated." + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + bash ./upload.sh ./MiniDexed*.zip From b383f4ce39409fa25c6b7c9ea5b29c7d5b7e89a2 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 22 Apr 2025 20:04:25 +0200 Subject: [PATCH 4/6] Fix filename on GitHub Releases --- .github/workflows/build.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5248d4b..795e189 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,6 @@ name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GIT_INFO: "" on: push: @@ -10,23 +9,28 @@ on: pull_request: jobs: - build64: name: Build 64-bit kernels runs-on: ubuntu-22.04 outputs: artifact-path: ${{ steps.upload64.outputs.artifact-path }} + git_info: ${{ steps.gitinfo.outputs.git_info }} steps: - uses: actions/checkout@v2 + - name: Compute Git Info for Artifact Name - run: echo "GIT_INFO=$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV + id: gitinfo + run: echo "::set-output name=git_info::$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" + - name: Get specific commits of git submodules run: sh -ex ./submod.sh + - name: Create sdcard directory run: mkdir -p ./sdcard/ + - name: Put git hash in startup message run: | - sed -i "s/Loading.../${{ env.GIT_INFO }}/g" src/userinterface.cpp + sed -i "s/Loading.../${{ steps.gitinfo.outputs.git_info }}/g" src/userinterface.cpp # Install 64-bit toolchain (aarch64) - name: Install 64-bit toolchain @@ -70,7 +74,7 @@ jobs: cp ./getsysex.sh sdcard/ echo "usbspeed=full" > sdcard/cmdline.txt # Performances - git clone https://github.com/Banana71/Soundplantage --depth 1 # depth 1 means only the latest commit + git clone https://github.com/Banana71/Soundplantage --depth 1 cp -r ./Soundplantage/performance ./Soundplantage/*.pdf ./sdcard/ # Hardware configuration cd hwconfig @@ -89,9 +93,9 @@ jobs: id: upload64 uses: actions/upload-artifact@v4 with: - name: MiniDexed_${{ github.run_number }}_${{ env.GIT_INFO }}_64bit + name: MiniDexed_${{ github.run_number }}_${{ steps.gitinfo.outputs.git_info }}_64bit path: sdcard/* - + build32: name: Build 32-bit kernels runs-on: ubuntu-22.04 @@ -99,12 +103,16 @@ jobs: artifact-path: ${{ steps.upload32.outputs.artifact-path }} steps: - uses: actions/checkout@v2 + - name: Compute Git Info for Artifact Name run: echo "GIT_INFO=$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Get specific commits of git submodules run: sh -ex ./submod.sh + - name: Create sdcard directory run: mkdir -p ./sdcard/ + - name: Put git hash in startup message run: | sed -i "s/Loading.../${{ env.GIT_INFO }}/g" src/userinterface.cpp @@ -148,11 +156,13 @@ jobs: pattern: MiniDexed_* merge-multiple: true path: combined + - name: Create combined ZIP file run: | cd combined - zip -r ../MiniDexed_${{ github.run_number }}_${{ env.GIT_INFO }}.zip . + zip -r ../MiniDexed_${{ github.run_number }}_${{ needs.build64.outputs.git_info }}.zip . cd .. + - name: Upload to GitHub Releases (only when building from main branch) if: ${{ github.ref == 'refs/heads/main' }} run: | From 26e258b25a36d5b43ffff515763481b5558032dc Mon Sep 17 00:00:00 2001 From: soyer Date: Tue, 22 Apr 2025 20:14:41 +0200 Subject: [PATCH 5/6] Update Synth_Dexed to 65d8383ad5 (#871) * use std::min and std::max in Compressor * update Synth_Dexed to 65d8383ad5 Contains various fixes: https://codeberg.org/dcoredump/Synth_Dexed/pulls/11 https://codeberg.org/dcoredump/Synth_Dexed/pulls/12 https://codeberg.org/dcoredump/Synth_Dexed/pulls/13 And sostenuto/hold: https://codeberg.org/dcoredump/Synth_Dexed/pulls/10 https://codeberg.org/dcoredump/Synth_Dexed/pulls/7 * use the corrected named functions of Synth_Dexed https://codeberg.org/dcoredump/Synth_Dexed/pulls/12 --- src/effect_compressor.cpp | 9 +++++---- src/minidexed.cpp | 4 ++-- submod.sh | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/effect_compressor.cpp b/src/effect_compressor.cpp index d2aaec7..1b35c26 100644 --- a/src/effect_compressor.cpp +++ b/src/effect_compressor.cpp @@ -12,6 +12,7 @@ MIT License. use at your own risk. */ +#include #include #include #include "effect_compressor.h" @@ -203,7 +204,7 @@ void Compressor::setPreGain_dB(float32_t gain_dB) void Compressor::setCompressionRatio(float32_t cr) { - comp_ratio = max(0.001f, cr); //limit to positive values + comp_ratio = std::max(0.001f, cr); //limit to positive values updateThresholdAndCompRatioConstants(); } @@ -213,7 +214,7 @@ void Compressor::setAttack_sec(float32_t a, float32_t fs_Hz) attack_const = expf(-1.0f / (attack_sec * fs_Hz)); //expf() is much faster than exp() //also update the time constant for the envelope extraction - setLevelTimeConst_sec(min(attack_sec,release_sec) / 5.0, fs_Hz); //make the level time-constant one-fifth the gain time constants + setLevelTimeConst_sec(std::min(attack_sec,release_sec) / 5.0, fs_Hz); //make the level time-constant one-fifth the gain time constants } void Compressor::setRelease_sec(float32_t r, float32_t fs_Hz) @@ -222,13 +223,13 @@ void Compressor::setRelease_sec(float32_t r, float32_t fs_Hz) release_const = expf(-1.0f / (release_sec * fs_Hz)); //expf() is much faster than exp() //also update the time constant for the envelope extraction - setLevelTimeConst_sec(min(attack_sec,release_sec) / 5.0, fs_Hz); //make the level time-constant one-fifth the gain time constants + setLevelTimeConst_sec(std::min(attack_sec,release_sec) / 5.0, fs_Hz); //make the level time-constant one-fifth the gain time constants } void Compressor::setLevelTimeConst_sec(float32_t t_sec, float32_t fs_Hz) { const float32_t min_t_sec = 0.002f; //this is the minimum allowed value - level_lp_sec = max(min_t_sec,t_sec); + level_lp_sec = std::max(min_t_sec,t_sec); level_lp_const = expf(-1.0f / (level_lp_sec * fs_Hz)); //expf() is much faster than exp() } diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 7664e99..de48840 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -1237,7 +1237,7 @@ std::string CMiniDexed::GetVoiceName (unsigned nTG) if (nTG < m_nToneGenerators) { assert (m_pTG[nTG]); - m_pTG[nTG]->setName (VoiceName); + m_pTG[nTG]->getName (VoiceName); } std::string Result (VoiceName); return Result; @@ -2078,7 +2078,7 @@ void CMiniDexed::SetVoiceName (const std::string &VoiceName, unsigned nTG) char Name[11]; strncpy(Name, VoiceName.c_str(),10); Name[10] = '\0'; - m_pTG[nTG]->getName (Name); + m_pTG[nTG]->setName (Name); } bool CMiniDexed::DeletePerformance(unsigned nID) diff --git a/submod.sh b/submod.sh index f9d3251..6ef767a 100755 --- a/submod.sh +++ b/submod.sh @@ -23,5 +23,5 @@ cd - # Use fixed master branch of Synth_Dexed cd Synth_Dexed/ git reset --hard -git checkout c9f5274 -f +git checkout 65d8383ad5 -f cd - From bebf9cec95c6cd6b3271b24390c0197d6c042c2a Mon Sep 17 00:00:00 2001 From: soyer Date: Tue, 22 Apr 2025 20:15:51 +0200 Subject: [PATCH 6/6] Fix op ordering and reenabling (#870) * fix op ordering The ops are in reverse order in the OPMask as well * reset OPMask after voice load If you change a voice, Dexed enables all operator. Do the same in MiniDexed. --- src/minidexed.cpp | 25 +++++++++++++++++-------- src/minidexed.h | 1 + 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index de48840..ebe9e1b 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -658,6 +658,7 @@ void CMiniDexed::ProgramChange (unsigned nProgram, unsigned nTG) assert (m_pTG[nTG]); m_pTG[nTG]->loadVoiceParameters (Buffer); + setOPMask(0b111111, nTG); if (m_pConfig->GetMIDIAutoVoiceDumpOnPC()) { @@ -1178,23 +1179,22 @@ void CMiniDexed::SetVoiceParameter (uint8_t uchOffset, uint8_t uchValue, unsigne if (nOP < 6) { + nOP = 5 - nOP; // OPs are in reverse order + if (uchOffset == DEXED_OP_ENABLE) { if (uchValue) { - m_uchOPMask[nTG] |= 1 << nOP; + setOPMask(m_uchOPMask[nTG] | 1 << nOP, nTG); } else { - m_uchOPMask[nTG] &= ~(1 << nOP); + setOPMask(m_uchOPMask[nTG] & ~(1 << nOP), nTG); } - m_pTG[nTG]->setOPAll (m_uchOPMask[nTG]); return; - } - - nOP = 5 - nOP; // OPs are in reverse order + } } uchOffset += nOP * 21; @@ -1213,12 +1213,12 @@ uint8_t CMiniDexed::GetVoiceParameter (uint8_t uchOffset, unsigned nOP, unsigned if (nOP < 6) { + nOP = 5 - nOP; // OPs are in reverse order + if (uchOffset == DEXED_OP_ENABLE) { return !!(m_uchOPMask[nTG] & (1 << nOP)); } - - nOP = 5 - nOP; // OPs are in reverse order } uchOffset += nOP * 21; @@ -1792,6 +1792,8 @@ void CMiniDexed::loadVoiceParameters(const uint8_t* data, uint8_t nTG) m_pTG[nTG]->loadVoiceParameters(&voice[6]); m_pTG[nTG]->doRefreshVoice(); + setOPMask(0b111111, nTG); + m_UI.ParameterChanged (); } @@ -1848,6 +1850,12 @@ void CMiniDexed::getSysExVoiceDump(uint8_t* dest, uint8_t nTG) dest[162] = 0xF7; // SysEx end } +void CMiniDexed::setOPMask(uint8_t uchOPMask, uint8_t nTG) +{ + m_uchOPMask[nTG] = uchOPMask; + m_pTG[nTG]->setOPAll (m_uchOPMask[nTG]); +} + void CMiniDexed::setMasterVolume(float32_t vol) { if (vol < 0.0) @@ -2022,6 +2030,7 @@ void CMiniDexed::LoadPerformanceParameters(void) { uint8_t* tVoiceData = m_PerformanceConfig.GetVoiceDataFromTxt(nTG); m_pTG[nTG]->loadVoiceParameters(tVoiceData); + setOPMask(0b111111, nTG); } setMonoMode(m_PerformanceConfig.GetMonoMode(nTG) ? 1 : 0, nTG); SetReverbSend (m_PerformanceConfig.GetReverbSend (nTG), nTG); diff --git a/src/minidexed.h b/src/minidexed.h index b382f7e..4193ad8 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -122,6 +122,7 @@ public: void loadVoiceParameters(const uint8_t* data, uint8_t nTG); void setVoiceDataElement(uint8_t data, uint8_t number, uint8_t nTG); void getSysExVoiceDump(uint8_t* dest, uint8_t nTG); + void setOPMask(uint8_t uchOPMask, uint8_t nTG); void setModController (unsigned controller, unsigned parameter, uint8_t value, uint8_t nTG); unsigned getModController (unsigned controller, unsigned parameter, uint8_t nTG);