aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-01 18:29:24 +0000
committerDavid Robillard <d@drobilla.net>2007-04-01 18:29:24 +0000
commit69ad86f21555d28f5065923eea06ccc3cc4f4ce5 (patch)
treeb2043bc9899a3a52b1aa0f3d92bcc7e82ca87ed1 /src/engine
parent719fc353d389b936cc1c064d512453268283b424 (diff)
downloadmachina-69ad86f21555d28f5065923eea06ccc3cc4f4ce5.tar.gz
machina-69ad86f21555d28f5065923eea06ccc3cc4f4ce5.tar.bz2
machina-69ad86f21555d28f5065923eea06ccc3cc4f4ce5.zip
Fixed missed events (off by one bug comparing time stamps with end of cycle).
git-svn-id: http://svn.drobilla.net/lad/machina@388 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/JackDriver.cpp7
-rw-r--r--src/engine/Machine.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp
index 7a2b03d..7df3a4b 100644
--- a/src/engine/JackDriver.cpp
+++ b/src/engine/JackDriver.cpp
@@ -182,7 +182,12 @@ JackDriver::write_event(Raul::BeatTime time,
if (_cycle_time.beats_to_ticks(time) + _cycle_time.offset_ticks() < _cycle_time.start_ticks()) {
std::cerr << "ERROR: Missed event by "
<< _cycle_time.start_ticks() - (_cycle_time.beats_to_ticks(time) + _cycle_time.offset_ticks())
- << "ticks." << std::endl;
+ << " ticks"
+ << "\n\tbpm: " << _cycle_time.bpm()
+ << "\n\tev time: " << _cycle_time.beats_to_ticks(time)
+ << "\n\tcycle_start: " << _cycle_time.start_ticks()
+ << "\n\tcycle_end: " << _cycle_time.start_ticks() + _cycle_time.length_ticks()
+ << "\n\tcycle_length: " << _cycle_time.length_ticks() << std::endl << std::endl;
return;
}
diff --git a/src/engine/Machine.cpp b/src/engine/Machine.cpp
index 2857e8b..c61bd4f 100644
--- a/src/engine/Machine.cpp
+++ b/src/engine/Machine.cpp
@@ -242,7 +242,7 @@ Machine::run(const Raul::TimeSlice& time)
// Must do comparison in ticks here to avoid rounding up and executing
// an event outside the current cycle
} else if (time.beats_to_ticks(earliest->exit_time())
- < time.beats_to_ticks(cycle_end)) {
+ <= time.beats_to_ticks(cycle_end)) {
this_time += earliest->exit_time() - _time;
_time = earliest->exit_time();
exit_node(sink, earliest);