A collection of noisy, fun, cool, geeky, techy, wired or just plain wierd stuff for your consideration!

Multichannel MIDI using Supercollider and Logic Pro 9

Today i learnt how to send different MIDI outputs, to separate channels within Logic. Now the real fun can begin!!!! Using this technique, along with Supercolliders Pdef (Pattern define) instruction it seems possible to start making some tracks to play and edit live. Instead of simply sending MIDI, through Logic, to one software instrument , i can start mixing up the instruments. Setting one pattern to play on bass, one pattern to play a drum track and one pattern to play a synth line is now a possibility. Still lots of experimenting to do before i get this mastered but i’m on the way.

For anyone who wants to know i’ll (try to) explain how to do this.
1) Load Logic and create two channels for software instruments. (one for piano, one for guitar for example)
2) Select the first channel. Now in the inspector window you should see (about half way down) a triangle next to the name of the instrument you have chosen, click it. This will reveal some variables for this channel. Set the MIDI channel (default: all) to 1.
3) Repeat this for the second channel, setting the MIDI channel to 2.
4) Now right-click on the record button (on the transport bar) and select ‘recording settings’. Make sure the ‘Auto demix by channel if multitrack recording’ box is ticked.
5) Load Supercollider and initialize the MIDI client and setup a MIDI out, by evaluating the following lines of code.
6) Ensure that the ‘r’ record button is pressed on all channels or the information is only sent to the ones that do have it selected (it turns red when when selected)

MIDIClient.init(0, 1);

m = MIDIOut (0, MIDIClient.destinations[0].uid);

6) Now when writing you MIDI code you need to instruct Supercollider which channel to play to. Here’s some code i wrote earlier to demonstrate.

Pbind ( \type, \midi, \midiout, m, \chan,0,
\scale, [ 10, 11, 13, 15, 16, 18, 20, 22],
\degree, Prand([ 1,2,3,4,5,6,7,8,], inf),
\dur, Pseq([1, 1/2, 1, 1/4, 1/4, ], inf),
\db, -4
Pbind ( \type, \midi, \midiout, m, \chan,1,
\scale, [ 0, 1, 3, 5, 6, 8, 10, 12],
\degree, Pseq([1,3,5,7,1,5,3,7, ], inf),
\dur, Pseq([1/4, 1/8, ], inf),
\db, -5
], inf
The first Pbind is set (using the ‘\chan’ command) to play from the Logic channel that is set to MIDI Channel 1, and the second Pbind will play through the Logic channel set to MIDI Channel 2. (Supercollider starts counting at 0. So Logic Midi channel 1 = Supercollider Midi channel 0, Logic MIDI channel 2 = Supercollider Midi channel 1 etc) The Ppar lets us combine Pbinds, and play them simultaneously.

Hopefully that made sense. If not come and find me at Uni and i’ll try and explain it a bit better.


3 responses

  1. Jim, I have now read all your posts up to now, brilliant, this is exactly the kind of reporting I am looking for ! Well done !

    October 13, 2009 at 19:40

  2. hey jimmy i think this is where i can leave a comment on ur blog no worries if not…

    have been messing around in supercollider and have copied ur code to sent to differnet midi channels.. and is sorting of working,,,however my logic 9 is being annoying and is sending to different midi channels however it only works when on a selected instrument on the arrange page… so its like its sending to differnet channels but only to the instrument selected :/..i would i send to differnet channels but incorparate other code for differnet instruments on the page?? i have msn if it would be easier to talk on there 🙂 marshallampsrule@hotmail.com

    hope your well


    October 23, 2009 at 00:10

    • you need to make sure the ‘r’ record button on every channel is clicked or the information only goes to the channels set to record.

      October 23, 2009 at 02:13

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s