Author |
Message |
Acoustic Interloper
Joined: Jul 07, 2007 Posts: 2067 Location: Berks County, PA
Audio files: 89
|
Posted: Thu Sep 13, 2007 12:10 pm Post subject:
How to create a virtual MIDI cable? Subject description: Sending MIDI from process A to process B. |
|
|
Just started programming OSX recently, and this task looks fairly straightforward, but I thought I'd run it past the experts.
I just want to create a process that looks like a MIDI cable inside the Mac, so that one application can write MIDI to it and another can read it. It seems that if I do MIDISourceCreate and MIDIDestinationCreate and essentially "pipe" data arriving at Destination -> Source, that this should do it?
Will this virtual MIDI channel appear like a first class device, for example with respect to MIDIGetNumberOfSources() and MIDIGetNumberOfDestinations() and related queries? I would think so.
Maybe there is already a utility that does so? I'd prefer to reuse that, instead of doing more coding, if it's available.
Thanks. _________________ When the stream is deep
my wild little dog frolics,
when shallow, she drinks. |
|
Back to top
|
|
|
EdisonRex
Site Admin
Joined: Mar 07, 2007 Posts: 4579 Location: London, UK
Audio files: 172
|
Posted: Thu Sep 13, 2007 3:14 pm Post subject:
|
|
|
this is what I have Max/MSP for. It may be overkill some of the time, but it keeps me in practice.
most sequencers implement this function as part of their existence.
I suppose you could write this yourself, but for midi it's kind of trivial, and yes, you are on the right track procedurally. _________________ Garret: It's so retro.
EGM: What does retro mean to you?
Parker: Like, old and outdated.
Home,My Studio,and another view |
|
Back to top
|
|
|
elektro80
Site Admin
Joined: Mar 25, 2003 Posts: 21959 Location: Norway
Audio files: 14
|
Posted: Thu Sep 13, 2007 3:57 pm Post subject:
|
|
|
There are supposed to be some code examples for this in the various SDK bundles. _________________ A Charity Pantomime in aid of Paranoid Schizophrenics descended into chaos yesterday when someone shouted, "He's behind you!"
MySpace
SoundCloud
Flickr |
|
Back to top
|
|
|
Acoustic Interloper
Joined: Jul 07, 2007 Posts: 2067 Location: Berks County, PA
Audio files: 89
|
Posted: Thu Sep 13, 2007 6:31 pm Post subject:
|
|
|
Applications -> Utilities -> Audio MIDI Setup -> IAC Driver -> x Device is on line
appears to be the mantra. I figured of CoreMIDI made it relatively easy, they should have included an app that uses it. There is also a Network MIDI driver that I guess talks only to other Macs. Don't see a protocol for it.
I had been using an early copy of LoopBE http://www.nerds.de/ on XP. Looks like those guys now have a network MIDI protocol that'll work cross XP/OSX platform, probably have to buy two copies.
Translating my XP MIDI system calls to CoreMIDI has been straightforward enough. My biggest remaining gripe is that the documentation for CoreMIDI beyond the intro doc is nothing more than the header files in HTML, with terse and at times misleading comments. Surprisinly, Windows XP docs on MSDN were much better commented when I did this for XP 2 years ago. Where OSX overlaps with other UNIX (e.g., pthreads), there is a wealth of docs, but for where Apple is doing its custom value-add, the documentation so far is on the slim side. Some web searches outside Apple have helped a lot.
Thanks. _________________ When the stream is deep
my wild little dog frolics,
when shallow, she drinks. |
|
Back to top
|
|
|
EdisonRex
Site Admin
Joined: Mar 07, 2007 Posts: 4579 Location: London, UK
Audio files: 172
|
Posted: Fri Sep 14, 2007 3:35 am Post subject:
|
|
|
Acoustic Interloper wrote: | Applications -> Utilities -> Audio MIDI Setup -> IAC Driver -> x Device is on line
appears to be the mantra. I figured of CoreMIDI made it relatively easy, they should have included an app that uses it. There is also a Network MIDI driver that I guess talks only to other Macs. Don't see a protocol for it.
I had been using an early copy of LoopBE http://www.nerds.de/ on XP. Looks like those guys now have a network MIDI protocol that'll work cross XP/OSX platform, probably have to buy two copies.
Translating my XP MIDI system calls to CoreMIDI has been straightforward enough. My biggest remaining gripe is that the documentation for CoreMIDI beyond the intro doc is nothing more than the header files in HTML, with terse and at times misleading comments. Surprisinly, Windows XP docs on MSDN were much better commented when I did this for XP 2 years ago. Where OSX overlaps with other UNIX (e.g., pthreads), there is a wealth of docs, but for where Apple is doing its custom value-add, the documentation so far is on the slim side. Some web searches outside Apple have helped a lot.
Thanks. |
Oh, right, IAC. Totally forgot that, thanks for reminding me.
CoreMIDI and CoreAudio are amazingly undocumented for mere users. I did find out how to add custom MIDI devices (hint: Cherrypicker) but even that has mystic bits in it. _________________ Garret: It's so retro.
EGM: What does retro mean to you?
Parker: Like, old and outdated.
Home,My Studio,and another view |
|
Back to top
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Mon Sep 17, 2007 4:58 am Post subject:
|
|
|
I think the XCode docs in general are pretty bad. The ones that aren't empty contain a lot of sales pitch that obscures the info that you're interested in. Java's free docs at java.sun.com are miles ahead. I really wanted to try out XCode when I first got my mac, but after a couple of frustrating searches through the docs after specific information, I gave up, installed Eclipse and returned to the wonderful world of Java.
/Stefan _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
|
Acoustic Interloper
Joined: Jul 07, 2007 Posts: 2067 Location: Berks County, PA
Audio files: 89
|
Posted: Mon Sep 17, 2007 7:01 am Post subject:
|
|
|
Antimon wrote: | I really wanted to try out XCode when I first got my mac, but after a couple of frustrating searches through the docs after specific information, I gave up, installed Eclipse and returned to the wonderful world of Java.
/Stefan |
It looks to me like the XCode framework is Microsoft all over again, but without decent documentation. One can argue the 'custom framework' philosophy either way. On one hand a custom framework can provide new capabilities, making it a good thing, but on the other hand it makes for non-portable code and locks one in. What I really dislike about it, having programmed on UNIX for over 25 years, is that none of the OSX framework stuff I have used so far -- Core MIDI, little bits of Core Audio, and some Core Services stuff -- looks the least bit like UNIX system calls and libraries. It looks like a windowing event framework shoved down the throat of the O.S., which is an accurate description of Windows.
I try to write portable code, and nevertheless I am spending many hours porting what were supposed to be two 'little, circumscribed' modules that do generic OS stuff (threads, dynamic libraries, etc.) and low level MIDI IO respectively. Happily, at least the pthreads part of the port will also work on Linux.
So, Apple seem to be raking cues from MS, not only on look & feel, but also on system structure. Too bad. _________________ When the stream is deep
my wild little dog frolics,
when shallow, she drinks. |
|
Back to top
|
|
|
brinxmat
Joined: Oct 24, 2005 Posts: 262 Location: Norway
|
|
Back to top
|
|
|
|