Forums > MaxMSP

Sending MIDI from Logic to MAX

October 9, 2007 | 5:06 pm

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


October 10, 2007 | 2:12 pm

Anyone? Anyone? Bueller?


October 10, 2007 | 2:57 pm

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.


October 10, 2007 | 3:27 pm

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.


October 10, 2007 | 6:24 pm

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


October 10, 2007 | 6:27 pm

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.


October 10, 2007 | 6:56 pm

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.


October 10, 2007 | 6:59 pm

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!


October 10, 2007 | 7:14 pm

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


October 10, 2007 | 7:49 pm

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!

simple test patch –
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 473 576 263 196617 rewire it into logic then bounce/record the audio output.;
#P newex 601 161 50 196617 r trigger;
#P newex 126 304 50 196617 r trigger;
#P newex 73 200 50 196617 s trigger;
#P toggle 582 162 15 0;
#P objectname blipOn;
#P toggle 89 294 15 0;
#P objectname midiOn;
#P newex 89 332 47 196617 gate 1 1;
#P newex 582 191 29 196617 gate;
#P user ezdac~ 565 516 609 549 0;
#P user gain~ 565 355 24 100 158 0 1.071519 7.94321 10.;
#P flonum 603 216 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname blipDur;
#P newex 582 242 31 196617 float;
#P newex 582 294 32 196617 line~;
#P newex 481 269 67 196617 cycle~ 1000;
#P newex 565 320 27 196617 *~;
#P message 582 269 91 196617 1. 10. 1. $1 0. 10;
#P newex 73 122 46 196617 change~;
#P flonum 216 96 80 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 330 443 53 196617 autopattr;
#X prestore blipDur 1 0 5.;
#X prestore blipOn 1 0 0;
#X prestore duration 1 0 25;
#X prestore midiOn 1 0 1;
#X prestore rate 1 0 64;
#P objectname u958000005;
#P newex 89 443 211 196617 noteout;
#P comment 230 371 196 196617 duration of note (may need to be adjusted);
#P number 189 371 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname duration;
#P message 89 369 43 196617 60 127;
#P newex 89 397 110 196617 makenote;
#P newex 73 174 34 196617 edge~;
#P newex 73 148 40 196617 ==~ -1;
#P number 200 57 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname rate;
#P newex 200 76 31 196617 !/ 4.;
#P newex 73 96 137 196617 rate~;
#P newex 73 57 65 196617 hostphasor~;
#P comment 245 58 238 196617 1/64th notes (assuming quarter note gets the beat;
#P comment 645 219 84 196617 blip sustain time;
#P comment 579 143 108 196617 Alternative ‘blip’ test;
#P comment 88 469 137 196617 record midi output into logic;
#P comment 130 288 67 196617 the midi test;
#P user panel 86 282 357 216;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 472 115 266 454;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 10 0 9 0;
#P connect 11 0 12 0;
#P connect 14 0 13 0;
#P connect 15 0 13 2;
#P connect 7 0 8 0;
#P connect 13 0 17 0;
#P connect 13 1 17 1;
#P connect 8 0 20 0;
#P connect 20 0 11 0;
#P fasten 23 0 22 0 486 304 570 304;
#P connect 22 0 27 0;
#P connect 25 0 21 0;
#P connect 21 0 24 0;
#P connect 24 0 22 1;
#P connect 26 0 25 1;
#P connect 30 0 14 0;
#P fasten 31 0 30 0 94 318 94 318;
#P connect 32 0 29 0;
#P connect 12 0 33 0;
#P connect 34 0 30 1;
#P fasten 27 0 28 1 570 496 604 496;
#P connect 27 0 28 0;
#P connect 29 0 25 0;
#P connect 35 0 29 1;
#P connect 9 0 19 0;
#P connect 9 0 8 1;
#P window clipboard copycount 37;


October 10, 2007 | 7:51 pm

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


October 11, 2007 | 10:05 am

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…

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 378 81 53 196617 autopattr;
#X prestore bpm 1 0 120;
#X prestore divisions 1 0 64;
#P objectname u718000007;
#P newex 201 69 27 196617 / 4.;
#P newex 201 102 64 196617 pak 120. 64;
#P message 174 210 43 196617 60 127;
#P newex 174 272 42 196617 noteout;
#P newex 174 243 85 196617 makenote 80 100;
#P toggle 174 128 15 0;
#P number 255 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname divisions;
#P number 201 42 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname bpm;
#P newex 201 133 110 196617 expr 60000./$f1/$i2;
#P newex 174 179 37 196617 metro;
#P comment 163 44 33 196617 BPM;
#P comment 296 42 180 196617 divisions per measure (assuming 4/4);
#P window linecount 2;
#P comment 122 68 76 196617 one beat == one quarter note;
#P window linecount 1;
#P comment 227 277 118 196617 select from Max/MSP 1;
#P connect 5 0 4 1;
#P connect 12 0 5 0;
#P connect 7 0 12 1;
#P connect 13 0 12 0;
#P connect 6 0 13 0;
#P connect 11 0 9 0;
#P connect 4 0 11 0;
#P connect 9 1 10 1;
#P connect 9 0 10 0;
#P connect 8 0 4 0;
#P window clipboard copycount 15;


October 11, 2007 | 1:43 pm

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).


October 11, 2007 | 1:44 pm

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.
—————————————————-


October 11, 2007 | 2:41 pm

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.


October 11, 2007 | 3:07 pm

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!


October 11, 2007 | 6:54 pm

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


October 11, 2007 | 9:38 pm

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



o s
December 8, 2007 | 10:25 pm

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
December 8, 2007 | 10:42 pm

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


December 8, 2007 | 10:46 pm



o s
December 9, 2007 | 12:02 am


Viewing 22 posts - 1 through 22 (of 22 total)