[ardour-dev] smpte bits patch

Joshua Leach leachj at cae.wisc.edu
Sun Jun 27 21:16:07 PDT 2004


Had some time off work last week, so I started writing a util to sync
sending DV video to my external DV converter with the midi time code
from ardour. 

I noticed ardour wasn't setting the frame rate bits correctly in the
time code. This patch has a small change to session_midi.cc and a few
to session_time.cc

-- 
----------------------------
-Joshua Leach
-------------- next part --------------
--- ardour-0.9beta16.1/libs/ardour/session_midi.cc	2004-06-04 09:51:57.000000000 -0500
+++ /usr/local/src/ardour-0.9beta16.1/libs/ardour/session_midi.cc	2004-06-27 22:33:56.732624448 -0500
@@ -578,7 +578,7 @@
 
 	smpte_time (_transport_frame, smpte);
 
-	msg[5] = (mtc_smpte_bits << 5) | smpte.hours;
+	msg[5] = mtc_smpte_bits | smpte.hours;
 	msg[6] = smpte.minutes;
 	msg[7] = smpte.seconds;
 	msg[8] = smpte.frames;
--- ardour-0.9beta16.1/libs/ardour/session_time.cc	2004-04-06 20:55:02.000000000 -0500
+++ /usr/local/src/ardour-0.9beta16.1/libs/ardour/session_time.cc	2004-06-27 22:36:20.448776272 -0500
@@ -57,22 +57,22 @@
 		_frames_per_smpte_frame = (jack_nframes_t) ceil ((double) _current_frame_rate / (double) smpte_frames_per_second);
 	}
 	last_smpte_valid = false;
-
+	// smpte type bits are the middle two in the upper nibble
 	switch ((int) ceil (fps)) {
 	case 24:
 		mtc_smpte_bits = 0;
 		break;
 
 	case 25:
-		mtc_smpte_bits = 0x10;
+		mtc_smpte_bits = 0x20;
 		break;
 
 	case 30:
 	default:
 		if (drop_frames) {
-			mtc_smpte_bits = 0x20;
-		} else {
 			mtc_smpte_bits = 0x40;
+		} else {
+			mtc_smpte_bits =  0x60;
 		}
 		break;
 	};


More information about the Ardour-Dev mailing list