johndavid (4) [Avatar] Offline

Can you explain me in detail all the process of receiving and recording Events? Are they 2 different processes? The events are received form the Interface and then are put into the Input Queue, when the startmidiin() is called, then retrieved by getmidiin() function, in response to a MIDI_DATA message, and then put into the track object? Or are they directly put into the track object when the startmidiin() is called? Does the MIDI_DATA message still have a part in this last one? What about the processmididata () function? What is its role in all the process?

By the way, which object timestamps events? The sync object or the input MIDI object? Because in the book it says first that it is the MIDI input object (page 171) and then it says that it is the Sync Object (Page 17smilie.

Thank you very, very much for your help. Sorry about my English,

KUMA (56) [Avatar] Offline
Re: Recording process? Which object timestamps events?
Though I don't wholly understand the detail, it seems something like this:
(When started, MaxSeq opens the default input device, connects it with the MidiIn object, and attaches to the latter a track object.) When a MidiEvent is received at the input device, MidiInCallback() (concerning which cf.p.316f) is called. This function calls GetEventTimeInTicks() (cf.p.316) to calculate the delta time, and then adds a timestamp to the event, puts it into the input queue (included in the MidiIn object), and posts a MIDI_DATA message to the client window. When the message is received, OnMidiData() (cf.p.367) is called which in turn calls ProcessMidiData() (cf.p.430f) which echos the event, if enabled, and then, the event is put into the track, if MaxSeq is in the state of recording.