MIDIPacketListAdd and MIDITimeStamp
MIDIPacketListAdd and MIDITimeStamp
- Subject: MIDIPacketListAdd and MIDITimeStamp
- From: Andrew Duncan <email@hidden>
- Date: Sun, 18 Aug 2002 23:30:42 +1200
Hi folks,
I'm building a simple Cocoa app in PB to send MIDI data to a soft synth
(currently testing with SimpleSynth and MIDI Monitor). I'm running 10.1.5.
My test app sends 10 NoteOn events as follows:
---
// ... declarations omitted
Byte noteOn[] = { 0x90, 60, 64 };
MIDITimeStamp when = 0;
for (i = 0; i < 10; ++i) {
noteOn[1] += 1;
when += 1000; // What's appropriate here?
newPacket = (MIDIPacket *) MIDIPacketListAdd(newPacketList, sizeof(buffer),
newPacket, when, 3, noteOn);
}
// code to send packets omitted
---
To my great surprise, this actually causes noises to emit from the speaker
(yay!), but the notes all sound at the same time (boo!). In other words, I
get a 10-note chord. :o)
I'd like to queue the notes so they play further apart. Every half-second
or more would be fine. If I can get that working, I should be golden.
Assuming that MIDISend doesn't just ignore my timestamps, what are
appropriate values? Or perhaps I need to set the timestamp to zero and
schedule things myself, perhaps with an NSTimer or something?
Many thanks, any clues would be much appreciated,
--
Andrew Duncan
----------------------------------------------------------------------
voice: +64 9 623 2926
mobile: 021 297 3174
web:
http://web.webwerks.co.nz/
----------------------------------------------------------------------
Programmers do it while (1)
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.