User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - MTC Quarter Frames Not Being Recognized As Such »
Welcome, Guest. Please Login or Register.
May 25th, 2025, 3:37am


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Questions and Discussion
(Moderator: Jamie OConnell)
   MTC Quarter Frames Not Being Recognized As Such
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: MTC Quarter Frames Not Being Recognized As Such  (Read 1238 times)
llamero
New Member
*



MIDI-OX Rules!

   


Posts: 5
MTC Quarter Frames Not Being Recognized As Such
« on: Jan 4th, 2003, 4:35am »
Quote Quote Modify Modify

I'm currently working on a little project for school which involves outputting midi time code from a program I'm writing. Full frames work great, but as soon as I start trying to output quarter frames, nothing will recognize them as such. Instead, I get lines such as:
 
 00019151   1  --     --  Buffer:     2 Bytes   SysEx Continue
 SYSX: F1 04
 
Instead of:
000007D1  MOX  1     F1    0A    --   --  ---  MTC Quarter Frame  
 
They both look like two byte sequences of 0xF1 followed by the relavent data byte for that given moment in time. I'm sure there's some subtlety that I'm missing here and would appreciate any suggestions or hints as to what may be causing this. Also, can anyone tell me what "SysEx Continue" means? Are there additional criterion placed on quarterframes which would cause what I am producing to not be classified as quarter frames by midi-ox?
 
I'm running MIDI-OX 6.5.0.340 and using MIDI-YOKE 4.0 (both wonderful pieces of software) under windows XP to loop the data back from my code to midi-ox. I'm using midiOutLongMsg to shove QF's out the door one at a time, two bytes each.  
 
Thanks!
Jason
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #1 on: Jan 4th, 2003, 12:50pm »
Quote Quote Modify Modify

You are correct in using midiOutLongMessage for the Full Frame message, however MTC is always sent in Windows as short messages because they need to be sent very quickly (4 per frame), so use midiOutShortMessage for the quarter frame messages and just pack the 2 BYTE message into the DWORD.
 
SysEx Continue is used to indentify the buffer because it doesn't start with 'F0' or end with 'F7'.
 
IP Logged

--Jamie
Music is its own reward.

llamero
New Member
*



MIDI-OX Rules!

   


Posts: 5
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #2 on: Jan 5th, 2003, 12:50am »
Quote Quote Modify Modify

Thanks for the quick reply... I had been using midiOutShortMsg previously but whenever I'd feed it a DWORD like 0x000000F1, 0x000010F1, etc, the quarterframes would never show up in midiox. However, if I change only the 0xF1 status byte to a 0x90 and no other portions of the code, the note off commands show up fine, with the quarter frame data bytes going as expected in the DATA1 field. It seems like either windows is refusing to output the frames with the F1 status byte, or they're being filtered on the way into midiox.  
 
And thusly I'm rather perplexed. Immediate thoughts were that these frames weren't passing some timing criteria to make them qualify as quarter frames... I'm currently just using a thread Sleep(8) command to space out the QF's, but plan to fix that after I get this thing outputting QF's correctly. The reason I went from the midiOutShortMsg to midiOutLongMsg was because at least the long msgs showed up in midi ox as SysEx Continue lines... but I have no clue which bit bucket all of my short messages are going into.
 
Do you know of any good resources for developing MTC generating software under Win32? I've come up dry on my previous searches, and it seems like there must be some bit of vital information that I'm missing here, and it's driving me nuts.
 
Thanks!
Jason
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #3 on: Jan 6th, 2003, 2:21am »
Quote Quote Modify Modify

Make sure that Quarter frames are not being filtered in MIDI-OX: Options | MIDI Filter.... Click the button by System Common and ensure that F1 - MIDI Time Code Quarter Frame is not selected.
 
To test that MTC will be sent and displayed, open the MTC transport: View | MTC Transport  and press Play.  You should see Quarter Frame messages in the output monitor.   You can also use this transport to test reception of MTC: it will update as MTC is received.
 
The only Windows MIDI programming book I know of that even discusses MTC is Maximum MIDI by Paul Messick
 
« Last Edit: Jan 6th, 2003, 2:28am by Jamie OConnell » IP Logged

--Jamie
Music is its own reward.

llamero
New Member
*



MIDI-OX Rules!

   


Posts: 5
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #4 on: Jan 6th, 2003, 2:30am »
Quote Quote Modify Modify

Nope.. Not filtering F1 frames in MidiOx, and the transport isn't reading my quarter frames, only my full frames. I've been able to see quarter frames from other sources like CoolEdit Pro in MidiOx, so I tend to think it's a problem in my code...
 
