Re: Using MIDISend/MIDISendSysex for Line 6 USB Device
Re: Using MIDISend/MIDISendSysex for Line 6 USB Device
- Subject: Re: Using MIDISend/MIDISendSysex for Line 6 USB Device
- From: Kurt Revis <email@hidden>
- Date: Thu, 18 Oct 2007 10:50:14 -0700
On Oct 18, 2007, at 9:29 AM, Boyd Timothy wrote:
So, I fired up XCode and started hacking away (not ever having done
MIDI programming before). Line 6 has some MIDI CC reference for some
older products and I assume that many of the MIDI CC #'s are the same
for this new piece of hardware.
I certainly hope so, but don't forget that that is just an
assumption. Check with Line6, or experiment with some other device
that has a known MIDI spec.
I followed some example MIDI code to enumerate the list of MIDI
devices and my code is able to see the POD X3 Live. So, then I
figured I'd try to use MIDISend() to try turning the Noise Gate
feature on or off.
The documentation says the MIDI CC # for Noise Gate is 22. You send a
value of 0 - 63 to turn the Noise Gate off or a 64 - 127 to turn it
on. Simple enough, or at least I thought.
I tried using MIDIPacketListInit(), MIDIPacketListAdd(), and
MIDISend() to send the on/off signals for the Noise Gate, but nothing
happened on the POD.
Please show some code. It's difficult to guess what you might have
done wrong.
Here's the simplest way to do it, if you want to avoid the
complication of MIDIPacketListAdd, and just send a packet list with
one message in it:
MIDIPacketList packetList;
packetList.numPackets = 1;
MIDIPacket* firstPacket = &packetList.packet[0];
firstPacket->timeStamp = 0; // send immediately
firstPacket->length = 3;
firstPacket->data[0] = 0xB0;
firstPacket->data[1] = 0x16;
firstPacket->data[2] = 0x00;
MIDISend(port, endpoint, &packetList);
(This assumes your device is listening to MIDI channel 1... which it
probably is, if you haven't specifically changed it.)
But I didn't get any errors reported back by the MIDISend() either.
Typically you won't. It's up to you to send valid MIDI; the system
doesn't really check for you.
So then I switched over to use MIDISendSysex() thinking that might be
what I need to do. The bytes I tried to send in that function were:
0xF0 0x16 0x00 0xF7 (to turn the Noise Gate on).
No, this is completely wrong. MIDI controller messages and sysex are
different; you can't just switch from one to the other.
Anyhow, I've searched around for information about MIDI and
controlling MIDI devices using CoreMIDI.framework, but haven't
happened across the right examples/tutorials/specifications.
I'd get familiar with the basic MIDI protocol first:
http://www.borg.com/~jglatt/tech/midispec.htm
That will at least save you from confusing CC messages with sysex!
I've seen stuff about RTP MIDI, is that what I should be doing?
No, you are doing very basic MIDI, the kind that hasn't changed for
20 years.
--
Kurt Revis
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden