Merge with main + fixing compiling error for RPI2

pull/495/head
Vincent GAUCHE 2 years ago
parent 5e90726403
commit ac43ec5f73
  1. 20
      performance/000064_RockOrgan.ini
  2. 114
      performance/000126_INIT.ini
  3. 6
      src/config.cpp
  4. 2
      src/config.h
  5. 524
      src/mididevice.cpp
  6. 74
      src/minidexed.cpp
  7. 53
      src/performanceconfig.cpp
  8. 4
      src/performanceconfig.h
  9. 55
      src/uimenu.cpp

@ -42,7 +42,7 @@ PitchBendStep2=0
PortamentoMode2=0 PortamentoMode2=0
PortamentoGlissando2=0 PortamentoGlissando2=0
PortamentoTime2=0 PortamentoTime2=0
VoiceData2=63 63 63 1B 63 63 63 00 27 05 00 00 00 00 00 00 56 00 02 00 01 41 63 63 24 63 63 63 00 27 00 00 00 00 03 00 02 56 01 00 00 07 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 00 00 0A 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 00 00 0C 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 01 00 02 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 01 00 03 63 63 63 63 32 32 32 32 05 05 01 29 00 03 00 01 00 04 18 52 6F 63 6B 6F 72 67 61 6E 20 D5 VoiceData2=63 63 63 1B 63 63 63 00 27 05 00 00 00 00 00 00 56 00 02 00 01 41 63 63 24 63 63 63 00 27 00 00 00 00 03 00 02 56 01 00 00 07 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 00 00 0A 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 00 00 0C 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 01 00 02 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 01 00 03 63 63 63 63 32 32 32 32 05 05 01 29 00 03 00 01 00 04 18 52 6F 63 6B 6F 72 67 61 6E 20 55
MonoMode2=0 MonoMode2=0
ModulationWheelRange2=99 ModulationWheelRange2=99
ModulationWheelTarget2=1 ModulationWheelTarget2=1
@ -69,7 +69,7 @@ PitchBendStep3=0
PortamentoMode3=0 PortamentoMode3=0
PortamentoGlissando3=0 PortamentoGlissando3=0
PortamentoTime3=0 PortamentoTime3=0
VoiceData3=63 63 63 1B 63 63 63 00 27 05 00 00 00 00 00 00 56 00 02 00 01 41 63 63 24 63 63 63 00 27 00 00 00 00 03 00 02 56 01 00 00 07 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 00 00 0A 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 00 00 0C 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 01 00 02 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 01 00 03 63 63 63 63 32 32 32 32 05 05 01 29 00 03 00 01 00 04 18 52 6F 63 6B 6F 72 67 61 6E 20 7D VoiceData3=63 63 63 1B 63 63 63 00 27 05 00 00 00 00 00 00 56 00 02 00 01 41 63 63 24 63 63 63 00 27 00 00 00 00 03 00 02 56 01 00 00 07 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 00 00 0A 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 00 00 0C 63 63 63 00 63 63 63 00 27 00 00 00 00 00 00 00 54 00 01 00 02 41 63 63 28 63 63 63 00 27 00 00 00 00 02 00 02 63 00 01 00 03 63 63 63 63 32 32 32 32 05 05 01 29 00 03 00 01 00 04 18 52 6F 63 6B 6F 72 67 61 6E 20 5D
MonoMode3=0 MonoMode3=0
ModulationWheelRange3=99 ModulationWheelRange3=99
ModulationWheelTarget3=1 ModulationWheelTarget3=1
@ -150,7 +150,7 @@ PitchBendStep6=0
PortamentoMode6=0 PortamentoMode6=0
PortamentoGlissando6=0 PortamentoGlissando6=0
PortamentoTime6=0 PortamentoTime6=0
VoiceData6=54 24 0A 10 63 63 5F 00 34 00 00 03 00 00 03 00 38 00 03 00 00 54 24 0A 0C 63 63 5F 00 34 12 00 03 00 00 00 01 49 00 01 00 01 54 24 0A 00 63 63 63 00 26 06 00 00 00 00 00 01 50 01 00 27 04 26 07 07 29 5D 5C 5C 00 24 1F 00 00 00 00 00 01 63 00 01 00 0D 2C 24 0A 16 63 63 63 00 22 00 00 00 00 00 00 01 4C 00 01 00 07 2D 23 0A 30 63 63 63 00 24 1F 00 00 00 00 03 01 61 01 00 1A 07 54 5F 5F 3C 32 32 32 32 0E 07 00 1E 0F 12 00 00 04 01 18 57 61 72 6D 20 53 74 67 20 41 74 VoiceData6=54 24 0A 10 63 63 5F 00 34 00 00 03 00 00 03 00 38 00 03 00 00 54 24 0A 0C 63 63 5F 00 34 12 00 03 00 00 00 01 49 00 01 00 01 54 24 0A 00 63 63 63 00 26 06 00 00 00 00 00 01 50 01 00 27 04 26 07 07 29 5D 5C 5C 00 24 1F 00 00 00 00 00 01 63 00 01 00 0D 2C 24 0A 16 63 63 63 00 22 00 00 00 00 00 00 01 4C 00 01 00 07 2D 23 0A 30 63 63 63 00 24 1F 00 00 00 00 03 01 61 01 00 1A 07 54 5F 5F 3C 32 32 32 32 0E 07 00 1E 0F 12 00 00 04 01 18 57 61 72 6D 20 53 74 67 20 41 55
MonoMode6=0 MonoMode6=0
ModulationWheelRange6=99 ModulationWheelRange6=99
ModulationWheelTarget6=1 ModulationWheelTarget6=1
@ -177,7 +177,7 @@ PitchBendStep7=0
PortamentoMode7=0 PortamentoMode7=0
PortamentoGlissando7=0 PortamentoGlissando7=0
PortamentoTime7=0 PortamentoTime7=0
VoiceData7=54 24 0A 10 63 63 5F 00 34 00 00 03 00 00 03 00 38 00 03 00 00 54 24 0A 0C 63 63 5F 00 34 12 00 03 00 00 00 01 49 00 01 00 01 54 24 0A 00 63 63 63 00 26 06 00 00 00 00 00 01 50 01 00 27 04 26 07 07 29 5D 5C 5C 00 24 1F 00 00 00 00 00 01 63 00 01 00 0D 2C 24 0A 16 63 63 63 00 22 00 00 00 00 00 00 01 4C 00 01 00 07 2D 23 0A 30 63 63 63 00 24 1F 00 00 00 00 03 01 61 01 00 1A 07 54 5F 5F 3C 32 32 32 32 0E 07 00 1E 0F 12 00 00 04 01 18 57 61 72 6D 20 53 74 67 20 41 D5 VoiceData7=54 24 0A 10 63 63 5F 00 34 00 00 03 00 00 03 00 38 00 03 00 00 54 24 0A 0C 63 63 5F 00 34 12 00 03 00 00 00 01 49 00 01 00 01 54 24 0A 00 63 63 63 00 26 06 00 00 00 00 00 01 50 01 00 27 04 26 07 07 29 5D 5C 5C 00 24 1F 00 00 00 00 00 01 63 00 01 00 0D 2C 24 0A 16 63 63 63 00 22 00 00 00 00 00 00 01 4C 00 01 00 07 2D 23 0A 30 63 63 63 00 24 1F 00 00 00 00 03 01 61 01 00 1A 07 54 5F 5F 3C 32 32 32 32 0E 07 00 1E 0F 12 00 00 04 01 18 57 61 72 6D 20 53 74 67 20 41 55
MonoMode7=0 MonoMode7=0
ModulationWheelRange7=99 ModulationWheelRange7=99
ModulationWheelTarget7=1 ModulationWheelTarget7=1
@ -204,7 +204,7 @@ PitchBendStep8=0
PortamentoMode8=0 PortamentoMode8=0
PortamentoGlissando8=0 PortamentoGlissando8=0
PortamentoTime8=0 PortamentoTime8=0
VoiceData8=54 24 0A 10 63 63 5F 00 34 00 00 03 00 00 03 00 38 00 03 00 00 54 24 0A 0C 63 63 5F 00 34 12 00 03 00 00 00 01 49 00 01 00 01 54 24 0A 00 63 63 63 00 26 06 00 00 00 00 00 01 50 01 00 27 04 26 07 07 29 5D 5C 5C 00 24 1F 00 00 00 00 00 01 63 00 01 00 0D 2C 24 0A 16 63 63 63 00 22 00 00 00 00 00 00 01 4C 00 01 00 07 2D 23 0A 30 63 63 63 00 24 1F 00 00 00 00 03 01 61 01 00 1A 07 54 5F 5F 3C 32 32 32 32 0E 07 00 1E 0F 12 00 00 04 01 18 57 61 72 6D 20 53 74 67 20 41 D1 VoiceData8=54 24 0A 10 63 63 5F 00 34 00 00 03 00 00 03 00 38 00 03 00 00 54 24 0A 0C 63 63 5F 00 34 12 00 03 00 00 00 01 49 00 01 00 01 54 24 0A 00 63 63 63 00 26 06 00 00 00 00 00 01 50 01 00 27 04 26 07 07 29 5D 5C 5C 00 24 1F 00 00 00 00 00 01 63 00 01 00 0D 2C 24 0A 16 63 63 63 00 22 00 00 00 00 00 00 01 4C 00 01 00 07 2D 23 0A 30 63 63 63 00 24 1F 00 00 00 00 03 01 61 01 00 1A 07 54 5F 5F 3C 32 32 32 32 0E 07 00 1E 0F 12 00 00 04 01 18 57 61 72 6D 20 53 74 67 20 41 55
MonoMode8=0 MonoMode8=0
ModulationWheelRange8=99 ModulationWheelRange8=99
ModulationWheelTarget8=1 ModulationWheelTarget8=1
@ -217,8 +217,8 @@ AftertouchTarget8=0
CompressorEnable=0 CompressorEnable=0
ReverbEnable=1 ReverbEnable=1
ReverbSize=75 ReverbSize=75
ReverbHighDamp=45 ReverbHighDamp=35
ReverbLowDamp=22 ReverbLowDamp=24
ReverbLowPass=30 ReverbLowPass=65
ReverbDiffusion=99 ReverbDiffusion=74
ReverbLevel=99 ReverbLevel=54

