Re: [PD] here I go again..dynamic abstractions
Hallo, Matt Barber hat gesagt: // Matt Barber wrote: I only see two options: I see a third option: $0 is not only different from the $-variables in message boxes, but it's also different from the $-variables used as object arguments.[1] So another way out would be to replace only $0 with something like #0. Of course beginners then still would like to use #0 in a message box. [1] Actually the $-variables 1,2,3,... in message boxes and those in object boxes aren't that different, because the contents of object boxes also are messages to Pd's objectmaker and they are used explicitely as messages when doing dynamic patching. Ciao -- Frank BarknechtDo You RjDj.me? _ __footils.org__ ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Quoting Frank Barknecht f...@footils.org: Hallo, Matt Barber hat gesagt: // Matt Barber wrote: I only see two options: I see a third option: $0 is not only different from the $-variables in message boxes, but it's also different from the $-variables used as object arguments.[1] So another way out would be to replace only $0 with something like #0. Of course beginners then still would like to use #0 in a message box. i always thought that $0 was a misnomer, as it has nothing to do with what $1,... means. the logical thing would be $0=abstractionname/msesageselector and have something else be the unique abstraction id. but who would be willing to change that? fgam IOhannes This message was sent using IMP, the Internet Messaging Program. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Frank Barknecht wrote: I see a third option: $0 is not only different from the $-variables in message boxes, but it's also different from the $-variables used as object arguments.[1] So another way out would be to replace only $0 with something like #0. Yes. This, at least, would end the irrelevant dollar sign variables in message boxes are different than abstraction initializers argument every time someone asks why $0 can't be used in a message box. :-) Also, it would be much less confusing in general, because $0 never means the same thing as $1...$n, inside *or* outside of message boxes. Of course beginners then still would like to use #0 in a message box. I'm not a beginner (though far from an expert), and I still want to use the unique identifier in message boxes. What, exactly, is wrong with that use case? Frank, I think you make quite a bit of use of $0 in messages in [memento], for example. If it's wrong, why does the idiom; [f $0]-[message $1( get suggested as a solution so often? In my opinion, that's just a kludge, avoiding the original problem. Looking back on the thread, I see this from Iohannes: $-args in message-boxes are a way to modify messages. since messages don't have a patch-context, neither have (their patchable instances) message-boxes. But the message-boxes *do* have a patch context; they live in an abstraction that has a unique identifier, which is sometimes useful to blend into a message. I'm sorry for being stubborn about this, but I still don't see Georg's basic question answered, just a lot of dancing around it. :-) Phil ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
On Sat, 7 Feb 2009, Claude Heiland-Allen wrote: I don't know why, but it makes parsing Pd patches 1000x less straightforward than required (you need a two-phase parser that has a special exception to detect message boxes and not expand dollars, allowing the message box objects to parse them itself later, while expanding dollars for everything else). The way it works in Pd, Is that the parsing only cuts a patch into lists of atoms, and then the evaluation of $ is a separate phase. There are two levels of evaluation of $ in patches: one is because the patch is saved as a sequence of messages that do dynamic patching of all of the patch. Therefore, an objectbox containing $0 has to be saved as \$0, which gets converted to $0 on the first evaluation, and the $0 turns into a float on the second evaluation. I don't think that this way of doing things is really bad, except perhaps that it allows one to make patches that do weird things that don't get saved back the same way (e.g. what if you edit a .pd file to put non-backslashed dollars in it?) That #X obj has this extra evaluation level compared to #X msg and others, is not necessarily bad nor uncommon. The LISP languages generally have that: there are a number of so-called special-forms in which arguments are not evaluated, and some others in which only some arguments are evaluated. This is how 'foo is a shortcut for (quote foo) in which the argument of quote is not evaluated. In theory, you only really need that one special-form in such a language, but the inventors of this figured out that it was annoying to have to have only one special-form because it needs too many apostrophes all over the place. In the end, though, inventors of various LISP dialects could not agree on how many special-forms there should be. (Macros allow the user to define its own things that look like special-forms, but because of their evaluation order, it also allows bypassing any non-evaluation too) In Tcl, which is a distant cousin of LISP, things are different. Instead, there is an extra level of syntax because all lists are assumed to be quoted, a first parsing handles only { } \{ \} and a second parsing handles $ \$ [ ] \[ \] ... not counting the [expr] calls, which are a third level of parsing and happens quite often because it's explicit in [if] [while] etc. The avoidance of having some kind of evaluation at the first level of parsing makes it necessary to have the second level. My point is that it's a tradeoff in the design of languages. If you remove complexity in one way, it reappears in another way if the complexity is necessary. So, what could have Pd done differently? Perhaps two things: 1. Avoid the substitution in the first evaluation, so that most backslashes aren't needed in the file format. 2. Use a different character for substitution in messageboxes, so that message arguments are substituted using # or whatever (that's a second level of parsing because # is not recognised at the first parsing level; or would it??). But this makes people want to use $ to access abstraction-args directly in it, and if that feature is considered as a good thing, then you still need to either skip substitution in #X msg by opposition to #X obj, or add another level of backslashes in msg. (But that's all very hypothetical and nothing of that will change in pd) I ran into this problem implementing PotatoData (basically a proof of concept, it's a Pd patch interpreter written in Lua with minimal amounts of C for DSP, can run some trivial audio patches) a couple of months ago, and just ducked it completely - message boxes in my implementation don't support dollars at all (nor commas or semicolons for sequencing and redirection, but that's a separate issue). I wish message boxes had used a different special character, it would have made life much much easier. I don't think it's a big deal. There are much more difficult things than that, that you have to do to make a good interpreter and/or compiler. It's just a bit confusing and somewhat easy to get wrong if you don't put all of your attention in it, but if pd were different, this set of problems would be replaced by another set of problems. It's a mess. There are two similar concepts at work: 1. replacing dollars with arguments at patch execution time 2. replacing dollars with arguments at message passing time There are three of them. 0. replacing dollars when loading patch (not normally used) 1. replacing dollars when loading #X obj 2. replacing dollars when message is sent to a #X msg box The confusion arises partly because when Pd loads a patch, it's really internally passing messages around. That's why level 0 is there. It's never used by normal patches, yet it makes it necessary to add extra backslashes everywhere. Perhaps all this Pd parsing process is more difficult because it is not so well documented (or the documentation has been forgotten
Re: [PD] here I go again..dynamic abstractions
On Sat, 7 Feb 2009, Frank Barknecht wrote: Messages don't have anything comparable to the canvas' $0. A possible alternative use for $0 in messages would be the selector (list, symbol, ...) as that is the thing before $1, but implementing that could be even more confusing to beginners. Why would that be confusing to beginners? _ _ __ ___ _ _ _ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
On Mon, 9 Feb 2009, zmoel...@iem.at wrote: i think it is simple, if the users understand the philosophical idea behind $args in message-boxes vs objects. hence my long explanations. once you understand what you are doing, it becomes quite simple to make Pd what you want (and why it does make sense the way it is done) Even after understanding that contents of objectboxes are just messages, it doesn't necessarily make much more sense, as you could have had completely different messageboxes in pd while still considering contents of objectboxes to be just messages. But it does make a lot more sense if we don't think about how else it could have been and instead just accept it as it is... (which may include working around it and not using messageboxes anymore). _ _ __ ___ _ _ _ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Hallo, Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote: On Sat, 7 Feb 2009, Frank Barknecht wrote: Messages don't have anything comparable to the canvas' $0. A possible alternative use for $0 in messages would be the selector (list, symbol, ...) as that is the thing before $1, but implementing that could be even more confusing to beginners. Why would that be confusing to beginners? Because it's not the $0 from object boxes. Ciao -- Frank ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
On Tue, 10 Feb 2009, Frank Barknecht wrote: Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote: On Sat, 7 Feb 2009, Frank Barknecht wrote: Messages don't have anything comparable to the canvas' $0. A possible alternative use for $0 in messages would be the selector (list, symbol, ...) as that is the thing before $1, but implementing that could be even more confusing to beginners. Why would that be confusing to beginners? Because it's not the $0 from object boxes. Ok. That was my impression too. As Johannes was saying, $0 in objectboxes could have been referring to the name of the abstraction (as it was located in the first place). That would have made it much more sensible to have that $0 in messageboxes. _ _ __ ___ _ _ _ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
There is already [route] to get the selectors bang, symbol, list, float and only 'other'. But it would be nice to have something like this : [33 hello -4.5 world( | [$0( | [print] and get print: list not 0 as now or [open mytext.txt 45( | [$0( | [print] and get print: open not 0 as now (and nor 'other' as does [route]) So the first element is $0, the second is $1, etc. I think it is not so difficult to understand for a beginner because it's logical. We must explain that [33 hello 4.5 world( is a list without the word list in the message because the message begin by a number and has several elements : it is the same [list 33 hello 4.5 world(. Idem for float. What do you think ? ++ Jack Le 10 févr. 09 à 17:45, Mathieu Bouchard a écrit : On Sat, 7 Feb 2009, Frank Barknecht wrote: Messages don't have anything comparable to the canvas' $0. A possible alternative use for $0 in messages would be the selector (list, symbol, ...) as that is the thing before $1, but implementing that could be even more confusing to beginners. Why would that be confusing to beginners? _ _ __ ___ _ _ _ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/ listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
On Tue, Feb 10, 2009 at 11:57:06AM -0500, Mathieu Bouchard wrote: But it does make a lot more sense if we don't think about how else it could have been and instead just accept it as it is... the winter sunshine, cold hands connecting boxes; Pd crashed again. [bang(/[until], Chris. --- http://mccormick.cx ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Frank Barknecht wrote: Hallo, Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote: On Sat, 7 Feb 2009, Frank Barknecht wrote: Messages don't have anything comparable to the canvas' $0. I missed this the first time it went by, and I think it's central to (my) confusion about this... Messages don't have anything comparable to the canvas' $0, but *message boxes do*! Why, therefore, is $0 not valid in a message box (as a way of embedding the canvas-identifier into a message), and further, why are people going so far as to suggest new, orthogonal meanings for $0 in a message box? Please, don't do this; it would only make the situation much more confusing! Arrgh! Phil A possible alternative use for $0 in messages would be the selector (list, symbol, ...) as that is the thing before $1, but implementing that could be even more confusing to beginners. Why would that be confusing to beginners? Because it's not the $0 from object boxes. Ciao ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
From: Frank Barknecht f...@footils.org [1] Actually the $-variables 1,2,3,... in message boxes and those in object boxes aren't that different, because the contents of object boxes also are messages to Pd's objectmaker and they are used explicitely as messages when doing dynamic patching. Yes, this is the case -- and probably one of the more elegant parts of Pd -- but I still think this has less to do with Pd as an expressive language and more to do with how it's implemented. Even so, I think that a message box is not a message, any more than a message to objectmaker is an object; either way the $ values mean something different in each context -- in the messages to objectmaker they ultimately function more like environment variables or script arguments, where in message boxes they're a little more like substitution placeholders in something like a macro or a sed command. I think the current $0 meaning is consistent with this interpretation. I think my argument might be somewhat different if dynamic patching were fully supported with an official API - a huge step would be the ability to destroy individual objects with messages (can you?)... Matt ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
On Wed, 11 Feb 2009, Chris McCormick wrote: the winter sunshine, cold hands connecting boxes; Pd crashed again. [bang(/[until], #N canvas 599 200 450 300 10; #X obj 30 49 t a; #X obj 0 0 loadbang; #X obj 0 19 t a a; #X connect 0 0 2 0; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 2 1 0 0; _ _ __ ___ _ _ _ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Jack wrote: What do you think ? s this is basically what frank has been suggesting and what matju and me have kind-of supported. it would have been good if it was like that in the first place. the rest frank, matju and me have written about it is, that it would be a bad idea to add this to Pd as it is now. it would make $0 be even more complicated to understand. mfgads.r IOhanne PS: apologies to frank and matju if they do not agree and i made them look like ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Hallo, Georg Werner hat gesagt: // Georg Werner wrote: i mean message boxes. i think there is the misunderstanding. you dont send $1 as a message, too. not as message nor creation argument. its an expanded string inside an object or when it leaves a messagebox. $0 is just an abstraction counter shifted by 1000. How about making $0 in messages be a message counter? ;-) Ciao -- Frank BarknechtDo You RjDj.me? _ __footils.org__ ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Quoting Georg Werner ge...@fricklr.de: Hi, i mean message boxes. i think there is the misunderstanding. you dont send $1 as a message, too. not as message nor creation argument. ok. i am only trying to explain why it is like it is without resorting to implementation-issues, but instead based on a more conceptual basis (which i don't have any guarantee to be true, since i have not designed the system; this is my view of the world i have come up with after a long time of paptching) to reiterate: a message-box works only on messages. a message-box is only a way to freeze a message in time (it's hard to patch messages that only exist in an instant of time otherwise). it is concerned only with messages! $-args in message-boxes are a way to modify messages. since messages don't have a patch-context, neither have (their patchable instances) message-boxes. mfgasd IOhannes This message was sent using IMP, the Internet Messaging Program. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
hi, Frank Barknecht: How about making $0 in messages be a message counter? if somebody really needs that - i dont ;) ok, i give up. i think we are on a rather philosophical point now. but i had a lot of times when students where asking why they have to write [f $0]-[foobar $1( instead of [foobar $0(. so this came up from a users point of view. after getting all your input (thanks). i think Claude brought up the most logical solution, because this makes the different functions of $ obvious and obsolete. And it would help users and devs. (i know it will be a long way - cause it will break some patches ... :( ) $ in message boxes is unfortunate. If there was a different symbol, perhaps #, you could combine both phases in one object box to avoid jumping through pointless hoops. [$0-#1-$2-#3( would be nice, but as Pd is now, it's a nightmare. not a nightmare, but this is one point why Pd is harder to learn for beginners than it has to. georg ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Quoting Georg Werner ge...@fricklr.de: hi, Frank Barknecht: How about making $0 in messages be a message counter? if somebody really needs that - i dont ;) ok, i give up. i think we are on a rather philosophical point now. yes, that's m point but i had a lot of times when students where asking why they have to write [f $0]-[foobar $1( instead of [foobar $0(. so this came up from a users point of view. i think it is simple, if the users understand the philosophical idea behind $args in message-boxes vs objects. hence my long explanations. once you understand what you are doing, it becomes quite simple to make Pd what you want (and why it does make sense the way it is done) fgmasdra IOhannes This message was sent using IMP, the Internet Messaging Program. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
[f $0]-[message $1( is conceptually different from [message $0( for the same reason that [f $2]-[message $1( is conceptually different from [message $2( (and would be, even if $0 had any meaning in a message box). When I teach I always start with dollar-sign expansion in message-boxes, since it's simpler and easier to comprehend. Then when this issue comes up when they move to dollar-sign expansion in abstractions (and it always does come up), you can help them think it through with what they already know about message boxes. I only see two options: one is to use a different dereference symbol for abstraction arguments in message boxes -- but why worry with that since it's easy enough to get abstraction arguments into messages at run-time? -- the other is to make an exception and have special behavior for $0 in message boxes (that is, make it the same as in object boxes) -- but then this probably breaks the consistency of the language. Matt Date: Mon, 09 Feb 2009 13:33:36 +0100 From: Georg Werner ge...@fricklr.de Subject: Re: [PD] here I go again..dynamic abstractions To: pd-list@iem.at Message-ID: 499022a0.7080...@fricklr.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed hi, Frank Barknecht: How about making $0 in messages be a message counter? if somebody really needs that - i dont ;) ok, i give up. i think we are on a rather philosophical point now. but i had a lot of times when students where asking why they have to write [f $0]-[foobar $1( instead of [foobar $0(. so this came up from a users point of view. after getting all your input (thanks). i think Claude brought up the most logical solution, because this makes the different functions of $ obvious and obsolete. And it would help users and devs. (i know it will be a long way - cause it will break some patches ... :( ) $ in message boxes is unfortunate. If there was a different symbol, perhaps #, you could combine both phases in one object box to avoid jumping through pointless hoops. [$0-#1-$2-#3( would be nice, but as Pd is now, it's a nightmare. not a nightmare, but this is one point why Pd is harder to learn for beginners than it has to. georg ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
I think it would make sense (both pedagogically and practically) if $0 in message boxes actually _did_ something. Incrementing per message box would be one option, but expanding to a user-defined symbol or float could be very useful: [loadbang] | [f $0] | [; set $0( That way, message box $0 is set by an incoming message: it then sets all current (and future) message box $0's for the patch/abstraction. Alternatively, you could use it for other stuff, like a substitution for pd-my-complicated-and-tiresome-to-type-subpatch-name. abstraction $0: set by pd, unique abs instance identifier, common to all object boxes message box $0: set by user through msg box, common to all abstraction instance msg's Seems like that would be consistent with the language as far as I understand it. -Jonathan --- On Mon, 2/9/09, Matt Barber brbrof...@gmail.com wrote: From: Matt Barber brbrof...@gmail.com Subject: Re: [PD] here I go again..dynamic abstractions To: PD-List pd-list@iem.at Date: Monday, February 9, 2009, 9:01 PM [f $0]-[message $1( is conceptually different from [message $0( for the same reason that [f $2]-[message $1( is conceptually different from [message $2( (and would be, even if $0 had any meaning in a message box). When I teach I always start with dollar-sign expansion in message-boxes, since it's simpler and easier to comprehend. Then when this issue comes up when they move to dollar-sign expansion in abstractions (and it always does come up), you can help them think it through with what they already know about message boxes. I only see two options: one is to use a different dereference symbol for abstraction arguments in message boxes -- but why worry with that since it's easy enough to get abstraction arguments into messages at run-time? -- the other is to make an exception and have special behavior for $0 in message boxes (that is, make it the same as in object boxes) -- but then this probably breaks the consistency of the language. Matt Date: Mon, 09 Feb 2009 13:33:36 +0100 From: Georg Werner ge...@fricklr.de Subject: Re: [PD] here I go again..dynamic abstractions To: pd-list@iem.at Message-ID: 499022a0.7080...@fricklr.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed hi, Frank Barknecht: How about making $0 in messages be a message counter? if somebody really needs that - i dont ;) ok, i give up. i think we are on a rather philosophical point now. but i had a lot of times when students where asking why they have to write [f $0]-[foobar $1( instead of [foobar $0(. so this came up from a users point of view. after getting all your input (thanks). i think Claude brought up the most logical solution, because this makes the different functions of $ obvious and obsolete. And it would help users and devs. (i know it will be a long way - cause it will break some patches ... :( ) $ in message boxes is unfortunate. If there was a different symbol, perhaps #, you could combine both phases in one object box to avoid jumping through pointless hoops. [$0-#1-$2-#3( would be nice, but as Pd is now, it's a nightmare. not a nightmare, but this is one point why Pd is harder to learn for beginners than it has to. georg ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Oops, I screwed up that ascii art patch. It should be more like this: [loadbang] | [f $0] | [; set dollarzero $1( -Jonathan --- On Mon, 2/9/09, Matt Barber brbrof...@gmail.com wrote: From: Matt Barber brbrof...@gmail.com Subject: Re: [PD] here I go again..dynamic abstractions To: PD-List pd-list@iem.at Date: Monday, February 9, 2009, 9:01 PM [f $0]-[message $1( is conceptually different from [message $0( for the same reason that [f $2]-[message $1( is conceptually different from [message $2( (and would be, even if $0 had any meaning in a message box). When I teach I always start with dollar-sign expansion in message-boxes, since it's simpler and easier to comprehend. Then when this issue comes up when they move to dollar-sign expansion in abstractions (and it always does come up), you can help them think it through with what they already know about message boxes. I only see two options: one is to use a different dereference symbol for abstraction arguments in message boxes -- but why worry with that since it's easy enough to get abstraction arguments into messages at run-time? -- the other is to make an exception and have special behavior for $0 in message boxes (that is, make it the same as in object boxes) -- but then this probably breaks the consistency of the language. Matt Date: Mon, 09 Feb 2009 13:33:36 +0100 From: Georg Werner ge...@fricklr.de Subject: Re: [PD] here I go again..dynamic abstractions To: pd-list@iem.at Message-ID: 499022a0.7080...@fricklr.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed hi, Frank Barknecht: How about making $0 in messages be a message counter? if somebody really needs that - i dont ;) ok, i give up. i think we are on a rather philosophical point now. but i had a lot of times when students where asking why they have to write [f $0]-[foobar $1( instead of [foobar $0(. so this came up from a users point of view. after getting all your input (thanks). i think Claude brought up the most logical solution, because this makes the different functions of $ obvious and obsolete. And it would help users and devs. (i know it will be a long way - cause it will break some patches ... :( ) $ in message boxes is unfortunate. If there was a different symbol, perhaps #, you could combine both phases in one object box to avoid jumping through pointless hoops. [$0-#1-$2-#3( would be nice, but as Pd is now, it's a nightmare. not a nightmare, but this is one point why Pd is harder to learn for beginners than it has to. georg ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
On Mon, Feb 9, 2009 at 3:45 PM, Jonathan Wilkes jancs...@yahoo.com wrote: I think it would make sense (both pedagogically and practically) if $0 in message boxes actually _did_ something. Incrementing per message box would be one option, but expanding to a user-defined symbol or float could be very useful: Actually, for me, I always think of the word CONTEXT. An abstraction is one context, and the meanings of the $ args means one thing. While in a message, a $ arg means something completely different. Once I realized that the two are not the same thing, it made sense. If the $ args had the same meanings in both an abstraction and a message, there would be no way to create a message inside of an abstraction that allowed for $ args that were unrelated to the $ args in the abstraction. In other words, if they were the same thing, there would be no way to create a variable message that had more args than there were in the abstraction itself. Mike [loadbang] | [f $0] | [; set $0( That way, message box $0 is set by an incoming message: it then sets all current (and future) message box $0's for the patch/abstraction. Alternatively, you could use it for other stuff, like a substitution for pd-my-complicated-and-tiresome-to-type-subpatch-name. abstraction $0: set by pd, unique abs instance identifier, common to all object boxes message box $0: set by user through msg box, common to all abstraction instance msg's Seems like that would be consistent with the language as far as I understand it. -Jonathan --- On Mon, 2/9/09, Matt Barber brbrof...@gmail.com wrote: From: Matt Barber brbrof...@gmail.com Subject: Re: [PD] here I go again..dynamic abstractions To: PD-List pd-list@iem.at Date: Monday, February 9, 2009, 9:01 PM [f $0]-[message $1( is conceptually different from [message $0( for the same reason that [f $2]-[message $1( is conceptually different from [message $2( (and would be, even if $0 had any meaning in a message box). When I teach I always start with dollar-sign expansion in message-boxes, since it's simpler and easier to comprehend. Then when this issue comes up when they move to dollar-sign expansion in abstractions (and it always does come up), you can help them think it through with what they already know about message boxes. I only see two options: one is to use a different dereference symbol for abstraction arguments in message boxes -- but why worry with that since it's easy enough to get abstraction arguments into messages at run-time? -- the other is to make an exception and have special behavior for $0 in message boxes (that is, make it the same as in object boxes) -- but then this probably breaks the consistency of the language. Matt Date: Mon, 09 Feb 2009 13:33:36 +0100 From: Georg Werner ge...@fricklr.de Subject: Re: [PD] here I go again..dynamic abstractions To: pd-list@iem.at Message-ID: 499022a0.7080...@fricklr.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed hi, Frank Barknecht: How about making $0 in messages be a message counter? if somebody really needs that - i dont ;) ok, i give up. i think we are on a rather philosophical point now. but i had a lot of times when students where asking why they have to write [f $0]-[foobar $1( instead of [foobar $0(. so this came up from a users point of view. after getting all your input (thanks). i think Claude brought up the most logical solution, because this makes the different functions of $ obvious and obsolete. And it would help users and devs. (i know it will be a long way - cause it will break some patches ... :( ) $ in message boxes is unfortunate. If there was a different symbol, perhaps #, you could combine both phases in one object box to avoid jumping through pointless hoops. [$0-#1-$2-#3( would be nice, but as Pd is now, it's a nightmare. not a nightmare, but this is one point why Pd is harder to learn for beginners than it has to. georg ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list -- Garry Shandling - I'm dating a woman now who, evidently, is unaware of it. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
This has been an interesting discussion about the philosophy behind dollar-sign symbols in Pd, but it seems to me like most participants are talking around Georg's original point at the head of the thread: it's inconvenient to get $0 (the unique-id-for-this-abstraction value) into a message, and its exclusion from message boxes seems arbitrary. Why arbitrary? It's very clear that dollar symbols mean different things in messages than they do in abstractions -- that is not the issue. In fact, $0 is a special case *when used as an abstraction parameter* as well -- it does not have anything close to the same meaning or function as $1, $2, etc. (i.e., initialization parameters). Yet, it is still allowed in abstractions. Why does the same reasoning not hold for message boxes? It is a perfectly valid use-case to send an abstraction-id (from the message's containing abstraction) in a message. This whole question might have been avoided if $0 did not start with a dollar sign (I think someone mentioned this already). But just because it does, why is it excluded from message boxes? At least one other response in this thread has gone so far as to suggest that since $0 doesn't have any meaning in a message box, it should be overloaded for something else (other than the unique abstraction identifier). No, please! :-) Despite all the discussion in this thread, I have yet to see a reason for this exclusion that wouldn't apply equally to using $0 as an abstraction-id. Phil Stone pkstonemusic.com Mike McGonagle wrote: On Mon, Feb 9, 2009 at 3:45 PM, Jonathan Wilkes jancs...@yahoo.com wrote: I think it would make sense (both pedagogically and practically) if $0 in message boxes actually _did_ something. Incrementing per message box would be one option, but expanding to a user-defined symbol or float could be very useful: Actually, for me, I always think of the word CONTEXT. An abstraction is one context, and the meanings of the $ args means one thing. While in a message, a $ arg means something completely different. Once I realized that the two are not the same thing, it made sense. If the $ args had the same meanings in both an abstraction and a message, there would be no way to create a message inside of an abstraction that allowed for $ args that were unrelated to the $ args in the abstraction. In other words, if they were the same thing, there would be no way to create a variable message that had more args than there were in the abstraction itself. Mike [loadbang] | [f $0] | [; set $0( That way, message box $0 is set by an incoming message: it then sets all current (and future) message box $0's for the patch/abstraction. Alternatively, you could use it for other stuff, like a substitution for pd-my-complicated-and-tiresome-to-type-subpatch-name. abstraction $0: set by pd, unique abs instance identifier, common to all object boxes message box $0: set by user through msg box, common to all abstraction instance msg's Seems like that would be consistent with the language as far as I understand it. -Jonathan --- On Mon, 2/9/09, Matt Barber brbrof...@gmail.com wrote: From: Matt Barber brbrof...@gmail.com Subject: Re: [PD] here I go again..dynamic abstractions To: PD-List pd-list@iem.at Date: Monday, February 9, 2009, 9:01 PM [f $0]-[message $1( is conceptually different from [message $0( for the same reason that [f $2]-[message $1( is conceptually different from [message $2( (and would be, even if $0 had any meaning in a message box). When I teach I always start with dollar-sign expansion in message-boxes, since it's simpler and easier to comprehend. Then when this issue comes up when they move to dollar-sign expansion in abstractions (and it always does come up), you can help them think it through with what they already know about message boxes. I only see two options: one is to use a different dereference symbol for abstraction arguments in message boxes -- but why worry with that since it's easy enough to get abstraction arguments into messages at run-time? -- the other is to make an exception and have special behavior for $0 in message boxes (that is, make it the same as in object boxes) -- but then this probably breaks the consistency of the language. Matt Date: Mon, 09 Feb 2009 13:33:36 +0100 From: Georg Werner ge...@fricklr.de Subject: Re: [PD] here I go again..dynamic abstractions To: pd-list@iem.at Message-ID: 499022a0.7080...@fricklr.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed hi, Frank Barknecht: How about making $0 in messages be a message counter? if somebody really needs that - i dont ;) ok, i give up. i think we are on a rather philosophical point now. but i had a lot of times when students where asking why they have
Re: [PD] here I go again..dynamic abstractions
On Mon, 9 Feb 2009, Frank Barknecht wrote: Georg Werner hat gesagt: // Georg Werner wrote: i mean message boxes. i think there is the misunderstanding. you dont send $1 as a message, too. not as message nor creation argument. its an expanded string inside an object or when it leaves a messagebox. $0 is just an abstraction counter shifted by 1000. How about making $0 in messages be a message counter? If it were just a side-effect of the logical similarity between messages and objects, it would be fine, but otherwise, messages are too transient for this to have any meaning, so I wouldn't bother with writing any code to support that. _ _ __ ___ _ _ _ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Hi, i mean message boxes. i think there is the misunderstanding. you dont send $1 as a message, too. not as message nor creation argument. its an expanded string inside an object or when it leaves a messagebox. georg IOhannes m zmoelnig schrieb: On Fri, Feb 06, 2009 at 11:08:05PM +0100, Georg Werner wrote: hi, can somebody explain why there is a 3rd rule of $-expansion: 'there is no $0 in message-boxes'. i stumble every now and then about it and it is IMHO not self-explanatory. it is not hard to implement and wouldn't make problems with existing patches - because $0 is never used in messages. and would make things easier not only for beginners. please explain what $0 in messages would mean to you. (note that i say message not message-box here). if a message is just a context-free .. message, then it cannot have a notion of $0. a message-box is just a way to write down a message. mga.sdr IOhannes just my 2 cents. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Hallo, Georg Werner hat gesagt: // Georg Werner wrote: can somebody explain why there is a 3rd rule of $-expansion: 'there is no $0 in message-boxes'. i stumble every now and then about it and it is IMHO not self-explanatory. it is not hard to implement and wouldn't make problems with existing patches - because $0 is never used in messages. and would make things easier not only for beginners. Actually this topic is discussed about once or twice a year on pd-list and pd-dev, so for deeper info check the archive. Anyway: $0 is a property of the surrounding abstraction or canvas, as are $1,... in object arguments. The $1,... in message boxes however are properties of the messages sent around and reaching a message box. While the value of dollar variable in message boxes changes all the time, the value of the canvas-dollars never change. Messages don't have anything comparable to the canvas' $0. A possible alternative use for $0 in messages would be the selector (list, symbol, ...) as that is the thing before $1, but implementing that could be even more confusing to beginners. Ciao -- Frank BarknechtDo You RjDj.me? _ __footils.org__ ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Rory Walsh wrote: Thanks IOhannes. I'll be happy soon I feel. If I understand correctly, by changing the names of the GUI's receive symbol to $0-tgl-1 and then using that symbol of '$0-tgl-1' as a send everything should be hunky-dory? I'm afraid it's still not working as I expect, I get a load of error: 0-tgl-1: no such object whenever I try to send a message with that symbol. I've attached an updated abstraction. If I can get this to work its going to really simplify my crazy abstraction. you are violating the 3rd rule of $-expansion: there is no $0 in message-boxes. furthermore: why do you need to _send_ things like color? just connecting the color message to the [bng] would be so much easier. fgmasdr IOhannes smime.p7s Description: S/MIME Cryptographic Signature ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
On Fri, Feb 06, 2009 at 10:51:38AM +0100, IOhannes m zmoelnig wrote: Rory Walsh wrote: Thanks IOhannes. I'll be happy soon I feel. If I understand correctly, by changing the names of the GUI's receive symbol to $0-tgl-1 and then using that symbol of '$0-tgl-1' as a send everything should be hunky-dory? I'm afraid it's still not working as I expect, I get a load of error: 0-tgl-1: no such object whenever I try to send a message with that symbol. I've attached an updated abstraction. If I can get this to work its going to really simplify my crazy abstraction. you are violating the 3rd rule of $-expansion: there is no $0 in message-boxes. Just to be a bit more verbose than IOhannes: if you need to get a $0 into a message box, you need to use $1 and a regular object box with $0 before it like this: [bang( | [$0] | [$1-hello my message( Best, Chris. --- http://mccormick.cx ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
hi, can somebody explain why there is a 3rd rule of $-expansion: 'there is no $0 in message-boxes'. i stumble every now and then about it and it is IMHO not self-explanatory. it is not hard to implement and wouldn't make problems with existing patches - because $0 is never used in messages. and would make things easier not only for beginners. just my 2 cents. georg Chris McCormick schrieb: On Fri, Feb 06, 2009 at 10:51:38AM +0100, IOhannes m zmoelnig wrote: Rory Walsh wrote: Thanks IOhannes. I'll be happy soon I feel. If I understand correctly, by changing the names of the GUI's receive symbol to $0-tgl-1 and then using that symbol of '$0-tgl-1' as a send everything should be hunky-dory? I'm afraid it's still not working as I expect, I get a load of error: 0-tgl-1: no such object whenever I try to send a message with that symbol. I've attached an updated abstraction. If I can get this to work its going to really simplify my crazy abstraction. you are violating the 3rd rule of $-expansion: there is no $0 in message-boxes. Just to be a bit more verbose than IOhannes: if you need to get a $0 into a message box, you need to use $1 and a regular object box with $0 before it like this: [bang( | [$0] | [$1-hello my message( Best, Chris. --- http://mccormick.cx ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Georg Werner wrote: hi, Hi Georg, can somebody explain why there is a 3rd rule of $-expansion: 'there is no $0 in message-boxes'. The following is from an implementor's viewpoint, not a user's viewpoint, so be warned :) I don't know why, but it makes parsing Pd patches 1000x less straightforward than required (you need a two-phase parser that has a special exception to detect message boxes and not expand dollars, allowing the message box objects to parse them itself later, while expanding dollars for everything else). I ran into this problem implementing PotatoData (basically a proof of concept, it's a Pd patch interpreter written in Lua with minimal amounts of C for DSP, can run some trivial audio patches) a couple of months ago, and just ducked it completely - message boxes in my implementation don't support dollars at all (nor commas or semicolons for sequencing and redirection, but that's a separate issue). I wish message boxes had used a different special character, it would have made life much much easier. i stumble every now and then about it and it is IMHO not self-explanatory. It's a mess. There are two similar concepts at work: 1. replacing dollars with arguments at patch execution time 2. replacing dollars with arguments at message passing time But they both use the same $ symbol syntax in Pd, so you can't have both taking place (ie, use $ at patch execution to create a message box that has $ to replace at dataflow time). And $0 is in phase 1, so what should a message box do with $0 in phase 2? The confusion arises partly because when Pd loads a patch, it's really internally passing messages around. $ in message boxes is unfortunate. If there was a different symbol, perhaps #, you could combine both phases in one object box to avoid jumping through pointless hoops. [$0-#1-$2-#3( would be nice, but as Pd is now, it's a nightmare. Claude -- http://claudiusmaximus.goto10.org ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Hi Claude, thanks for your explanation - i got your point, but this 2-phase parser is (must have been) already implemented in Pd. So, where do you see a problem in expanding/replacing $0 in Phase 2 - like $1 etc. (with that special fixed value)? georg Claude Heiland-Allen schrieb: Georg Werner wrote: hi, Hi Georg, can somebody explain why there is a 3rd rule of $-expansion: 'there is no $0 in message-boxes'. The following is from an implementor's viewpoint, not a user's viewpoint, so be warned :) I don't know why, but it makes parsing Pd patches 1000x less straightforward than required (you need a two-phase parser that has a special exception to detect message boxes and not expand dollars, allowing the message box objects to parse them itself later, while expanding dollars for everything else). I ran into this problem implementing PotatoData (basically a proof of concept, it's a Pd patch interpreter written in Lua with minimal amounts of C for DSP, can run some trivial audio patches) a couple of months ago, and just ducked it completely - message boxes in my implementation don't support dollars at all (nor commas or semicolons for sequencing and redirection, but that's a separate issue). I wish message boxes had used a different special character, it would have made life much much easier. i stumble every now and then about it and it is IMHO not self-explanatory. It's a mess. There are two similar concepts at work: 1. replacing dollars with arguments at patch execution time 2. replacing dollars with arguments at message passing time But they both use the same $ symbol syntax in Pd, so you can't have both taking place (ie, use $ at patch execution to create a message box that has $ to replace at dataflow time). And $0 is in phase 1, so what should a message box do with $0 in phase 2? The confusion arises partly because when Pd loads a patch, it's really internally passing messages around. $ in message boxes is unfortunate. If there was a different symbol, perhaps #, you could combine both phases in one object box to avoid jumping through pointless hoops. [$0-#1-$2-#3( would be nice, but as Pd is now, it's a nightmare. Claude ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] here I go again..dynamic abstractions
I keep running into problem with an abstraction I'm trying to implement. Let me first explain what I'm trying to do. I have an abstraction that has 16 tgls in a row. These are graphed on parent so they they can be altered from the main patch. When a user clicks on of the tgls it changes colour. This was all going fine until I created another instance of the same abstraction and found that clicking one of the tgls in one abstraction caused the other ones to change colour. This seems reasonable as they all share the same receive symbols. Then I set about having each tgls receive symbol change on instantiation. This too seemed to be working fine until I opened the whole patch again and found that the GUI objects most recent receive symbol is saved to them so every time I change one and close the patch I need to know what it was in order to change it dynamically on the next startup. I could simply hard code each abstraction but I may need up to thirty of them in one patch so this seems a little futile. There must a way of doing it? I've attached the a basic version of the abstraction. All you need to do is to instantiate it and pass a number box to it. It will work fine with many instances but as soon as I save and close Pd crashes the next time I save the parent patch. As I'm only getting back into Pd I'm sure I've implemented it badly. Perhaps someone could offer some advise on how to achieve what I want. Thanks for your patience with this. regards, Rory. #N canvas 354 114 926 648 10; #X obj -172 170 symbol \$1; #X msg -168 205 list \$1; #X obj -104 201 symbol; #X obj -162 268 pack s s f f f; #X msg -11 217 12; #X msg 27 216 22; #X obj -166 364 list trim; #X msg 121 218 set; #X obj -52 141 t b b b b b b; #X msg 59 217 addsemi; #X msg -97 175 color; #X obj -163 341 list prepend add2; #X msg 14 437 \; color 0 12 22; #X obj -51 85 loadbang; #X obj -97 62 inlet; #X floatatom -44 206 5 0 0 0 - - -; #X obj 19 72 loadbang; #X msg 24 104 44; #X obj -116 92 t b b f; #X obj 228 225 symbol \$1; #X msg 232 258 list \$1; #X obj 226 184 loadbang; #X obj 223 206 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X msg 236 355 \; obj_rec1 receive \$1; #X obj 147 121 bng 35 250 50 0 empty obj_rec1 empty 17 7 0 10 -262144 -1 -1; #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 2 0 3 1; #X connect 3 0 11 0; #X connect 4 0 3 3; #X connect 5 0 3 4; #X connect 6 0 12 0; #X connect 7 0 12 0; #X connect 8 0 0 0; #X connect 8 1 10 0; #X connect 8 2 15 0; #X connect 8 3 5 0; #X connect 8 3 4 0; #X connect 8 4 9 0; #X connect 8 5 7 0; #X connect 9 0 12 0; #X connect 10 0 2 0; #X connect 11 0 6 0; #X connect 13 0 8 0; #X connect 14 0 18 0; #X connect 15 0 3 2; #X connect 16 0 17 0; #X connect 17 0 15 0; #X connect 18 0 12 0; #X connect 18 1 8 0; #X connect 18 2 15 0; #X connect 19 0 20 0; #X connect 20 0 23 0; #X connect 21 0 22 0; #X connect 22 0 19 0; #X coords 0 -1 1 1 85 60 1 100 100; ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] here I go again..dynamic abstractions
Rory Walsh wrote: [...] read about $0. it does exactly what you want without having to dynamically change anything. just use $0-tgl-1 as a send/receive name in each abstractions and be happy. fgmadsr IOhannes smime.p7s Description: S/MIME Cryptographic Signature ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list