Merge branch 'main' into optperfmenu

pull/874/head
probonopd 2 months ago committed by GitHub
commit 6a369925a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 61
      .github/workflows/build.yml
  2. 2
      src/config.cpp
  3. 9
      src/effect_compressor.cpp
  4. 1
      src/mididevice.cpp
  5. 36
      src/minidexed.cpp
  6. 1
      src/minidexed.h
  7. 1
      src/minidexed.ini
  8. 6
      src/net/mdnspublisher.cpp
  9. 8
      submod.sh
  10. 57
      syslogserver.py

@ -1,5 +1,3 @@
# Build 32-bit and 64-bit separately
name: Build name: Build
env: env:
@ -11,21 +9,28 @@ on:
pull_request: pull_request:
jobs: jobs:
build64: build64:
name: Build 64-bit kernels name: Build 64-bit kernels
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
outputs: outputs:
artifact-path: ${{ steps.upload64.outputs.artifact-path }} artifact-path: ${{ steps.upload64.outputs.artifact-path }}
git_info: ${{ steps.gitinfo.outputs.git_info }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Compute Git Info for Artifact Name
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 - name: Get specific commits of git submodules
run: sh -ex ./submod.sh run: sh -ex ./submod.sh
- name: Create sdcard directory - name: Create sdcard directory
run: mkdir -p ./sdcard/ run: mkdir -p ./sdcard/
- name: Put git hash in startup message - name: Put git hash in startup message
run: | run: |
sed -i "s/Loading.../$(date +%Y%m%d)-$(git rev-parse --short HEAD)/g" src/userinterface.cpp sed -i "s/Loading.../${{ steps.gitinfo.outputs.git_info }}/g" src/userinterface.cpp
# Install 64-bit toolchain (aarch64) # Install 64-bit toolchain (aarch64)
- name: Install 64-bit toolchain - name: Install 64-bit toolchain
@ -65,15 +70,30 @@ jobs:
cd - cd -
cp -r ./circle-stdlib/libs/circle/boot/* sdcard cp -r ./circle-stdlib/libs/circle/boot/* sdcard
rm -rf sdcard/config*.txt sdcard/README sdcard/Makefile sdcard/armstub sdcard/COPYING.linux 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/ cp ./getsysex.sh sdcard/
echo "usbspeed=full" > sdcard/cmdline.txt echo "usbspeed=full" > sdcard/cmdline.txt
# Performances
git clone https://github.com/Banana71/Soundplantage --depth 1
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 - name: Upload 64-bit artifacts
id: upload64 id: upload64
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: build64-artifacts name: MiniDexed_${{ github.run_number }}_${{ steps.gitinfo.outputs.git_info }}_64bit
path: sdcard/* path: sdcard/*
build32: build32:
@ -83,13 +103,19 @@ jobs:
artifact-path: ${{ steps.upload32.outputs.artifact-path }} artifact-path: ${{ steps.upload32.outputs.artifact-path }}
steps: steps:
- uses: actions/checkout@v2 - 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 - name: Get specific commits of git submodules
run: sh -ex ./submod.sh run: sh -ex ./submod.sh
- name: Create sdcard directory - name: Create sdcard directory
run: mkdir -p ./sdcard/ run: mkdir -p ./sdcard/
- name: Put git hash in startup message - name: Put git hash in startup message
run: | 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) # Install 32-bit toolchain (arm-none-eabi)
- name: Install 32-bit toolchain - name: Install 32-bit toolchain
@ -116,7 +142,7 @@ jobs:
id: upload32 id: upload32
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: build32-artifacts name: MiniDexed_${{ github.run_number }}_${{ env.GIT_INFO }}_32bit
path: sdcard/* path: sdcard/*
combine: combine:
@ -124,26 +150,19 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: [ build64, build32 ] needs: [ build64, build32 ]
steps: steps:
- name: Download 64-bit artifacts - name: Download artifacts
uses: actions/download-artifact@v4
with:
name: build64-artifacts
path: combined
- name: Download 32-bit artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: build32-artifacts pattern: MiniDexed_*
merge-multiple: true
path: combined path: combined
- name: Create combined ZIP file - name: Create combined ZIP file
run: | run: |
cd combined cd combined
zip -r ../MiniDexed_${GITHUB_RUN_NUMBER}_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD).zip . zip -r ../MiniDexed_${{ github.run_number }}_${{ needs.build64.outputs.git_info }}.zip .
cd .. 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) - name: Upload to GitHub Releases (only when building from main branch)
if: ${{ github.ref == 'refs/heads/main' }} if: ${{ github.ref == 'refs/heads/main' }}
run: | run: |

@ -209,7 +209,7 @@ void CConfig::Load (void)
m_INetworkIPAddress = m_Properties.GetIPAddress("NetworkIPAddress") != 0; m_INetworkIPAddress = m_Properties.GetIPAddress("NetworkIPAddress") != 0;
m_INetworkSubnetMask = m_Properties.GetIPAddress("NetworkSubnetMask") != 0; m_INetworkSubnetMask = m_Properties.GetIPAddress("NetworkSubnetMask") != 0;
m_INetworkDefaultGateway = m_Properties.GetIPAddress("NetworkDefaultGateway") != 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; m_INetworkDNSServer = m_Properties.GetIPAddress("NetworkDNSServer") != 0;
const u8 *pSyslogServerIP = m_Properties.GetIPAddress ("NetworkSyslogServerIPAddress"); const u8 *pSyslogServerIP = m_Properties.GetIPAddress ("NetworkSyslogServerIPAddress");

@ -12,6 +12,7 @@
MIT License. use at your own risk. MIT License. use at your own risk.
*/ */
#include <algorithm>
#include <circle/logger.h> #include <circle/logger.h>
#include <cstdlib> #include <cstdlib>
#include "effect_compressor.h" #include "effect_compressor.h"
@ -203,7 +204,7 @@ void Compressor::setPreGain_dB(float32_t gain_dB)
void Compressor::setCompressionRatio(float32_t cr) 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(); 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() attack_const = expf(-1.0f / (attack_sec * fs_Hz)); //expf() is much faster than exp()
//also update the time constant for the envelope extraction //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) 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() release_const = expf(-1.0f / (release_sec * fs_Hz)); //expf() is much faster than exp()
//also update the time constant for the envelope extraction //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) 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 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() level_lp_const = expf(-1.0f / (level_lp_sec * fs_Hz)); //expf() is much faster than exp()
} }

