[Csnd-dev] Escape characters in scoreline strings

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd-dev] Escape characters in scoreline strings

hlolli
To continue with the discussion on Slack.

Yesterday John fixed a lot with handling escaped characters in score event strings, newline is correctly handled and things mostly work. But for completion, then we are still left with strange behaviour from escaped quotation marks, which can be reproduced with the following csound code

..elided...
instr 1
  Str strget p4
  prints Str
  ires compilestr Str
endin

<CsScore>
i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
e 0 10
</CsScore>
..elided...


Best,
Hlödver
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Escape characters in scoreline strings

jpff
Have you tried \\\" instead of \" as I suspect the " is being used in the or have to stop the string.

Not at a computer yet so will be a while before I can test.

⁣Sent from TypeApp ​

On Mar 6, 2018, 10:10, at 10:10, "Hlöðver Sigurðsson" <[hidden email]> wrote:

>To continue with the discussion on Slack.
>
>Yesterday John fixed a lot with handling escaped characters in score
>event
>strings, newline is correctly handled and things mostly work. But for
>completion, then we are still left with strange behaviour from escaped
>quotation marks, which can be reproduced with the following csound code
>
>..elided...
>instr 1
>  Str strget p4
>  prints Str
>  ires compilestr Str
>endin
>
><CsScore>
>i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
>e 0 10
></CsScore>
>..elided...
>
>
>Best,
>Hlödver
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Escape characters in scoreline strings

jpff
In reply to this post by hlolli
Hummmm.  It is not to do with the place changed yesterdy but earlier in
the pre lexer.  Tracing the rdscor.c funcion I see the score is already
"w 0 60\ni 1 0x0p+0 0x0p+0 0x0p+0 0x0p+0 \"giExp2 ftgen 0, 0,  131072,\\\"\ne\n"

so the exp has been scrambled.  Initial look showed nothing amiss.  May
take a while.

On Tue, 6 Mar 2018, Hlöðver Sigurðsson wrote:

> To continue with the discussion on Slack.
> Yesterday John fixed a lot with handling escaped characters in score event
> strings, newline is correctly handled and things mostly work. But for
> completion, then we are still left with strange behaviour from escaped
> quotation marks, which can be reproduced with the following csound code
>
> ..elided...
> instr 1
>   Str strget p4
>   prints Str
>   ires compilestr Str
> endin
>
> <CsScore>
> i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
> e 0 10
> </CsScore>
> ..elided...
>
>
> Best,
> Hlödver
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Escape characters in scoreline strings

jpff
In reply to this post by hlolli
Can you try again?  Think it is fixed



On Tue, 6 Mar 2018, Hlöðver Sigurðsson wrote:

> To continue with the discussion on Slack.
> Yesterday John fixed a lot with handling escaped characters in score event
> strings, newline is correctly handled and things mostly work. But for
> completion, then we are still left with strange behaviour from escaped
> quotation marks, which can be reproduced with the following csound code
>
> ..elided...
> instr 1
>   Str strget p4
>   prints Str
>   ires compilestr Str
> endin
>
> <CsScore>
> i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
> e 0 10
> </CsScore>
> ..elided...
>
>
> Best,
> Hlödver
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Escape characters in scoreline strings

hlolli
Confirmed, this code snippet works now on my computer!

On 6 March 2018 at 16:20, jpff <[hidden email]> wrote:
Can you try again?  Think it is fixed



On Tue, 6 Mar 2018, Hlöðver Sigurðsson wrote:

To continue with the discussion on Slack.
Yesterday John fixed a lot with handling escaped characters in score event
strings, newline is correctly handled and things mostly work. But for
completion, then we are still left with strange behaviour from escaped
quotation marks, which can be reproduced with the following csound code

..elided...
instr 1
  Str strget p4
  prints Str
  ires compilestr Str
endin

<CsScore>
i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
e 0 10
</CsScore>
..elided...


Best,
Hlödver