Sending MIDI from Logic to MAX

Isosceles_CAT's icon

Hello, I recently built a neat little FM synth, and I was hoping to control it from my sequencer (Logic). I assumed that this would be a simple matter of configuring the IAC bus, but the results were... less than satisfactory. A quick search here revealed that the IAC bus has disappointed others as well.

Just looking for some recommendations as to what the best way to do this might be.

Thanks kindly,
Joshua

Isosceles_CAT's icon

Anyone? Anyone? Bueller?

Exit Only's icon

hi. i am a logic/max user and have run into problems with the IAC buss as well.

I think your best bet is to use rewire and send midi data via the rewire object. Rewire has its problems as well, though Logic 8 claims to have better rewire implementation (I dont have a copy yet).

I've found that rewire with max/logic only seems to work if I do things in a particular order-

Open Logic, open/create the song I want. Make sure the song is fully loaded.

Open max. set the audio driver to ad_rewire. Turn audio on.

If I dont do everything in exactly that order, Max will freeze and I can't even close it with a force quit, i have to reboot. Its a big pain, but this seems to work. Once you have that up and going....

If you havent, create a rewire object in logic's environment and put it in your arrange page. In the parameters for the rewire object should say MaxMSP under the 'device'.

If you create a notein object in max and double click on it, you should see a rewire option in the pop up menu.

Any notes you create with the rewire object should be sent to max with good timing.

When you close everything, be sure to quit Max first, then logic.

Another solution is to create a pluggo plugin and run it in logic. I prefer rewire (even if it is a hassle) because i can edit more seamlessly while I'm working.

Exit Only's icon

I almost forgot...

For the audio returns, select an audio object in logic, under it's channel parameter select Rewire Stereo -> MaxMSP -> Rewire 1&2

Now dac~ 1 2 will send audio to that audio object in logic.

Adam Murray's icon

I got Logic 8 recently. So far I have just been using Max to send MIDI to Logic, which is trivial (just select "from Max/MSP 1/2" as the midi out). I was wondering how to go the other way so I will have to give this a shot. Thanks for the info, Nick.

If there are any problems with this approach, another option may be to create a VST plugin with Max, and once you have the MIDI data inside there you can do anything you want like sending it over UDP (OSC-style communication). Maybe overkill?

-Adam

Adam Murray's icon

Oh and obviously if you are going to create a VST plugin, that pretty much solves the problem anyway. I was just thinking that sending the data to Max is much more useful if you are in the middle of developing a synth in Max.

Exit Only's icon

the thing about 'from MaxMSP as midi out' is that it is actually just the IAC bus creating a specific port for MaxMSP.

I've encountered all kinds of timing problems trying to send midi data over the IAC bus, which are not the due to anything within max.

As an example, I would create a rewire-synced note generator that would pump out a midi note at 64th note intervals. If I recorded the midi output over the MaxMSP midi port (i.e. the IAC bus) into logic, the timing would be way off and not in any way consistent. Some notes would be early, others late, some would not show up at all.

However, if I used the same generator to create a simple sine 'blip' at 64th note intervals and then recorded the audio ouput into logic..the timing would be perfect. A small amount of latency but all I had to do was shift the first blip into place and the rest would follow.

Ive resorted to using vst~ to load my instruments in max if I want to send any midi data from max to commercial vst apps. Its all a bit aggravating.

Exit Only's icon

Oh, and if you DO just want to use the IAC bus, its a lot simpler to just create a new instrument object in logic and set its port to
"to MaxMSP 1" rather than using rewire. But dont say I didnt warn you about the timing!

Adam Murray's icon

Interesting. I have not had many issues with timing using this approach. I am also doing metro-based event sequencing and I have not had many issues with timing that so many other people complain about (note that I only ever use a single master metro; I never run multiple metros in parallel). If I am generating a large amount of MIDI data simultaneously then I sometimes get a hiccup (I'm pretty sure it's on the Max side), but it has been easy enough to clean things up in Logic after a recording.

Perhaps it is because I have a Core 2 Duo Powerbook with enough horsepower, and/or perhaps it is because Logic 8 has improved their product? I think I remember reading that Apple really improved some MIDI timing stuff in this version, but I have no idea if that applies to the IAC.

But... I don't know if I've tried running a lot of 64th note generators at once, so maybe I just haven't pushed things hard enough? If I remember this the next time I get a chance, I can try it out. Feel free to send me any patches to try to recreate problems you've had and we can try to determine if Logic 8 has improved the situation.

-Adam

Exit Only's icon

I would love to hear that this is a fault of logic 7 and not the IAC because I doubt the OS developers are going to care too much about my problem!

Max Patch
Copy patch and select New From Clipboard in Max.

simple test patch -

Exit Only's icon

oh and btw Im running OSX 10.4.10 on a 1.83ghz intel core duo macbook pro. no shortage of horsepower here :)

Adam Murray's icon

Quote: Nick Inhofe wrote on Wed, 10 October 2007 12:49
----------------------------------------------------
> I would love to hear that this is a fault of logic 7 and not the IAC because I doubt the OS developers are going to care too much about my problem!
>

