Forums > MaxMSP

Dynamic Message Routing – inspiration needed

March 30, 2012 | 12:18 pm

Hi fellow maxers,

I’m looking for an elegant solution for the following scenario:

I’ve got a lot of incoming controller data in the form of message streams.
I need to map these messages dynamically (changing over time) to different sound-generating modules.
The routing should be set with symbols.
For example: controllerB::X_speed -> synthA::Pitch.
One-to-Many routing should be possible.

Probably I’ll also need to insert some kind of transformer to adjust the controller value ranges…

My first idea was to use a combination of [router] and the pattr system.

Maybe some of you have found an elegant system for this?
Maybe javascript or java ?
3rd party externals ?

cheers & thx,

March 30, 2012 | 1:05 pm

router controlled with a matrix and eventually the pattr seems elegant enough to me.

I would also map all controllers into the 0.-1. range to get an uniform interface. Then I’d do a mapping into the modules for each parameters.


March 30, 2012 | 2:57 pm

[poly~ gate 32]

March 30, 2012 | 6:23 pm

Attach a uniquely named [receive …] to the input of each parameter you want to control.

Attach each controller data output to unique [foward ] objects.

The nice thing about [foward] is that you can dynamically change the recipient name so all you have to do is change the names on the fly to cause the data to go to a different parameter.

The suggestion to scale everything between 0 and 1 is an excellent one.

March 30, 2012 | 8:28 pm

Nice tips here, I’m coming doing something similar myself, the [forward] object is great for this, I also find if you can get your data onto a jitter matrix you can do some excellent stuff with [jit.gen] and things like [jit.slide] can add some nice touches to your data.

Also [histo] and [table] are great for probability based routing.

March 30, 2012 | 8:35 pm

thanks for the tips guys :)
I think I’ll dwell more deeply into the pattr system.
I’ve always seen it as a more stable preset replacement – but now I’ve realized that there’s really more to it.

You can do routing by binding pattr objects to other pattr objects.
The parameter mode is also new to me.

Even after years, there’s always something new to discover in max :))

March 30, 2012 | 9:07 pm

I seriously considered the pattr stuff but frankly I was unable to make head or tail of it.

In the end I came up with a simple scheme using a name hierarchy (as objects get nested) and everything just feeds into a simple javascript dictionary object that’s managed centrally. With that, I’ve got completely persistence with automatic saving and reloading of parameter values for sliders and dials.

The ability to set the target of a [forward] object was critical to being able to do this and it works really nice.

March 30, 2012 | 9:32 pm

What do you exactly mean with javascript dictionary object?
I think I’ll need something similar. Some sort of central manager.
Auto-populating an umenu with the available parameters would also be a nice thing to have…

I want to stick to max5, so I can’t use the dict object…

March 31, 2012 | 10:09 am

This patch demonstrates using the pattr system to acheive some of the requirements mentioned in the thread:

– dynamically choosing a ‘target’ for a ‘control stream’
– scaling control range to target range (in this patch, the scaling will only work for targets that have a ‘minimum’ and ‘maximum’ attribute)
– auto-populating umenus with potential targets

— Pasted Max Patch, click to expand. —
March 31, 2012 | 12:54 pm

wow, that’s brilliant.
thanks for sharing!!

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

Forums > MaxMSP