I found a USENET post from a while back that sounds exactly like the problem I'm seeing...
 
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8& amp;threadm=MPG.131dec56dc525beb9896d9%40news.pond.net&rnum=6&prev=/groups%3Fq%3Dwindows%2B%2522midi%2Btime%2Bcode%2522%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DMPG.131dec56dc525beb9896d9%2540news.pond.net%26rnum%3D6
 
However this was from 2 years ago, and no resolution was ever found, at least in this thread. Have you successfully been able to use midiOutShortMsg to send quarter frames? Becuase I'm starting to believe that MS is in fact doing some filtering on the way out as is suggested in the above thread.
 
Thanks again!
Jason
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #5 on: Jan 6th, 2003, 2:33am »
Quote Quote Modify Modify

I believe that the assumption made in the referenced article is incorrect.  I am able to send MTC in Windows via midiOutShortMessage() in both the 16 bit thunked MME stuff on Windows 9x and the full blown 32 bit MME stuff under Win 2000, XP.
 
Again, please investigate the MIDI-OX MTC transport.  It demonstrates both sending and receiving of MTC.  You can hook 2 instances of MIDI-OX together via MIDI Yoke and send MTC from one instance to the other and see the transport update in both instances.
« Last Edit: Jan 6th, 2003, 2:35am by Jamie OConnell » IP Logged

--Jamie
Music is its own reward.

llamero
New Member
*



MIDI-OX Rules!

   


Posts: 5
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #6 on: Jan 6th, 2003, 10:57pm »
Quote Quote Modify Modify

I had sort of wondered how to get the transport panel to talk to itself.. never thought to launch two instances of midiox. I've been using the MTC transport all along at the same time as I watch the output window. I can get the transport to respond when I send full frames, but it won't advance when I think I'm sending quarter frames.  
 
I also downloaded the tool kit demo from the Maximum Midi site. Working on getting a copy of the book...  I've been using the MidiSpy demo app's raw hex dump function as a sanity check, and both it AND midi-ox show no traffic what so ever when I feed midiOutShortMsg the DWORD 0x0000nxF1 where n is the qf number and x is the data nibble in a loop, sending the next number frame each time with the relavent data byte, wrapping to zero after seven. Windows is reporting MMSYSERR_NOERROR on each call to the function. So just for kicks, I installed my midisport 1x1 on my laptop and ran my stuff. The transmit LED blinks when it sends full frames, but goes dark when the QF frame routines run. So I'd consider that fairly conclusive proof that the data is being lost on the way out of my code through windows and not on the way through midi yoke or into midi ox.
 
I'm really hoping I'm just missing some extraordinarily stupid detail. I think the next thing I might do is to strip the QF generating code out into its own program and try to get JUST it working.  
 
Thanks again for your advice...
Jason
« Last Edit: Jan 6th, 2003, 11:19pm by llamero » IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #7 on: Jan 8th, 2003, 1:15pm »
Quote Quote Modify Modify

Another thought: a receiver may show no activity until it receives 2 frames worth of MTC (8 MTC messages), because it doesn't know what time it is until it has received 8 messages.  I think, though, that MIDI-OX will show you a solitary MTC message in the monitor, so I am perplexed as well.  Try sending some note on's and off's right before you send your MTC to see if you get any data flowing at all.
« Last Edit: Jan 8th, 2003, 1:16pm by Jamie OConnell » IP Logged

--Jamie
Music is its own reward.

llamero
New Member
*



MIDI-OX Rules!

   


Posts: 5
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #8 on: Jan 8th, 2003, 2:20pm »
Quote Quote Modify Modify

Here's the resolution to the problem. I e-mailed the guy who posted the problem 3 years ago on USENET linked above, and by some miracle not only did he get the message, but was able to send me back the solution. Thanks Alan!
 
"Hi Jason,
 
I dug around and found it.
You won't believe it.
 
It's specific to MS Windows and a bizzare enough "bug" that I think it still exists in current versions.
 
If you do a midiOutOpen and use the MidiMapper as the output device (-1), F1-FF status bytes will not go through. Changing the midiOutOpen to a specific midi device works fine.
 
If you have a single midi out device, then try 0 or 1 as the device.
 
Otherwise you might have to do a midiInGetNumDevs and midiInGetDevCaps and hunt for the device you want.
 
Hope this helps,
I went through alot of hair pulling to figure that one out.
 
-Alan"
 
I had hardcoded the midiOutOpen to MIDI mapper with the intent of adding the configuration box AFTER I had the basic mechanics working. Changed it to a specific value and the quarter frames work fine.  
 
Jason
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: MTC Quarter Frames Not Being Recognized As Suc
« Reply #9 on: Jan 9th, 2003, 9:39am »
Quote Quote Modify Modify

Thanks for the info!  I wasn't aware of that problem, and I will add something to the FAQ about this.
IP Logged

--Jamie
Music is its own reward.

Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.