RE – Construction of Message

Jan 31, 2008 at 2:26pm

RE – Construction of Message

Hi,
I get from the serial object a stream of numbers:
This should lead back to Messages of the form:
“A 123 !”
“A 12 !”
etc.
How do I do this?

actual stream coming out of serial – object:
print: 33
print: 13
print: 10
print: 65
print: 32
print: 51
print: 55
print: 50
print: 32
print: 33
print: 13
print: 10
print: 65
print: 32
print: 51
print: 53
print: 57
print: 32
print: 33
print: 13
print: 10
print: 65
print: 32
print: 51
print: 53
print: 52
print: 32
print: 33
print: 13
print: 10
print: 65
print: 32
print: 51
print: 55
print: 49
print: 32
print: 33
print: 13
print: 10
print: 65
print: 32
print: 51
print: 54
print: 56
print: 32
Thanks for support

#35594
Jan 31, 2008 at 3:13pm

The stream you get are ASCII char:
65 is ‘A’
32 is ‘ ‘
51 is ’3′
55 is ’7′
50 is ’2′
32 is ‘ ‘
33 is ‘!’

10 and 13 are lf/cr

So you have to convert this stream using something like [serial] ->
[sel 10 13] -> [zl group 66] -> [itoa] -> …

Good luck

p

On 31 janv. 08, at 15:26, ATH wrote:

>
> Hi,
> I get from the serial object a stream of numbers:
> This should lead back to Messages of the form:
> “A 123 !”
> “A 12 !”
> etc.
> How do I do this?
>
> actual stream coming out of serial – object:
> print: 33
> print: 13
> print: 10
> print: 65
> print: 32
> print: 51
> print: 55
> print: 50
> print: 32

> _____________________________

Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://www.crfmw.be/max

#121470
Jan 31, 2008 at 6:21pm

Thanks very much.
why zlgroup 66? Is the serial interface by definition sending packages of 66 bytes?
kind regards

#121471
Jan 31, 2008 at 7:26pm

#121472
Jan 31, 2008 at 9:59pm

On 31 janv. 08, at 20:26, Patrick Delges wrote:

> But I just discovered that you don’t have to put an argument, so [zl
> group] should work too (but in case you never send it a bang, it
> will never output anything).

It’s not totally true. The default value is 256, so when you don’t
provide the argument to zl, it waits for 256 elements to send the list
to the output.

ej

#P button 74 79 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 114 209 34 196617 zl len;
#P newex 114 239 32 196617 print;
#P newex 140 183 60 196617 print group;
#P newex 114 149 46 196617 zl group;
#P newex 74 111 50 196617 uzi 1000;
#P connect 1 0 4 0;
#P connect 1 0 2 0;
#P connect 5 0 0 0;
#P connect 4 0 3 0;
#P connect 0 2 1 0;
#P window clipboard copycount 6;

#121473
Feb 1, 2008 at 8:17am

#121474
Feb 1, 2008 at 9:46am

Thanks, this was a revelation. What made it complicated for me was: I didn’t know, and it isnt well documented in the help, that zlgroup truncates the stream when receiving a bang, even if not all of the 66 (or whatever) ascii-codes have passed.

kind regards

#121475
Feb 1, 2008 at 10:37am

#121476

You must be logged in to reply to this topic.