Cocoa, MIDI, how to?
April 9, 2008 10:22 PM   Subscribe

How do I play MIDI notes from a Cocoa application, simply?

Okay, fully nerdcore. I have a Cocoa application which needs to play a series of MIDI notes using the 'guitar' general MIDI sound. I know the MIDI notenumbers and can handle the timing. How do I do it?

My application has a window in which I could embed a hidden Quicktime player. I could probably ask this to play a MIDI sequence, but I still need classes to construct the sequence etc.

Context: the application is a guitar chord/scale finder. I would like to be able to play the currently selected notes in sequence as a chord or scale. That's all.

A bonus would be to be able to detect incoming MIDI and use this to map the incoming MIDI notes to a virtual guitar fretboard.
posted by unSane to Computers & Internet (4 answers total) 1 user marked this as a favorite
 
You want to make use of the Core Audio framework.
posted by Blazecock Pileon at 10:25 PM on April 9, 2008


Here is sample code.
posted by Blazecock Pileon at 10:26 PM on April 9, 2008


Best answer: You could also use the QuickTime framework to play MIDI notes.
posted by Blazecock Pileon at 11:10 PM on April 9, 2008


Response by poster: Brilliant, Pileon, that third link is just what I needed. I was looking in the Cocoa documentation which is why I missed it.
posted by unSane at 5:22 AM on April 10, 2008


« Older Ordering MySQL queries by comma-separated strings?   |   "I Me Me I" performance art on the Gong Show Newer »
This thread is closed to new comments.