@ -265,6 +265,7 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
else else
{ {
// Ignore any other CC messages at this time // Ignore any other CC messages at this time
LOGNOTE("Ignoring CC %d (%d) on Performance Select Channel %d\n", pMessage[1], pMessage[2], nPerfCh);
} }
} }
} }

@ -658,6 +658,7 @@ void CMiniDexed::ProgramChange (unsigned nProgram, unsigned nTG)
assert (m_pTG[nTG]); assert (m_pTG[nTG]);
m_pTG[nTG]->loadVoiceParameters (Buffer); m_pTG[nTG]->loadVoiceParameters (Buffer);
setOPMask(0b111111, nTG);
if (m_pConfig->GetMIDIAutoVoiceDumpOnPC()) if (m_pConfig->GetMIDIAutoVoiceDumpOnPC())
{ {
@ -1178,23 +1179,22 @@ void CMiniDexed::SetVoiceParameter (uint8_t uchOffset, uint8_t uchValue, unsigne
if (nOP < 6) if (nOP < 6)
{ {
nOP = 5 - nOP; // OPs are in reverse order
if (uchOffset == DEXED_OP_ENABLE) if (uchOffset == DEXED_OP_ENABLE)
{ {
if (uchValue) if (uchValue)
{ {
m_uchOPMask[nTG] |= 1 << nOP; setOPMask(m_uchOPMask[nTG] | 1 << nOP, nTG);
} }
else else
{ {
m_uchOPMask[nTG] &= ~(1 << nOP); setOPMask(m_uchOPMask[nTG] & ~(1 << nOP), nTG);
} }
m_pTG[nTG]->setOPAll (m_uchOPMask[nTG]);
return; return;
} }
nOP = 5 - nOP; // OPs are in reverse order
} }
uchOffset += nOP * 21; uchOffset += nOP * 21;
@ -1213,12 +1213,12 @@ uint8_t CMiniDexed::GetVoiceParameter (uint8_t uchOffset, unsigned nOP, unsigned
if (nOP < 6) if (nOP < 6)
{ {
nOP = 5 - nOP; // OPs are in reverse order
if (uchOffset == DEXED_OP_ENABLE) if (uchOffset == DEXED_OP_ENABLE)
{ {
return !!(m_uchOPMask[nTG] & (1 << nOP)); return !!(m_uchOPMask[nTG] & (1 << nOP));
} }
nOP = 5 - nOP; // OPs are in reverse order
} }
uchOffset += nOP * 21; uchOffset += nOP * 21;
@ -1237,7 +1237,7 @@ std::string CMiniDexed::GetVoiceName (unsigned nTG)
if (nTG < m_nToneGenerators) if (nTG < m_nToneGenerators)
{ {
assert (m_pTG[nTG]); assert (m_pTG[nTG]);
m_pTG[nTG]->setName (VoiceName); m_pTG[nTG]->getName (VoiceName);
} }
std::string Result (VoiceName); std::string Result (VoiceName);
return Result; return Result;
@ -1792,6 +1792,8 @@ void CMiniDexed::loadVoiceParameters(const uint8_t* data, uint8_t nTG)
m_pTG[nTG]->loadVoiceParameters(&voice[6]); m_pTG[nTG]->loadVoiceParameters(&voice[6]);
m_pTG[nTG]->doRefreshVoice(); m_pTG[nTG]->doRefreshVoice();
setOPMask(0b111111, nTG);
m_UI.ParameterChanged (); m_UI.ParameterChanged ();
} }
@ -1848,6 +1850,12 @@ void CMiniDexed::getSysExVoiceDump(uint8_t* dest, uint8_t nTG)
dest[162] = 0xF7; // SysEx end 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) void CMiniDexed::setMasterVolume(float32_t vol)
{ {
if (vol < 0.0) if (vol < 0.0)
@ -2022,6 +2030,7 @@ void CMiniDexed::LoadPerformanceParameters(void)
{ {
uint8_t* tVoiceData = m_PerformanceConfig.GetVoiceDataFromTxt(nTG); uint8_t* tVoiceData = m_PerformanceConfig.GetVoiceDataFromTxt(nTG);
m_pTG[nTG]->loadVoiceParameters(tVoiceData); m_pTG[nTG]->loadVoiceParameters(tVoiceData);
setOPMask(0b111111, nTG);
} }
setMonoMode(m_PerformanceConfig.GetMonoMode(nTG) ? 1 : 0, nTG); setMonoMode(m_PerformanceConfig.GetMonoMode(nTG) ? 1 : 0, nTG);
SetReverbSend (m_PerformanceConfig.GetReverbSend (nTG), nTG); SetReverbSend (m_PerformanceConfig.GetReverbSend (nTG), nTG);
@ -2080,7 +2089,7 @@ void CMiniDexed::SetVoiceName (const std::string &VoiceName, unsigned nTG)
char Name[11]; char Name[11];
strncpy(Name, VoiceName.c_str(),10); strncpy(Name, VoiceName.c_str(),10);
Name[10] = '\0'; Name[10] = '\0';
m_pTG[nTG]->getName (Name); m_pTG[nTG]->setName (Name);
} }
bool CMiniDexed::DeletePerformance(unsigned nID) bool CMiniDexed::DeletePerformance(unsigned nID)
@ -2309,6 +2318,7 @@ void CMiniDexed::UpdateNetwork()
if (m_pConfig->GetSyslogEnabled()) if (m_pConfig->GetSyslogEnabled())
{ {
LOGNOTE ("Syslog server is enabled in configuration");
CIPAddress ServerIP = m_pConfig->GetNetworkSyslogServerIPAddress(); CIPAddress ServerIP = m_pConfig->GetNetworkSyslogServerIPAddress();
if (ServerIP.IsSet () && !ServerIP.IsNull ()) if (ServerIP.IsSet () && !ServerIP.IsNull ())
{ {
@ -2320,6 +2330,14 @@ void CMiniDexed::UpdateNetwork()
new CSysLogDaemon (m_pNet, ServerIP, usServerPort); 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; m_bNetworkReady = true;
} }

@ -122,6 +122,7 @@ public:
void loadVoiceParameters(const uint8_t* data, uint8_t nTG); void loadVoiceParameters(const uint8_t* data, uint8_t nTG);
void setVoiceDataElement(uint8_t data, uint8_t number, uint8_t nTG); void setVoiceDataElement(uint8_t data, uint8_t number, uint8_t nTG);
void getSysExVoiceDump(uint8_t* dest, 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); void setModController (unsigned controller, unsigned parameter, uint8_t value, uint8_t nTG);
unsigned getModController (unsigned controller, unsigned parameter, uint8_t nTG); unsigned getModController (unsigned controller, unsigned parameter, uint8_t nTG);

@ -161,6 +161,7 @@ NetworkIPAddress=0
NetworkSubnetMask=0 NetworkSubnetMask=0
NetworkDefaultGateway=0 NetworkDefaultGateway=0
NetworkDNSServer=0 NetworkDNSServer=0
NetworkSyslogEnabled=0
NetworkSyslogServerIPAddress=0 NetworkSyslogServerIPAddress=0
# Performance # Performance

@ -117,10 +117,13 @@ boolean CmDNSPublisher::UnpublishService (const char *pServiceName)
return FALSE; return FALSE;
} }
LOGDBG ("Unpublish service %s", (const char *) pService->ServiceName); LOGDBG ("Unpublish service %s", (const char *) pService->ServiceName);
SendResponse (pService, FALSE);
/*
if (!SendResponse (pService, TRUE)) if (!SendResponse (pService, TRUE))
{ {
LOGWARN ("Send failed"); LOGWARN ("Send failed");
} }
*/
for (unsigned i = 0; i < pService->nTextRecords; i++) for (unsigned i = 0; i < pService->nTextRecords; i++)
{ {
delete pService->ppText[i]; delete pService->ppText[i];
@ -172,10 +175,13 @@ void CmDNSPublisher::Run (void)
TService *pService = TService *pService =
static_cast<TService *> (CPtrList::GetPtr (pElement)); static_cast<TService *> (CPtrList::GetPtr (pElement));
assert (pService); assert (pService);
SendResponse (pService, FALSE);
/*
if (!SendResponse (pService, FALSE)) if (!SendResponse (pService, FALSE))
{ {
LOGWARN ("Send failed"); LOGWARN ("Send failed");
} }
*/
pElement = m_ServiceList.GetNext (pElement); pElement = m_ServiceList.GetNext (pElement);
} }
m_Mutex.Release (); m_Mutex.Release ();

@ -2,13 +2,13 @@
set -ex set -ex
# Update top-level modules as a baseline # 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 # Use fixed master branch of circle-stdlib then re-update
cd circle-stdlib/ cd circle-stdlib/
git reset --hard git reset --hard
git checkout 1111eee # Matches Circle Step49 git checkout 1111eee -f # Matches Circle Step49
git submodule update --init --recursive git submodule update --init --recursive -f
cd - cd -
# Optional update submodules explicitly # Optional update submodules explicitly
@ -23,5 +23,5 @@ cd -
# Use fixed master branch of Synth_Dexed # Use fixed master branch of Synth_Dexed
cd Synth_Dexed/ cd Synth_Dexed/
git reset --hard git reset --hard
git checkout c9f5274 git checkout 65d8383ad5 -f
cd - cd -

@ -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.")
Loading…
Cancel
Save