Is it possible to get the name of a variable after a receive obj ?
a kind of a intern pd message
cheers
get name of variable message
Is it possible to get the name of a variable after a receive obj ?
a kind of a intern pd message
cheers
@mx Try adding [prepend set] before the message boxes at the bottom. The "set" message will clear a message box which will then display whatever comes after it.
@mx [send] and [receive] names are just addresses, like [s 3_Albert_Square_Manchester] and they just send and receive the message like a post box.
You could prepend a name to your variable like this.........variable_name.pd
You will have just made a list where the first part is the symbol variable_mine. [list split 1] breaks the list after the first item and so separates out the symbol.
David. (and sorry.... same solution as @rjp9)
kay, many thanks. I find a workaround combining [pp] and dynamic [send].
and is there a way to have in a symbol format the name of a subpatch ?
[pd tryToGetMe]
@mx Hello again....
Yes, a symbol name for a sub-patch is the most used I think..
Here are a few ideas for dynamic patching.
You can plant abstractions within your sub-patch by sending it messages. An abstraction is a patch that you are going to use many times, and which contains $ variables to differentiate each copy. At creation the abstraction is given it's variables (and you can give it as many as you wish). All objects in Pd behave like abstractions (though they are not)...... [send december] for example, where "december" is its "variable" to which you have no direct access...... hence this thread.
The variables that are given to the abstraction at creation can be floats (numbers) or symbols, and are now called "arguments" because they have been fixed for this copy. Those arguments can then be put into [send] and [receive] objects (and indeed ANY object) so as to differentiate that copy of the abstraction. The $ variables behave differently in objects and messages........... so it's a bit of a head-twist......... but basically any $1 in any object will have that $1 replaced by the first argument of the abstraction....... $2 the second....etc. A $1 in a message will be replaced by the first atom arriving at it's inlet (from a "packed" list), and $2 by the second etc. (so they remain "variable"!!).
Here is an example I made a while ago to try to explain how it works........
keyboard.zip
So now the next part........ to create new copies of the abstraction dynamically.........
put_dynamic.pd
((PUT put_dynamic.pd in the "keyboard" folder))
and to build a patch from scratch dynamically.............
try_me_3.zip
Work your way through these patches in the order in which I have posted them, and you should get to where you want to be..........
David.
Oops! Looks like something went wrong!