Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small enhancement on MTC #107

Open
mink99 opened this issue Nov 24, 2018 · 1 comment
Open

small enhancement on MTC #107

mink99 opened this issue Nov 24, 2018 · 1 comment

Comments

@mink99
Copy link

mink99 commented Nov 24, 2018

I am currently working on some mtc stuff. Maybe a
void sendMTCFullFrameMessage(fps,hh,mm,ss,ff) could be added ? I know it is basically a normal sysex message, but it would be a nice simplification...

same for sendMTCQuarterMessage()

a parameter as in sendMTCQuarterMessage(int msgCount, int Value) would simplify this. This message is called from an interrupt and this could speed things up:

void sendMTCQuarterMessage (int msgCount,int v)
{
byte toSend;
switch (msgCount)
{
case 0:
toSend = 0x00 | lo_nibble(v);
break;
case 1:
toSend = 0x10 | hi_nibble(v);
break;
case 2:
toSend = 0x20 | lo_nibble(v);
break;
case 3:
toSend = 0x30 | hi_nibble(v);
break;
case 4:
toSend = 0x40 | lo_nibble(v);
break;
case 5:
toSend = 0x50 | hi_nibble(v);
break;
case 6:
toSend = 0x60 | lo_nibble(v);
break;
case 7:
toSend = 0x72 | hi_nibble(v); //defaults to 25 ....
//toSend = 0x70 | hi_nybble(hh) | 0b00100000; //would be 24
break;
}
MidiPort.write(0xF1);
MidiPort.write(toSend);
}

maybe even the counter could be handled internally...¨

@mink99
Copy link
Author

mink99 commented Nov 25, 2018

I see that reading the mtc full frame message is somehow in the fr “sysex construction helpers”, however this message is not a universal sysex, it is a dedicated message with well defined parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant