Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Escape characters in scoreline strings

Date2018-03-06 10:10
FromHlöðver Sigurðsson
Subject[Csnd-dev] Escape characters in scoreline strings
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

Date2018-03-06 11:56
FromJohn ff
SubjectRe: [Csnd-dev] Escape characters in scoreline strings
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"  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
>
>
>i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
>e 0 10
>
>..elided...
>
>
>Best,

Date2018-03-06 14:52
Fromjpff
SubjectRe: [Csnd-dev] Escape characters in scoreline strings
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
> 
> 
> i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
> e 0 10
> 
> ..elided...
> 
> 
> Best,
> Hlödver
> 
>

Date2018-03-06 15:20
Fromjpff
SubjectRe: [Csnd-dev] Escape characters in scoreline strings
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
> 
> 
> i 1 0 0 "giExp2 ftgen 0, 0, 131072, \"exp\", 0, -50, 1"
> e 0 10
> 
> ..elided...
> 
> 
> Best,
> Hlödver
> 
>

Date2018-03-06 15:35
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Escape characters in scoreline strings
Confirmed, this code snippet works now on my computer!

On 6 March 2018 at 16:20, jpff <jpff@codemist.co.uk> 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