13
0

Make recorded MIDI controls discrete, take 2.

Hopefully-desired behaviour is that controls created in the GUI are linear, so
clicking in stuff works like other automation, but controls that originated
from recording are set to discrete so Ardour plays back the input exactly,
instead of doing crazy things like linear interpolation of already high-rate
user input, hold pedals, and so on.

Hopefully that remains the desired behaviour, because we're basically screwed
for ever making any control discrete by default, since we only save the mode to
XML at all if it's not the default, which is currently linear.
This commit is contained in:
David Robillard 2014-12-05 00:15:40 -05:00
parent ad340333f4
commit 0bf778c847

View File

@ -34,6 +34,7 @@
#include "pbd/pthread_utils.h"
#include "pbd/basename.h"
#include "evoral/Control.hpp"
#include "evoral/EventSink.hpp"
#include "ardour/debug.h"
@ -303,6 +304,14 @@ MidiSource::mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::Musica
{
if (_model) {
_model->end_write (option, end);
/* Make captured controls discrete to play back user input exactly. */
for (MidiModel::Controls::iterator i = _model->controls().begin(); i != _model->controls().end(); ++i) {
if (i->second->list()) {
i->second->list()->set_interpolation(Evoral::ControlList::Discrete);
_interpolation_style.insert(std::make_pair(i->second->parameter(), Evoral::ControlList::Discrete));
}
}
}
_writing = false;