summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-06-10 04:22:34 +0200
committerRobin Gareus <robin@gareus.org>2014-06-10 04:22:34 +0200
commit438179d278559bcb41a8abdadfb5e6b2e1e89d2d (patch)
treef023235e9e61d36f9aed26b05fbe45cbf2d3ba33
parentc0376fe7b3eae7dd167a37b2d68087e0cda38832 (diff)
wrap MIDI timecode at 24h
-rw-r--r--libs/ardour/session_midi.cc2
-rw-r--r--libs/midi++2/mmc.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index c13ae54338..639ea399d3 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -417,7 +417,7 @@ Session::send_full_time_code (framepos_t const t, MIDI::pframes_t nframes)
msg[4] = 0x1;
msg[9] = 0xf7;
- msg[5] = (mtc_timecode_bits | timecode.hours) & 0x7f;
+ msg[5] = mtc_timecode_bits | (timecode.hours % 24);
msg[6] = timecode.minutes;
msg[7] = timecode.seconds;
msg[8] = timecode.frames;
diff --git a/libs/midi++2/mmc.cc b/libs/midi++2/mmc.cc
index b49585ccd2..0bdb359dec 100644
--- a/libs/midi++2/mmc.cc
+++ b/libs/midi++2/mmc.cc
@@ -710,7 +710,7 @@ MachineControlCommand::fill_buffer (MachineControl* mmc, MIDI::byte* b) const
if (_command == MachineControl::cmdLocate) {
*b++ = 0x6; // byte count
*b++ = 0x1; // "TARGET" subcommand
- *b++ = _time.hours & 0x7f;
+ *b++ = _time.hours % 24;
*b++ = _time.minutes;
*b++ = _time.seconds;
*b++ = _time.frames;