MIDI Source help
MIDI Source help
- Subject: MIDI Source help
- From: Morgan Harris <email@hidden>
- Date: Sun, 4 Nov 2007 21:16:47 +1100
Hi everyone
First of all I want to thank everyone for helping me out with the MIDI
stuff last time, especially Kurt Revis. Your advice got me pretty far
with working with MIDI, but I'm having a tough time creating MIDI
packets (I'm totally fine with packets I've received from another
source, like my keyboard, but when I try to make a new packet and send
it somewhere, nothing happens.)
I've tried both sending it over the IAC Bus, and by creating my own
MIDI source. The eventual plan is to use my own source anyway so I'll
give you my code for that:
/* AppController.m */
#import "AppController.h"
@implementation AppController
MIDIEndpointRef Src;
MIDIPortRef Outport;
- (IBAction)startButtonPress:(id)sender
{
MIDIClientRef client = NULL;
MIDIClientCreate(CFSTR("Controller"),NULL,NULL,&client);
MIDIOutputPortCreate(client, CFSTR("Output Port"), &Outport);
MIDISourceCreate(client, CFSTR("ControllerSource"), &Src);
}
- (IBAction)testButtonPress:(id)sender;
{
MIDIPacketList pktlist;
MIDIPacket* packet;
packet = MIDIPacketListInit(&pktlist);
Byte data[3] = {0x90, 40, 64};
MIDIPacketListAdd(&pktlist, sizeof(packet), packet, 0, 3, data);
MIDIReceived(Src, &pktlist);
}
@end
Needless to say I've got a nib set up with buttons sending both of
those actions, and that's all working fine. Can anyone tell me what's
going wrong?
_______________________________________________
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