Here is my code to create a Midi Event Packet. It creates a note on/off event with velocity and note number on channel 1.
How can I set a channel number?
var midiEventPacket = MIDIEventPacket ()
midiEventPacket.timeStamp = 0
midiEventPacket.wordCount = 1
midiEventPacket.words.0 = isNoteOff ? 0x20900000 : 0x20800000
midiEventPacket.words.0 = midiEventPacket.words.0 | ((note) << 8) // Note = 60
midiEventPacket.words.0 = midiEventPacket.words.0 | UInt32(velocity) // Velocity = 127