add aftertouch. correct system reset

This commit is contained in:
Alex Birch 2019-06-23 23:17:28 +01:00
parent 13fd1c60e0
commit b0f10b7940
No known key found for this signature in database
GPG Key ID: 305EB1F98D44ACBA
2 changed files with 11 additions and 2 deletions

View File

@ -188,7 +188,15 @@ void JuicySFAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer
fluid_midi_event_set_program(midi_event, m.getChannelPressureValue()); fluid_midi_event_set_program(midi_event, m.getChannelPressureValue());
fluid_synth_handle_midi_event(fluidSynth, midi_event); fluid_synth_handle_midi_event(fluidSynth, midi_event);
delete_fluid_midi_event(midi_event); delete_fluid_midi_event(midi_event);
} else if (m.isResetAllControllers()) { } else if (m.isAftertouch()) {
fluid_midi_event_t *midi_event(new_fluid_midi_event());
fluid_midi_event_set_type(midi_event, static_cast<int>(KEY_PRESSURE));
fluid_midi_event_set_channel(midi_event, fluidSynthModel.getChannel());
fluid_midi_event_set_key(midi_event, m.getNoteNumber());
fluid_midi_event_set_value(midi_event, m.getAfterTouchValue());
fluid_synth_handle_midi_event(fluidSynth, midi_event);
delete_fluid_midi_event(midi_event);
} else if (m.isMetaEvent()) {
fluid_midi_event_t *midi_event(new_fluid_midi_event()); fluid_midi_event_t *midi_event(new_fluid_midi_event());
fluid_midi_event_set_type(midi_event, static_cast<int>(MIDI_SYSTEM_RESET)); fluid_midi_event_set_type(midi_event, static_cast<int>(MIDI_SYSTEM_RESET));
fluid_synth_handle_midi_event(fluidSynth, midi_event); fluid_synth_handle_midi_event(fluidSynth, midi_event);

View File

@ -67,7 +67,8 @@ void SoundfontSynthVoice::pitchWheelMoved (int newValue) {
} }
void SoundfontSynthVoice::controllerMoved (int controllerNumber, int newValue) { void SoundfontSynthVoice::controllerMoved (int controllerNumber, int newValue) {
Logger::outputDebugString ( juce::String::formatted("Controlled moved: %d, %d\n", controllerNumber, newValue) ); // this seems to be "program change" event
Logger::outputDebugString ( juce::String::formatted("Controller moved: %d, %d\n", controllerNumber, newValue) );
} }
void SoundfontSynthVoice::renderNextBlock (AudioBuffer<float>& outputBuffer, int startSample, int numSamples) { void SoundfontSynthVoice::renderNextBlock (AudioBuffer<float>& outputBuffer, int startSample, int numSamples) {