Max Msp - audio out from Max into Logic then out of Logic back into Max?

Joe Cooney's icon

i'm trying to get logic to listen to the output of max msp, so i can process the audio with plugins then send it back into max. i'm using a gate~ to switch between 2 signals, one directly out from max and one that is being sent to logic then received then output in max. i'm having some problems. i'm using soundflower to route everything but i'm getting no sound at all coming into logic, even though both max and logic's outputs are set to soundflower 64ch. the way i have everything set up is i have a dac~ channels 1 and 2 as the main output of max msp that is also is going to my laptop's speakers. the dac~ 1 2 object is running out of the gate~ object's 1st output which is on by default and works perfectly. when i select the switch the gate~ object's second output is selected which sends audio into a dac~ 3 4. this dac~ object acts as the output that logic receives, so i have set an audio track on logic with the input on 3 and 4. this track is then output to 5 6 which should be received by a adc~ 5 6 object within max, but no sound is coming to logic or back to max this way. i have a live.gain running before the dac~3 4 which shows audio is going in, but a live.gain running after the ad~5 6 shows no audio is coming back. does anyone know what is going wrong? i've attached pictures showing the patch, the inputs and outputs of max and the logic channel strip when max is playing audio

Screen-Shot-2016-03-28-at-7.12.27-pm.png
png
Screen-Shot-2016-03-28-at-7.12.41-pm.png
png
Screen-Shot-2016-03-28-at-7.13.03-pm.png
png
Screen-Shot-2016-03-28-at-7.13.52-pm.png
png
Joe Cooney's icon

can anyone help?

dhjdhjdhj's icon

I use Loopback from Rogue Amoeba for this kind of thing.

joeman's icon

I use JACK. Send audio from any app into any other. Works for me.

Joe Cooney's icon

i've downloaded Loopback but i'm getting absolutely nowhere with it... i've set Max on channels 1 and 2, with logic on 3 and 4 and Max on 5 and 6, meaning Max's main output is 1 and 2, but is sending audio to logic on 3 and 4 through a dac 3 4, then logic picks it up on the input 3 and 4 and outputs it on 5 and 6 to max which is picked up by a adc 5 6 then output to dac 5 6. this sounds easy but nothing is working.. no audio to logic, nothing at all .. can someone please help me because this is holding my project back significantly

dhjdhjdhj's icon

Can you break this up into parts....stop worrying for a moment whether audio is getting OUT of logic and focus on making sure that audio is getting in. Did you select your loopback device as your core audio device in Max and in Logic? Do you know for certain that Max is producing audio in the first place?
What kind of loopback device did you create? I normally create an 8-port device and then aggregate it with a "real" device so that ultimately one of the apps gets to send audio to the outside.

Mitch Turner's icon

Joe,
I've done this in the past. In order to make it work, I had to create an "aggregate device" comprised of my Builtin input/output and SoundFlower (2ch). I created this device using the AudioMIDI Setup application. If I understand what you are trying to do, then you would create an aggregate device made up of the Builtin input/output and SoundFlower (64ch).

Below is a link to a help file I made a good while ago. There is an explanation, however, the pictures are a bit out of date. The approach should still work.
http://home.lagrange.edu/mturner/MitchWebSite/logic_help_files_files/LogicMaxAggregateDevice.rtfd.zip

Let me know if you want any help,
Mitch

Joe Cooney's icon

thank you all for the advice!

