Is this a bug?
@Bangflip Sort of...... but we are not allowed to call it that.
Messages that start with a float (number) and have more items than one are automatically treated as lists.
But if the first item is text then it is dropped by a [$1 $2 etc.( message, and that puts your $3 out of range.
You can fix that by setting the message explicitly as a list.....
[list two 1 3( will work.
When a message starts with a "text" that text is treated as a selector for routing the rest of the list.
But list is also a selector..... it gets complicated.
We cannot call it a bug because the selector processing is so fundamental to almost every patch ever made that it cannot be changed...... patches made prior to such a massive change would be broken.
There is a thread about it here....... https://forum.pdpatchrepo.info/topic/13636/route-asymbol-doesn-t-match-tagged-symbols
The thread includes some example patches.
"list" has issues too though.
And things get worse when using [route] and [select].
........... pd-selector.pd
Also, if you are (might be?) unsure about global and local variables in Pd ($ dollars) then read this...... https://forum.pdpatchrepo.info/topic/9774/pure-data-noob/4
And make sure you understand the order of operations........ https://forum.pdpatchrepo.info/topic/13320/welcome-to-the-forum
David.
How to match two symbols
would use their own selectors and that selectors would be a thing, but they are not and it does not help in any way
Selectors are used all the time. Every method - apart from float, symbol and pointer methods - starts with a selector. For example, if you send
[set foo(
to [tabwrite]
, set
is the selector.
How to match two symbols
Clearly, the idea behind the design was that people would use their own selectors and that selectors would be a thing, but they are not and it does not help in any way, but now it is too late and we can just cry about it. Or laugh.
How to match two symbols
The whole selector system is flawed, but [route], when not used with special selectors, works just on the selectors, as it is described in the help file.
Pd would be so much better if just
- 5 was a float (as it is),
- abc was a symbol,
- a b c was a list
and that would be all.
But it is what it is and we have to live with it or build a better system.
Although it is awkward sometimes, it is still possible to do everything that is needed with what we have.
How to express speedlim in messages?
@whale-av Woah, I didn't even think to test bang, but my patch works with bang anyway! Bullet dodged....BUT it adds the "symbol" selector to symbols if they are delayed (and the "list" selector to lists of symbols if they are delayed). That goes away if I use [list trim] after the list object. Why would [list trim] remove the "symbol" selector? No mention of that in the help file.
Note to self: remember this message box technique
<apologies to @ddw_music for hijacking topic/>
[route aSymbol] doesn't match tagged symbols?
@ingox said:
My opinion is that the whole selector system is dubious. [abc( should just be a symbol.
Yes. "all" is not special...... it is just that any single atom text is treated as text unless tagged as a symbol. A great source of confusion and changing that would be good.......
But it is not special....... it will trigger a bang through [route all] just like any other single atom text...... but will not trigger [sel all].
At the moment a single atom text will [route] and produce a bang........ but for it to trigger [select] it must first be tagged as a symbol........ crazy....
The other sources of problems can be that an automatically tagged list........ a list starting with a float..... can require a [list trim] before being passed on...... although for the user there is no indication that the message has had the list tag added.
And that a list of two symbols although routed correctly loses the symbol tag for the second atom when passing through [route] because it has become a singleton and reverted to text.... ...... That issue would also be addressed by your suggestion.
So yes....... a singleton text should be a symbol....... and can still be a selector that will trigger a bang.
Consistency between objects needs addressing and the selector system would be fixed I think.
And single atom text being a symbol might be all that is required, if any single atom is treated as a selector in the same way as any first atom is currently and [list] is made consistent between atom types.
We have had this discussion previously...... https://forum.pdpatchrepo.info/topic/12794/route-list-vs-array-problem/15
But nothing can actually be done without a serious plan....... we are wasting our time except when we document these anomalies.
The elephant in the room is the millions of patches already in existence.
If we can work out how to make the changes we would like....... without any changes to those existing patches being necessary..... then we will have a proposal for the list....
That might be possible........ but I think that the current inconsistency of the triggering of a bang will put a spanner in the works.
So maybe only alternative objects..... [routeNEW] [selectNEW] etc. would be possible while continuing with the old message system..
David.
retrieving parent patches saved location (like savestate)?
@RT-Chris If you want to integrate different abstractions you can also add another selector for each abstraction. Selectors can also be symbols, so you can just use the name of the abstraction. Then you can use the abstractions in different projects and it will still work.
retrieving parent patches saved location (like savestate)?
@RT-Chris Well the above is not the centralized approach.
Here is an example of a save mechanism that is controlled by the main patch:
It is much more simple. In the abstraction the data is prepended with selectors and on retrieval sorted via [route]. I think this principle would always be the way to go, although there are other ways to implement the mechanics. In addition there is a selector for the set, so different presets can be saved in the same file.
Since the abstractions are tagging their data themselves, this is quite flexible. Therefor the text search to see if the selectors are already in the file.
Purr Data 2.13.0 Released
Hi y'all,
Purr Data 2.13.0 is now available
Downloads:
https://git.purrdata.net/jwilkes/purr-data#downloads
Please report issues here:
https://git.purrdata.net/jwilkes/purr-data/-/issues
Changes
- ported Vanilla's [inlet~ fwd] argument (reimplemented to avoid stack allocation and various other problems) (Thanks to Guillem!)
- scrollbar fix for optimal zoom (Thanks Ico!)
- avoid null selectors in core where trivial to do so, gracefully handle and annotate them when/if they happen. Also added an experimental [debuginfo] object so we can output a message with a null selector (and other methods in the future good for testing)
- ported Vanilla patch for [pow~] handling negative samples in input
- ported [savestate] from Vanilla
- ported array, scalar "bang" methods
- add base argument and inlet for [log]
- add zcheckgetfn to m_pd.h for checking method signatures match before doing an end run around typedmess. This is used for the reimplementation of [inlet~ fwd]. (Thanks to Guillem for this)
- port and re-implement Vanilla's "#ffffff" syntax for setting iemgui colors. Additionally, support the "#fff" short syntax. We're not currently saving the symbol colors in the Pd file format, yet. A warning is printed about this since it means we're still storing the lossy color format. A future version will save the symbol colors, but we want to ship a few releases supporting the new syntax before making this breaking file format change.
- added "test-object" abstraction for doing more detailed testing of objects
- fixed bug where the box width was wrong when editing certain objects (thanks to Guillem)
- port "seed" method for [noise~]
- throttle canvas_motion (part 1 of 2 of getting rid of exponential explosion when moving selections)
- port [text] "sort" method
- when clicking an error link, bring the relevant object into the viewport and animate it to make it easy for the user to find
- add "-alsaadd" flag with pulse device for pulse support (Thanks to Sam!)
- fixed some alsa bugs
- ported from Vanilla: preserve phase in [clone] after [all( message, fixed a crasher
- expand and improve the type hints for errors with edge case atoms (null selectors, null symbols, "floatlike" symbol payloads, etc.)
- improvements to french translations (Thanks Joseph!)
- update pd-lua compatibility with Lua 5.4 (Thanks Albert!)
- port multi-step undo from Vanilla (Thanks Guillem!)
- initial touch support in GUI (Thanks Albert and spidercatnat!)
- zoom viewport fix (Thanks Albert!)
Purr Data 2.12.0 Released
Hi y'all,
Purr Data 2.12.0 is now available
Downloads:
https://git.purrdata.net/jwilkes/purr-data#downloads
Please report issues here:
https://git.purrdata.net/jwilkes/purr-data/-/issues
Changes
- vastly improved window sizing and scrollbar behavior. Now things like the help patches with content that fits in the viewport should load without scrollbars present. (thanks to Ico)
- show current text name (if any) in text editor for [text define]
- ported [text define] "send" method from Vanilla
- ported [text insert] from Vanilla
- ported [dac]/[adc] set method from Vanilla
- added French translation and improve German translation (thanks to Albert and Joseph Gastelais)
- ensure plot traces remain in the bounding box of the graph (thanks to Ico)
- ported "symbol" method for [float] from Vanilla
- added "type hints" for errors wrt unusual or problematic Pd messages. This includes
- symbol atom which would be parsed as a float if found in a Pd file
- same thing but with symbol messages, e.g., "symbol 43"
- empty symbol messages "symbol"
- empty symbol selector ""
- null selector
- symbol atoms/messages with weird "floatlike" data that would overflow/underflow if loaded by a Pd file.
- ported "send" methods from Vanilla for [int], [float], and [value]
- document the "tempo" messages for relevant objects
- fixed a crasher with pasting from Pd patch file (thanks to Ico)
- fixed a long-standing crasher where editing an open GOP window would hide everything except the patch cords under certain circumstances
- an object/gop being edited now has the same size as one that isn't being edited (thanks to Ico)
- fixed keyboard shortcut for dropdown that caused problems for some keyboard types (thanks to Albert)
- fixed ggee/image border selection when on GOP
- fixed long-standing bug with route where a bang wouldn't get sent to the reject outlet
- fixed bug where nested gops erroneously showed a selection rectangle
- fixed a crasher with resizing a nesting GOP when dragging with the mouse
- custom scrollbars from Pd-l2ork 1.0 (thanks to Ico)
- increased gatom character width to 160
- fixed off-by-one problem with iemgui label positions
- fixed bar graph display when graph has its own window
- made a larger hitbox for xlet connection for easier patching (thanks to Ico)
- make default CSS match pd-l2ork 1.0 style
- different, "greyed-out" style for inlet hover (as an inlet can't begin a connection with a mouse, but an outlet can)