Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
Ingo Stockwrites: > On 05/20/2018 02:12 PM, Derek Kwan wrote: >> As a side note, I don't really particular about this situation right now >> and don't have a use case as of yet, but it looks like both the $$ >> approach and the tosymbol approach don't work with trying to insert >> literal "$0, $1, $2" and so on in [text]s the "patching" sort of way via >> [text insert]? You can enter those literals just fine via the popup Pd >> text window and those will save just fine, but both the $$ and tosymbol >> methods via [text insert] yield input that looks to be their escaped >> \$0, \$1 versions within the popup Pd text window and then when you try >> to save the contents of that window they get resolved (so $0 goes to 0 >> and $1 yields \\$1: argument number out of range warnings). > > Yes, the escape mechanism seems to be a bit quirky at times. For > example, in the attached patch create-arrays5.pd, the array names are > being created the way described above in the thread and put into a > [text] object, where they occur escaped. The contents of the [text] can > be saved with the patch. If you create the arrays from the [text] after > writing to it, the arrays are created fine. But if you reload the patch, > $0 is escaped in the array objects, although the contents of [text] look > exactly the same. Maybe a bug, maybe some quirk. > > Anyhow, there is a solution for writing $0 into [text] and easily > generate objects from there that is robust against saving the [text] > contents with the patch, using [text fromlist], which is demonstrated in > the attached patch create-arrays7.pd. :) > > best wishes, ingo > > > > ___ > Pd-list@lists.iem.at mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list ah, well that answers that hah. thx! and yeah, i suppose its' a bit quirky given that at least functionally texts are collections of lists but I suppose these sorts of things fall more into the "not officially supported" category than not... derek -- Derek Kwan www.derekxkwan.com ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
Ingo Stockwrites: > Now this works without error messages, combining some of the approaches > in this thread. > > ingo > > > On 05/15/2018 03:47 PM, Ingo Stock wrote: >> But it works by creating the message with set and changing messages! >> >> [set obj 30 30 array define, adddollsym $2-$3( --> [( does the trick. >> >> See also attached working demo. >> >> >> On 05/15/2018 03:26 PM, Roman Haefeli wrote: >>> On Tue, 2018-05-15 at 14:09 +0200, Christof Ressi wrote: > [obj 20 20 array define $$1-snd0] this only works as long as you don't save and reopen the patch, where "$$1" will become "$\$1" (which is resolved to "$\\$1" instead of "\\$1"). >>> >>> I see. Thanks for pointing it out. >>> >>> Roman >>> >>> >>> >>> ___ >>> Pd-list@lists.iem.at mailing list >>> UNSUBSCRIBE and account-management -> >>> https://lists.puredata.info/listinfo/pd-list >>> >>> >>> >>> ___ >>> Pd-list@lists.iem.at mailing list >>> UNSUBSCRIBE and account-management -> >>> https://lists.puredata.info/listinfo/pd-list > > ___ > Pd-list@lists.iem.at mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list Thanks all, sorry for the delayed response, got tied up with a looming deadline during the week... Good solutions to try out with the $$ and the [list tosymbol] options. Yep, essentially what I wanted to do is was create a bunch of array defines with $0 in them and not care about saving the dynamic patching machinery used to create them. I suppose it wasn't super necessary in my use case, but just keeping up my usual practice of prepending everything with $0-, I suppose I tend to be on the extra paranoid side of wanting to keep everything patch unique. A use case I could definitely see myself doing at some point is something that I would want to open multiple instances of that involve large sample banks, like say a live looping patch with 50 10 second recordable loops or even just a sound launcher/processor patch have can draw from 100s of different loaded up sounds. In those cases, again I wouldn't care so much about saving the machinery used to make all those [array defines], but doing all of those by hand would definitely be a pain and they would all need $0-s in their names to avoid collisions when multiple instances are open... As a side note, I don't really particular about this situation right now and don't have a use case as of yet, but it looks like both the $$ approach and the tosymbol approach don't work with trying to insert literal "$0, $1, $2" and so on in [text]s the "patching" sort of way via [text insert]? You can enter those literals just fine via the popup Pd text window and those will save just fine, but both the $$ and tosymbol methods via [text insert] yield input that looks to be their escaped \$0, \$1 versions within the popup Pd text window and then when you try to save the contents of that window they get resolved (so $0 goes to 0 and $1 yields \\$1: argument number out of range warnings). Again, don't particularly care that much about finding a solution to this other issue at the moment, but figured I bring it up as a possible branch of further discussion since the topic is open at the moment anyways... Thanks again for the help on the dynamically creating [array defines] with literal $0s. Derek -- Derek Kwan www.derekxkwan.com ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
Now this works without error messages, combining some of the approaches in this thread. ingo On 05/15/2018 03:47 PM, Ingo Stock wrote: > But it works by creating the message with set and changing messages! > > [set obj 30 30 array define, adddollsym $2-$3( --> [( does the trick. > > See also attached working demo. > > > On 05/15/2018 03:26 PM, Roman Haefeli wrote: >> On Tue, 2018-05-15 at 14:09 +0200, Christof Ressi wrote: [obj 20 20 array define $$1-snd0] >>> >>> this only works as long as you don't save and reopen the patch, where >>> "$$1" will become "$\$1" (which is resolved to "$\\$1" instead of >>> "\\$1"). >> >> I see. Thanks for pointing it out. >> >> Roman >> >> >> >> ___ >> Pd-list@lists.iem.at mailing list >> UNSUBSCRIBE and account-management -> >> https://lists.puredata.info/listinfo/pd-list >> >> >> >> ___ >> Pd-list@lists.iem.at mailing list >> UNSUBSCRIBE and account-management -> >> https://lists.puredata.info/listinfo/pd-list #N canvas 172 88 575 641 12; #X msg 37 103 5; #X obj 37 149 until; #X obj 37 172 f; #X obj 67 172 + 1; #X msg 37 195 symbol snd\$1; #X obj 37 218 text set \$0-arraynames 1e+06; #X obj 97 172 mod; #X obj 37 126 t f f b; #X msg 139 149 clear; #N canvas 749 289 231 201 \$0-arrays 1; #X obj 30 30 array define \$0-snd0; #X obj 30 53 array define \$0-snd1; #X obj 30 76 array define \$0-snd2; #X obj 30 99 array define \$0-snd3; #X obj 30 122 array define \$0-snd4; #X restore 37 34 pd \$0-arrays; #X msg 139 356 clear; #X obj 139 379 s pd-\$0-arrays; #X obj 37 310 text size \$0-arraynames; #X obj 37 356 until; #X obj 37 379 f; #X obj 67 379 + 1; #X obj 97 379 mod; #X obj 107 425 text get \$0-arraynames; #X obj 37 290 bng 15 250 50 0 empty empty create_arrays 17 7 0 10 -262144 -1 -1; #X obj 37 333 t f f b; #X obj 37 563 s pd-\$0-arrays; #X obj 37 448 + 30; #X obj 37 425 * 23; #X obj 37 83 bng 15 250 50 0 empty empty write_to_text 17 7 0 10 -262144 -1 -1; #X obj 139 172 text define -k \$0-arraynames; #A set snd0 \; snd1 \; snd2 \; snd3 \; snd4 \;; #X msg 74 425 0; #X msg 37 540 obj 30 \$1 array define $\$2-snd4; #X obj 254 327 loadbang; #X msg 107 517 set obj 30 \, adddollar 1 \, add2 array define \, adddollsym \$1; #X obj 37 471 pack f f; #X obj 37 402 t f b f; #X obj 107 448 list fromsymbol; #X obj 107 494 list tosymbol; #X obj 107 471 list prepend 36 50 45; #X connect 0 0 7 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 6 0 2 1; #X connect 7 0 1 0; #X connect 7 1 6 1; #X connect 7 2 8 0; #X connect 8 0 24 0; #X connect 10 0 11 0; #X connect 12 0 19 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 14 0 30 0; #X connect 15 0 16 0; #X connect 16 0 14 1; #X connect 17 0 31 0; #X connect 18 0 12 0; #X connect 19 0 13 0; #X connect 19 1 16 1; #X connect 19 2 10 0; #X connect 21 0 29 0; #X connect 22 0 21 0; #X connect 23 0 0 0; #X connect 25 0 29 1; #X connect 26 0 20 0; #X connect 27 0 10 0; #X connect 28 0 26 0; #X connect 29 0 26 0; #X connect 30 0 22 0; #X connect 30 1 25 0; #X connect 30 2 17 0; #X connect 31 0 33 0; #X connect 32 0 28 0; #X connect 33 0 32 0; signature.asc Description: OpenPGP digital signature ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
But it works by creating the message with set and changing messages! [set obj 30 30 array define, adddollsym $2-$3( --> [( does the trick. See also attached working demo. On 05/15/2018 03:26 PM, Roman Haefeli wrote: > On Tue, 2018-05-15 at 14:09 +0200, Christof Ressi wrote: >>> [obj 20 20 array define $$1-snd0] >> >> this only works as long as you don't save and reopen the patch, where >> "$$1" will become "$\$1" (which is resolved to "$\\$1" instead of >> "\\$1"). > > I see. Thanks for pointing it out. > > Roman > > > > ___ > Pd-list@lists.iem.at mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list > #N canvas 181 88 734 679 12; #X msg 39 116 5; #X obj 39 162 until; #X obj 39 185 f; #X obj 69 185 + 1; #X msg 39 208 symbol snd\$1; #X obj 39 231 text set \$0-arraynames 1e+06; #X obj 99 185 mod; #X obj 39 139 t f f b; #X msg 141 162 clear; #N canvas 932 380 231 201 \$0-arrays 1; #X restore 39 47 pd \$0-arrays; #X msg 141 369 clear; #X obj 141 392 s pd-\$0-arrays; #X obj 39 323 text size \$0-arraynames; #X obj 39 369 until; #X obj 39 392 f; #X obj 69 392 + 1; #X obj 99 392 mod; #X obj 109 438 text get \$0-arraynames; #X obj 39 303 bng 15 250 50 0 empty empty create_arrays 17 7 0 10 -262144 -1 -1; #X obj 39 346 t f f b; #X obj 39 530 s pd-\$0-arrays; #X obj 39 461 + 30; #X obj 39 438 * 23; #X obj 39 96 bng 15 250 50 0 empty empty write_to_text 17 7 0 10 -262144 -1 -1; #X obj 141 185 text define -k \$0-arraynames; #A set snd0 \; snd1 \; snd2 \; snd3 \; snd4 \;; #X msg 76 438 0; #X obj 39 484 pack f f s; #X obj 39 415 t f b f b; #X msg 39 507; #X msg 123 484 set obj 30 \, adddollar 1 \, add2 array define \, adddollsym \$2-\$3; #X obj 256 340 loadbang; #X msg 39 589 set obj 30 30 array define \, adddollsym \$2-\$3; #X msg 39 612; #X msg 256 363 set; #X connect 0 0 7 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 6 0 2 1; #X connect 7 0 1 0; #X connect 7 1 6 1; #X connect 7 2 8 0; #X connect 8 0 24 0; #X connect 10 0 11 0; #X connect 12 0 19 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 14 0 27 0; #X connect 15 0 16 0; #X connect 16 0 14 1; #X connect 17 0 26 2; #X connect 18 0 12 0; #X connect 19 0 13 0; #X connect 19 1 16 1; #X connect 19 2 10 0; #X connect 21 0 26 0; #X connect 22 0 21 0; #X connect 23 0 0 0; #X connect 25 0 26 1; #X connect 26 0 28 0; #X connect 27 0 22 0; #X connect 27 1 25 0; #X connect 27 2 17 0; #X connect 27 3 29 0; #X connect 28 0 20 0; #X connect 29 0 28 0; #X connect 30 0 10 0; #X connect 30 0 33 0; #X connect 31 0 32 0; #X connect 33 0 28 0; signature.asc Description: OpenPGP digital signature ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
On Tue, 2018-05-15 at 14:09 +0200, Christof Ressi wrote: > > [obj 20 20 array define $$1-snd0] > > this only works as long as you don't save and reopen the patch, where > "$$1" will become "$\$1" (which is resolved to "$\\$1" instead of > "\\$1"). I see. Thanks for pointing it out. Roman signature.asc Description: This is a digitally signed message part ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
Don't know if this could help for your case... ++ Jack Le 15/05/2018 à 13:15, Derek Kwan a écrit : > > Hello list, > > Perhaps a bit of a long shot and pretty much the exact opposite of the $0 > in messages conversations as of late: Is there a way to NOT resolve > dollar arguments in messages and/or objects? > > Example case: Lately for a project I've wanted to create vast swaths of > [array define]s and I've done so with dynamic patching. Since I want > their bound symbols to be something like "$0-snd0", "$0-snd1" > $0"-snd2"... "$0-snd50", I DON'T want dollar arguments (particularly the > $0) to resolve to anything. Similarly, I store filepath + array symbol > pairs in texts to do a big load at the beginning and for right now and > can always add the $0-bit via passing that symbol through a > [makefilename], but I'm wondering if I can pass $0s unresolved into a > text without having to manually type it in via the popup window. > > Of course I can always edit the patch in emacs/vim and do a > search/replace, but I'm looking for an in-Pd solutions... Also for the > array business I suppose I could do that via [clone], but that situation > doesn't seem ideal either... > > Thanks! > > Derek > not_resolving_dollar.pd Description: application/extension-pd ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
Hi, usually this is not necessary. As $0 changes with every patch opening, the dynamically created objects containing $0 must be recreated again every time. $0 resolves to an actual number in this process (i.e. 1023), but this is alright, as you can access 1023-array1 through [array get $0-array1] (if $0 equals 1023 in that session). I attached a demo patch that shows how it can be done (even without [makefilename]). best wishes, ingo On 05/15/2018 01:15 PM, Derek Kwan wrote: > > Hello list, > > Perhaps a bit of a long shot and pretty much the exact opposite of the $0 > in messages conversations as of late: Is there a way to NOT resolve > dollar arguments in messages and/or objects? > > Example case: Lately for a project I've wanted to create vast swaths of > [array define]s and I've done so with dynamic patching. Since I want > their bound symbols to be something like "$0-snd0", "$0-snd1" > $0"-snd2"... "$0-snd50", I DON'T want dollar arguments (particularly the > $0) to resolve to anything. Similarly, I store filepath + array symbol > pairs in texts to do a big load at the beginning and for right now and > can always add the $0-bit via passing that symbol through a > [makefilename], but I'm wondering if I can pass $0s unresolved into a > text without having to manually type it in via the popup window. > > Of course I can always edit the patch in emacs/vim and do a > search/replace, but I'm looking for an in-Pd solutions... Also for the > array business I suppose I could do that via [clone], but that situation > doesn't seem ideal either... > > Thanks! > > Derek > #N canvas 299 119 386 630 12; #X msg 39 116 5; #X obj 39 162 until; #X obj 39 185 f; #X obj 69 185 + 1; #X msg 39 208 symbol snd\$1; #X obj 39 231 text set \$0-arraynames 1e+06; #X obj 99 185 mod; #X obj 39 139 t f f b; #X msg 141 162 clear; #N canvas 687 243 231 201 \$0-arrays 1; #X restore 39 47 pd \$0-arrays; #X msg 141 369 clear; #X obj 141 392 s pd-\$0-arrays; #X obj 39 323 text size \$0-arraynames; #X obj 39 369 until; #X obj 39 392 f; #X obj 69 392 + 1; #X obj 99 392 mod; #X obj 82 438 text get \$0-arraynames; #X obj 39 303 bng 15 250 50 0 empty empty create_arrays 17 7 0 10 -262144 -1 -1; #X obj 39 415 t f f; #X obj 39 346 t f f b; #X obj 39 530 s pd-\$0-arrays; #X obj 39 461 + 30; #X obj 39 438 * 23; #X obj 39 484 pack f \$0 s; #X msg 39 507 obj 30 \$1 array define \$2-\$3; #X obj 39 96 bng 15 250 50 0 empty empty write_to_text 17 7 0 10 -262144 -1 -1; #X obj 141 185 text define -k \$0-arraynames; #A set snd0 \; snd1 \; snd2 \; snd3 \; snd4 \;; #X connect 0 0 7 0; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 6 0 2 1; #X connect 7 0 1 0; #X connect 7 1 6 1; #X connect 7 2 8 0; #X connect 8 0 27 0; #X connect 10 0 11 0; #X connect 12 0 20 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 14 0 19 0; #X connect 15 0 16 0; #X connect 16 0 14 1; #X connect 17 0 24 2; #X connect 18 0 12 0; #X connect 19 0 23 0; #X connect 19 1 17 0; #X connect 20 0 13 0; #X connect 20 1 16 1; #X connect 20 2 10 0; #X connect 22 0 24 0; #X connect 23 0 22 0; #X connect 24 0 25 0; #X connect 25 0 21 0; #X connect 26 0 0 0; signature.asc Description: OpenPGP digital signature ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Escaping/not resolving dollar argts in msgs/objects?
On Tue, 2018-05-15 at 04:15 -0700, Derek Kwan wrote: > Hello list, > > Perhaps a bit of a long shot and pretty much the exact opposite of > the $0 > in messages conversations as of late: Is there a way to NOT resolve > dollar arguments in messages and/or objects? I think you cannot dynamically disable the resolution of dollar symbols. > Example case: Lately for a project I've wanted to create vast swaths > of > [array define]s and I've done so with dynamic patching. Since I want > their bound symbols to be something like "$0-snd0", "$0-snd1" > $0"-snd2"... "$0-snd50", I DON'T want dollar arguments (particularly > the > $0) to resolve to anything Do I understand correctly that you want to be able to create those objects containing literal '$0'? You can "trick" Pd into creating a symbol that itself has a dollar variable: [0 ( | [obj 20 20 array define $$1-snd0] | [s canvas] > . Similarly, I store filepath + array symbol > pairs in texts to do a big load at the beginning and for right now > and > can always add the $0-bit via passing that symbol through a > [makefilename], but I'm wondering if I can pass $0s unresolved into a > text without having to manually type it in via the popup window. You could use the same trick. > Of course I can always edit the patch in emacs/vim and do a > search/replace, but I'm looking for an in-Pd solutions... Also for > the > array business I suppose I could do that via [clone], but that > situation > doesn't seem ideal either... I was just wondering why I haven't ever experienced the same need for literal dollar symbols in my patching career and realized that I never save dynamically created stuff. I rather let the dynamic stuff be created each time I load the patch. This way all dollar variables resolve to the currently correct value and I never bothered to use literal dollar signs in dynamic patching. Maybe I'm not fully understanding your case, but I can't see how having dynamically generated '$0' is useful in any way. Either you create all dynamic stuff from scratch, then you can as well use the value of $0 or you're saving stuff for later, but why do you need $0 then? Don't you rather want something fixed/controllable, that evaluates to the same value on each run? Roman signature.asc Description: This is a digitally signed message part ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
[PD] Escaping/not resolving dollar argts in msgs/objects?
Hello list, Perhaps a bit of a long shot and pretty much the exact opposite of the $0 in messages conversations as of late: Is there a way to NOT resolve dollar arguments in messages and/or objects? Example case: Lately for a project I've wanted to create vast swaths of [array define]s and I've done so with dynamic patching. Since I want their bound symbols to be something like "$0-snd0", "$0-snd1" $0"-snd2"... "$0-snd50", I DON'T want dollar arguments (particularly the $0) to resolve to anything. Similarly, I store filepath + array symbol pairs in texts to do a big load at the beginning and for right now and can always add the $0-bit via passing that symbol through a [makefilename], but I'm wondering if I can pass $0s unresolved into a text without having to manually type it in via the popup window. Of course I can always edit the patch in emacs/vim and do a search/replace, but I'm looking for an in-Pd solutions... Also for the array business I suppose I could do that via [clone], but that situation doesn't seem ideal either... Thanks! Derek -- Derek Kwan www.derekxkwan.com ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list