|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-16 10:22:01
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Oct 16 13:11:13 2011 +0300
Fix time offset bug with MIDI writer.
---
songwriter-ini.cc | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/songwriter-ini.cc b/songwriter-ini.cc
index 6ae8e69..31cced5 100644
--- a/songwriter-ini.cc
+++ b/songwriter-ini.cc
@@ -50,10 +50,12 @@ void FoFMIDIWriter::writeMIDI() const {
ev.channel = 0;
ev.arg1 = 105; // Special note value for starting a new sentence
// End the previous sentence (if not at the beginning)
- if (sentenceOn) { ev.arg2 = 0; writer.writeEvent(ev); } // Note OFF
+ if (sentenceOn) {
+ ev.arg2 = 0;
+ writer.writeEvent(ev);
+ ev.timecode = 0; // Reset time for the next event
+ } // Note OFF
sentenceOn = true;
- // The same timecode for the rest
- ev.timecode = 0;
// Begin a new one
ev.arg2 = 127; writer.writeEvent(ev); // Note ON
}
|