• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need help getting started with CoreMidi
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help getting started with CoreMidi


  • Subject: Re: Need help getting started with CoreMidi
  • From: Michael Ellis <email@hidden>
  • Date: Wed, 23 Jan 2013 22:31:39 -0500



On Wed, Jan 23, 2013 at 5:30 PM, David Hicks <email@hidden> wrote:

You need to create a pair of MIDI Endpoints for your app; one is a Destination Endpoint with an appropriate Callback which would get called as the MIDI data you are playing come in to the system.


I think the Python package I mentioned in my reply to Tim is doing pretty much as you describe if I'm understanding the code correctly, I see the following in the C source file
...
 
typedef struct _SCMData {
  MIDIClientRef theMidiClient;
  MIDIEndpointRef midiSource;
  MIDIEndpointRef midiDestination;
  CFMutableDataRef receivedMidi;
} SCMData;     

....             

  MIDIClientCreate(CFSTR("simple core midi client"), NULL, NULL,
                   &(_scmData.theMidiClient));
  MIDISourceCreate(_scmData.theMidiClient, CFSTR("simple core midi source"),
                   &(_scmData.midiSource));

  _scmData.receivedMidi = CFDataCreateMutable(kCFAllocatorDefault, 0);
  MIDIDestinationCreate(_scmData.theMidiClient,
                        CFSTR("simple core midi destination"),
                        recvMidiProc,
                        NULL,
                        &(_scmData.midiDestination));            
.... 

Whether you can take the input data to the Callback and harmonize it and get it into a MusicSequence that is playing a MusicPlayer, all in a timely fashion ...

 I'm hoping that will be the case.  The algorithm shouldn't introduce more than a few msec delay, if that, so the main trick will be get each Note Event as soon as it arrives from my keyboard and promptly buffer the results. 

Thanks for explaining how it works.  I'll let you know how it turns out.

Cheers,
Mike



 _______________________________________________
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

References: 
 >Re: Need help getting started with CoreMidi (From: David Hicks <email@hidden>)

  • Prev by Date: Re: AU Properties and Ownership of CF objects
  • Next by Date: Overrinding USB Audio Properties
  • Previous by thread: Re: Need help getting started with CoreMidi
  • Next by thread: Re: Need help getting started with CoreMidi
  • Index(es):
    • Date
    • Thread