• 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: Fri, 25 Jan 2013 20:21:53 -0500

Making some progress. Finally figured out that the C file from simplecoremidi didn't have any code to explicitly connect to any midi devices.  Added code some based on examples from "Learning Core Audio: A Hands-On Guide to Audio Programming for Mac and iOS" (a well-written reference, IMO) and am now able to connect to my keyboard,  get the events, and pass the notes into Logic.  So far no perceptible lag from the trip through the Python interpreter.  Hopefully that will continue to be the case once I've got the harmonizer in the loop; right now I'm just doubling the notes an octave up to verify that I'm correctly reading and sending.

Much clean up and merging to do.  Will share more once I've got it working well.  Many, many thanks to all of you for help so far.


Cheers,
Mike


On Thu, Jan 24, 2013 at 2:40 PM, Douglas Barr <email@hidden> wrote:
Yep the transformer object is closer to what you're looking for, but looking at the example score it wouldn't be quite as straightforward as I thought it might be from the initial description. The chord memorizer might be appropriate, but I've always found it took too much time to set up to be worth it.


On 24 January 2013 17:10, Michael Ellis <email@hidden> wrote:
Those are very useful and well-produced videos, thanks!  I understood the general concept of the Environment before watching, but watching your friend go through the specifics was really helpful.  The arpeggiator won't quite do what I'm after (see attached score snippet), but it sits exactly where I need to be in the signal chain.  

I've verified that I can launch the little example from simplecoremidi and see the "simple core midi" device represented in the physical inputs list and route it directly to the sequencer input.  Next steps is figuring how to grab the output from my midi keyboard and route it through the "simple core midi" device.  Once that's working it should be easy to send it through my harmonizer.

Cheers,
Mike


On Thu, Jan 24, 2013 at 3:48 AM, Douglas Barr <email@hidden> wrote:
Just to present an alternative approach to using CoreMIDI (and possibly an over engineered solution), what you are trying to do can be achieved pretty easily within the environment page of Logic itself. It's worth learning how to use the environment as it opens up a surprising amount of options without needing to rely on third party software. Unfortunately Apple don't really provide any particularly good documentation on it.

A friend has put together a couple of screencasts (for the audiotuts site, so the genre of music he uses as an example might not be your sort of thing) about how to set up arpeggiators in the environment. While not exactly what you're looking for they should give you enough of an intro to the environment to work out a solution to your question. Anything you set up in the environment can easily be imported to other sessions.

http://vimeo.com/36211137
http://vimeo.com/36367261

Doug



On 24 January 2013 03:31, Michael Ellis <email@hidden> wrote:


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





 _______________________________________________
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>)
 >Re: Need help getting started with CoreMidi (From: Michael Ellis <email@hidden>)

  • Prev by Date: Re: Recording and streaming in a HAL plugin/driver
  • Next by Date: kAudioUnitSubType_MultiChannelMixer seems to apply fade-in: Possibly to prevent?
  • Previous by thread: Re: Need help getting started with CoreMidi
  • Next by thread: Overrinding USB Audio Properties
  • Index(es):
    • Date
    • Thread