How to send MIDI to Logic's software instruments


I wanted to get Whole-Play to use Logic's software instruments for playback, which was not too hard to do, but since it took a bit of researching and fiddling with, I thought I'd document the process here for future reference, plus it might help someone else too.

My scenario is: I generate MIDI messages from custom software (using Chuck), and I want to send that midi to Logic (Pro 9), using different software instruments. A similar procedure might apply to other scenarios where the MIDI is generated elsewhere (i.e. some other software).

The overall idea

To achieve this, the approach I've taken is (explanations will follow):

  1. In Logic, add the software instruments I'm interested in.
  2. Create a port for each instrument in the IAC Driver.
  3. Map each port from step #2 to the appropriate instrument fom step #1 in Logic's Environment window.
  4. Set the right bus to use when sending MIDI from Chuck.

Step by step

Add software instruments

This is pretty standard. In Logic, just click the '+' button in the arrange area, select 'software instrument', and choose the desired one from the Library. For instance I have a bass and a clarinet, both using the EXS24.

Create ports in the IAC Driver

This is a OSX thing. Basically you create virtual MIDI ports that your software can use to communicate. In my case I've created two ports, one for each instrument. Here's a step by step guide:

  1. Open "Audio MIDI Setup" (type that in Spotlight for easy access).
  2. You'll probably get the audio window. Open the midi window (in the Window menu, or pressing Cmd + 2).
  3. Double click on the IAC Driver icon.
  4. Make sure the "Device is online" option is checked.
  5. Open the "More information" panel if it's not already open. Here's where you add the ports.
  6. Click the '+' button to add a port. By default it'll be named something like "IAC Bus 1", but you can change the name to something more memorable (like 'bus_bass' and 'bus_clarinet').

Done! Now you have a number of MIDI buses that you can use in your applications to send midi to and fro.

Map ports to instruments

Back to Logic. Open the Environment window (in the Window menu, or pressing Cmd + 8). Here you'll be able to patch each of the buses you've created in the IAC Driver. Just click and drag from the bus to the appropriate instrument. Now whenever you send MIDI data through each bus, the right instrument will be used. Nice!

In the MIDI source, use the appropriate bus for each instrument

This is Chuck-specific information. If you're trying to send MIDI from some other source (programming language, software) you'll have to figure out how to select the right bus. In Chuck I'm using Burce Murphy's MIDIsender class. The code is quite simple:

MIDIsender mSend;"bus_bass"); // use the name you've used when creating the bus in the IAC Driver

Done! Now you can start sending MIDI with the MIDIsender object, and it will be sent to Logic, which will route it to the clarinet software instrument.

One more twist: using channels

I had one more requirement. I wanted to use two different software instruments in Logic for a single instrument in my Chuck program. In this case I wanted to use a normal clarinet by default, but a stacatto clarinet for notes with stacatto. I could have created separate buses in the IAC Driver, and then created two MIDIsender objects in my program, but that seemed a bit unnecessary. It would be much better to have a single bus, and be able to send MIDI to two separate channels, one for normal playing, the other for stacatto notes.

This is not difficult, but it requires a bit more work in Logic:

  1. Open the Environment window.
  2. Add a channel splitter: in the Environment window's menu, choose "New > Channel Splitter".
  3. Connect the bus from the IAC Driver to the channel splitter.
  4. Connect each channel from the splitter to the appropriate instrument (in my case, 1 to "clarinet" and 2 to "clarinet stacatto").

Sorted. Now from Chuck I can send notes to either channel:

mSend.noteon(midiPitch, midiVol, channel);

1 comment

Add a comment

[ change image ]

PS: no links allowed in comment.

All comments


I do have an unresolved issue though. I want to record all the incoming MIDI, and can't figure out how to set that up. There's some info that might be relevant here:

But no joy yet.

End of page. Back to page navigation.