mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
Slightly hacky but functional fix for large quantities of MIDI output when interpolating sharp changes in controller value. Fixes #3476.
git-svn-id: svn://localhost/ardour2/branches/3.0@7840 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ca00c3bcc3
commit
42a23312a0
1 changed files with 12 additions and 2 deletions
|
|
@ -39,6 +39,16 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
|
/** Minimum time between MIDI outputs from a single controller,
|
||||||
|
expressed in beats. This is to limit the rate at which MIDI messages
|
||||||
|
are generated, particularly for quickly-changing controllers which
|
||||||
|
are being interpolated.
|
||||||
|
|
||||||
|
XXX: This is a hack. The time should probably be expressed in
|
||||||
|
seconds rather than beats, and should be configurable etc. etc.
|
||||||
|
*/
|
||||||
|
static double const time_between_controller_outputs = 1.0 / 256;
|
||||||
|
|
||||||
namespace Evoral {
|
namespace Evoral {
|
||||||
|
|
||||||
// Read iterator (const_iterator)
|
// Read iterator (const_iterator)
|
||||||
|
|
@ -253,9 +263,9 @@ Sequence<Time>::const_iterator::operator++()
|
||||||
case CONTROL:
|
case CONTROL:
|
||||||
// Increment current controller iterator
|
// Increment current controller iterator
|
||||||
if (_force_discrete) {
|
if (_force_discrete) {
|
||||||
ret = _control_iter->list->rt_safe_earliest_event_discrete_unlocked (_control_iter->x, x, y, false);
|
ret = _control_iter->list->rt_safe_earliest_event_discrete_unlocked (_control_iter->x + time_between_controller_outputs, x, y, false);
|
||||||
} else {
|
} else {
|
||||||
ret = _control_iter->list->rt_safe_earliest_event_unlocked (_control_iter->x, x, y, false);
|
ret = _control_iter->list->rt_safe_earliest_event_unlocked (_control_iter->x + time_between_controller_outputs, x, y, false);
|
||||||
}
|
}
|
||||||
assert(!ret || x > _control_iter->x);
|
assert(!ret || x > _control_iter->x);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue