Hallo, hard off hat gesagt: // hard off wrote:
i have run into a small problem with a new abstraction that i use to load files into tables.
the abstraction is called loadrun.pd , and inside this abstraction is a subpatch that makes a number of tables. at the moment, these tables are being sent to pd-loadrun.pd
but, i want to open several instances of this abstraction at once.
the problem is how to send stuff from a subpatch to the abstraction, without sending it to all other copies of the abstraction?
i think i read somewhere about a local send object , (maybe in zexy?)
Local sends won't help here, the problem is, that "pd-loadrun.pd" is and will stay a global receiver.
What you could do however is a little hackish and untested, but should work:
Inside of loadrun.pd you create a subpatch [pd $0-mytables], which will carry the tables later.
Inside loadrun.pd you then loadbang a [f $0] object and send this number to either an outlet or a to a global sender like "LOADRUN_DOLLAR_ZEROS"
Now for every loadrun.pd's "$0" you receive, you can make a new sender for the $0-mytables subpatch and send your messages to it with:
[r LOADRUN_DOLLAR_ZEROS] | [makefilename pd-%d-mytables] | [; $1 obj 10 10 a_table(
Ugly, but also somehow cool.
Of course it would be simpler to just put the dynamic messages stuff into loadrun.pd itself, then you wouldn't need to deal with the global sender LOADRUN_DOLLAR_ZEROS or an outlet, but it depends on what you want to do exactly.
You can also use this trick to address objects prepended with $0 inside loadrun.pd, for example a table called [table $0-file]: Just try to somehow get $0 outside of the abstraction to use it outside.
However it may be easier to use a table named with $1 like [table $1-file], and then use different arguments for every instance of the abstraction.
Frank Barknecht _ ______footils.org_ __goto10.org__