Csound Csound-dev Csound-tekno Search About

[Csnd] score lines with tcl newlines fail

Date2019-03-16 01:11
FromForrest Curo
Subject[Csnd] score lines with tcl newlines fail
Both computers are using the current ubuntu, and are connected by one ethernet cable.

One runs csound while the other sends strings via tcp
to a fifo:
ie                   nc -l 10.42.0.1 1250 > testfif
which routes it to csound ( -L testfif ).

When the line comes from tcl, whether or not it ends in "\n"
I get:

illegal RT scoreline:
i1 0 1 550 0.5
              ^
------------
Putting \n at the end produces the same response plus
unknown opcode

How to make this work?
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-03-16 19:57
Fromjohn
SubjectRe: [Csnd] score lines with tcl newlines fail
Really I do not know tye answer but did you try -C option to nc?

On Fri, 15 Mar 2019, Forrest Curo wrote:

> Both computers are using the current ubuntu, and are connected by one ethernet
> cable.
> 
> One runs csound while the other sends strings via tcp
> to a fifo:
> ie                   nc -l 10.42.0.1 1250 > testfif
> which routes it to csound ( -L testfif ).
> 
> When the line comes from tcl, whether or not it ends in "\n"
> I get:
> 
> illegal RT scoreline:
> i1 0 1 550 0.5
>               ^
> ------------
> Putting \n at the end produces the same response plus
> unknown opcode
> 
> How to make this work?
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-03-16 20:59
FromPete Goodeve
SubjectRe: [Csnd] score lines with tcl newlines fail
AttachmentsNone  

Date2019-03-16 22:22
FromForrest Curo
SubjectRe: [Csnd] score lines with tcl newlines fail
Yes, I'm sure tcl is doing something odd...
Direct terminal nc input gets across and is digested by csound.

tcl sending to   -->  nc listening on terminal works but
tcl sending to ----> nc listening & feeding to fifo, no.

-C on the listening end doesn't seem to affect this.
If the result goes to csound through fifo, we get 'illegal Rt scoreline'

if the listening-terminal | pipes to nc -C localhost port
       where nc listening in another terminal | pipes the result to fifo...
              no response. (I expect this just eats the newline altogether.)
-----------
Okay, if I put the tcl input into a file ... Let's see.
 

On Sat, Mar 16, 2019 at 1:59 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Fri, Mar 15, 2019 at 06:11:26PM -0700, Forrest Curo wrote:
> Both computers are using the current ubuntu, and are connected by one
> ethernet cable.
>
> One runs csound while the other sends strings via tcp
> to a fifo:
> ie                   nc -l 10.42.0.1 1250 > testfif
> which routes it to csound ( -L testfif ).
>
> When the line comes from tcl, whether or not it ends in "\n"
> I get:
>
> illegal RT scoreline:
> i1 0 1 550 0.5
>               ^
> ------------
> Putting \n at the end produces the same response plus
> unknown opcode
>
> How to make this work?
>

Hi,

I don't have tcl installed, but I tried the same sort of setup,
just sending commands across nc. e.g, in Linux (Mint):

        mkfifo tempfifo
        csound -L tempfifo myinstr.csd

In another window:

        nc -l 1234 >tempfifo

On my PDA (running termux):

        nc 192.168.1.6 1234     #to the Linux machine
        ... and type some commands that myinstr accepts

Works fine, so I don't think it can be in the nc link or the fifo.
tcl may be doing something odd.

Can you trap the output of your tcl script directly?  Also
try what I did, and type in strings to send?

Good luck.

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-03-16 23:13
FromForrest Curo
SubjectRe: [Csnd] score lines with tcl newlines fail
i1 0 1 330 0.5
i1 0 1 330 0.5
i1 0 1 330 0.5

Trying the same with nc -Cl  the result is unchanged.
Whatever is upsetting csound when I pass lines through tc is...
a nonprinting character? excess trailing blanks?

On Sat, Mar 16, 2019 at 3:22 PM Forrest Curo <treegestalt@gmail.com> wrote:
Yes, I'm sure tcl is doing something odd...
Direct terminal nc input gets across and is digested by csound.

tcl sending to   -->  nc listening on terminal works but
tcl sending to ----> nc listening & feeding to fifo, no.

-C on the listening end doesn't seem to affect this.
If the result goes to csound through fifo, we get 'illegal Rt scoreline'

if the listening-terminal | pipes to nc -C localhost port
       where nc listening in another terminal | pipes the result to fifo...
              no response. (I expect this just eats the newline altogether.)
-----------
Okay, if I put the tcl input into a file ... Let's see.
 

On Sat, Mar 16, 2019 at 1:59 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Fri, Mar 15, 2019 at 06:11:26PM -0700, Forrest Curo wrote:
> Both computers are using the current ubuntu, and are connected by one
> ethernet cable.
>
> One runs csound while the other sends strings via tcp
> to a fifo:
> ie                   nc -l 10.42.0.1 1250 > testfif
> which routes it to csound ( -L testfif ).
>
> When the line comes from tcl, whether or not it ends in "\n"
> I get:
>
> illegal RT scoreline:
> i1 0 1 550 0.5
>               ^
> ------------
> Putting \n at the end produces the same response plus
> unknown opcode
>
> How to make this work?
>

Hi,

I don't have tcl installed, but I tried the same sort of setup,
just sending commands across nc. e.g, in Linux (Mint):

        mkfifo tempfifo
        csound -L tempfifo myinstr.csd

