Csound Csound-dev Csound-tekno Search About

[Csnd] String parameters/error

Date2019-10-19 11:15
FromBernard Geyer
Subject[Csnd] String parameters/error
instr Test1
  printf_i "test %s %s\n", 1, p4, p5
endin

instr Test2
  S1 = p4
  S2 = p5
  printf_i "test %s %s\n", 1, S1, S2
endin

i "Test1" 0 0.01 "aaa" "bbb" ; segfault

i "Test2" 0 0.01 "aaa" "bbb" ; works

Why does the first example don't work ?

Btw, for what reason can we use strings in schedule and scoreline and not in
event ? Has it to do with efficiency ?




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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-10-19 11:22
From"Jeanette C."
SubjectRe: [Csnd] String parameters/error
Oct 19 2019, Bernard Geyer has written:
...
> instr Test2
>  S1 = p4
>  S2 = p5
Even surprised this works. From experience - admittedly some time ago -
I learned: S1 = p4 is OK, from then onwards use S2 strget p5. I just
know that it is, not why.
...

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Just call out my name, and I will be there... <3
(Britney Spears)

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-10-19 13:40
Fromjoachim heintz
SubjectRe: [Csnd] String parameters/error
yes i'd also say. use strget when you want to be sure it works:
	S1 strget p4
or
	S1 = strget(p4)

	joachim



On 19/10/19 12:22, Jeanette C. wrote:
> Oct 19 2019, Bernard Geyer has written:
> ...
>> instr Test2
>>  S1 = p4
>>  S2 = p5
> Even surprised this works. From experience - admittedly some time ago -
> I learned: S1 = p4 is OK, from then onwards use S2 strget p5. I just
> know that it is, not why.
> ...
>
> Best wishes,
>
> Jeanette
>

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