I'm working on a project that requires me to be able to freely copy text within a patch from one location to another, but I've run into a couple of problems. One of them is that PD doesn't allow me to transfer semicolons or commas between windows; it treats them as special characters. The second problem is that PD doesn't seem to be able to transfer line breaks from one chunk of text to another. Any help with getting around these two problems would be greatly appreciated.
-
Problems with Text in Puredata
-
I've tried hard to crack this problem but never have. However, there is some respite: Unicode character U+201A (dec 226 128 154) looks just like a comma. Here it is, between the quotation marks: " ‚ " (assuming that it copies correctly). You can safely use this in text without it being interpreted,
As for the semi-colon, I'm still searching for a solution...
-
@Polaris You can add a comma and you can add a semi-colon to a message like this......
message-help.pd
which will not escape the characters ("/").
...... which might help?
You would need to send the message "something like"...... in 1_genie_in_a_bottle.pd
dollar_in_a_message.zip
As it is sending a message it can be banged by incoming lists...... so you can use $1, $2...... etc. to include other text, symbols and floats as the message is sent..... like this..... please.pd ..... (JUST updated and simplified).
But it is a very painful exercise.
Useful if you only need to build the "structure" once though (if the message "format" will be stable).
((NOTE: "set" allows you to see the message in the next message box...... BUT if you use "set" the message will not be "sent onwards". If you are setting gui properties you should not use it.))
David. -
The method you showed me in "please.pd" does allow me to embed commas inside messages, which is a step up, but semicolons cause line breaks to occur where I don't want them. Also, I need to be able to send the text to a canvas. When I try to do that, the commas and semicolons get interpreted when I don't want them to be.
All I'm trying to do is send a block of natural language text from one location to another where it can be read intact. Surely there is some way to do it.
-
@Polaris Would you post a text file with the block of natural language please. This is probably the most difficult problem in Pd...... and there is not necessarily a solution.
How do you want it to appear in the canvas?
As a Title, a comment, in a message box?
Do you need to do anything with it afterwards?
David. -
Here is a file illustrating my situation: Untitled-1.pd As you can see, the comma gets a slash added to it when it arrives at the canvas as a label.
The text doesn't need to have anything done to it once it arrives at the canvas or whatever object is capable of displaying it. The only thing it needs to be able to do is display a different block of text when prompted to do so.
-
As I said, Unicode is your best bet: comma.pd. On my machine, you can't paste the character into the patch, but it works if you edit the patch in a text editor. If you have a lot of commas, you can run Find & Replace in a text editor.
I'm afraid that there is no solution I'm aware of for the semi-colon, unless you're OK with Unicode U+204F, the reverse semi-colon! " ⁏ "
-
@Polaris I agree with @LiamG...... and he has given a very neat solution for the comma.
Unfortunately a "real" semi-colon or comma, once in a message, will be interpreted and can only do damage.
Other characters can be filtered if you need to.........here is an example...... twitter_stack.pd
To use Liams solution you would need to temporarily change your keyboard layout.
David. -
Hah, take a look at this!! ---> ;
It turns out that the Greek question-mark (u037e) looks just like a semi-colon.
This should work, assuming that you have the right characters installed.
-
So all I have to to do is open the patch in a text editor and paste those codes into the right spots? That will work excellently. Thank you for coming up with that solution. (I just wish there was an easy way to format the text. As it is, I have to insert a semicolon when a line ends and hope that I've positioned it in a way that avoids the appearance of lines ending at different horizontal positions.)