asiohead
11-19-2009, 10:36 PM
I’m working on a step sequencer, and I need to create some midi events. But I can’t exactly figure out how. (The notes come from an array, NotesArray.)
I initialise a IMidiMsg once like this
IMidiMsg* seqMsg = new IMidiMsg(0,128,0,100);
Then I generated a message like this in a method that gets called in ProcessDoubleReplacing
seqMsg->MakeNoteOnMsg(NotesArray[x],100,0);
mMidiQueue.push_back(*seqMsg);
seqMsg->MakeNoteOffMsg(NotesArray[x],0);
mMidiQueue.push_back(*seqMsg);
SendMidiMsg(seqMsg);
But this doesn’t work at all because I have no control over how fast the queue is being read. The note events are being fired so close, nothin really happens.
Also, why do you have to give an offset in the MakeNote … methods, and what does this Offset mean exactly ?
Could someone explain how to construct and work with midi messages, where to send/handle them (ProcessMidiMsg or ProcessDoubleReplacing)
How do I sync the sending of messages to the tempo, because now they just fire at sample rate. I have no control over it.
And how do I set the other parameters on the seqMsg object , like decay, note length, AttackTime, etc …
Thanx
I initialise a IMidiMsg once like this
IMidiMsg* seqMsg = new IMidiMsg(0,128,0,100);
Then I generated a message like this in a method that gets called in ProcessDoubleReplacing
seqMsg->MakeNoteOnMsg(NotesArray[x],100,0);
mMidiQueue.push_back(*seqMsg);
seqMsg->MakeNoteOffMsg(NotesArray[x],0);
mMidiQueue.push_back(*seqMsg);
SendMidiMsg(seqMsg);
But this doesn’t work at all because I have no control over how fast the queue is being read. The note events are being fired so close, nothin really happens.
Also, why do you have to give an offset in the MakeNote … methods, and what does this Offset mean exactly ?
Could someone explain how to construct and work with midi messages, where to send/handle them (ProcessMidiMsg or ProcessDoubleReplacing)
How do I sync the sending of messages to the tempo, because now they just fire at sample rate. I have no control over it.
And how do I set the other parameters on the seqMsg object , like decay, note length, AttackTime, etc …
Thanx