Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Re: Can string variables really be k-rate?

Date2008-01-27 11:11
Fromvictor
Subject[Csnd] Re: Re: Re: Can string variables really be k-rate?
The manual is correct, they can be written at performance time,
but only once.

Victor
----- Original Message ----- 
From: "Rory Walsh" 
To: 
Sent: Saturday, January 26, 2008 6:15 PM
Subject: [Csnd] Re: Re: Can string variables really be k-rate?


> We've been through it before alright but I couldn't find any reference to 
> it in my mail archive. Should the manual be changed or is it easy to make 
> them k-rate? I can't even seem to modify them once. The example below will 
> not budge from number:0.0
>
> Rory.
>
>
>
>
> victor wrote:
>> I think they can only be modified once. We've been through
>> this before, haven't we?
>> ----- Original Message ----- From: "Rory Walsh" 
>> To: 
>> Sent: Saturday, January 26, 2008 2:49 PM
>> Subject: [Csnd] Can string variables really be k-rate?
>>
>>
>>> The manual states that string variables can be manipulated at 
>>> initialisation or performance time. So why won't the following code work 
>>> for me? It runs but keeps spitting out the same thing each time, am I 
>>> missing something?
>>>
>>> instr 1
>>> k1 line 1, p3, p3
>>> Sname = "number:"
>>> Sres sprintfk "%s:%2.1f\n", Sname, k1
>>> printks Sres, 0
>>> endin
>>>
>>> Rory.
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
>>> csound"
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
>> csound"
>>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound" 


Date2008-01-27 12:26
FromRory Walsh
Subject[Csnd] Re: Can string variables really be k-rate?
In fact they can be updated during performance as often as you like. 
Jonathan provided a working example in the manual which works fine, 
updating during performance. In order to get my example running I had to 
take out printks and use puts instead.

instr 1
k1 line 1, p3, p3
Sname = "number";
Sres sprintfk "%s:%2.1f\n", Sname, k1
puts Sres, k1
endin

Just so we're clear this doesn't work(why?):

instr 1
k1 line 1, p3, p3
Sname = "number";
Sres sprintfk "%s:%2.1f\n", Sname, k1
printks Sres, 0
endin

but this does:

instr 1
   kup line 0, p3, 100
   kdown line 30, p3, 10
   printks "kup = %f, kdown = %f\\n", 1, kup, kdown
endin

In one example printks works as expected, in the other example it 
doesn't. I'm afraid I'm still no nearer to understanding strings in Csound.

Rory.



victor wrote:
> The manual is correct, they can be written at performance time,
> but only once.
> 
> Victor
> ----- Original Message ----- From: "Rory Walsh" 
> To: 
> Se

Date2008-01-27 22:12
From"Oeyvind Brandtsegg"
Subject[Csnd] Re: Re: Can string variables really be k-rate?
AttachmentsNone  

Date2008-01-28 00:20
FromRory Walsh
Subject[Csnd] Re: Re: Re: Can string variables really be k-rate?
Looks like printks can't correctly print string variables that have been 
altered using sprintfk whereas puts can. Would others agree with this 
statement?

Rory.


Oeyvind Brandtsegg wrote:
> Looks like printks can update the % values to the string, but the
> string itself is only updated once.
> Oeyvind
> 
> 2008/1/27, Rory Walsh :
>> In fact they can be updated during performance as often as you like.
>> Jonathan provided a working example in the manual which works fine,
>> updating during performance. In order to get my example running I had to
>> take out printks and use puts instead.
>>
>> instr 1
>> k1 line 1, p3, p3
>> Sname = "number";
>> Sres sprintfk "%s:%2.1f\n", Sname, k1
>> puts Sres, k1
>> endin
>>
>> Just so we're clear this doesn't work(why?):
>>
>> instr 1
>> k1 line 1, p3, p3
>> Sname = "number";
>> Sres sprintfk "%s:%2.1f\n", Sname, k1
>> printks Sres, 0
>> endin
>>
>> but this does:
>>
>> instr 1
>>   kup line 0, p3, 100
>>   kdown line 30, p3, 10
>>   printks "kup = %f, kdown = %f\\n", 1, kup, kdown
>> endin
>>
>> In one example printks works as expected, in the other example it
>> doesn't. I'm afraid I'm still no nearer to understanding strings in Csound.
>>
>> Rory.
>>
>>
>>
>> victor wrote:
>>> The manual is correct, they can be written at performance time,
>>> but only once.
>>>
>>> Victor
>>> ----- Original Message ----- From: "Rory Walsh" 
>>> To: 
>>> Se
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>