In another window:

        nc -l 1234 >tempfifo

On my PDA (running termux):

        nc 192.168.1.6 1234     #to the Linux machine
        ... and type some commands that myinstr accepts

Works fine, so I don't think it can be in the nc link or the fifo.
tcl may be doing something odd.

Can you trap the output of your tcl script directly?  Also
try what I did, and type in strings to send?

Good luck.

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-03-17 00:06
FromPete Goodeve
SubjectRe: [Csnd] score lines with tcl newlines fail
AttachmentsNone  

Date2019-03-17 01:08
FromForrest Curo
SubjectRe: [Csnd] score lines with tcl newlines fail
Sending to a port from a terminal & piping to 'od -c' produces lines like:
0000000   i   1       0       1       3   3   0       0   .   5  \n   i
[The 'i' above is the beginning of the next score line which continues below.

Sending the same line from tcl to 'od -c' produces:
0000000   i   1       0       1       3   3   0       0   .   5  \r  \n
*
The tcl line is one character ( '\r' ) longer.

In the tcl routine, after I set a socket name ie 'ch'
and run:
fconfigure $ch -buffering line -translation lf

tcl sends the shell-terminal format and
ought to work, then.
==============
I didn't know about 'od', thanks much!!!


On Sat, Mar 16, 2019 at 5:06 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Sat, Mar 16, 2019 at 04:13:05PM -0700, Forrest Curo wrote:
> i1 0 1 330 0.5
> i1 0 1 330 0.5
> i1 0 1 330 0.5
>
> Trying the same with nc -Cl  the result is unchanged.
> Whatever is upsetting csound when I pass lines through tc is...
> a nonprinting character? excess trailing blanks?
>
Yeah, it looks, from the score lines you've shown, that spaces
sometimes aren't there.  As you say, maybe some invisible character?

Can you try intercepting the lines with a 'tee' to a file, and then
look at that with 'od -c'?

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-03-17 02:29
FromPete Goodeve
SubjectRe: [Csnd] score lines with tcl newlines fail
AttachmentsNone  

Date2019-03-17 03:18
FromForrest Curo
SubjectRe: [Csnd] score lines with tcl newlines fail
Tk is ugly but makes it very easy to link mousing an area on a 'canvas' to executing some tcl routine, such as sending a note to csound. Maybe more limited than other GUIy languages, but far less painful!

Emacs can hold a tcl script in one buffer -- and start a tcl process in another, executing whatever commands one copies into that.

On Sat, Mar 16, 2019 at 7:29 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Sat, Mar 16, 2019 at 06:08:45PM -0700, Forrest Curo wrote:
> Sending to a port from a terminal & piping to 'od -c' produces lines like:
> 0000000   i   1       0       1       3   3   0       0   .   5  \n   i
> [The 'i' above is the beginning of the next score line which continues
> below.
>
> Sending the same line from tcl to 'od -c' produces:
> 0000000   i   1       0       1       3   3   0       0   .   5  \r  \n
> *
> The tcl line is one character ( '\r' ) longer.
>
> In the tcl routine, after I set a socket name ie 'ch'
> and run:
> fconfigure $ch -buffering line -translation lf
>
> tcl sends the shell-terminal format and
> ought to work, then.

Sounds like the return char is screwing things up, then.
Strange -- I'd have thought that csound would be happy with that.
(I assume p4 was "33" in the above!)

Don't know tcl (last played with it 25(?) years ago!) but I hope
that works.

> ==============
> I didn't know about 'od', thanks much!!!

Welcome!  It's a useful tool in many situations...

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-03-17 05:24
FromForrest Curo
SubjectRe: [Csnd] score lines with tcl newlines fail
Attachmentstcl.png  
Now it's working, yay!
tcl.png

On Sat, Mar 16, 2019 at 8:18 PM Forrest Curo <treegestalt@gmail.com> wrote:
Tk is ugly but makes it very easy to link mousing an area on a 'canvas' to executing some tcl routine, such as sending a note to csound. Maybe more limited than other GUIy languages, but far less painful!

Emacs can hold a tcl script in one buffer -- and start a tcl process in another, executing whatever commands one copies into that.

On Sat, Mar 16, 2019 at 7:29 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Sat, Mar 16, 2019 at 06:08:45PM -0700, Forrest Curo wrote:
> Sending to a port from a terminal & piping to 'od -c' produces lines like:
> 0000000   i   1       0       1       3   3   0       0   .   5  \n   i
> [The 'i' above is the beginning of the next score line which continues
> below.
>
> Sending the same line from tcl to 'od -c' produces:
> 0000000   i   1       0       1       3   3   0       0   .   5  \r  \n
> *
> The tcl line is one character ( '\r' ) longer.
>
> In the tcl routine, after I set a socket name ie 'ch'
> and run:
> fconfigure $ch -buffering line -translation lf
>
> tcl sends the shell-terminal format and
> ought to work, then.

Sounds like the return char is screwing things up, then.
Strange -- I'd have thought that csound would be happy with that.
(I assume p4 was "33" in the above!)

Don't know tcl (last played with it 25(?) years ago!) but I hope
that works.

> ==============
> I didn't know about 'od', thanks much!!!

Welcome!  It's a useful tool in many situations...

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-03-17 20:42
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] score lines with tcl newlines fail
AttachmentsNone