View Single Post
Old 12-15-2009, 03:40 PM   #128
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

... about the MIDI_eventlist approach i obviously forget http://forum.cockos.com/showthread.php?t=45430, with a cool example posted by rome. MIDI looks like a brand new place for extensions.. but padre & rome seems in the starting block for that!

Quote:
Originally Posted by MikeLacey View Post
Ooh look at that, can open and worms just everywhere.
What I meant above is that, if I was sure of what I'm doing I won't use the MIDI_eventlist appoach!

I've started digging into midi too.. but directly working with chunks. It's ok for READ and it can answer some your Q's above (see bellow). The few WRITE tests I did: removing cc123, empying, .. seemed also safe but I stopped there: it seemed "too easy to be true" (and schwa didn't talk about that in the thread above, where midi selection is also aksed)
So the few things I can answer you about your Q's in the previous posts are bellow. I only talk about my "C" point of view here, but HTH!

Inside a take's chunk (GetSetObjectState(MediaItem*)), the midi event list looks like:
Code:
e 4781 90 0e 01
e 240 80 0e 00
E 269 90 10 7f
E 240 80 10 00
E 240 b0 7b 00
here 5 events: 2* note on/off on channel 1 and the famous "all notes off" (cc123 on channel 1) that ends midi takes.
- 1st token: dunno yet if it can be different from "e/E". however, lower/upper case distinguish selected events (one of yours Qs)
- 2nd token: *offset* with the previous event or with the begining of the take for the 1st event. it's not really a timing (dunno the english wording..), in short the unit is 1/2560T, e.g. 240 = 1/16. note: working with offset can be nice (copy/paste,..)
- 3 following "bytes" = classical hexa midi coding (one of your Qs, if we're talking about the same "raw data")

beware! in the middle of this gentle midi event list you can face a wicked base64 sysex!
Code:
<X 286306 0
8AECAwQF9w==
>
note: does not work with external midi source file. any tips to complete/correct these info would be appreciated..
Jeffos is offline   Reply With Quote