Re: Changing the transfer speed to a USB to MIDI interface
Re: Changing the transfer speed to a USB to MIDI interface
- Subject: Re: Changing the transfer speed to a USB to MIDI interface
- From: Anders Gärder <email@hidden>
- Date: Wed, 15 Feb 2006 00:21:01 +0100
Doug Wyatt wrote:
This program works for me...
#include <CoreFoundation/CoreFoundation.h>
#include <CoreMIDI/CoreMIDI.h>
void SetGetSpeed(MIDIEndpointRef ep, SInt32 speed)
{
MIDIObjectSetIntegerProperty(ep, kMIDIPropertyMaxSysExSpeed, speed);
SInt32 speed2 = 0;
MIDIObjectGetIntegerProperty(ep, kMIDIPropertyMaxSysExSpeed,
&speed2);
printf("%d -> %d\n", (int)speed, (int)speed2);
}
int main (int argc, const char * argv[])
{
MIDIEndpointRef ep = MIDIGetDestination(0);
CFStringRef name = NULL;
MIDIObjectGetStringProperty(ep, kMIDIPropertyDisplayName, &name);
CFShow(name);
SInt32 speed = 0;
MIDIObjectGetIntegerProperty(ep, kMIDIPropertyMaxSysExSpeed, &speed);
printf("original: %d\n", speed);
SetGetSpeed(ep, 10000);
SetGetSpeed(ep, 20000);
SetGetSpeed(ep, 30000);
return 0;
}
For you, does it work for some endpoints and not others?
Yes this program works for me, too.
But, although MIDIObjectGetIntegerProperty reports the correct
information back
the driver continues to use the value I first gave it, so if I set it to
3125bytes/s, data is sent at this
speed. If I change the speed to 31250bytes/s it still sends it at
3125bytes/s.
If I set it to 31250bytes/s first the data is sent at 31250bytes/s but
when I set it
back to 3125bytes/s it is still outputted at 31250bytes/s to the driver
which then slowly outputs the data
to the usb midi interface.
If I quit our program I get to set the speed again. I know very little
of OSX internals, maybe the driver is unloaded and reloaded then?
In the interests of simplicity I'd hope you can get the changing of
the property to work so that you can use MIDISendSysEx. I'm curious to
isolate the problem with setting the maximum speed, so if you can
investigate further I'd appreciate it.
What driver owns the endpoint? Is this your driver or are you using
the USB class driver or something else? If it's your driver, be aware
that CoreMIDI does set the property to a default value of 3125 for
newly-created endpoints.
I am using the USB class driver. The serial speed of the USB MIDI
interface is set by sending SysEx commands to it.
/Anders
_______________________________________________
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