Support more MIDI CCs (#122)

Add support for MIDI CCs

10 = Pan
71 = Resonance
74 = Frequency Cutoff
91 = Reverb Send
94 = Detune Level

Closes #121
pull/123/head^2
probonopd 3 years ago committed by GitHub
parent 43d1b3ab93
commit fe39d8dc01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      src/mididevice.cpp

@ -33,8 +33,13 @@
#define MIDI_CC_BANK_SELECT_MSB 0 // TODO
#define MIDI_CC_MODULATION 1
#define MIDI_CC_VOLUME 7
#define MIDI_CC_PAN_POSITION 10
#define MIDI_CC_BANK_SELECT_LSB 32
#define MIDI_CC_BANK_SUSTAIN 64
#define MIDI_CC_RESONANCE 71
#define MIDI_CC_FREQUENCY_CUTOFF 74
#define MIDI_CC_REVERB_LEVEL 91
#define MIDI_CC_DETUNE_LEVEL 94
#define MIDI_PROGRAM_CHANGE 0b1100
#define MIDI_PITCH_BEND 0b1110
@ -162,6 +167,10 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
m_pSynthesizer->SetVolume (pMessage[2], nTG);
break;
case MIDI_CC_PAN_POSITION:
m_pSynthesizer->SetPan (pMessage[2], nTG);
break;
case MIDI_CC_BANK_SELECT_LSB:
m_pSynthesizer->BankSelectLSB (pMessage[2], nTG);
break;
@ -169,6 +178,22 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
case MIDI_CC_BANK_SUSTAIN:
m_pSynthesizer->setSustain (pMessage[2] >= 64, nTG);
break;
case MIDI_CC_RESONANCE:
m_pSynthesizer->SetResonance (pMessage[2], nTG);
break;
case MIDI_CC_FREQUENCY_CUTOFF:
m_pSynthesizer->SetCutoff (pMessage[2], nTG);
break;
case MIDI_CC_REVERB_LEVEL:
m_pSynthesizer->SetReverbSend (pMessage[2], nTG);
break;
case MIDI_CC_DETUNE_LEVEL:
m_pSynthesizer->SetMasterTune (pMessage[2], nTG);
break;
}
break;

Loading…
Cancel
Save