Make `Receive (Local)` to retrieve value from ancestor patches

The thing with Send/Receive (Local) is that if I have added a node in the main application patch and surrounded it with Send (Local) region, I can’t use the Receive (Local) inside that node’s definition to receive a value that I’m sending through the Send (Local) region defined in the parent patch. Could a Receive(Scope) node be added, or a flag be added to Receive (Local) to support this?

This request is similar to what is being requested here where they mention the ability send the Send value to sub-patches as well.

React has called Context API createContext – React which acts in similar fashion. In it, React keeps looking upwards the components tree till it finds a Provider for the Consumer.

Not sure I follow, if I have MyNode using a Receive (Local) and put it inside a Send (Local) with an LFO connected to the border, I get that LFO’s value

I guess this is not what you meant? Could you maybe share a patch showing what you could not manage to do? Here it also works if I’m nesting another level and use the Receive (Local) there.

SendLocal.vl (11.4 KB)

Oh this is exactly what I meant. It somehow wasn’t working that time when I tried. Must be a logic error that I did. Thanks!

1 Like