[PD] hexadecimal conversion problem

oliver oliver at klingt.org
Wed Jan 20 01:19:21 CET 2021


i'm trying to convert arbitrary hexadecimal numbers to decimal ones, 
preferably with vanilla objects.

while it's easy to do it the other way round with [makefilename], i'm 
facing a peculiar problem from hex --> dec when the letter E is present 
and followed by a number.

my approach would be to take a hex number, interpret it as a symbol, get 
each hex-digit's ascii value, and do the conversion from there

let's take the hex number 27E5 as an example

no matter what sort of conversion i try ([symbol], [list tosymbol], 
[makefilename], [fudiformat]), PD always interprets it as a decimal 
number with an exponent, so

makefilename %s

will give me "symbol 2.7e+006" in the console (or in a symbol atom).

(of course a number like 27A5 or 275E expands with no problem to a 
straight symbol and can then be ascii-fied)

is there anything i can do to make PD take 27E5 as a literal symbol 
rather than a float ?



/////////////// http://pendler.klingt.org //////////////
\\\\\\\\\\\\\\\ http://oliver.klingt.org  \\\\\\\\\\\\\\

More information about the Pd-list mailing list