Sorry! This is still busted pretty bad in Logic 8.

The reason I have not been having problems with MIDI timing is I am doing all my timing inside of Max. I am not trying to do a hostsync~. I am operating purely in the event domain and relying on metro. Of course this means my recording will not be in sync with Logic's metronome, but I am not doing overdub recording so I can just align it when I am done recording.

Using the simple patch below I was able to record steady 64th notes in Logic. I zoomed in on the piano roll editor and it lines up perfectly for the entire recording of many measures.

Now I would also like to know a workaround to the problem of host-syncing Max to Logic and sending MIDI back into Logic with good timing. I am still wondering if building the patch as a plug-in will help...

Max Patch
Copy patch and select New From Clipboard in Max.


Isosceles_CAT's icon

Thank you! That is *exactly* what I was looking for. It worked perfectly. :)

Joshua

Quote: Nick Inhofe wrote on Wed, 10 October 2007 10:57
----------------------------------------------------
> I think your best bet is to use rewire and send midi data via the rewire object. Rewire has its problems as well, though Logic 8 claims to have better rewire implementation (I dont have a copy yet).

Isosceles_CAT's icon

I like the idea of creating my own plugins, but I would need pluggo to do this though, right?

Quote: adamj wrote on Wed, 10 October 2007 14:27
----------------------------------------------------
> Oh and obviously if you are going to create a VST plugin, that pretty much solves the problem anyway. I was just thinking that sending the data to Max is much more useful if you are in the middle of developing a synth in Max.
----------------------------------------------------

Exit Only's icon

All you need to create pluggo plugins is pluggo runtime. It is free and available in the download section. It doesn't come with any plugins, but is only the 'shell' for you to create your own.

Be sure and read the pluggo development materials, which are listed under documentation.

Exit Only's icon

This is very interesting adam! I tried your patch (i had the rewire driver selected, but audio was off) and the timing was right on once I moved the first recorded note into place. I tried another recording of the midi output with the rewire driver on, and the timing became jittery again!

Its not the IAC bus that has been giving me problems. And max is putting out good timing because I have had good response with recording audio output from max into logic using rewire sync.

So logic is the culprit then and only when it is trying to do rewire-sync. i cant tell if this is more, or less frustrating. at least i cant blame it on max!

Adam Murray's icon

Quote: Nick Inhofe wrote on Thu, 11 October 2007 08:07
----------------------------------------------------
> I tried your patch (i had the rewire driver selected, but audio was off) and the timing was right on once I moved the first recorded note into place. I tried another recording of the midi output with the rewire driver on, and the timing became jittery again!

Really? I tried adding a hostphasor~ into my patch (connected to a scope~ so I could make sure it is doing its thing), selected rewire as the driver, enabled the dac~, and the timing is still dead-on.

I thought maybe the rewire driver was somehow interfering with the virtual "from Max/MSP" MIDI port (aka the IAC), but that does not seem to be the case on my machine.

>
> So logic is the culprit then and only when it is trying to do rewire-sync.

I thought so too but now I'm not convinced. I still think it could be a timing issue inside Max or a problem with Max's rewire driver. Logic may certainly be part of the problem, though.

Have you ever tried your patch with another rewire host? Can anyone confirm whether it works correctly with something besides Logic, like Cubase or Live? Or for that matter, has anyone used Logic as a rewire host for Live or Reason and had issues syncing to Logic?

-Adam

Exit Only's icon

well, i have Pro Tools and I'll try to get that set up in the next day or so.

o s's icon

Quote: Nick Inhofe wrote on Wed, 10 October 2007 16:57
----------------------------------------------------
> hi. i am a logic/max user and have run into problems with the IAC buss as well.
>
> I think your best bet is to use rewire and send midi data via the rewire object. Rewire has its problems as well, though Logic 8 claims to have better rewire implementation (I dont have a copy yet).
>
> I've found that rewire with max/logic only seems to work if I do things in a particular order-
>
> Open Logic, open/create the song I want. Make sure the song is fully loaded.
>
> Open max. set the audio driver to ad_rewire. Turn audio on.
>
> If I dont do everything in exactly that order, Max will freeze and I can't even close it with a force quit, i have to reboot. Its a big pain, but this seems to work. Once you have that up and going....
>
> If you havent, create a rewire object in logic's environment and put it in your arrange page. In the parameters for the rewire object should say MaxMSP under the 'device'.
>
> If you create a notein object in max and double click on it, you should see a rewire option in the pop up menu.
>
> Any notes you create with the rewire object should be sent to max with good timing.
>
>
> When you close everything, be sure to quit Max first, then logic.
>
>
> Another solution is to create a pluggo plugin and run it in logic. I prefer rewire (even if it is a hassle) because i can edit more seamlessly while I'm working.
>
>
>
----------------------------------------------------

I've followed exactly your instructions but...

-I start logic

-I start max, setting the audio driver to rewire

max window says: ad_rewire: error starting audio. Is RewireMixer running?

greatful for any hint

ole

o s's icon

I'am running logic 7.1. and Max/Msp 4.6.3 on a G4 Alu-Powerbook, OS X 4.10

o s's icon