wrap MIDI timecode at 24h
authorRobin Gareus <robin@gareus.org>
Tue, 10 Jun 2014 02:22:34 +0000 (04:22 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 10 Jun 2014 02:22:34 +0000 (04:22 +0200)
libs/ardour/session_midi.cc
libs/midi++2/mmc.cc

index c13ae54338ba8a87cac9f055c6d4625bb4fe41d4..639ea399d317a9983c5b456b75f2de393ce1d19a 100644 (file)
@@ -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;
index b49585ccd2d68cf88edf5690282693e605bc8857..0bdb359decc44e808e7e416ed7ad8560fdd313c9 100644 (file)
@@ -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;