[PD-dev] issiconvert

Funs Seelen funsseelen at gmail.com
Mon Jun 3 12:50:22 CEST 2013


Hello devs,

Inspired by this thread (
http://lists.puredata.info/pipermail/pd-list/2013-05/102885.html) I spent
the weekend doing exercises in writing simple conversions from int to
symbol and vice versa, trying to get more used to the pd api. I ended up
with a library of 8 classes I called `issiconvert'.

-----------------------
Conversions with 4 different specifiers 0x, 0i, 0o, 0b:

[int2shex]: `float 4095' -> `symbol 0xfff'
[int2sdec]: `float 4095' -> `symbol 0i4095'
[int2soct]: `float 4095' -> `symbol 0o7777'
[int2sbin]: `float 4095' -> `symbol 0b111111111111'
-----------------------
Symbol with any of the four specifiers to int:

[sany2int]:
  `symbol 0xff' -> `float 255'
  `symbol 0o377' -> `float 255', etc.
-----------------------
A simple version of zexy's symbol2list, but float instead of anything
(`clist' means list of character values):

[symbol2clist]: `symbol foo' -> `list 102 111 111', `symbol 0i12' -> `list
48 105 49 50'
-----------------------
Does nothing except for printing the input if symbol:

[symbol2symbol]: `symbol foo' -> `symbol foo'
-----------------------
Obvious:

[strlen]: `symbol foo' -> `float 3'
-----------------------

Probably some, or possibly all of these functions already exist in some
different way, but if some of you think this effort wasn't completely
superfluous (except for my own experience) please tell me if you think
names or specifiers should be changed or not. Then I could upload it
somewhere (patch tracker, git repo on sourceforge or anywhere else)
afterwards.

Regards,
--Funs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20130603/36e6c50f/attachment.htm>


More information about the Pd-dev mailing list