Is it possible to type more than one consecutive "space" with GEM [text2d] ?
I need to print some type of karaoke lyrics with chord changes on the line above. Obviously the chord symbols need to be right where the changes are in the lyrics.
Maybe there is another solution or object to do this - I'm quite new to GEM so I don't really know many objects.
Thanx, Ingo
On Sat, 17 Apr 2010, Ingo Scherzinger wrote:
Is it possible to type more than one consecutive „space“ with GEM [text2d] ?
Use "non-breaking space" unicode characters. They always count as non-spaces, so you can put them in symbols at will. That's what I use to put spaces in IEMGUI labels.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
Thank you, Mathieu!
I tried to input them with [ALT+CTL+space] but pd doesn't accept that. What's a proper method of typing "non-breaking spaces" inside of pd or typing them into a standard textfile so pd can read them?
Ingo
-----Ursprüngliche Nachricht----- Von: Mathieu Bouchard [mailto:matju@artengine.ca] Gesendet: Samstag, 17. April 2010 18:33 An: Ingo Scherzinger Cc: pd-list@iem.at Betreff: Re: [PD] how to type more than one "space" in GEM with [text2d]
On Sat, 17 Apr 2010, Ingo Scherzinger wrote:
Is it possible to type more than one consecutive space with GEM [text2d] ?
Use "non-breaking space" unicode characters. They always count as non-spaces, so you can put them in symbols at will. That's what I use to put spaces in IEMGUI labels.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Sat, 17 Apr 2010, Ingo Scherzinger wrote:
I tried to input them with [ALT+CTL+space] but pd doesn't accept that. What's a proper method of typing "non-breaking spaces" inside of pd or typing them into a standard textfile so pd can read them?
There are several ways. This is OS-dependent and charset-dependent. I found Pd 0.41 to be typing in iso-latin-1 in Tk on OSX, but using utf-8 on Linux, while on OSX, utf-8 chars of Pd files are still correctly read, or something like that.
loading GridFlow fixes half of the problem of typing characters on Linux (really), but for a full fix, you'd need to apply a fix that has been published some months ago and that is being left out of Pd. I don't know why this problem is specific to Linux, and if instead it has to do with the version of Tk, it could be a cross-platform problem eventually...
Back to Unicode now... If I send a «194 160» list-message to [#to_symbol], i get an invisible symbol, that you can add to a message-box using a «add2 $1» message-box. But there are other ways. I think I loaded the pd file in a text editor or hex editor... or that I found the key for it... but the key is OS-dependent, and then, it's also keyboard-layout dependent.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
Thank you again, Mathieu!
I'll give it a try. I was testing on Windows so far but I actually need it on Linux. So it looks like a good idea to figure it out on the OS I'll need it to use on since it seems to be different on every platform.
Ingo
-----Ursprüngliche Nachricht----- Von: Mathieu Bouchard [mailto:matju@artengine.ca] Gesendet: Samstag, 17. April 2010 19:03 An: Ingo Scherzinger Cc: pd-list@iem.at Betreff: Re: AW: [PD] how to type more than one "space" in GEM with
[text2d]
On Sat, 17 Apr 2010, Ingo Scherzinger wrote:
I tried to input them with [ALT+CTL+space] but pd doesn't accept that. What's a proper method of typing "non-breaking spaces" inside of pd or typing them into a standard textfile so pd can read them?
There are several ways. This is OS-dependent and charset-dependent. I found Pd 0.41 to be typing in iso-latin-1 in Tk on OSX, but using utf-8 on Linux, while on OSX, utf-8 chars of Pd files are still correctly read, or something like that.
loading GridFlow fixes half of the problem of typing characters on Linux (really), but for a full fix, you'd need to apply a fix that has been published some months ago and that is being left out of Pd. I don't know why this problem is specific to Linux, and if instead it has to do with the version of Tk, it could be a cross-platform problem eventually...
Back to Unicode now... If I send a «194 160» list-message to [#to_symbol], i get an invisible symbol, that you can add to a message-box using a «add2 $1» message-box. But there are other ways. I think I loaded the pd file in a text editor or hex editor... or that I found the key for it... but the key is OS-dependent, and then, it's also keyboard-layout dependent.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Sat, 17 Apr 2010, Ingo Scherzinger wrote:
I'll give it a try. I was testing on Windows so far but I actually need it on Linux. So it looks like a good idea to figure it out on the OS I'll need it to use on since it seems to be different on every platform.
Well, if you only need to send the space to [text2d], then perhaps you can just generate it with objects and let GEM handle the rest, and never save the character in message boxes.
It will be either "194 160" for utf-8, or "160" for latin-1 and for "unencoded unicode".
I think that I first had started with a different kind of nbsp that took three bytes, and this wasn't understood on OSX, and I changed it to the normal nbsp I've been talking about so far, and it became cross-platform.
I don't remember what it is like on Windows.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
Ok, I managed to enter several ascii 160 (nonbereakable) and even ascii 32 (normal spaces) in a row into [text2d] with [prepend_ascii]. So it shouldn't be a big deal to put a line of text together from ascii. However, the real problem is that [textfile] or [zexy/msgfile] cannot even output regular spaces that can be converted to ascii 32. There is no output at all for the spaces. They are only used internally for separation purposes.
OTOH I will be getting standard textfiles with regular "spaces" but I can't even read the spaces to convert them to something pd can handle within pd. I don't even know if textfiles can even hold "nonbreakable spaces" at all. So now the original question has changed to:
Is there an object that can read textfiles (or any other file type) that includes "spaces" and can output these spaces (as something) so I can convert them to "ascii 32" or "ascii 160"?
Pleeeaase (!) DO NOT start a general discussion about spaces in pd here. There is a time and a place for everything but this is neither the time nor the place. This stuff has already been discussed many times before.
I'd be deeply grateful for any suggestion! Ingo
Well, if you only need to send the space to [text2d], then perhaps you can just generate it with objects and let GEM handle the rest, and never save the character in message boxes.
It will be either "194 160" for utf-8, or "160" for latin-1 and for "unencoded unicode".
I think that I first had started with a different kind of nbsp that took three bytes, and this wasn't understood on OSX, and I changed it to the normal nbsp I've been talking about so far, and it became cross-platform.
I don't remember what it is like on Windows.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
Ingo Scherzinger wrote:
Is there an object that can read textfiles (or any other file type) that includes "spaces" and can output these spaces (as something) so I can convert them to "ascii 32" or "ascii 160"?
[mrpeach/binfile] will output raw bytes from any file, so spaces in a text file will show up as 32.
Martin
On 2010-04-18 16:16, Martin Peach wrote:
Ingo Scherzinger wrote:
Is there an object that can read textfiles (or any other file type) that includes "spaces" and can output these spaces (as something) so I can convert them to "ascii 32" or "ascii 160"?
[mrpeach/binfile] will output raw bytes from any file, so spaces in a text file will show up as 32.
and Gem is (almost[1]) able to directly read these via the "string" message. that's all documented for [text3d], and all [text*] objects basically have the same interface.
gmasd IOhannes
[1] if you only use ASCII; if you want to use extended characters, you have to convert the UTF-8 bytes that you get out from [binfile] into Unicode-codepoint numbers. there's an abstraction somewhere in iem/unicode/ that does just that. i seem to remember that something like this was on the list just recently...
Thank you!
[mrpeach/binfile] works perfectly for what I need.
I was already using the "string" message with [text2d]. The problem was only to "read" the spaces with [textfile] which seems to be impossible. Reading it with [mrpeach/binfile] and changing it to a "string" message does the trick.
Ingo
Betreff: Re: [PD] how to type more than one "space" in GEM with [text2d] -
[textfile]
output?
On 2010-04-18 16:16, Martin Peach wrote:
Ingo Scherzinger wrote:
Is there an object that can read textfiles (or any other file type)
that
includes "spaces" and can output these spaces (as something) so I can convert them to "ascii 32" or "ascii 160"?
[mrpeach/binfile] will output raw bytes from any file, so spaces in a text file will show up as 32.
and Gem is (almost[1]) able to directly read these via the "string"
message.
that's all documented for [text3d], and all [text*] objects basically have the same interface.
gmasd IOhannes
[1] if you only use ASCII; if you want to use extended characters, you have to convert the UTF-8 bytes that you get out from [binfile] into Unicode-codepoint numbers. there's an abstraction somewhere in iem/unicode/ that does just that. i seem to remember that something like this was on the list just
recently...