Parsing osc based on partial string

Miguel Angel Crozzoli's icon

Hi there,

I am wondering if I can use routepass + route obejct (or something else) to parse an osc msg based on part of a string coming from python.

I am sending from python column (name) with row (value), such as (freq_220, 023) or (dim_0, 012). I know the prefix (freq_ and dim_) but the amount of freqs or dims is dynamic.

I imagine that I can create lists based on my prefix and then parse this list based on index?

I tried to find an example in this forum to do thins, but I couldnt find anything. anyone can guide me in the right direction? also is it possible to extract the number for freq_ and send it to another object?

Thanks a lot,

Source Audio's icon

Why don't you format your messages from python in form that can be

routed without any problems in first place ?

In a max message comma has special meaning: to iter comma separated items.

here message output gets divided into 2 lines :

only way to receive and pass further is to send it as symbol:

that can be passed to regexp to get rid of disturbing chars in the message.

and what do you mean by:

"amount of freqs or dims is dynamic."

something like :

(dim_0, 012, 100, 125, 079) ?

and is first number after dim_ also a value or index or whatever ?

Miguel Angel Crozzoli's icon

Thank you for your advice! I found a solution through regexp as you mentioned.

Source Audio's icon

Without braces and commas, things are much simpler