Been trying to figure out a way to do this, tried escaping the escape character, but [adddollar( does not like that and it seems escapping the esacape character outputs both the escape and escapee, so two \ instead of one, bug? I am playing with dynamic patching and being able to use the creation args of the abstraction to set the number of dollar signs in a message for the subpatch would greatly simplify my patch, but I can not quite figure it. Best I have managed is just using [adddollar( and a counter to add them in after the message is created in the subpatch, but being able to create them directly would make things much neater.
adding an escaped dollar to a message.
@oid How would escaping the escape character help to get a certain number of signs into a message? I cannot think of a solution without a counter.
There might be other ways to achieve what you want, for example using [list|.
@ingox escaping reserved characters, including the escape character generally tells an interpreter to treat the following reserved character as a normal character and I need to dynamically create the message [set $1 $2...(, where the abstractions creation argument says how many of those dollar sign arguments to supply the set message. So, i need to do
[;pd-subpatch msg 10 10 set \$1 \$2...(
so, yes a counter, but just for the creation message and considerably less wiring will be needed.
Did i make more sense this go around?
Edit: fixed my missing back slashes.
@whale-av Don't think I want to contruct a message that way, convoluted indeed. The basic core of the patch is a shift register built around messages and triggers.
So it would have creation arguments for length and width, width being the number of arguments in the set message. Your second solution is more or less my best solution so far, but if I can figure a way to create a message with those escaped dollar signs, it makes the sub patch much simpler and the logice to create it much simpler,, but I am not feeling confident about that since this seems to happen
Is this a bug that needs to be reported or is there some logic behind such behavior?
@oid Here is another way......... woof2.pd
But you still need a counter and to construct two messages in the mother patch...... as in fact you would need to do in your second post.
And then you need to connect the message in the subpatch.
I think doing the work in the subpatch, where the message [$1 $2.........( will then already exist.......... and be already connected to other objects in the subpatch....... will be the easiest and most logical solution.
@oid I think the behavior in your example on the bottom of your last post may not actually be a bug, but the behavior of Pd with special signs is sometimes really strange. I believe in this example the first message only tries to display the escaped character but there is none. The second gets the \, but escapes it itself. And so on.
It may be simpler to build the shift register with [text].
@ingox nice! It did not even cross my mind to use [makefilename] even though I am abusing it elsewhere in this abstraction, almost as simple as reliable escaping would be! A shift register is easier with [text], you gave me one in that other thread that works quite well, but if you want access to the individual stages of the shift register, it can become quite cpu intensive or quite convoluted. I have found some work arounds, but none of them are even remotely as efficient as cascading my simple three object memory cell. Thanks for that patch, it greatly simplifies the creation logic of this.
As for the behavior regarding escape characters, I think the issue might be that the escape characters are part of the file format/written language of pure data and it is just a fluke that we get them proper in some situations within the visual language. I am going to go ahead and file a bug report, perhaps we will get properly workiing escape characters in the next release!
@whale-av Missed your second post somehow. I did not make the connection that [;pd-subpatch( was a standard send message, I was thinking it was some fancy black magic, connecting to a [send] simplifies some message creation, thanks for pointing that out. I know I still need a counter, but I need that counter in the abstraction for otherthings anyways and this means less connections to make and keep track of. I may come around to your view as I get more accustomed to dynamic patching, but at this time I find keeping the creation messages as simple and few as possible, helps greatly in keeping me out of trouble.
And I found my slashes, apparently add2 will make them for you if you feed the $ to it as a symbol, stupid simple. Thanks for the hand holding, learned a good deal this go around.
@oid You are right....... dynamic patching can get messy.
But it is very satisfying.
And often....... when creating many abstractions........ it can make for a really tidy patch.
Or allow dynamic cord patching
Both of those were made with counters setting the position of abstractions as they were created.
In the second image the patch chords can be moved when head amps for channels are set.
The Pd patch is small, but can create a 64in 64out mixer....... or a 4in 2out mixer..... as you wish.
@oid Yes, you can produce backslashes. Until recent Pd Vanilla versions you could not type them. The message that then contains them I think could not be edited in edit mode. Sending them onward will probably not give the result you are looking for......... but I am willing to learn...
They are illegal characters as they are reserved for Pd's internal workings.
You will see them in a patch if you open it in a text editor.
The author is against their use in messages....... https://lists.puredata.info/pipermail/pd-list/2002-10/008323.html ....... but has that changed since they can now be typed?..... or is that just to facilitate sending file paths?
Always fun though, looking for how and why they were produced!
@whale-av That reminds me, I came across you mentioning your 64x64 mixer elsewhere on the forum and you mentioned that you were possibly going to comment it and create a tutorial with it on dynamic patching, did that ever happen? I looked for it, but I did not find it.
That post from the mailing list is somewhat depressing, 18 years old, that better way has not manifested, nor has escaping, but the escaping issues go beyond messages, you can not escape a # in a lable, so no C#, oddly enough it replaces the # with another reserved character, a $.. Wonder what Mr Puckette's view on the subject is at this time. Perhaps I will bring this up on the mailing list instead of a bug report.
@whale-av Forgot to say, you can edit those messages and it does send them on just as expected, the above gives [set $1 $2 $3 $4 $5( in [pd test]. The slashes are retained proper even if you edit the message, this is how my first fixed width shift register worked and why I was trying to get those slashes in the first place, it makes the creation logic much simpler.
@oid Yes..... some Gui's change $ to # when you put a $ in their send or receive names.....????.
I find Pd even more appealing because of its quirks.
But I like problem solving...... attempting to solve problems......
Ha...... the mixer dynamic patching tutorial......
I wrote the manual....
..... and then felt I should re-write the patch for vanilla.
A long, long period spent writing abstractions to replace "extended" externals.
And then stuck trying to replace the cookbook control externals for [biquad~]........
And then I forgot all about it.