View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006693 | ardour | bugs | public | 2015-11-28 14:57 | 2016-01-09 15:45 |
Reporter | tpalagyi | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | Linux | OS | Ubuntu | OS Version | 15.10 |
Product Version | 4.X git (version in description) | ||||
Summary | 0006693: Can not use transport controls of M-Audio Axiom 25 mkII | ||||
Description | From git, version: Ardour 4.4.332 "Discreet Music" (built from revision 4.4-332-gb842495) Intel 64 bit Assigning transport control buttons of M-Audio Axiom 25 mkii to play/stop etc. buttons of Ardour does not work. | ||||
Steps To Reproduce | - Ctrl + Middle button click on Play button in Ardour -> "operate controller now" widget appears - Press play button on Midi keyboard -> It seems Ardour registered the key as the above mentioned widget disappears - Push play button on Midi keyboard -> Nothing happens Same behaviour for all transport control buttons on the Midi controller. Registering fader or encoders seems working, but their behaviour is strange, sometimes they refuse working if they are moved too fast. | ||||
Additional Information | Investigation showed that transport control button registration indeed succeeded, but when button was pressed on controller the code in libs/surfaces/generic_midi/midicontrollable.cc inside MIDIControllable::midi_sense_controller section if (in_sync || _surface->motorised ()) { controllable->set_value (midi_to_control (new_value)); } is where the set_value does not happen due to in_sync is always 0 when transport control buttons of the Midi controller are used. This is due to this section: bool const in_sync = ( range < threshold && controllable->get_value() <= midi_to_control(max_value) && controllable->get_value() >= midi_to_control(min_value) ); specifically that range is 127 for the control buttons (0 - 127) but threshold is 10. Changing threshold to 300 solve the issue, transport control buttons start working. For the moment I did this to let me use the transport controls (as a side effect the fader end encoders are working OK even with fast movements): diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index 54bb65c..a2308f7 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -59,7 +59,7 @@ using namespace std; GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s) : ControlProtocol (s, _("Generic MIDI")) , _motorised (false) - , _threshold (10) + , _threshold (threshold_default) , gui (0) { _input_port = s.midi_input_port (); @@ -580,10 +580,10 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) if ((prop = node.property ("threshold")) != 0) { if (sscanf (prop->value().c_str(), "%d", &_threshold) != 1) { - _threshold = 10; + _threshold = threshold_default; } } else { - _threshold = 10; + _threshold = threshold_default; } if ((prop = node.property ("motorized")) != 0) { @@ -726,7 +726,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath) if ((prop = (*citer)->property ("threshold")) != 0) { _threshold = atoi (prop->value ()); } else { - _threshold = 10; + _threshold = threshold_default; } } diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h index f09c8e4..f4f92eb 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h @@ -101,6 +101,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol { } private: + static const int threshold_default = 300; MIDI::Port* _input_port; MIDI::Port* _output_port; ARDOUR::microseconds_t _feedback_interval; | ||||
Tags | No tags attached. | ||||
|
axiom25mkii_transport_control_fix.patch (1,804 bytes)
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index 54bb65c..a2308f7 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -59,7 +59,7 @@ using namespace std; GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s) : ControlProtocol (s, _("Generic MIDI")) , _motorised (false) - , _threshold (10) + , _threshold (threshold_default) , gui (0) { _input_port = s.midi_input_port (); @@ -580,10 +580,10 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) if ((prop = node.property ("threshold")) != 0) { if (sscanf (prop->value().c_str(), "%d", &_threshold) != 1) { - _threshold = 10; + _threshold = threshold_default; } } else { - _threshold = 10; + _threshold = threshold_default; } if ((prop = node.property ("motorized")) != 0) { @@ -726,7 +726,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath) if ((prop = (*citer)->property ("threshold")) != 0) { _threshold = atoi (prop->value ()); } else { - _threshold = 10; + _threshold = threshold_default; } } diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h index f09c8e4..f4f92eb 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h @@ -101,6 +101,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol { } private: + static const int threshold_default = 300; MIDI::Port* _input_port; MIDI::Port* _output_port; ARDOUR::microseconds_t _feedback_interval; |
|
There's no way to this work correctly with the current code. Combining threshold, CC messages, toggled and non-toggled controls is not handled correctly. Your proposed fix makes toggled controls work, but breaks continuously valued controls (because the existing code is wrong). Also, note that in C++, you cannot only define a static const member in the object definition, it has to be present in the object declaration too. Some compilers allow it, but it is not standard. Just FYI. |