Dynamic Message Routing – inspiration needed

Mar 30, 2012 at 12:18pm

Dynamic Message Routing – inspiration needed

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,
jan.

#62675
Mar 30, 2012 at 1:05pm

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.

p

#226368
Mar 30, 2012 at 2:57pm

[poly~ gate 32]

#226369
Mar 30, 2012 at 6:23pm

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.

#226370
Mar 30, 2012 at 8:28pm

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.

#226371
Mar 30, 2012 at 8:35pm

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

#226372
Mar 30, 2012 at 9:07pm

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.

#226373
Mar 30, 2012 at 9:32pm

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…

#226374
Mar 31, 2012 at 10:09am

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. –
#226375
Mar 31, 2012 at 12:54pm

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

#226376

You must be logged in to reply to this topic.