@ -1,7 +1,7 @@
BankNumber1=18 BankNumber1=71
VoiceNumber1=32 VoiceNumber1=1
MIDIChannel1=1 MIDIChannel1=1
Volume1=50 Volume1=38
Pan1=64 Pan1=64
Detune1=0 Detune1=0
Cutoff1=99 Cutoff1=99
@ -9,13 +9,13 @@ Resonance1=0
NoteLimitLow1=0 NoteLimitLow1=0
NoteLimitHigh1=127 NoteLimitHigh1=127
NoteShift1=0 NoteShift1=0
ReverbSend1=0 ReverbSend1=99
PitchBendRange1=2 PitchBendRange1=2
PitchBendStep1=0 PitchBendStep1=0
PortamentoMode1=0 PortamentoMode1=0
PortamentoGlissando1=0 PortamentoGlissando1=0
PortamentoTime1=0 PortamentoTime1=0
VoiceData1=63 63 63 63 63 63 63 00 27 00 00 00 00 00 00 00 00 00 01 00 07 63 63 63 63 63 63 63 00 27 00 00 00 00 00 00 00 00 00 01 00 07 63 63 63 63 63 63 63 00 27 00 00 00 00 00 00 00 00 00 01 00 07 63 63 63 63 63 63 63 00 27 00 00 00 00 00 00 00 00 00 01 00 07 63 63 63 63 63 63 63 00 27 00 00 00 00 00 00 00 00 00 01 00 07 63 63 63 63 63 63 63 00 27 00 00 00 00 00 00 00 63 00 01 00 07 63 63 63 63 32 32 32 32 00 00 01 23 00 00 00 01 00 03 18 49 4E 49 54 20 56 4F 49 43 45 51 VoiceData1=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 55
MonoMode1=0 MonoMode1=0
ModulationWheelRange1=99 ModulationWheelRange1=99
ModulationWheelTarget1=1 ModulationWheelTarget1=1
@ -25,24 +25,24 @@ BreathControlRange1=99
BreathControlTarget1=0 BreathControlTarget1=0
AftertouchRange1=99 AftertouchRange1=99
AftertouchTarget1=0 AftertouchTarget1=0
BankNumber2=0 BankNumber2=71
VoiceNumber2=1 VoiceNumber2=1
MIDIChannel2=0 MIDIChannel2=2
Volume2=100 Volume2=38
Pan2=63 Pan2=0
Detune2=0 Detune2=-3
Cutoff2=99 Cutoff2=99
Resonance2=0 Resonance2=0
NoteLimitLow2=0 NoteLimitLow2=0
NoteLimitHigh2=127 NoteLimitHigh2=127
NoteShift2=0 NoteShift2=0
ReverbSend2=0 ReverbSend2=99
PitchBendRange2=2 PitchBendRange2=2
PitchBendStep2=0 PitchBendStep2=0
PortamentoMode2=0 PortamentoMode2=0
PortamentoGlissando2=0 PortamentoGlissando2=0
PortamentoTime2=0 PortamentoTime2=0
VoiceData2=31 63 1C 44 62 62 5B 00 27 36 32 01 01 04 00 02 52 00 01 00 07 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 62 00 01 00 08 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 07 4D 4C 52 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 05 3E 33 1D 47 52 5F 60 00 1B 00 07 03 01 00 00 00 56 00 00 00 0E 48 4C 63 47 63 58 60 00 27 00 0E 03 03 00 00 00 62 00 00 00 0E 54 5F 5F 3C 32 32 32 32 15 07 01 25 00 05 00 00 04 03 18 42 52 41 53 53 20 20 20 31 20 5D VoiceData2=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 75
MonoMode2=0 MonoMode2=0
ModulationWheelRange2=99 ModulationWheelRange2=99
ModulationWheelTarget2=1 ModulationWheelTarget2=1
@ -52,24 +52,24 @@ BreathControlRange2=99
BreathControlTarget2=0 BreathControlTarget2=0
AftertouchRange2=99 AftertouchRange2=99
AftertouchTarget2=0 AftertouchTarget2=0
BankNumber3=0 BankNumber3=71
VoiceNumber3=1 VoiceNumber3=1
MIDIChannel3=0 MIDIChannel3=2
Volume3=100 Volume3=38
Pan3=64 Pan3=127
Detune3=0 Detune3=3
Cutoff3=99 Cutoff3=99
Resonance3=0 Resonance3=0
NoteLimitLow3=0 NoteLimitLow3=0
NoteLimitHigh3=127 NoteLimitHigh3=127
NoteShift3=0 NoteShift3=0
ReverbSend3=0 ReverbSend3=99
PitchBendRange3=2 PitchBendRange3=2
PitchBendStep3=0 PitchBendStep3=0
PortamentoMode3=0 PortamentoMode3=0
PortamentoGlissando3=0 PortamentoGlissando3=0
PortamentoTime3=0 PortamentoTime3=0
VoiceData3=31 63 1C 44 62 62 5B 00 27 36 32 01 01 04 00 02 52 00 01 00 07 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 62 00 01 00 08 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 07 4D 4C 52 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 05 3E 33 1D 47 52 5F 60 00 1B 00 07 03 01 00 00 00 56 00 00 00 0E 48 4C 63 47 63 58 60 00 27 00 0E 03 03 00 00 00 62 00 00 00 0E 54 5F 5F 3C 32 32 32 32 15 07 01 25 00 05 00 00 04 03 18 42 52 41 53 53 20 20 20 31 20 57 VoiceData3=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 DD
MonoMode3=0 MonoMode3=0
ModulationWheelRange3=99 ModulationWheelRange3=99
ModulationWheelTarget3=1 ModulationWheelTarget3=1
@ -79,24 +79,24 @@ BreathControlRange3=99
BreathControlTarget3=0 BreathControlTarget3=0
AftertouchRange3=99 AftertouchRange3=99
AftertouchTarget3=0 AftertouchTarget3=0
BankNumber4=0 BankNumber4=71
VoiceNumber4=1 VoiceNumber4=1
MIDIChannel4=0 MIDIChannel4=3
Volume4=100 Volume4=38
Pan4=64 Pan4=0
Detune4=0 Detune4=-3
Cutoff4=99 Cutoff4=99
Resonance4=0 Resonance4=0
NoteLimitLow4=0 NoteLimitLow4=0
NoteLimitHigh4=127 NoteLimitHigh4=127
NoteShift4=0 NoteShift4=0
ReverbSend4=0 ReverbSend4=99
PitchBendRange4=2 PitchBendRange4=2
PitchBendStep4=0 PitchBendStep4=0
PortamentoMode4=0 PortamentoMode4=0
PortamentoGlissando4=0 PortamentoGlissando4=0
PortamentoTime4=0 PortamentoTime4=0
VoiceData4=31 63 1C 44 62 62 5B 00 27 36 32 01 01 04 00 02 52 00 01 00 07 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 62 00 01 00 08 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 07 4D 4C 52 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 05 3E 33 1D 47 52 5F 60 00 1B 00 07 03 01 00 00 00 56 00 00 00 0E 48 4C 63 47 63 58 60 00 27 00 0E 03 03 00 00 00 62 00 00 00 0E 54 5F 5F 3C 32 32 32 32 15 07 01 25 00 05 00 00 04 03 18 42 52 41 53 53 20 20 20 31 20 57 VoiceData4=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 55
MonoMode4=0 MonoMode4=0
ModulationWheelRange4=99 ModulationWheelRange4=99
ModulationWheelTarget4=1 ModulationWheelTarget4=1
@ -106,24 +106,24 @@ BreathControlRange4=99
BreathControlTarget4=0 BreathControlTarget4=0
AftertouchRange4=99 AftertouchRange4=99
AftertouchTarget4=0 AftertouchTarget4=0
BankNumber5=0 BankNumber5=71
VoiceNumber5=1 VoiceNumber5=1
MIDIChannel5=0 MIDIChannel5=3
Volume5=100 Volume5=38
Pan5=64 Pan5=127
Detune5=0 Detune5=3
Cutoff5=99 Cutoff5=99
Resonance5=0 Resonance5=0
NoteLimitLow5=0 NoteLimitLow5=0
NoteLimitHigh5=127 NoteLimitHigh5=127
NoteShift5=0 NoteShift5=0
ReverbSend5=0 ReverbSend5=99
PitchBendRange5=2 PitchBendRange5=2
PitchBendStep5=0 PitchBendStep5=0
PortamentoMode5=0 PortamentoMode5=0
PortamentoGlissando5=0 PortamentoGlissando5=0
PortamentoTime5=0 PortamentoTime5=0
VoiceData5=31 63 1C 44 62 62 5B 00 27 36 32 01 01 04 00 02 52 00 01 00 07 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 62 00 01 00 08 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 07 4D 4C 52 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 05 3E 33 1D 47 52 5F 60 00 1B 00 07 03 01 00 00 00 56 00 00 00 0E 48 4C 63 47 63 58 60 00 27 00 0E 03 03 00 00 00 62 00 00 00 0E 54 5F 5F 3C 32 32 32 32 15 07 01 25 00 05 00 00 04 03 18 42 52 41 53 53 20 20 20 31 20 5D VoiceData5=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 5D
MonoMode5=0 MonoMode5=0
ModulationWheelRange5=99 ModulationWheelRange5=99
ModulationWheelTarget5=1 ModulationWheelTarget5=1
@ -133,24 +133,24 @@ BreathControlRange5=99
BreathControlTarget5=0 BreathControlTarget5=0
AftertouchRange5=99 AftertouchRange5=99
AftertouchTarget5=0 AftertouchTarget5=0
BankNumber6=0 BankNumber6=71
VoiceNumber6=1 VoiceNumber6=1
MIDIChannel6=0 MIDIChannel6=3
Volume6=100 Volume6=38
Pan6=64 Pan6=0
Detune6=0 Detune6=1
Cutoff6=99 Cutoff6=99
Resonance6=0 Resonance6=0
NoteLimitLow6=0 NoteLimitLow6=0
NoteLimitHigh6=127 NoteLimitHigh6=127
NoteShift6=0 NoteShift6=0
ReverbSend6=0 ReverbSend6=99
PitchBendRange6=2 PitchBendRange6=2
PitchBendStep6=0 PitchBendStep6=0
PortamentoMode6=0 PortamentoMode6=0
PortamentoGlissando6=0 PortamentoGlissando6=0
PortamentoTime6=0 PortamentoTime6=0
VoiceData6=31 63 1C 44 62 62 5B 00 27 36 32 01 01 04 00 02 52 00 01 00 07 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 62 00 01 00 08 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 07 4D 4C 52 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 05 3E 33 1D 47 52 5F 60 00 1B 00 07 03 01 00 00 00 56 00 00 00 0E 48 4C 63 47 63 58 60 00 27 00 0E 03 03 00 00 00 62 00 00 00 0E 54 5F 5F 3C 32 32 32 32 15 07 01 25 00 05 00 00 04 03 18 42 52 41 53 53 20 20 20 31 20 75 VoiceData6=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 55
MonoMode6=0 MonoMode6=0
ModulationWheelRange6=99 ModulationWheelRange6=99
ModulationWheelTarget6=1 ModulationWheelTarget6=1
@ -160,24 +160,24 @@ BreathControlRange6=99
BreathControlTarget6=0 BreathControlTarget6=0
AftertouchRange6=99 AftertouchRange6=99
AftertouchTarget6=0 AftertouchTarget6=0
BankNumber7=0 BankNumber7=71
VoiceNumber7=1 VoiceNumber7=1
MIDIChannel7=0 MIDIChannel7=3
Volume7=100 Volume7=38
Pan7=64 Pan7=120
Detune7=0 Detune7=-4
Cutoff7=99 Cutoff7=99
Resonance7=0 Resonance7=0
NoteLimitLow7=0 NoteLimitLow7=0
NoteLimitHigh7=127 NoteLimitHigh7=127
NoteShift7=0 NoteShift7=0
ReverbSend7=0 ReverbSend7=99
PitchBendRange7=2 PitchBendRange7=2
PitchBendStep7=0 PitchBendStep7=0
PortamentoMode7=0 PortamentoMode7=0
PortamentoGlissando7=0 PortamentoGlissando7=0
PortamentoTime7=0 PortamentoTime7=0
VoiceData7=31 63 1C 44 62 62 5B 00 27 36 32 01 01 04 00 02 52 00 01 00 07 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 62 00 01 00 08 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 07 4D 4C 52 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 05 3E 33 1D 47 52 5F 60 00 1B 00 07 03 01 00 00 00 56 00 00 00 0E 48 4C 63 47 63 58 60 00 27 00 0E 03 03 00 00 00 62 00 00 00 0E 54 5F 5F 3C 32 32 32 32 15 07 01 25 00 05 00 00 04 03 18 42 52 41 53 53 20 20 20 31 20 75 VoiceData7=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 55
MonoMode7=0 MonoMode7=0
ModulationWheelRange7=99 ModulationWheelRange7=99
ModulationWheelTarget7=1 ModulationWheelTarget7=1
@ -187,10 +187,10 @@ BreathControlRange7=99
BreathControlTarget7=0 BreathControlTarget7=0
AftertouchRange7=99 AftertouchRange7=99
AftertouchTarget7=0 AftertouchTarget7=0
BankNumber8=0 BankNumber8=71
VoiceNumber8=1 VoiceNumber8=1
MIDIChannel8=0 MIDIChannel8=0
Volume8=100 Volume8=64
Pan8=64 Pan8=64
Detune8=0 Detune8=0
Cutoff8=99 Cutoff8=99
@ -198,13 +198,13 @@ Resonance8=0
NoteLimitLow8=0 NoteLimitLow8=0
NoteLimitHigh8=127 NoteLimitHigh8=127
NoteShift8=0 NoteShift8=0
ReverbSend8=0 ReverbSend8=99
PitchBendRange8=2 PitchBendRange8=2
PitchBendStep8=0 PitchBendStep8=0
PortamentoMode8=0 PortamentoMode8=0
PortamentoGlissando8=0 PortamentoGlissando8=0
PortamentoTime8=0 PortamentoTime8=0
VoiceData8=31 63 1C 44 62 62 5B 00 27 36 32 01 01 04 00 02 52 00 01 00 07 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 62 00 01 00 08 4D 24 29 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 07 4D 4C 52 47 63 62 62 00 27 00 00 03 03 00 00 02 63 00 01 00 05 3E 33 1D 47 52 5F 60 00 1B 00 07 03 01 00 00 00 56 00 00 00 0E 48 4C 63 47 63 58 60 00 27 00 0E 03 03 00 00 00 62 00 00 00 0E 54 5F 5F 3C 32 32 32 32 15 07 01 25 00 05 00 00 04 03 18 42 52 41 53 53 20 20 20 31 20 55 VoiceData8=5F 1D 14 32 63 5F 00 00 29 00 13 00 00 03 00 06 4F 00 01 00 0E 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 00 63 00 01 00 00 5F 1D 14 32 63 5F 00 00 36 00 1B 00 00 03 00 06 55 00 01 00 07 5F 14 14 32 63 5F 00 00 00 00 00 00 00 03 00 02 63 00 01 00 07 5F 32 23 4E 63 4B 00 00 37 00 34 00 00 03 00 07 3A 00 1A 00 07 60 19 19 43 63 4B 00 00 00 00 00 00 00 03 00 02 63 00 01 00 0A 5E 43 5F 3C 32 32 32 32 04 06 00 0F 21 00 00 00 04 02 18 46 45 4E 44 45 52 48 4F 44 45 01
MonoMode8=0 MonoMode8=0
ModulationWheelRange8=99 ModulationWheelRange8=99
ModulationWheelTarget8=1 ModulationWheelTarget8=1
@ -216,12 +216,12 @@ AftertouchRange8=99
AftertouchTarget8=0 AftertouchTarget8=0
CompressorEnable=1 CompressorEnable=1
ReverbEnable=1 ReverbEnable=1
ReverbSize=70 ReverbSize=52
ReverbHighDamp=50 ReverbHighDamp=28
ReverbLowDamp=50 ReverbLowDamp=28
ReverbLowPass=30 ReverbLowPass=66
ReverbDiffusion=65 ReverbDiffusion=66
ReverbLevel=99 ReverbLevel=33
FXTubeEnable=1 FXTubeEnable=1
FXTubeOverdrive=10 FXTubeOverdrive=10
FXChorusEnable=1 FXChorusEnable=1

