[Fwd: Re: [PD] numberstream, parsing]

Marc Lavallée marc at hacklava.net
Sun Oct 16 17:49:28 CEST 2005


Matthijs,
To parse a stream of numbers coming from comport and convert them to PD data 
types, please check my ascii externals, programmed especially to address 
this problem. Again, the url is:
http://puredata.info/Members/odradek/ascii-0.1.1.tar.bz2/view
--
Marc

Le 16 Octobre 2005 09:56, Matthijs van Henten a écrit :
> Thanks for all the suggestions.
> Piotr, how do you mean with sending the data in OSC directly?
> My main goal was to convert the number stream coming from the pic into
> OSC anyways :)
>
> The thing is: I get a stream of numbers. somehow I have to say: this
> number is parameter 1, this number is parameter 2, etc.. I found
> splitting the stream in pd quite cumbersome. I have to designate numbers
> as control chars, so I can properly route the numbers etc. - it's like
> rebuilding a complete terminal emulation in PD, and I havent found very
> convenient ways of doing such, except using a lot of
> trigger/spigot/retrigger etc. constructions. I haven't gotten them 100%
> watertight anyways.
>
> Until so far, I only had one 8 bit number that the pic could simply dump
> on the comport. but now I have 4 10 bit numbers. To do proper debugging
> I have written small routines to print all the numbers as nice ascii
> strings of numbers. so when doing a 'cat /dev/ttyS0' you would read
> something like::
>
> 1000	890	514	997
>
> the comport object would interpret this as a huge list of numbers:
>
> 49
> 48
> 48
> 48
> 32
>
> etc. etc. ( this is only the first number 1000 and a space)
>
> anyways, your remark got me thinking since there's modules for python
> and perl to talk OSC, and reading the comport is a trivial thing to do
> as well ( I remember in perl I could do something like my string = 'cat
> /dev/ttyS0')
>
> Does anyone have  a better solution?
>
> thanks for the hints already!
>
> Piotr Majdak wrote:
> > Matthijs van Henten wrote:
> >> I built a little something on a pic, that sends data over rs232.
> >> This is a bit hard in pd, I haven't figured out a way to do this
> >> 'elegantly'
> >
> > What about sending the data in OSC format instead developing an own
> > protocol? With OSC, you could use very elegantly OSCdump and OSCroute.
> > Furthermore, you won't have any problems converting the data to ASCII
> > on PIC and back to int/float in pd...
> >
> > br, Piotr
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list




More information about the Pd-list mailing list