Hi,
a quick question: I wanted to detect a character in a symbol, in order to route that symbol in a different way. Afaik, there is no object that does that, so the only way would be to decompose the symbol in ascii values, and then detect it.
Btw, this would also be used to decompose the original symbol into several parts (e.g. 123as78 -> 123 as 78). As before, the only way I imagine it would be doable in Pd would be through ascii decomposition.
Any better ideas?
Thanks,
João
On Sat, 7 Aug 2010, João Pais wrote:
a quick question: I wanted to detect a character in a symbol, in order to route that symbol in a different way. Afaik, there is no object that does that, so the only way would be to decompose the symbol in ascii values, and then detect it.
you can use [gf/string_replace] to replace one character by any other and then you use [sel] to see whether you get a different symbol.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
I've looked into this. I see two problems:
for non-pd users, I should limit myself to pd-ext objects - or I would
have to ship gridflow with it, which might not be legal (don't know), but
anyway isn't practical.
numbers) to any other string format that I could use with [sel]. as I
understood, string replace doesn't take spaces or expressions like "a " as
parameter. In the cases I'm thinking of, the character to be detected is
always in the middle. For now I'm using charaters / and :, like 7/8 or
1:13.
Joao
On Sat, 7 Aug 2010, João Pais wrote:
a quick question: I wanted to detect a character in a symbol, in order to route that symbol in a different way. Afaik, there is no object that does that, so the only way would be to decompose the symbol in ascii values, and then detect it.
you can use [gf/string_replace] to replace one character by any other and then you use [sel] to see whether you get a different symbol.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
Don't know if it is what you are looking for. ++
Jack
Le mardi 10 août 2010 à 11:07 +0100, João Pais a écrit :
I've looked into this. I see two problems:
- this would be for the "famous" patch that I'm sending around. Since it's
for non-pd users, I should limit myself to pd-ext objects - or I would
have to ship gridflow with it, which might not be legal (don't know), but
anyway isn't practical.
- I couldn't understand how to go from x/y (x and y being any natural
numbers) to any other string format that I could use with [sel]. as I
understood, string replace doesn't take spaces or expressions like "a " as
parameter. In the cases I'm thinking of, the character to be detected is
always in the middle. For now I'm using charaters / and :, like 7/8 or
1:13.Joao
On Sat, 7 Aug 2010, João Pais wrote:
a quick question: I wanted to detect a character in a symbol, in order to route that symbol in a different way. Afaik, there is no object that does that, so the only way would be to decompose the symbol in ascii values, and then detect it.
you can use [gf/string_replace] to replace one character by any other and then you use [sel] to see whether you get a different symbol.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Tue, 10 Aug 2010, João Pais wrote:
- I couldn't understand how to go from x/y (x and y being any natural
numbers) to any other string format that I could use with [sel]. as I understood, string replace doesn't take spaces or expressions like "a " as parameter. In the cases I'm thinking of, the character to be detected is always in the middle. For now I'm using charaters / and :, like 7/8 or 1:13.
You said you wanted to detect, not split. Replacing a character by a space does not split a symbol in several elements (but it does if you know how to take advantage of pd's traditional bugs). Otherwise use [s2l] or [l2s].
- this would be for the "famous" patch that I'm sending around. Since
it's for non-pd users, I should limit myself to pd-ext objects
If it's for non-pd users, you should limit yourself to non-pd objects. I mean, if they end up using your patch, they will be some kind of pd user, albeit one that we don't see so often so far.
or I would have to ship gridflow with it, which might not be legal (don't know),
ah, thanks for the feedback. (??)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
- this would be for the "famous" patch that I'm sending around. Since
it's for non-pd users, I should limit myself to pd-ext objects
If it's for non-pd users, you should limit yourself to non-pd objects. I mean, if they end up using your patch, they will be some kind of pd user, albeit one that we don't see so often so far.
well, technically they're using pd, even if they don't even know about it.
they'll know even less when the java (processing) gui is done, and pd runs
in -nogui mode.
anyway these are people that don't know about Pd and don't really want to,
they have other priorities.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 08/07/2010 11:30 PM, João Pais wrote:
Hi,
a quick question: I wanted to detect a character in a symbol, in order to route that symbol in a different way. Afaik, there is no object that does that,
[routeOSC] can basically do that, since it supports wildcard matching. the only limitation is, that the message's selector has to start with a "/", but that can quite easily be done in vanilla Pd.
fgamsdr IOhannes
Hmm, I couldn't find this. Basically I want a way to detect the difference
between symbols like "4/8" and "4:8". for now, maybe other characters will
come in later.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 08/07/2010 11:30 PM, João Pais wrote:
Hi,
a quick question: I wanted to detect a character in a symbol, in order
to route that symbol in a different way. Afaik, there is no object that
does that,[routeOSC] can basically do that, since it supports wildcard matching. the only limitation is, that the message's selector has to start with a "/", but that can quite easily be done in vanilla Pd.
fgamsdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkxfBUEACgkQkX2Xpv6ydvSPPQCfW6aYBkbPAy59rDTIJjKo24Uc EiMAn27sf5Crq3znFwkNbn4wXSQAFuIA =UvpT -----END PGP SIGNATURE-----