MIDI song position pointer, and code optimization
I'd like to implement code to extract MIDI song position pointer information out of a MIDI input stream. I've written the code to do so (the messages are 3 bytes long, and start with decimal 242) - see below (the bytes are just printed to the Max window).
My question: does anyone have a better, more efficient way to capture these three bytes out of the incoming MIDI stream? For some reason, something tells me that I'm doing this in a more clunky fashion than I need to, and I'm having a mental block!
Thanks in advance...
@dan not sure if that's more efficient, that's a few objects less.
I think vanille's solution is perfect.
Maybe a bit less efficient, but that does it really matter when processing midi?
Thanks to you guys for the two solutions! Both much cleaner and nicer than mine...
Ultimately though there should be an object for this - it is a standard system midi message, so it should only need minor editing of existing code ,
cheers
Just another one:
and yes, a seperate object for MTC and SPP would definitely be handsome...
That's beautiful Stefan, one object!