Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running EnvelopForLive inside of Max/MSP directly? #90

Open
hems opened this issue Jul 28, 2022 · 7 comments
Open

Running EnvelopForLive inside of Max/MSP directly? #90

hems opened this issue Jul 28, 2022 · 7 comments

Comments

@hems
Copy link

hems commented Jul 28, 2022

Hello,

I have seen a few examples of Max4Live devices running inside of Max MSP directly and i'm wondering if that would be possible ( and fir there are examples ) with Envelop4Live?

@mcslee
Copy link
Contributor

mcslee commented Jul 28, 2022

You could certainly adapt the max 4 live devices to run in standalone max. The components should work fine standalone, however you will be missing some key things that Live provides:

  • the live audio flow, you'd need to wire up your own sound sources for inputs
  • the live routing architecture, which envelop devices use to route ambisonics audio to the master bus
  • the live device framework, saving settings, having multiple device instances on different tracks, etc.

You could create your own stand-ins for that. The "core guts" of the Envelop ambisonic panning implementation doesn't really depend on the live audio routing. But it will take a big of patching surgery to pull out the relevant bits. We don't really have any ready-to-use examples of this, unfortunately.

@hems
Copy link
Author

hems commented Aug 1, 2022

Thanks for the insights!

  • the live routing architecture, which envelop devices use to route ambisonics audio to the master bus

This definitely seems like the most black magic part for me, I don't really know/understand how you can wire the audio between devices on Max4Live like if they are send~ and receive~ objects! i'm familiar with send and receive for data but for audio i have no idea how it works inside of Envelop!

Thanks a lot for your quick and awesome answer as usual!

@mcslee
Copy link
Contributor

mcslee commented Aug 1, 2022

Yeah, the inter-channel wiring was definitely one of the trickier parts of E4L... it uses the fact that plugin devices can have more than just a single stereo out pair, as well as multiple inputs. The E4L panners actually have 8 stereo outputs, for a total of 16 channels which supports 3rd-order Ambisonics. There are routing settings for these additional outputs which can be set using Max code, e.g. so outputs 3/4 from an E4L panner go to inputs 3/4 of the E4L Master Bus.

It does get a bit hairy but it works. The routing assignment logic is here in these patchers if you're curious:
https://github.com/EnvelopSound/EnvelopForLive/blob/master/patchers/bus/e4l.bus.send.maxpat
https://github.com/EnvelopSound/EnvelopForLive/blob/master/patchers/live/e4l.live.routing.maxpat

You can see the multi-outs on the E4L panner devices, and the init routine that gets called to set them up to be "invisibly" routed to the E4L Master Bus.
Screen Shot 2022-08-01 at 9 18 53 AM
Screen Shot 2022-08-01 at 9 18 57 AM

Then on the E4L Master Bus side, there are multiple inputs and some more e4l.bus.receive initialization stuff...
Screen Shot 2022-08-01 at 9 19 51 AM
Screen Shot 2022-08-01 at 9 20 28 AM

In standalone Max you could just rip all of this fiddly stuff out and either use send~/receive~ or just simply connect the device patch cords directly. This routing stuff is all definitely a bit of a hack (or your more flattering term "black magic") around the fact that Live does not really support multi-channel audio - everything is stereo, so we construct the multi-channel flow ourselves by using extra sets of stereo pairs.

@hems
Copy link
Author

hems commented Aug 25, 2022

In standalone Max you could just rip all of this fiddly stuff out and either use send~/receive~ or just simply connect the device patch cords directly. This routing stuff is all definitely a bit of a hack (or your more flattering term "black magic") around the fact that Live does not really support multi-channel audio - everything is stereo, so we construct the multi-channel flow ourselves by using extra sets of stereo pairs.

thanks a lot for taking your time to reply this!

I had a look at the source code and indeed the live api seems fairly "completicated" ( aka messy ) but indeed it works! very good work you did!

in the end of the day trying to run envelop4live inside creates it's own set of problems, still it is a valid experiment to learn more about envelop4live and ( ambisonics and live api as well! ).

I wonder if there would be any advantage of trying to use "spat~" over ICST or if in the future we would be able to have envelop4live support multiple libraries ( i.e. spat and icst )

@mcslee
Copy link
Contributor

mcslee commented Aug 25, 2022

I wonder if there would be any advantage of trying to use "spat~" over ICST or if in the future we would be able to have envelop4live support multiple libraries ( i.e. spat and icst )

The spat tools are very well regarded, lots of powerful stuff in there. However, they are not under an open source license that is compatible with Envelop's GPL licensing. So we are not able to utilize or include those in this project for release. Definitely something you could experiment with independently though!

@ghost
Copy link

ghost commented Aug 25, 2022

I seem to be able to use E4L devices in native Max using mcs.amxd~ objects. The latter will produce 18-channel audio cords, the first two of which can be ignored (m4l stereo passthrough). It's not without some glitches/errors but it mostly works.

Screen Shot 2022-08-25 at 2 40 20 PM

@hems
Copy link
Author

hems commented Aug 28, 2022

I seem to be able to use E4L devices in native Max using mcs.amxd~ objects. The latter will produce 18-channel audio cords, the first two of which can be ignored (m4l stereo passthrough). It's not without some glitches/errors but it mostly works.

that's definitely the right way to do it, very good catch! 🎱

i wonder if the "sync" function will also follow the transport on max when doing that..

i definitely need to give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants