diff options
author | Len Ovens <len@ovenwerks.net> | 2015-07-09 18:27:08 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-07-10 16:52:43 -0400 |
commit | ed8ab2c80aae099e983a1aa7907910e5132d4303 (patch) | |
tree | 0c23bcc6675a13fa935087bb61c43ae41c17831c /libs | |
parent | a29b0508839ec3aed45b6f5b9305228883b078ca (diff) |
Fixed pb in toggle mode to switch at half way (fixes #6424)
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/generic_midi/midicontrollable.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index 89df2cbdea..f03a113cfe 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -373,9 +373,13 @@ MIDIControllable::midi_sense_pitchbend (Parser &, pitchbend_t pb) controllable->set_value (midi_to_control (pb)); DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI pitchbend %1 value %2 %3\n", (int) control_channel, (float) midi_to_control (pb), current_uri() )); } else { - float new_value = controllable->get_value() > 0.5f ? 0.0f : 1.0f; - controllable->set_value (new_value); - DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI pitchbend %1 value %2 %3\n", (int) control_channel, (float) new_value, current_uri())); + if (pb > 8065.0f) { + controllable->set_value (1); + DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Midi pitchbend %1 value 1 %2\n", (int) control_channel, current_uri())); + } else { + controllable->set_value (0); + DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Midi pitchbend %1 value 0 %2\n", (int) control_channel, current_uri())); + } } last_value = control_to_midi (controllable->get_value ()); |