Update application.cpp

MrDham-issue30
MrDham 2 years ago committed by GitHub
parent 34cc291cfb
commit 0277b888a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      Open_Theremin_V3/application.cpp

@ -603,8 +603,11 @@ void Application::midi_application ()
case MIDI_SILENT:
// Always refresh midi loop antena cc.
if (new_midi_loop_cc_val != old_midi_loop_cc_val)
{
if (loop_midi_cc < 128)
{
midi_msg_send(midi_channel, 0xB0, loop_midi_cc, new_midi_loop_cc_val);
}
old_midi_loop_cc_val = new_midi_loop_cc_val;
}
else
@ -615,10 +618,10 @@ void Application::midi_application ()
// Always refresh midi rod antena cc if applicable.
if (new_midi_rod_cc_val != old_midi_rod_cc_val)
{
if (rod_midi_cc != 255)
if (rod_midi_cc < 128)
{
midi_msg_send(midi_channel, 0xB0, rod_midi_cc, (uint8_t)(new_midi_rod_cc_val >> 7));
if (rod_midi_cc_lo != 255)
if (rod_midi_cc_lo < 128)
{
midi_msg_send(midi_channel, 0xB0, rod_midi_cc_lo, (uint8_t)(new_midi_rod_cc_val & 0x007F));
}
@ -671,8 +674,11 @@ void Application::midi_application ()
case MIDI_PLAYING:
// Always refresh midi loop antena cc.
if (new_midi_loop_cc_val != old_midi_loop_cc_val)
{
if (loop_midi_cc < 128)
{
midi_msg_send(midi_channel, 0xB0, loop_midi_cc, new_midi_loop_cc_val);
}
old_midi_loop_cc_val = new_midi_loop_cc_val;
}
else
@ -683,10 +689,10 @@ void Application::midi_application ()
// Always refresh midi rod antena cc if applicable.
if (new_midi_rod_cc_val != old_midi_rod_cc_val)
{
if (rod_midi_cc != 255)
if (rod_midi_cc < 128)
{
midi_msg_send(midi_channel, 0xB0, rod_midi_cc, (uint8_t)(new_midi_rod_cc_val >> 7));
if (rod_midi_cc_lo != 255)
if (rod_midi_cc_lo < 128)
{
midi_msg_send(midi_channel, 0xB0, rod_midi_cc_lo, (uint8_t)(new_midi_rod_cc_val & 0x007F));
}

Loading…
Cancel
Save