Merge branch 'probonopd-main' into fx

pull/409/head
abscisys 2 years ago
commit d933e052bd
  1. 10
      .github/workflows/build.yml
  2. 1
      src/Rules.mk
  3. 6
      src/circle_stdlib_app.h
  4. 18
      src/config.cpp
  5. 6
      src/config.h
  6. 2
      src/mididevice.cpp
  7. 35
      src/minidexed.cpp
  8. 2
      src/minidexed.h
  9. 3
      src/minidexed.ini
  10. 8
      src/serialmididevice.cpp
  11. 4
      src/userinterface.cpp

@ -20,11 +20,17 @@ jobs:
run: |
set -ex
git submodule update --init --recursive
- name: Use Circle develop branch for WM8960 and i2c display support until it is merged upstream
- name: Use Circle develop branch for SSD1306 display rotation support until it is merged upstream
run: |
set -ex
cd circle-stdlib/
git checkout e318f89 # Needed to support Circle develop?
cd -
cd circle-stdlib/libs/circle
git checkout 646c362 # develop
git checkout ec09d7e # develop
cd -
cd circle-stdlib/libs/circle-newlib
git checkout 48bf91d # needed for circle ec09d7e
cd -
- name: Install toolchains
run: |

@ -23,6 +23,7 @@ LIBS += \
$(CIRCLEHOME)/addon/SDCard/libsdcard.a \
$(CIRCLEHOME)/lib/usb/libusb.a \
$(CIRCLEHOME)/lib/input/libinput.a \
$(CIRCLEHOME)/lib/sound/libsound.a \
$(CIRCLEHOME)/addon/fatfs/libfatfs.a \
$(CIRCLEHOME)/lib/fs/libfs.a \
$(CIRCLEHOME)/lib/sched/libsched.a \

@ -214,8 +214,10 @@ public:
return false;
}
// Initialize newlib stdio with a reference to Circle's file system and console
CGlueStdioInit (mFileSystem, mConsole);
// Initialize newlib stdio with a reference to Circle's console
// (Remove mFileSystem as a parameter to mirror change in circle-stdlib's
// commit "Remove obsolete FATFS-related code", dated Dec 2022)
CGlueStdioInit (mConsole);
mLogger.Write (GetKernelName (), LogNotice, "Compile time: " __DATE__ " " __TIME__);

