• 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: Creating a MIDI Clock via Core Audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a MIDI Clock via Core Audio


  • Subject: Re: Creating a MIDI Clock via Core Audio
  • From: Tamas Nagy <email@hidden>
  • Date: Thu, 29 Aug 2013 15:10:07 +0200

Any idea on this guys? Seems nobody using a CAClock as a MIDI Clock?

Thanks,

Tamas

On Aug 27, 2013, at 7:08 PM, Tamas Nagy <email@hidden> wrote:

Hi list,

I'm trying to create an internal MIDI clock in my app, but wanted to the clock could be seen in other apps by sending the clock messages to midi out nodes.

I achieved the internal clock working, but using kCAClockProperty_MIDIClockDestinations to output the clock message is not working. Probably I missed something, but the "documentation" of Core Audio does not provide me any useful information.

Here is the code I'm using:

CAClockNew(0, &theClock);

syncMode = kCAClockSyncMode_Internal;
timeBase = kCAClockTimebase_HostTime;

tempoMap.beats = 4;
tempoMap.tempoBPM = 120.0f;

CAClockSetProperty(theClock,kCAClockProperty_SyncMode,sizeof(syncMode), &syncMode);
CAClockSetProperty(theClock,kCAClockProperty_InternalTimebase,sizeof(timeBase), &timeBase);
CAClockSetProperty(theClock,kCAClockProperty_TempoMap,sizeof(tempoMap), &tempoMap);

    MIDIEndpointRef *sources;
    int i, j;
    
    ItemCount num_sources = MIDIGetNumberOfSources();
    sources = (MIDIEndpointRef *)malloc(sizeof(MIDIEndpointRef) * num_sources);
    j = 0;
    for (i = 0; i < num_sources; i++) {
        MIDIEndpointRef source;
        source = MIDIGetSource(i);
        sources[j++] = source;
    }
    
    CFArrayRef sourcesArray = CFArrayCreate(NULL, (void *)sources, j, NULL);
    
CAClockSetProperty(theClock,kCAClockProperty_MIDIClockDestinations,sizeof(sourcesArray), &sourcesArray);
    
    
CAClockStart(theClock);


thanks for any advice. 

Tamas

 _______________________________________________
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: 
 >Creating a MIDI Clock via Core Audio (From: Tamas Nagy <email@hidden>)

  • Prev by Date: Re: Coreaudio-api Digest, Vol 10, Issue 230
  • Next by Date: Userland driver: Not enough headroom at first in IO operation.
  • Previous by thread: Creating a MIDI Clock via Core Audio
  • Next by thread: EXS24 parameters available in AUSampler on iOS?
  • Index(es):
    • Date
    • Thread