Merge pull request #31 from MrDham/MrDham-issue30

Update application.cpp
master V2.8
MrDham 2 years ago committed by GitHub
commit ea62c26cc8
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