From 623a23dcd7bf6910a10594dc2599f31574c93860 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 17 Dec 2010 05:06:39 +0000 Subject: Fix node duration when step recording. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@2738 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/MachineBuilder.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/engine/MachineBuilder.cpp b/src/engine/MachineBuilder.cpp index 7c65feb..3078cc2 100644 --- a/src/engine/MachineBuilder.cpp +++ b/src/engine/MachineBuilder.cpp @@ -63,6 +63,11 @@ MachineBuilder::is_delay_node(SharedPtr node) const void MachineBuilder::set_node_duration(SharedPtr node, Raul::TimeDuration d) const { + if (_step) { + node->set_duration(TimeStamp(d.unit(), 1, 0)); + return; + } + Raul::TimeStamp q_dur = Quantizer::quantize(TimeStamp(d.unit(), _quantization), d); // Never quantize a note to duration 0 @@ -172,10 +177,7 @@ MachineBuilder::event(Raul::TimeStamp time_offset, SharedPtr resolved = *i; resolved->set_exit_action(SharedPtr(new MidiAction(ev_size, buf))); - if (_step) - set_node_duration(resolved, TimeStamp(t.unit())); - else - set_node_duration(resolved, t - resolved->enter_time()); + set_node_duration(resolved, t - resolved->enter_time()); // Last active note if (_active_nodes.size() == 1) { -- cgit v1.2.1