@ -72,6 +72,7 @@ void CConfig::Load (void)
m_bIgnoreAllNotesOff = m_Properties.GetNumber ("IgnoreAllNotesOff", 0) != 0; m_bIgnoreAllNotesOff = m_Properties.GetNumber ("IgnoreAllNotesOff", 0) != 0;
m_bMIDIAutoVoiceDumpOnPC = m_Properties.GetNumber ("MIDIAutoVoiceDumpOnPC", 1) != 0; m_bMIDIAutoVoiceDumpOnPC = m_Properties.GetNumber ("MIDIAutoVoiceDumpOnPC", 1) != 0;
m_bHeaderlessSysExVoices = m_Properties.GetNumber ("HeaderlessSysExVoices", 0) != 0; m_bHeaderlessSysExVoices = m_Properties.GetNumber ("HeaderlessSysExVoices", 0) != 0;
m_bExpandPCAcrossBanks = m_Properties.GetNumber ("ExpandPCAcrossBanks", 1) != 0;
m_bLCDEnabled = m_Properties.GetNumber ("LCDEnabled", 0) != 0; m_bLCDEnabled = m_Properties.GetNumber ("LCDEnabled", 0) != 0;
m_nLCDPinEnable = m_Properties.GetNumber ("LCDPinEnable", 4); m_nLCDPinEnable = m_Properties.GetNumber ("LCDPinEnable", 4);
@ -185,6 +186,11 @@ bool CConfig::GetHeaderlessSysExVoices (void) const
return m_bHeaderlessSysExVoices; return m_bHeaderlessSysExVoices;
} }
bool CConfig::GetExpandPCAcrossBanks (void) const
{
return m_bExpandPCAcrossBanks;
}
bool CConfig::GetLCDEnabled (void) const bool CConfig::GetLCDEnabled (void) const
{ {
return m_bLCDEnabled; return m_bLCDEnabled;

@ -78,6 +78,7 @@ public:
bool GetIgnoreAllNotesOff (void) const; bool GetIgnoreAllNotesOff (void) const;
bool GetMIDIAutoVoiceDumpOnPC (void) const; // true if not specified bool GetMIDIAutoVoiceDumpOnPC (void) const; // true if not specified
bool GetHeaderlessSysExVoices (void) const; // false if not specified bool GetHeaderlessSysExVoices (void) const; // false if not specified
bool GetExpandPCAcrossBanks (void) const; // true if not specified
// HD44780 LCD // HD44780 LCD
// GPIO pin numbers are chip numbers, not header positions // GPIO pin numbers are chip numbers, not header positions
@ -159,6 +160,7 @@ private:
bool m_bIgnoreAllNotesOff; bool m_bIgnoreAllNotesOff;
bool m_bMIDIAutoVoiceDumpOnPC; bool m_bMIDIAutoVoiceDumpOnPC;
bool m_bHeaderlessSysExVoices; bool m_bHeaderlessSysExVoices;
bool m_bExpandPCAcrossBanks;
bool m_bLCDEnabled; bool m_bLCDEnabled;
unsigned m_nLCDPinEnable; unsigned m_nLCDPinEnable;

@ -29,44 +29,44 @@
#include <assert.h> #include <assert.h>
#include "userinterface.h" #include "userinterface.h"
LOGMODULE ("mididevice"); LOGMODULE("mididevice");
#define MIDI_NOTE_OFF 0b1000 #define MIDI_NOTE_OFF 0b1000
#define MIDI_NOTE_ON 0b1001 #define MIDI_NOTE_ON 0b1001
#define MIDI_AFTERTOUCH 0b1010 // TODO #define MIDI_AFTERTOUCH 0b1010 // TODO
#define MIDI_CHANNEL_AFTERTOUCH 0b1101 // right now Synth_Dexed just manage Channel Aftertouch not Polyphonic AT -> 0b1010 #define MIDI_CHANNEL_AFTERTOUCH 0b1101 // right now Synth_Dexed just manage Channel Aftertouch not Polyphonic AT -> 0b1010
#define MIDI_CONTROL_CHANGE 0b1011 #define MIDI_CONTROL_CHANGE 0b1011
#define MIDI_CC_BANK_SELECT_MSB 0 #define MIDI_CC_BANK_SELECT_MSB 0
#define MIDI_CC_MODULATION 1 #define MIDI_CC_MODULATION 1
#define MIDI_CC_BREATH_CONTROLLER 2 #define MIDI_CC_BREATH_CONTROLLER 2
#define MIDI_CC_FOOT_PEDAL 4 #define MIDI_CC_FOOT_PEDAL 4
#define MIDI_CC_VOLUME 7 #define MIDI_CC_VOLUME 7
#define MIDI_CC_PAN_POSITION 10 #define MIDI_CC_PAN_POSITION 10
#define MIDI_CC_BANK_SELECT_LSB 32 #define MIDI_CC_BANK_SELECT_LSB 32
#define MIDI_CC_BANK_SUSTAIN 64 #define MIDI_CC_BANK_SUSTAIN 64
#define MIDI_CC_RESONANCE 71 #define MIDI_CC_RESONANCE 71
#define MIDI_CC_FREQUENCY_CUTOFF 74 #define MIDI_CC_FREQUENCY_CUTOFF 74
#define MIDI_CC_REVERB_LEVEL 91 #define MIDI_CC_REVERB_LEVEL 91
#define MIDI_CC_ORBITONE_LEVEL 92 // added with mixing console #define MIDI_CC_ORBITONE_LEVEL 92 // added with mixing console
#define MIDI_CC_CHORUS_LEVEL 93 // added with mixing console #define MIDI_CC_CHORUS_LEVEL 93 // added with mixing console
#define MIDI_CC_DETUNE_LEVEL 94 #define MIDI_CC_DETUNE_LEVEL 94
#define MIDI_CC_PHASER_LEVEL 95 // added with mixing console #define MIDI_CC_PHASER_LEVEL 95 // added with mixing console
#define MIDI_CC_ALL_SOUND_OFF 120 #define MIDI_CC_ALL_SOUND_OFF 120
#define MIDI_CC_ALL_NOTES_OFF 123 #define MIDI_CC_ALL_NOTES_OFF 123
#define MIDI_PROGRAM_CHANGE 0b1100 #define MIDI_PROGRAM_CHANGE 0b1100
#define MIDI_PITCH_BEND 0b1110 #define MIDI_PITCH_BEND 0b1110
#define MIDI_SYSTEM_EXCLUSIVE_BEGIN 0xF0 #define MIDI_SYSTEM_EXCLUSIVE_BEGIN 0xF0
#define MIDI_SYSTEM_EXCLUSIVE_END 0xF7 #define MIDI_SYSTEM_EXCLUSIVE_END 0xF7
#define MIDI_TIMING_CLOCK 0xF8 #define MIDI_TIMING_CLOCK 0xF8
#define MIDI_ACTIVE_SENSING 0xFE #define MIDI_ACTIVE_SENSING 0xFE
CMIDIDevice::TDeviceMap CMIDIDevice::s_DeviceMap; CMIDIDevice::TDeviceMap CMIDIDevice::s_DeviceMap;
CMIDIDevice::CMIDIDevice (CMiniDexed *pSynthesizer, CConfig *pConfig, CUserInterface *pUI) CMIDIDevice::CMIDIDevice(CMiniDexed *pSynthesizer, CConfig *pConfig, CUserInterface *pUI)
: m_pSynthesizer (pSynthesizer), : m_pSynthesizer(pSynthesizer),
m_pConfig (pConfig), m_pConfig(pConfig),
m_pUI (pUI) m_pUI(pUI)
{ {
for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++) for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++)
{ {
@ -74,94 +74,93 @@ CMIDIDevice::CMIDIDevice (CMiniDexed *pSynthesizer, CConfig *pConfig, CUserInter
} }
} }
CMIDIDevice::~CMIDIDevice (void) CMIDIDevice::~CMIDIDevice(void)
{ {
m_pSynthesizer = 0; m_pSynthesizer = 0;
} }
void CMIDIDevice::SetChannel (u8 ucChannel, unsigned nTG) void CMIDIDevice::SetChannel(u8 ucChannel, unsigned nTG)
{ {
assert (nTG < CConfig::ToneGenerators); assert(nTG < CConfig::ToneGenerators);
m_ChannelMap[nTG] = ucChannel; m_ChannelMap[nTG] = ucChannel;
} }
u8 CMIDIDevice::GetChannel (unsigned nTG) const u8 CMIDIDevice::GetChannel(unsigned nTG) const
{ {
assert (nTG < CConfig::ToneGenerators); assert(nTG < CConfig::ToneGenerators);
return m_ChannelMap[nTG]; return m_ChannelMap[nTG];
} }
void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsigned nCable) void CMIDIDevice::MIDIMessageHandler(const u8 *pMessage, size_t nLength, unsigned nCable)
{ {
// The packet contents are just normal MIDI data - see // The packet contents are just normal MIDI data - see
// https://www.midi.org/specifications/item/table-1-summary-of-midi-message // https://www.midi.org/specifications/item/table-1-summary-of-midi-message
if (m_pConfig->GetMIDIDumpEnabled ()) if (m_pConfig->GetMIDIDumpEnabled())
{ {
switch (nLength) switch (nLength)
{ {
case 1: case 1:
if ( pMessage[0] != MIDI_TIMING_CLOCK if (pMessage[0] != MIDI_TIMING_CLOCK && pMessage[0] != MIDI_ACTIVE_SENSING)
&& pMessage[0] != MIDI_ACTIVE_SENSING)
{ {
printf ("MIDI%u: %02X\n", nCable, (unsigned) pMessage[0]); printf("MIDI%u: %02X\n", nCable, (unsigned)pMessage[0]);
} }
break; break;
case 2: case 2:
printf ("MIDI%u: %02X %02X\n", nCable, printf("MIDI%u: %02X %02X\n", nCable,
(unsigned) pMessage[0], (unsigned) pMessage[1]); (unsigned)pMessage[0], (unsigned)pMessage[1]);
break; break;
case 3: case 3:
printf ("MIDI%u: %02X %02X %02X\n", nCable, printf("MIDI%u: %02X %02X %02X\n", nCable,
(unsigned) pMessage[0], (unsigned) pMessage[1], (unsigned)pMessage[0], (unsigned)pMessage[1],
(unsigned) pMessage[2]); (unsigned)pMessage[2]);
break; break;
default: default:
switch(pMessage[0]) switch (pMessage[0])
{ {
case MIDI_SYSTEM_EXCLUSIVE_BEGIN: case MIDI_SYSTEM_EXCLUSIVE_BEGIN:
printf("MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength)); printf("MIDI%u: SysEx data length: [%d]:", nCable, uint16_t(nLength));
for (uint16_t i = 0; i < nLength; i++) for (uint16_t i = 0; i < nLength; i++)
{ {
if((i % 16) == 0) if ((i % 16) == 0)
printf("\n%04d:",i); printf("\n%04d:", i);
printf(" 0x%02x",pMessage[i]); printf(" 0x%02x", pMessage[i]);
} }
printf("\n"); printf("\n");
break; break;
default: default:
printf("MIDI%u: Unhandled MIDI event type %0x02x\n",nCable,pMessage[0]); printf("MIDI%u: Unhandled MIDI event type %0x02x\n", nCable, pMessage[0]);
} }
break; break;
} }
} }
// Only for debugging: // Only for debugging:
/* /*
if(pMessage[0]==MIDI_SYSTEM_EXCLUSIVE_BEGIN) if(pMessage[0]==MIDI_SYSTEM_EXCLUSIVE_BEGIN)
{
printf("MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength));
for (uint16_t i = 0; i < nLength; i++)
{ {
if((i % 16) == 0) printf("MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength));
printf("\n%04d:",i); for (uint16_t i = 0; i < nLength; i++)
printf(" 0x%02x",pMessage[i]); {
if((i % 16) == 0)
printf("\n%04d:",i);
printf(" 0x%02x",pMessage[i]);
}
printf("\n");
} }
printf("\n"); */
}
*/
// Handle MIDI Thru // Handle MIDI Thru
if (m_DeviceName.compare (m_pConfig->GetMIDIThruIn ()) == 0) if (m_DeviceName.compare(m_pConfig->GetMIDIThruIn()) == 0)
{ {
TDeviceMap::const_iterator Iterator; TDeviceMap::const_iterator Iterator;
Iterator = s_DeviceMap.find (m_pConfig->GetMIDIThruOut ()); Iterator = s_DeviceMap.find(m_pConfig->GetMIDIThruOut());
if (Iterator != s_DeviceMap.end ()) if (Iterator != s_DeviceMap.end())
{ {
Iterator->second->Send (pMessage, nLength, nCable); Iterator->second->Send(pMessage, nLength, nCable);
} }
} }
@ -171,17 +170,17 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
return; return;
} }
m_MIDISpinLock.Acquire (); m_MIDISpinLock.Acquire();
u8 ucStatus = pMessage[0]; u8 ucStatus = pMessage[0];
u8 ucChannel = ucStatus & 0x0F; u8 ucChannel = ucStatus & 0x0F;
u8 ucType = ucStatus >> 4; u8 ucType = ucStatus >> 4;
// GLOBAL MIDI SYSEX // GLOBAL MIDI SYSEX
if (pMessage[0] == MIDI_SYSTEM_EXCLUSIVE_BEGIN && pMessage[3] == 0x04 && pMessage[4] == 0x01 && pMessage[nLength-1] == MIDI_SYSTEM_EXCLUSIVE_END) // MASTER VOLUME if (pMessage[0] == MIDI_SYSTEM_EXCLUSIVE_BEGIN && pMessage[3] == 0x04 && pMessage[4] == 0x01 && pMessage[nLength - 1] == MIDI_SYSTEM_EXCLUSIVE_END) // MASTER VOLUME
{ {
float32_t nMasterVolume=((pMessage[5] & 0x7c) & ((pMessage[6] & 0x7c) <<7))/(1<<14); float32_t nMasterVolume = ((pMessage[5] & 0x7c) & ((pMessage[6] & 0x7c) << 7)) / (1 << 14);
LOGNOTE("Master volume: %f",nMasterVolume); LOGNOTE("Master volume: %f", nMasterVolume);
m_pSynthesizer->setMasterVolume(nMasterVolume); m_pSynthesizer->setMasterVolume(nMasterVolume);
} }
else else
@ -196,7 +195,7 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
{ {
break; break;
} }
m_pUI->UIMIDICmdHandler (ucChannel, ucStatus & 0xF0, pMessage[1], pMessage[2]); m_pUI->UIMIDICmdHandler(ucChannel, ucStatus & 0xF0, pMessage[1], pMessage[2]);
break; break;
} }
@ -209,14 +208,13 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
uint8_t ucSysExChannel = (pMessage[2] & 0x0F); uint8_t ucSysExChannel = (pMessage[2] & 0x0F);
if (m_ChannelMap[nTG] == ucSysExChannel || m_ChannelMap[nTG] == OmniMode) if (m_ChannelMap[nTG] == ucSysExChannel || m_ChannelMap[nTG] == OmniMode)
{ {
LOGNOTE("MIDI-SYSEX: channel: %u, len: %u, TG: %u",m_ChannelMap[nTG],nLength,nTG); LOGNOTE("MIDI-SYSEX: channel: %u, len: %u, TG: %u", m_ChannelMap[nTG], nLength, nTG);
HandleSystemExclusive(pMessage, nLength, nCable, nTG); HandleSystemExclusive(pMessage, nLength, nCable, nTG);
} }
} }
else else
{ {
if ( m_ChannelMap[nTG] == ucChannel if (m_ChannelMap[nTG] == ucChannel || m_ChannelMap[nTG] == OmniMode)
|| m_ChannelMap[nTG] == OmniMode)
{ {
switch (ucType) switch (ucType)
{ {
@ -230,13 +228,13 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
{ {
if (pMessage[2] <= 127) if (pMessage[2] <= 127)
{ {
m_pSynthesizer->keydown (pMessage[1], m_pSynthesizer->keydown(pMessage[1],
pMessage[2], nTG); pMessage[2], nTG);
} }
} }
else else
{ {
m_pSynthesizer->keyup (pMessage[1], nTG); m_pSynthesizer->keyup(pMessage[1], nTG);
} }
break; break;
@ -246,13 +244,13 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
break; break;
} }
m_pSynthesizer->keyup (pMessage[1], nTG); m_pSynthesizer->keyup(pMessage[1], nTG);
break; break;
case MIDI_CHANNEL_AFTERTOUCH: case MIDI_CHANNEL_AFTERTOUCH:
m_pSynthesizer->setAftertouch (pMessage[1], nTG); m_pSynthesizer->setAftertouch(pMessage[1], nTG);
m_pSynthesizer->ControllersRefresh (nTG); m_pSynthesizer->ControllersRefresh(nTG);
break; break;
case MIDI_CONTROL_CHANGE: case MIDI_CONTROL_CHANGE:
@ -264,53 +262,53 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
switch (pMessage[1]) switch (pMessage[1])
{ {
case MIDI_CC_MODULATION: case MIDI_CC_MODULATION:
m_pSynthesizer->setModWheel (pMessage[2], nTG); m_pSynthesizer->setModWheel(pMessage[2], nTG);
m_pSynthesizer->ControllersRefresh (nTG); m_pSynthesizer->ControllersRefresh(nTG);
break; break;
case MIDI_CC_FOOT_PEDAL: case MIDI_CC_FOOT_PEDAL:
m_pSynthesizer->setFootController (pMessage[2], nTG); m_pSynthesizer->setFootController(pMessage[2], nTG);
m_pSynthesizer->ControllersRefresh (nTG); m_pSynthesizer->ControllersRefresh(nTG);
break; break;
case MIDI_CC_BREATH_CONTROLLER: case MIDI_CC_BREATH_CONTROLLER:
m_pSynthesizer->setBreathController (pMessage[2], nTG); m_pSynthesizer->setBreathController(pMessage[2], nTG);
m_pSynthesizer->ControllersRefresh (nTG); m_pSynthesizer->ControllersRefresh(nTG);
break; break;
case MIDI_CC_VOLUME: case MIDI_CC_VOLUME:
m_pSynthesizer->SetVolume (pMessage[2], nTG); m_pSynthesizer->SetVolume(pMessage[2], nTG);
break; break;
case MIDI_CC_PAN_POSITION: case MIDI_CC_PAN_POSITION:
m_pSynthesizer->SetPan (pMessage[2], nTG); m_pSynthesizer->SetPan(pMessage[2], nTG);
break; break;
case MIDI_CC_BANK_SELECT_MSB: case MIDI_CC_BANK_SELECT_MSB:
m_pSynthesizer->BankSelectMSB (pMessage[2], nTG); m_pSynthesizer->BankSelectMSB(pMessage[2], nTG);
break; break;
case MIDI_CC_BANK_SELECT_LSB: case MIDI_CC_BANK_SELECT_LSB:
m_pSynthesizer->BankSelectLSB (pMessage[2], nTG); m_pSynthesizer->BankSelectLSB(pMessage[2], nTG);
break; break;
case MIDI_CC_BANK_SUSTAIN: case MIDI_CC_BANK_SUSTAIN:
m_pSynthesizer->setSustain (pMessage[2] >= 64, nTG); m_pSynthesizer->setSustain(pMessage[2] >= 64, nTG);
break; break;
case MIDI_CC_RESONANCE: case MIDI_CC_RESONANCE:
m_pSynthesizer->SetResonance (maplong (pMessage[2], 0, 127, 0, 99), nTG); m_pSynthesizer->SetResonance(maplong(pMessage[2], 0, 127, 0, 99), nTG);
break; break;
case MIDI_CC_FREQUENCY_CUTOFF: case MIDI_CC_FREQUENCY_CUTOFF:
m_pSynthesizer->SetCutoff (maplong (pMessage[2], 0, 127, 0, 99), nTG); m_pSynthesizer->SetCutoff(maplong(pMessage[2], 0, 127, 0, 99), nTG);
break; break;
case MIDI_CC_REVERB_LEVEL: case MIDI_CC_REVERB_LEVEL:
#ifdef MIXING_CONSOLE_ENABLE #ifdef MIXING_CONSOLE_ENABLE
this->m_pSynthesizer->setMixingConsoleSendLevel(nTG, MixerOutput::FX_PlateReverb, maplong(pMessage[2], 0, 127, 0, 99)); this->m_pSynthesizer->setMixingConsoleSendLevel(nTG, MixerOutput::FX_PlateReverb, maplong(pMessage[2], 0, 127, 0, 99));
#else #else
m_pSynthesizer->SetReverbSend (maplong (pMessage[2], 0, 127, 0, 99), nTG); m_pSynthesizer->SetReverbSend(maplong(pMessage[2], 0, 127, 0, 99), nTG);
#endif #endif
break; break;
@ -330,22 +328,25 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
if (pMessage[2] == 0) if (pMessage[2] == 0)
{ {
// "0 to 127, with 0 being no celeste (detune) effect applied at all." // "0 to 127, with 0 being no celeste (detune) effect applied at all."
m_pSynthesizer->SetMasterTune (0, nTG); m_pSynthesizer->SetMasterTune(0, nTG);
} }
else else
{ {
m_pSynthesizer->SetMasterTune (maplong (pMessage[2], 1, 127, -99, 99), nTG); m_pSynthesizer->SetMasterTune(maplong(pMessage[2], 1, 127, -99, 99), nTG);
} }
break; break;
case MIDI_CC_ALL_SOUND_OFF: case MIDI_CC_ALL_SOUND_OFF:
m_pSynthesizer->panic (pMessage[2], nTG); m_pSynthesizer->panic(pMessage[2], nTG);
break; break;
case MIDI_CC_ALL_NOTES_OFF: case MIDI_CC_ALL_NOTES_OFF:
if (!m_pConfig->GetIgnoreAllNotesOff ()) // As per "MIDI 1.0 Detailed Specification" v4.2
// From "ALL NOTES OFF" states:
// "Receivers should ignore an All Notes Off message while Omni is on (Modes 1 & 2)"
if (!m_pConfig->GetIgnoreAllNotesOff() && m_ChannelMap[nTG] != OmniMode)
{ {
m_pSynthesizer->notesOff (pMessage[2], nTG); m_pSynthesizer->notesOff(pMessage[2], nTG);
} }
break; break;
} }
@ -353,22 +354,24 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
case MIDI_PROGRAM_CHANGE: case MIDI_PROGRAM_CHANGE:
// do program change only if enabled in config // do program change only if enabled in config
if( m_pConfig->GetMIDIRXProgramChange() ) if (m_pConfig->GetMIDIRXProgramChange())
m_pSynthesizer->ProgramChange (pMessage[1], nTG); m_pSynthesizer->ProgramChange(pMessage[1], nTG);
break; break;
case MIDI_PITCH_BEND: { case MIDI_PITCH_BEND:
{
if (nLength < 3) if (nLength < 3)
{ {
break; break;
} }
s16 nValue = pMessage[1]; s16 nValue = pMessage[1];
nValue |= (s16) pMessage[2] << 7; nValue |= (s16)pMessage[2] << 7;
nValue -= 0x2000; nValue -= 0x2000;
m_pSynthesizer->setPitchbend (nValue, nTG); m_pSynthesizer->setPitchbend(nValue, nTG);
} break; }
break;
default: default:
break; break;
@ -377,162 +380,161 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
} }
} }
} }
m_MIDISpinLock.Release (); m_MIDISpinLock.Release();
} }
void CMIDIDevice::AddDevice (const char *pDeviceName) void CMIDIDevice::AddDevice(const char *pDeviceName)
{ {
assert (pDeviceName); assert(pDeviceName);
assert (m_DeviceName.empty ()); assert(m_DeviceName.empty());
m_DeviceName = pDeviceName; m_DeviceName = pDeviceName;
assert (!m_DeviceName.empty ()); assert(!m_DeviceName.empty());
s_DeviceMap.insert (std::pair<std::string, CMIDIDevice *> (pDeviceName, this)); s_DeviceMap.insert(std::pair<std::string, CMIDIDevice *>(pDeviceName, this));
} }
void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nLength, const unsigned nCable, const uint8_t nTG) void CMIDIDevice::HandleSystemExclusive(const uint8_t *pMessage, const size_t nLength, const unsigned nCable, const uint8_t nTG)
{ {
int16_t sysex_return; int16_t sysex_return;
sysex_return = m_pSynthesizer->checkSystemExclusive(pMessage, nLength, nTG); sysex_return = m_pSynthesizer->checkSystemExclusive(pMessage, nLength, nTG);
LOGDBG("SYSEX handler return value: %d", sysex_return); LOGDBG("SYSEX handler return value: %d", sysex_return);
switch (sysex_return) switch (sysex_return)
{ {
case -1: case -1:
LOGERR("SysEx end status byte not detected."); LOGERR("SysEx end status byte not detected.");
break; break;
case -2: case -2:
LOGERR("SysEx vendor not Yamaha."); LOGERR("SysEx vendor not Yamaha.");
break; break;
case -3: case -3:
LOGERR("Unknown SysEx parameter change."); LOGERR("Unknown SysEx parameter change.");
break; break;
case -4: case -4:
LOGERR("Unknown SysEx voice or function."); LOGERR("Unknown SysEx voice or function.");
break; break;
case -5: case -5:
LOGERR("Not a SysEx voice bulk upload."); LOGERR("Not a SysEx voice bulk upload.");
break; break;
case -6: case -6:
LOGERR("Wrong length for SysEx voice bulk upload (not 155)."); LOGERR("Wrong length for SysEx voice bulk upload (not 155).");
break; break;
case -7: case -7:
LOGERR("Checksum error for one voice."); LOGERR("Checksum error for one voice.");
break; break;
case -8: case -8:
LOGERR("Not a SysEx bank bulk upload."); LOGERR("Not a SysEx bank bulk upload.");
break; break;
case -9: case -9:
LOGERR("Wrong length for SysEx bank bulk upload (not 4096)."); LOGERR("Wrong length for SysEx bank bulk upload (not 4096).");
case -10: case -10:
LOGERR("Checksum error for bank."); LOGERR("Checksum error for bank.");
break; break;
case -11: case -11:
LOGERR("Unknown SysEx message."); LOGERR("Unknown SysEx message.");
break; break;
case 64: case 64:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setMonoMode(pMessage[5],nTG); m_pSynthesizer->setMonoMode(pMessage[5], nTG);
break; break;
case 65: case 65:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setPitchbendRange(pMessage[5],nTG); m_pSynthesizer->setPitchbendRange(pMessage[5], nTG);
break; break;
case 66: case 66:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setPitchbendStep(pMessage[5],nTG); m_pSynthesizer->setPitchbendStep(pMessage[5], nTG);
break; break;
case 67: case 67:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setPortamentoMode(pMessage[5],nTG); m_pSynthesizer->setPortamentoMode(pMessage[5], nTG);
break; break;
case 68: case 68:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setPortamentoGlissando(pMessage[5],nTG); m_pSynthesizer->setPortamentoGlissando(pMessage[5], nTG);
break; break;
case 69: case 69:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setPortamentoTime(pMessage[5],nTG); m_pSynthesizer->setPortamentoTime(pMessage[5], nTG);
break; break;
case 70: case 70:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setModWheelRange(pMessage[5],nTG); m_pSynthesizer->setModWheelRange(pMessage[5], nTG);
break; break;
case 71: case 71:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setModWheelTarget(pMessage[5],nTG); m_pSynthesizer->setModWheelTarget(pMessage[5], nTG);
break; break;
case 72: case 72:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setFootControllerRange(pMessage[5],nTG); m_pSynthesizer->setFootControllerRange(pMessage[5], nTG);
break; break;
case 73: case 73:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setFootControllerTarget(pMessage[5],nTG); m_pSynthesizer->setFootControllerTarget(pMessage[5], nTG);
break; break;
case 74: case 74:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setBreathControllerRange(pMessage[5],nTG); m_pSynthesizer->setBreathControllerRange(pMessage[5], nTG);
break; break;
case 75: case 75:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setBreathControllerTarget(pMessage[5],nTG); m_pSynthesizer->setBreathControllerTarget(pMessage[5], nTG);
break; break;
case 76: case 76:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setAftertouchRange(pMessage[5],nTG); m_pSynthesizer->setAftertouchRange(pMessage[5], nTG);
break; break;
case 77: case 77:
LOGDBG("SysEx Function parameter change: %d Value %d",pMessage[4],pMessage[5]); LOGDBG("SysEx Function parameter change: %d Value %d", pMessage[4], pMessage[5]);
m_pSynthesizer->setAftertouchTarget(pMessage[5],nTG); m_pSynthesizer->setAftertouchTarget(pMessage[5], nTG);
break; break;
case 100: case 100:
// load sysex-data into voice memory // load sysex-data into voice memory
LOGDBG("One Voice bulk upload"); LOGDBG("One Voice bulk upload");
m_pSynthesizer->loadVoiceParameters(pMessage,nTG); m_pSynthesizer->loadVoiceParameters(pMessage, nTG);
break; break;
case 200: case 200:
LOGDBG("Bank bulk upload."); LOGDBG("Bank bulk upload.");
//TODO: add code for storing a bank bulk upload // TODO: add code for storing a bank bulk upload
LOGNOTE("Currently code for storing a bulk bank upload is missing!"); LOGNOTE("Currently code for storing a bulk bank upload is missing!");
break; break;
default: default:
if(sysex_return >= 300 && sysex_return < 500) if (sysex_return >= 300 && sysex_return < 500)
{ {
LOGDBG("SysEx voice parameter change: Parameter %d value: %d",pMessage[4] + ((pMessage[3] & 0x03) * 128), pMessage[5]); LOGDBG("SysEx voice parameter change: Parameter %d value: %d", pMessage[4] + ((pMessage[3] & 0x03) * 128), pMessage[5]);
m_pSynthesizer->setVoiceDataElement(pMessage[4] + ((pMessage[3] & 0x03) * 128), pMessage[5],nTG); m_pSynthesizer->setVoiceDataElement(pMessage[4] + ((pMessage[3] & 0x03) * 128), pMessage[5], nTG);
switch(pMessage[4] + ((pMessage[3] & 0x03) * 128)) switch (pMessage[4] + ((pMessage[3] & 0x03) * 128))
{ {
case 134: case 134:
m_pSynthesizer->notesOff(0,nTG); m_pSynthesizer->notesOff(0, nTG);
break; break;
} }
} }
else if(sysex_return >= 500 && sysex_return < 600) else if (sysex_return >= 500 && sysex_return < 600)
{ {
LOGDBG("SysEx send voice %u request",sysex_return-500); LOGDBG("SysEx send voice %u request", sysex_return - 500);
SendSystemExclusiveVoice(sysex_return-500, nCable, nTG); SendSystemExclusiveVoice(sysex_return - 500, nCable, nTG);
} }
break; break;
} }
} }
void CMIDIDevice::SendSystemExclusiveVoice(uint8_t nVoice, const unsigned nCable, uint8_t nTG) void CMIDIDevice::SendSystemExclusiveVoice(uint8_t nVoice, const unsigned nCable, uint8_t nTG)
{ {
uint8_t voicedump[163]; uint8_t voicedump[163];
// Get voice sysex dump from TG // Get voice sysex dump from TG
m_pSynthesizer->getSysExVoiceDump(voicedump, nTG); m_pSynthesizer->getSysExVoiceDump(voicedump, nTG);
TDeviceMap::const_iterator Iterator; TDeviceMap::const_iterator Iterator;
// send voice dump to all MIDI interfaces // send voice dump to all MIDI interfaces
auto end = s_DeviceMap.end(); for (Iterator = s_DeviceMap.begin(); Iterator != s_DeviceMap.end(); ++Iterator)
for(Iterator = s_DeviceMap.begin(); Iterator != end; ++Iterator) {
{ Iterator->second->Send(voicedump, sizeof(voicedump) * sizeof(uint8_t));
Iterator->second->Send (voicedump, sizeof(voicedump)*sizeof(uint8_t)); // LOGDBG("Send SYSEX voice dump %u to \"%s\"",nVoice,Iterator->first.c_str());
// LOGDBG("Send SYSEX voice dump %u to \"%s\"",nVoice,Iterator->first.c_str()); }
}
} }

@ -51,6 +51,7 @@ CMiniDexed::CMiniDexed (
#ifdef ARM_ALLOW_MULTI_CORE #ifdef ARM_ALLOW_MULTI_CORE
m_nActiveTGsLog2 (0), m_nActiveTGsLog2 (0),
#endif #endif
m_GetChunkTimer ("GetChunk", 1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()), m_GetChunkTimer ("GetChunk", 1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()),
m_bProfileEnabled (m_pConfig->GetProfileEnabled ()), m_bProfileEnabled (m_pConfig->GetProfileEnabled ()),
m_bSavePerformance (false), m_bSavePerformance (false),
@ -82,6 +83,15 @@ CMiniDexed::CMiniDexed (
m_nNoteLimitHigh[i] = 127; m_nNoteLimitHigh[i] = 127;
m_nNoteShift[i] = 0; m_nNoteShift[i] = 0;
m_nModulationWheelRange[i] = 99; m_nModulationWheelRange[i] = 99;
m_nModulationWheelTarget[i] = 7; m_nModulationWheelTarget[i] = 7;
m_nFootControlRange[i] = 99; m_nFootControlRange[i] = 99;
@ -318,6 +328,8 @@ bool CMiniDexed::Initialize (void)
} }
#if defined(ARM_ALLOW_MULTI_CORE) #if defined(ARM_ALLOW_MULTI_CORE)
m_pSoundDevice->SetWriteFormat (SoundFormatSigned16, 2); // 16-bit Stereo m_pSoundDevice->SetWriteFormat (SoundFormatSigned16, 2); // 16-bit Stereo
#else #else
m_pSoundDevice->SetWriteFormat (SoundFormatSigned16, 1); // 16-bit Mono m_pSoundDevice->SetWriteFormat (SoundFormatSigned16, 1); // 16-bit Mono
@ -510,13 +522,34 @@ void CMiniDexed::ProgramChange (unsigned nProgram, unsigned nTG)
{ {
assert (m_pConfig); assert (m_pConfig);
nProgram=constrain((int)nProgram,0,31); unsigned nBankOffset;
bool bPCAcrossBanks = m_pConfig->GetExpandPCAcrossBanks();
if (bPCAcrossBanks)
{
// Note: This doesn't actually change the bank in use
// but will allow PC messages of 0..127
// to select across four consecutive banks of voices.
//
// So if the current bank = 5 then:
// PC 0-31 = Bank 5, Program 0-31
// PC 32-63 = Bank 6, Program 0-31
// PC 64-95 = Bank 7, Program 0-31
// PC 96-127 = Bank 8, Program 0-31
nProgram=constrain((int)nProgram,0,127);
nBankOffset = nProgram >> 5;
nProgram = nProgram % 32;
}
else
{
nBankOffset = 0;
nProgram=constrain((int)nProgram,0,31);
}
assert (nTG < CConfig::ToneGenerators); assert (nTG < CConfig::ToneGenerators);
m_nProgram[nTG] = nProgram; m_nProgram[nTG] = nProgram;
uint8_t Buffer[156]; uint8_t Buffer[156];
m_SysExFileLoader.GetVoice (m_nVoiceBankID[nTG], nProgram, Buffer); m_SysExFileLoader.GetVoice (m_nVoiceBankID[nTG]+nBankOffset, nProgram, Buffer);
assert (m_pTG[nTG]); assert (m_pTG[nTG]);
m_pTG[nTG]->loadVoiceParameters (Buffer); m_pTG[nTG]->loadVoiceParameters (Buffer);
@ -656,6 +689,8 @@ void CMiniDexed::SetResonance (int nResonance, unsigned nTG)
m_UI.ParameterChanged (); m_UI.ParameterChanged ();
} }
void CMiniDexed::SetMIDIChannel (uint8_t uchChannel, unsigned nTG) void CMiniDexed::SetMIDIChannel (uint8_t uchChannel, unsigned nTG)
{ {
assert (nTG < CConfig::ToneGenerators); assert (nTG < CConfig::ToneGenerators);
@ -771,6 +806,7 @@ void CMiniDexed::setModWheel (uint8_t value, unsigned nTG)
m_pTG[nTG]->setModWheel (value); m_pTG[nTG]->setModWheel (value);
} }
void CMiniDexed::setFootController (uint8_t value, unsigned nTG) void CMiniDexed::setFootController (uint8_t value, unsigned nTG)
{ {
assert (nTG < CConfig::ToneGenerators); assert (nTG < CConfig::ToneGenerators);
@ -808,6 +844,8 @@ void CMiniDexed::ControllersRefresh (unsigned nTG)
void CMiniDexed::SetParameter (TParameter Parameter, int nValue) void CMiniDexed::SetParameter (TParameter Parameter, int nValue)
{ {
assert(Parameter < TParameter::ParameterUnknown); assert(Parameter < TParameter::ParameterUnknown);
m_nParameter[Parameter] = nValue; m_nParameter[Parameter] = nValue;
@ -1812,6 +1850,8 @@ void CMiniDexed::ProcessSound (void)
uint8_t indexL=0, indexR=1; uint8_t indexL=0, indexR=1;
// BEGIN TG mixing // BEGIN TG mixing
float32_t tmp_float[nFrames*2];
if(nMasterVolume > 0.0f) if(nMasterVolume > 0.0f)
{ {
for (uint8_t i = 0; i < CConfig::ToneGenerators; i++) for (uint8_t i = 0; i < CConfig::ToneGenerators; i++)
@ -2315,6 +2355,11 @@ void CMiniDexed::getSysExVoiceDump(uint8_t* dest, uint8_t nTG)
void CMiniDexed::setMasterVolume (float32_t vol) void CMiniDexed::setMasterVolume (float32_t vol)
{ {
this->nMasterVolume = constrain(vol, 0.0f, 1.0f); this->nMasterVolume = constrain(vol, 0.0f, 1.0f);
} }
std::string CMiniDexed::GetPerformanceFileName(unsigned nID) std::string CMiniDexed::GetPerformanceFileName(unsigned nID)
@ -2375,7 +2420,7 @@ bool CMiniDexed::DoSetNewPerformance (void)
bool CMiniDexed::SavePerformanceNewFile () bool CMiniDexed::SavePerformanceNewFile ()
{ {
m_bSavePerformanceNewFile = m_PerformanceConfig.GetInternalFolderOk(); m_bSavePerformanceNewFile = m_PerformanceConfig.GetInternalFolderOk() && m_PerformanceConfig.CheckFreePerformanceSlot();
return m_bSavePerformanceNewFile; return m_bSavePerformanceNewFile;
} }
@ -2404,7 +2449,8 @@ void CMiniDexed::LoadPerformanceParameters(void)
{ {
for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++) for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++)
{ {
BankSelectLSB (m_PerformanceConfig.GetBankNumber (nTG), nTG);
BankSelect (m_PerformanceConfig.GetBankNumber (nTG), nTG);
ProgramChange (m_PerformanceConfig.GetVoiceNumber (nTG), nTG); ProgramChange (m_PerformanceConfig.GetVoiceNumber (nTG), nTG);
SetMIDIChannel (m_PerformanceConfig.GetMIDIChannel (nTG), nTG); SetMIDIChannel (m_PerformanceConfig.GetMIDIChannel (nTG), nTG);
SetVolume (m_PerformanceConfig.GetVolume (nTG), nTG); SetVolume (m_PerformanceConfig.GetVolume (nTG), nTG);
@ -2422,6 +2468,24 @@ void CMiniDexed::LoadPerformanceParameters(void)
m_nNoteLimitHigh[nTG] = m_PerformanceConfig.GetNoteLimitHigh (nTG); m_nNoteLimitHigh[nTG] = m_PerformanceConfig.GetNoteLimitHigh (nTG);
m_nNoteShift[nTG] = m_PerformanceConfig.GetNoteShift (nTG); m_nNoteShift[nTG] = m_PerformanceConfig.GetNoteShift (nTG);
if(m_PerformanceConfig.VoiceDataFilled(nTG)) if(m_PerformanceConfig.VoiceDataFilled(nTG))
{ {
uint8_t* tVoiceData = m_PerformanceConfig.GetVoiceDataFromTxt(nTG); uint8_t* tVoiceData = m_PerformanceConfig.GetVoiceDataFromTxt(nTG);
@ -2429,6 +2493,7 @@ void CMiniDexed::LoadPerformanceParameters(void)
} }
setMonoMode(m_PerformanceConfig.GetMonoMode(nTG) ? 1 : 0, nTG); setMonoMode(m_PerformanceConfig.GetMonoMode(nTG) ? 1 : 0, nTG);
this->SetParameter(TParameter::ParameterCompressorEnable, this->m_PerformanceConfig.GetCompressorEnable()); this->SetParameter(TParameter::ParameterCompressorEnable, this->m_PerformanceConfig.GetCompressorEnable());
#if defined(MIXING_CONSOLE_ENABLE) #if defined(MIXING_CONSOLE_ENABLE)
for(size_t fx = 0; fx < MixerOutput::kFXCount; ++fx) for(size_t fx = 0; fx < MixerOutput::kFXCount; ++fx)
@ -2738,5 +2803,4 @@ unsigned CMiniDexed::getModController (unsigned controller, unsigned parameter,
return 0; return 0;
break; break;
} }
} }

@ -20,11 +20,13 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
// //
#include <circle/logger.h>
#include "performanceconfig.h" #include "performanceconfig.h"
#include "mididevice.h" #include "mididevice.h"
#include <cstring> #include <cstring>
#include <algorithm> #include <algorithm>
#include <sstream>
LOGMODULE ("Performance");
CPerformanceConfig::CPerformanceConfig (FATFS *pFileSystem) CPerformanceConfig::CPerformanceConfig (FATFS *pFileSystem)
: m_Properties ("performance.ini", pFileSystem) : m_Properties ("performance.ini", pFileSystem)
@ -890,8 +892,27 @@ bool CPerformanceConfig::GetInternalFolderOk()
return nInternalFolderOk; return nInternalFolderOk;
} }
bool CPerformanceConfig::CheckFreePerformanceSlot(void)
{
if (nLastPerformance < NUM_PERFORMANCES)
{
// There is a free slot...
return true;
}
else
{
return false;
}
}
bool CPerformanceConfig::CreateNewPerformanceFile(void) bool CPerformanceConfig::CreateNewPerformanceFile(void)
{ {
if (nLastPerformance >= NUM_PERFORMANCES) {
// No space left for new performances
LOGWARN ("No space left for new performance");
return false;
}
std::string sPerformanceName = NewPerformanceName; std::string sPerformanceName = NewPerformanceName;
NewPerformanceName=""; NewPerformanceName="";
nActualPerformance=nLastPerformance; nActualPerformance=nLastPerformance;
@ -972,19 +993,26 @@ bool CPerformanceConfig::ListPerformances()
Result = f_findfirst (&Directory, &FileInfo, "SD:/" PERFORMANCE_DIR, "*.ini"); Result = f_findfirst (&Directory, &FileInfo, "SD:/" PERFORMANCE_DIR, "*.ini");
for (unsigned i = 0; Result == FR_OK && FileInfo.fname[0]; i++) for (unsigned i = 0; Result == FR_OK && FileInfo.fname[0]; i++)
{ {
if (!(FileInfo.fattrib & (AM_HID | AM_SYS))) if (nLastPerformance >= NUM_PERFORMANCES)
{
LOGNOTE ("Skipping performance %s", FileInfo.fname);
}
else
{ {
std::string FileName = FileInfo.fname; if (!(FileInfo.fattrib & (AM_HID | AM_SYS)))
size_t nLen = FileName.length();
if ( nLen > 8 && nLen <26 && strcmp(FileName.substr(6,1).c_str(), "_")==0)
{ {
nPIndex=stoi(FileName.substr(0,6)); std::string FileName = FileInfo.fname;
if(nPIndex > nLastFileIndex) size_t nLen = FileName.length();
if ( nLen > 8 && nLen <26 && strcmp(FileName.substr(6,1).c_str(), "_")==0)
{ {
nLastFileIndex=nPIndex; nPIndex=stoi(FileName.substr(0,6));
} if(nPIndex > nLastFileIndex)
{
nLastFileIndex=nPIndex;
}
m_nPerformanceFileName[nLastPerformance++]= FileName; m_nPerformanceFileName[nLastPerformance++]= FileName;
}
} }
} }
@ -993,14 +1021,15 @@ bool CPerformanceConfig::ListPerformances()
// sort by performance number-name // sort by performance number-name
if (nLastPerformance > 2) if (nLastPerformance > 2)
{ {
sort (m_nPerformanceFileName+1, m_nPerformanceFileName + nLastPerformance); // default is always on first place. %%%%%%%%%%%%%%%% sort (m_nPerformanceFileName+1, m_nPerformanceFileName + nLastPerformance); // default is always on first place. %%%%%%%%%%%%%%%%
} }
} }
LOGNOTE ("Number of Performances: %d", nLastPerformance);
return nInternalFolderOk; return nInternalFolderOk;
} }
void CPerformanceConfig::SetNewPerformance (unsigned nID) void CPerformanceConfig::SetNewPerformance (unsigned nID)
{ {
nActualPerformance=nID; nActualPerformance=nID;

@ -29,6 +29,7 @@
#include <Properties/propertiesfatfsfile.h> #include <Properties/propertiesfatfsfile.h>
#define NUM_VOICE_PARAM 156 #define NUM_VOICE_PARAM 156
#define PERFORMANCE_DIR "performance" #define PERFORMANCE_DIR "performance"
#define NUM_PERFORMANCES 256
class CPerformanceConfig // Performance configuration class CPerformanceConfig // Performance configuration
{ {
@ -212,6 +213,7 @@ public:
std::string GetNewPerformanceDefaultName(void); std::string GetNewPerformanceDefaultName(void);
void SetNewPerformanceName(std::string nName); void SetNewPerformanceName(std::string nName);
bool DeletePerformance(unsigned nID); bool DeletePerformance(unsigned nID);
bool CheckFreePerformanceSlot(void);
private: private:
CPropertiesFatFsFile m_Properties; CPropertiesFatFsFile m_Properties;
@ -251,7 +253,7 @@ private:
unsigned nLastFileIndex; unsigned nLastFileIndex;
unsigned nActualPerformance = 0; unsigned nActualPerformance = 0;
//unsigned nMenuSelectedPerformance = 0; //unsigned nMenuSelectedPerformance = 0;
std::string m_nPerformanceFileName[1024]; std::string m_nPerformanceFileName[NUM_PERFORMANCES];
FATFS *m_pFileSystem; FATFS *m_pFileSystem;
bool nInternalFolderOk=false; bool nInternalFolderOk=false;

@ -893,6 +893,7 @@ const CUIMenu::TMenuItem CUIMenu::s_PerformanceMenu[] =
{0} {0}
}; };
CUIMenu::CUIMenu (CUserInterface *pUI, CMiniDexed *pMiniDexed) : CUIMenu::CUIMenu (CUserInterface *pUI, CMiniDexed *pMiniDexed) :
m_pUI (pUI), m_pUI (pUI),
m_pMiniDexed (pMiniDexed), m_pMiniDexed (pMiniDexed),
@ -904,6 +905,23 @@ CUIMenu::CUIMenu (CUserInterface *pUI, CMiniDexed *pMiniDexed) :
m_nCurrentMenuDepth (0) m_nCurrentMenuDepth (0)
{ {
assert(pMiniDexed); assert(pMiniDexed);
#ifndef ARM_ALLOW_MULTI_CORE
// If there is just one core, then there is only a single
// tone generator so start on the TG1 menu...
m_pParentMenu = s_MainMenu;
m_pCurrentMenu = s_TGMenu;
m_nCurrentMenuItem = 0;
m_nCurrentSelection = 0;
m_nCurrentParameter = 0;
m_nCurrentMenuDepth = 1;
// Place the "root" menu at the top of the stack
m_MenuStackParent[0] = s_MenuRoot;
m_MenuStackMenu[0] = s_MainMenu;
m_nMenuStackItem[0] = 0;
m_nMenuStackSelection[0] = 0;
m_nMenuStackParameter[0] = 0;
#endif
} }
void CUIMenu::EventHandler (TMenuEvent Event) void CUIMenu::EventHandler (TMenuEvent Event)
@ -926,13 +944,28 @@ void CUIMenu::EventHandler (TMenuEvent Event)
break; break;
case MenuEventHome: case MenuEventHome:
#ifdef ARM_ALLOW_MULTI_CORE
m_pParentMenu = s_MenuRoot; m_pParentMenu = s_MenuRoot;
m_pCurrentMenu = s_MainMenu; m_pCurrentMenu = s_MainMenu;
m_nCurrentMenuItem = 0; m_nCurrentMenuItem = 0;
m_nCurrentSelection = 0; m_nCurrentSelection = 0;
m_nCurrentParameter = 0; m_nCurrentParameter = 0;
m_nCurrentMenuDepth = 0; m_nCurrentMenuDepth = 0;
#else
// "Home" is the TG0 menu if only one TG active
m_pParentMenu = s_MainMenu;
m_pCurrentMenu = s_TGMenu;
m_nCurrentMenuItem = 0;
m_nCurrentSelection = 0;
m_nCurrentParameter = 0;
m_nCurrentMenuDepth = 1;
// Place the "root" menu at the top of the stack
m_MenuStackParent[0] = s_MenuRoot;
m_MenuStackMenu[0] = s_MainMenu;
m_nMenuStackItem[0] = 0;
m_nMenuStackSelection[0] = 0;
m_nMenuStackParameter[0] = 0;
#endif
EventHandler (MenuEventUpdate); EventHandler (MenuEventUpdate);
break; break;
@ -954,12 +987,17 @@ void CUIMenu::MenuHandler (CUIMenu *pUIMenu, TMenuEvent Event)
pUIMenu->m_MenuStackParent[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_pParentMenu; pUIMenu->m_MenuStackParent[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_pParentMenu;
pUIMenu->m_MenuStackMenu[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_pCurrentMenu; pUIMenu->m_MenuStackMenu[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_pCurrentMenu;
pUIMenu->m_nMenuStackItem[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_nCurrentMenuItem; pUIMenu->m_nMenuStackItem[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_nCurrentMenuItem;
pUIMenu->m_nMenuStackSelection[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_nCurrentSelection; pUIMenu->m_nMenuStackSelection[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_nCurrentSelection;
pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_nCurrentParameter; pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth] = pUIMenu->m_nCurrentParameter;
pUIMenu->m_nCurrentMenuDepth++; pUIMenu->m_nCurrentMenuDepth++;
pUIMenu->m_pParentMenu = pUIMenu->m_pCurrentMenu; pUIMenu->m_pParentMenu = pUIMenu->m_pCurrentMenu;
pUIMenu->m_nCurrentParameter = pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].Parameter; pUIMenu->m_nCurrentParameter = pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].Parameter;
pUIMenu->m_pCurrentMenu = pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].MenuItem; pUIMenu->m_pCurrentMenu = pUIMenu->m_pCurrentMenu[pUIMenu->m_nCurrentSelection].MenuItem;
pUIMenu->m_nCurrentMenuItem = pUIMenu->m_nCurrentSelection; pUIMenu->m_nCurrentMenuItem = pUIMenu->m_nCurrentSelection;
pUIMenu->m_nCurrentSelection = 0; pUIMenu->m_nCurrentSelection = 0;
@ -1092,7 +1130,6 @@ void CUIMenu::EditVoiceBankNumber (CUIMenu *pUIMenu, TMenuEvent Event)
void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event) void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event)
{ {
unsigned nTG = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-1]; unsigned nTG = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-1];
int nHighestBank = pUIMenu->m_pMiniDexed->GetSysExFileLoader ()->GetNumHighestBank();
int nValue = pUIMenu->m_pMiniDexed->GetTGParameter (CMiniDexed::TTGParameter::TGParameterProgram, nTG); int nValue = pUIMenu->m_pMiniDexed->GetTGParameter (CMiniDexed::TTGParameter::TGParameterProgram, nTG);
@ -1107,11 +1144,7 @@ void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event)
// Switch down a voice bank and set to the last voice // Switch down a voice bank and set to the last voice
nValue = CSysExFileLoader::VoicesPerBank-1; nValue = CSysExFileLoader::VoicesPerBank-1;
int nVB = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TTGParameter::TGParameterVoiceBank, nTG); int nVB = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TTGParameter::TGParameterVoiceBank, nTG);
if (--nVB < 0) nVB = pUIMenu->m_pMiniDexed->GetSysExFileLoader ()->GetNextBankDown(nVB);
{
// Wrap around to last loaded bank
nVB = nHighestBank;
}
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterVoiceBank, nVB, nTG); pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterVoiceBank, nVB, nTG);
} }
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterProgram, nValue, nTG); pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterProgram, nValue, nTG);
@ -1123,11 +1156,7 @@ void CUIMenu::EditProgramNumber (CUIMenu *pUIMenu, TMenuEvent Event)
// Switch up a voice bank and reset to voice 0 // Switch up a voice bank and reset to voice 0
nValue = 0; nValue = 0;
int nVB = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TTGParameter::TGParameterVoiceBank, nTG); int nVB = pUIMenu->m_pMiniDexed->GetTGParameter(CMiniDexed::TTGParameter::TGParameterVoiceBank, nTG);
if (++nVB > (int) nHighestBank) nVB = pUIMenu->m_pMiniDexed->GetSysExFileLoader ()->GetNextBankUp(nVB);
{
// Wrap around to first bank
nVB = 0;
}
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterVoiceBank, nVB, nTG); pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterVoiceBank, nVB, nTG);
} }
pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterProgram, nValue, nTG); pUIMenu->m_pMiniDexed->SetTGParameter (CMiniDexed::TTGParameter::TGParameterProgram, nValue, nTG);
@ -2145,5 +2174,3 @@ void CUIMenu::EditTGParameterModulation (CUIMenu *pUIMenu, TMenuEvent Event)
nValue > rParam.Minimum, nValue < rParam.Maximum); nValue > rParam.Minimum, nValue < rParam.Maximum);
} }

Loading…
Cancel
Save