Mitch, your guide was very helpful but for some reason once i set up an aggregate device with loopback (i don't have soundflower anymore) Max won't let me set the aggregate device as my driver for some reason. i want to send audio out of max (on a seperate channel that isn't picked up by max's audio output) to logic which then sends it back into max on an output channel that max is using so there is sound. i've made some progress but once again something has completely stopped my progress.. the first 3 pictures i've attached are Loopback's settings, Max's audio settings, Logic's audio settings. max and logic both use channels 3 + 4 and 5 + 6 because those are the channels that audio is being sent and received on. channel 1 + 2 is max's main audio output (without being sent to logic) and 7 + 8 is the audio output of Max where the audio that is received from Logic is played through. using this setup, Max seems to be successfully sending audio to logic, as the live.gain after the adc~ 5 6 is showing it is receiving audio, (the 4th picture) and there is audio in the logic channel strip (5th picture). but there is no audio coming out of max when it is being sent to logic and received in max, even though channels 7 and 8 are exclusively used by Max as an audio output. this seems to be the last hurdle that i have to get over, what is going wrong? also i've found that in logic once audio is being received by max, setting the output as the stereo output instead of 5 and 6 introduces a horribly loud feedback

Screen-Shot-2016-03-31-at-2.27.34-pm.png
png
Joe Cooney's icon

the last picture is when it feedbacks once the stereo output is selected

Joe Cooney's icon

having a bit of trouble attaching the screenshots

Screen-Shot-2016-03-31-at-2.48.39-pm.png
png
Joe Cooney's icon

here are the rest

Screen-Shot-2016-03-31-at-2.39.46-pm.png
png
Screen-Shot-2016-03-31-at-2.48.57-pm.png
png
Joe Cooney's icon

.

Screen-Shot-2016-03-31-at-2.49.10-pm.png
png
Screen-Shot-2016-03-31-at-2.49.28-pm.png
png
Mitch Turner's icon

Joe,
I just got it to work. I am working on a new help file. I should have it finished in a few minutes. My suggestion is not to use "Loopback" at all. Make the aggregate device from BuiltIn and SoundFlower (64 ch). If you want to contact me via email, my address is:

mmturner2468 ( a____ t ) gmail (d__0 __t) com (replace "at" and "dot")

Should be done in about a half an hour.

Cheers,
Mitch

Mitch Turner's icon

I was able to get audio from Max --> to LOGIC --> back to Max. I've updated my Aggregate Device help file. I did not use "Loopback", instead, I used only Built-in I/O and Soundflower (64ch).

Hope this helps out,
Mitch

Joe Cooney's icon

thank you mitch! i shall try this out and report back. will this work if i swap the built in i/o with my scarlett 2i2 soundcard's i/o?

Mitch Turner's icon

Joe,
I believe you will have to create an Aggregate device that includes soundcard and soundflower. I've never done it, but it should be as simple as swaping the soundcard for the built-in i/o.

Cheers,
Mitch

Joe Cooney's icon

after following exactly what you described in your guide it's not working for me still.. first of all, when i set up the aggregate device, when soundflower is open and i select to add soundflower to the aggregate device it always crashes, so i have to select soundflower then open the soundflower app so the icon is at the top bar of the screen, meaning it is always red. after following everything from the pictures in the guide, logic does receive the audio from max but it is very quiet, and it is not sending audio in the 5-6 output, and max is not receiving the audio that is sent. here are the screenshots

Screen-Shot-2016-03-31-at-5.22.01-pm.png
png
Screen-Shot-2016-03-31-at-5.21.41-pm.png
png
Screen-Shot-2016-03-31-at-5.22.10-pm.png
png
Mitch Turner's icon

Joe,
I am not exactly sure why soundflower's inputs and outputs are red in Audio-MIDI setup, however, I think they should be green. I'd delete the aggregate devices you have created. Then, I'd say that you need to un-install soundflower, restart your computer, and re-install soundflower. Here is how.

Start by uninstalling Soundflower. I modified instructions found on Matt Ingalls' GitHub page

To uninstall soundflower:
1) go to the folder called:
/Library/Extensions
Then inside that folder, look for a "Soundflower.kext" file. If there is one, DRAG it into the trash (you may be asked for the admin password)
(This folder is at the root level, not the one inside your User folder.)

2) go to the folder called:
/System/Library/Extensions
Then inside that folder, look for a "Soundflower.kext" file. If there is one, DRAG it into the trash (you may be asked for the admin password)

3) empty the trash
4) restart your computer (you must do the restart before re-installing soundflower)

Now re-install soundflower. I'm using Mac OS 10.11.3 (El Capitan). I used the soundflower found in this DMG file:
https://github.com/mattingalls/Soundflower/releases/download/2.0b2/Soundflower-2.0b2.dmg

After the install, you may have to restart your machine one more time.

Last, go to Audio MIDI setup and create a new Aggregate Device.

Hope this does it,
Mitch

Mitch Turner's icon

Joe,
Looks like there is an Uninstall script in the DMG file I mentioned in my last post. Running that script will accomplish the same result as looking for and deleting the kext files yourself. I assume it will ask you to restart your machine before you re-install soundflower.

Cheers,
Mitch

Joe Cooney's icon

i ran the uninstaller, downloaded the file from that link, restarted my computer then found that the uninstall deleted the soundflowerbed app so i technically couldn't open soundflower, as it was still red when i tried to add it to an aggregate device in the audio midi setup menu, so i had to re install soundflowerbed after finding it online, meaning i had access to it again but it's still red when i try and add it to an aggregate device

Joe Cooney's icon

also soundflower-2.0b2 doesn't install a soundflower folder in the applications menu so there's nothing i can do with it

Mitch Turner's icon

Joe,
I'm sorry I could not help anymore. BTW, soundflowerbed is not included in the latest soundflower DMG file. I think it is being replaced. I can email you the version that works on my machine, if you like.

You might find some help at the link below. Seems you are not the only one having issues with Soundflower. Looks like Matt is pretty active answering questions here:
https://github.com/RogueAmoeba/Soundflower-Original/issues

Mitch

Jeff Ali's icon

I'm looking for a simple way to stream audio out from one app into Max. The app I want to stream from is SonicPi. There are no audio options from SonicPi other than to set the system sound. Also, SonicPi is not ReWire aware.

I am able to get SonicPi to stream into Logic Pro 9 using an aggregate device as the main driver so that much works and makes sense. What I am trying to understand is how to get the audio into Max.

What do I need to add to my Max patch to achieve this?

The goal is to have SonicPi stream into Max 7 to be processed and then recorded using the recorder or quick record.

I'm attaching a simple Max 7 patch, please note the STEREO MIXER. Ideally, the audio from SonicPi would be connected to the inputs of the STEREO MIXER.

Thanks!

Generative-Coded-Music-Mix-in-Max-and-SonicPi.png
png