-
Notifications
You must be signed in to change notification settings - Fork 270
Closed
Description
SourceForge reference: https://sourceforge.net/p/arduinomidilib/feature-requests/3/
There is "setHandleTimeCodeQuarterFrame" callback, but there is one more message, that is used in Midi Time Code. It's called Time Code Full Frame
Here is picture of how it should look like:
http://www.muzoborudovanie.ru/articles/midi/pict/407.gif
Here is some code, which I use now to catch this message (should be used with bug fix I have posted):
MIDI.setHandleSystemExclusive(HandleTCFF);
...
void HandleTCFF(byte* array, byte arsize)
{
if((arsize > 2) && (array[1]==0x7F))
{
Hours = array[5] & 0x1F;
Minutes = array[6] & 0x3F;
Seconds = array[7] & 0x3F;
Frames = array[8] & 0x1F;
}
}
Forgot to mention why &'s are used. There can be some other data in byte:
Frames: xxxyyyyy
xxx - Reserved
yyyyy - Frame number (0-29)
Seconds: xxyyyyyy
xx - Reserved
yyyyyy - Second number (0-59)
Minutes:
xx - Reserved
yyyyyy - Minute number (0-59)
Hours: xyyzzzzz
x - Reserved
yy - Frame format:
00 - 24 fps
01 - 25 fps
10 - 30 fps Drop frame
11 - 30 fps Non-drop
zzzzz - Hour number (0-23)