]> git.sesse.net Git - nageru/commitdiff
Send note velocity of 1 instead of 127 for lights.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Jan 2019 21:37:00 +0000 (22:37 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Jan 2019 21:37:00 +0000 (22:37 +0100)
Seemingly at least the Behringer PL-1 isn't happy about 127;
it has 0 for off (well, default color), 1 for on, 2 for blink,
and ignores all others. 1 should be fine for other devices as
far as I know, so simply make it universal.

nageru/midi_mapper.cpp

index 3b22192b3b8b0670356ebdb9230a8133777b0983..e858603b932f824d49e852a403fa574d94bb557d 100644 (file)
@@ -638,7 +638,7 @@ void MIDIMapper::update_lights_lock_held()
 
                // For some reason, not all devices respond to note off.
                // Use note-on with velocity of 0 (which is equivalent) instead.
-               snd_seq_ev_set_noteon(&ev, /*channel=*/0, note_num, active ? 127 : 0);
+               snd_seq_ev_set_noteon(&ev, /*channel=*/0, note_num, active ? 1 : 0);
                WARN_ON_ERROR("snd_seq_event_output", snd_seq_event_output(alsa_seq, &ev));
                current_light_status[note_num] = active;
        }