@ -70,6 +70,7 @@ void CConfig::Load (void)
m_bMIDIRXProgramChange = m_Properties.GetNumber ("MIDIRXProgramChange", 1) != 0;
m_bIgnoreAllNotesOff = m_Properties.GetNumber ("IgnoreAllNotesOff", 0) != 0;
m_bMIDIAutoVoiceDumpOnPC = m_Properties.GetNumber ("MIDIAutoVoiceDumpOnPC", 1) != 0;
m_bLCDEnabled = m_Properties.GetNumber ("LCDEnabled", 0) != 0;
m_nLCDPinEnable = m_Properties.GetNumber ("LCDPinEnable", 4);
@ -84,6 +85,8 @@ void CConfig::Load (void)
m_nSSD1306LCDI2CAddress = m_Properties.GetNumber ("SSD1306LCDI2CAddress", 0);
m_nSSD1306LCDWidth = m_Properties.GetNumber ("SSD1306LCDWidth", 128);
m_nSSD1306LCDHeight = m_Properties.GetNumber ("SSD1306LCDHeight", 32);
m_bSSD1306LCDRotate = m_Properties.GetNumber ("SSD1306LCDRotate", 0) != 0;
m_bSSD1306LCDMirror = m_Properties.GetNumber ("SSD1306LCDMirror", 0) != 0;
m_nLCDColumns = m_Properties.GetNumber ("LCDColumns", 16);
m_nLCDRows = m_Properties.GetNumber ("LCDRows", 2);
@ -171,6 +174,11 @@ bool CConfig::GetIgnoreAllNotesOff (void) const
return m_bIgnoreAllNotesOff;
}
bool CConfig::GetMIDIAutoVoiceDumpOnPC (void) const
{
return m_bMIDIAutoVoiceDumpOnPC;
}
bool CConfig::GetLCDEnabled (void) const
{
return m_bLCDEnabled;
@ -231,6 +239,16 @@ unsigned CConfig::GetSSD1306LCDHeight (void) const
return m_nSSD1306LCDHeight;
}
bool CConfig::GetSSD1306LCDRotate (void) const
{
return m_bSSD1306LCDRotate;
}
bool CConfig::GetSSD1306LCDMirror (void) const
{
return m_bSSD1306LCDMirror;
}
unsigned CConfig::GetLCDColumns (void) const
{
return m_nLCDColumns;

@ -76,6 +76,7 @@ public:
const char *GetMIDIThruOut (void) const; // "" if not specified
bool GetMIDIRXProgramChange (void) const; // true if not specified
bool GetIgnoreAllNotesOff (void) const;
bool GetMIDIAutoVoiceDumpOnPC (void) const; // true if not specified
// HD44780 LCD
// GPIO pin numbers are chip numbers, not header positions
@ -93,6 +94,8 @@ public:
unsigned GetSSD1306LCDI2CAddress (void) const;
unsigned GetSSD1306LCDWidth (void) const;
unsigned GetSSD1306LCDHeight (void) const;
bool GetSSD1306LCDRotate (void) const;
bool GetSSD1306LCDMirror (void) const;
unsigned GetLCDColumns (void) const;
unsigned GetLCDRows (void) const;
@ -153,6 +156,7 @@ private:
std::string m_MIDIThruOut;
bool m_bMIDIRXProgramChange;
bool m_bIgnoreAllNotesOff;
bool m_bMIDIAutoVoiceDumpOnPC;
bool m_bLCDEnabled;
unsigned m_nLCDPinEnable;
@ -167,6 +171,8 @@ private:
unsigned m_nSSD1306LCDI2CAddress;
unsigned m_nSSD1306LCDWidth;
unsigned m_nSSD1306LCDHeight;
bool m_bSSD1306LCDRotate;
bool m_bSSD1306LCDMirror;
unsigned m_nLCDColumns;
unsigned m_nLCDRows;

@ -203,7 +203,7 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
if (ucStatus == MIDI_SYSTEM_EXCLUSIVE_BEGIN)
{
// MIDI SYSEX per MIDI channel
uint8_t ucSysExChannel = (pMessage[2] & 0x07);
uint8_t ucSysExChannel = (pMessage[2] & 0x0F);
if (m_ChannelMap[nTG] == ucSysExChannel || m_ChannelMap[nTG] == OmniMode)
{
LOGNOTE("MIDI-SYSEX: channel: %u, len: %u, TG: %u",m_ChannelMap[nTG],nLength,nTG);

@ -20,9 +20,9 @@
#include "minidexed.h"
#include <circle/logger.h>
#include <circle/memory.h>
#include <circle/pwmsoundbasedevice.h>
#include <circle/i2ssoundbasedevice.h>
#include <circle/hdmisoundbasedevice.h>
#include <circle/sound/pwmsoundbasedevice.h>
#include <circle/sound/i2ssoundbasedevice.h>
#include <circle/sound/hdmisoundbasedevice.h>
#include <circle/gpiopin.h>
#include <string.h>
#include <stdio.h>
@ -434,6 +434,8 @@ void CMiniDexed::BankSelectLSB (unsigned nBankLSB, unsigned nTG)
void CMiniDexed::ProgramChange (unsigned nProgram, unsigned nTG)
{
assert (m_pConfig);
nProgram=constrain((int)nProgram,0,31);
assert (nTG < CConfig::ToneGenerators);
@ -444,7 +446,16 @@ void CMiniDexed::ProgramChange (unsigned nProgram, unsigned nTG)
assert (m_pTG[nTG]);
m_pTG[nTG]->loadVoiceParameters (Buffer);
if (m_pConfig->GetMIDIAutoVoiceDumpOnPC())
{
// Only do the voice dump back out over MIDI if we have a specific
// MIDI channel configured for this TG
if (m_nMIDIChannel[nTG] < CMIDIDevice::Channels)
{
m_SerialMIDI.SendSystemExclusiveVoice(nProgram,0,nTG);
}
}
m_UI.ParameterChanged ();
}
@ -531,6 +542,8 @@ void CMiniDexed::SetResonance (int nResonance, unsigned nTG)
void CMiniDexed::SetMIDIChannel (uint8_t uchChannel, unsigned nTG)
{
assert (nTG < CConfig::ToneGenerators);
assert (uchChannel < CMIDIDevice::ChannelUnknown);
m_nMIDIChannel[nTG] = uchChannel;
for (unsigned i = 0; i < CConfig::MaxUSBMIDIDevices; i++)
@ -1234,13 +1247,7 @@ void CMiniDexed::ProcessSound (void)
assert (CConfig::ToneGenerators == 8);
// swap stereo channels if needed
uint8_t indexL=0, indexR=1;
if (m_bChannelsSwapped)
{
indexL=1;
indexR=0;
}
// BEGIN TG mixing
float32_t tmp_float[nFrames*2];
@ -1302,6 +1309,14 @@ void CMiniDexed::ProcessSound (void)
#endif
// END adding FXRack
// swap stereo channels if needed prior to writing back out
if (m_bChannelsSwapped)
{
indexL=1;
indexR=0;
}
// Convert dual float array (left, right) to single int16 array (left/right)
for(uint16_t i=0; i<nFrames;i++)
{
@ -1659,7 +1674,7 @@ void CMiniDexed::getSysExVoiceDump(uint8_t* dest, uint8_t nTG)
dest[0] = 0xF0; // SysEx start
dest[1] = 0x43; // ID=Yamaha
dest[2] = GetTGParameter(TGParameterMIDIChannel, nTG); // Sub-status and MIDI channel
dest[2] = 0x00 | m_nMIDIChannel[nTG]; // 0x0c Sub-status 0 and MIDI channel
dest[3] = 0x00; // Format number (0=1 voice)
dest[4] = 0x01; // Byte count MSB
dest[5] = 0x1B; // Byte count LSB

@ -38,7 +38,7 @@
#include <circle/gpiomanager.h>
#include <circle/i2cmaster.h>
#include <circle/multicore.h>
#include <circle/soundbasedevice.h>
#include <circle/sound/soundbasedevice.h>
#include <circle/spinlock.h>
#include "common.h"
#include "effect_mixer.hpp"

@ -16,6 +16,7 @@ MIDIBaudRate=31250
#MIDIThru=umidi1,ttyS1
MIDIRXProgramChange=1
IgnoreAllNotesOff=0
MIDIAutoVoiceDumpOnPC=1
# HD44780 LCD
LCDEnabled=1
@ -34,6 +35,8 @@ LCDI2CAddress=0x00
SSD1306LCDI2CAddress=0x0
SSD1306LCDWidth=128
SSD1306LCDHeight=32
SSD1306LCDRotate=0
SSD1306LCDMirror=0
# Default is 16x2 display (e.g. HD44780)
LCDColumns=16

@ -98,7 +98,13 @@ void CSerialMIDIDevice::Process (void)
continue;
}
if(m_nSysEx > 0)
// System Real Time messages may appear anywhere in the byte stream, so handle them specially
if(uchData == 0xF8 || uchData == 0xFA || uchData == 0xFB || uchData == 0xFC || uchData == 0xFE || uchData == 0xFF)
{
MIDIMessageHandler (&uchData, 1);
continue;
}
else if(m_nSysEx > 0)
{
m_SerialMessage[m_nSysEx++]=uchData;
if ((uchData & 0x80) == 0x80 || m_nSysEx >= MAX_MIDI_MESSAGE)

@ -58,7 +58,9 @@ bool CUserInterface::Initialize (void)
unsigned i2caddr = m_pConfig->GetLCDI2CAddress ();
unsigned ssd1306addr = m_pConfig->GetSSD1306LCDI2CAddress ();
if (ssd1306addr != 0) {
m_pSSD1306 = new CSSD1306Device (m_pConfig->GetSSD1306LCDWidth (), m_pConfig->GetSSD1306LCDHeight (), m_pI2CMaster, ssd1306addr);
m_pSSD1306 = new CSSD1306Device (m_pConfig->GetSSD1306LCDWidth (), m_pConfig->GetSSD1306LCDHeight (),
m_pI2CMaster, ssd1306addr,
m_pConfig->GetSSD1306LCDRotate (), m_pConfig->GetSSD1306LCDMirror ());
LOGDBG ("LCD: SSD1306");
if (!m_pSSD1306->Initialize ())
{

Loading…
Cancel
Save