Fixed pb in toggle mode to switch at half way (fixes #6424)
This commit is contained in:
parent
a29b050883
commit
ed8ab2c80a
@ -373,9 +373,13 @@ MIDIControllable::midi_sense_pitchbend (Parser &, pitchbend_t pb)
|
|||||||
controllable->set_value (midi_to_control (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() ));
|
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI pitchbend %1 value %2 %3\n", (int) control_channel, (float) midi_to_control (pb), current_uri() ));
|
||||||
} else {
|
} else {
|
||||||
float new_value = controllable->get_value() > 0.5f ? 0.0f : 1.0f;
|
if (pb > 8065.0f) {
|
||||||
controllable->set_value (new_value);
|
controllable->set_value (1);
|
||||||
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI pitchbend %1 value %2 %3\n", (int) control_channel, (float) new_value, current_uri()));
|
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 ());
|
last_value = control_to_midi (controllable->get_value ());
|
||||||
|
Loading…
Reference in New Issue
Block a user