Csound Csound-dev Csound-tekno Search About

[Csnd] Svariable at k-rate?

Date2017-11-08 14:51
From"Jeanette C."
Subject[Csnd] Svariable at k-rate?
Hey hey,
I read the string variables could be both i-rate and k-rate, or changeable at 
performance-time. Somehow this doesn't work for me:
if condition
   kdate date
   Sfilename sprintfk "%d.wav", kdate
   ...
endif

Using printks to print kdate, whenever the branch is executed, shows that 
kdate changes. I didn't figure out a way to print Sfilename, since printks 
doesn't accept an Svariable argument.

Any hints or another mechanism to generate changing filenames would be very 
welcome.

Best wishes,

Jeanette

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

Don't worry, you're gonna be alright,
But Cinderella's got to go <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

Date2017-11-08 16:41
FromRory Walsh
SubjectRe: [Csnd] Svariable at k-rate?
How about:

if metro(1) == 1 then
  kdate date
  Sfilename sprintfk "%d.wav", kdate
  printks Sfilename, 0
endif

On 8 November 2017 at 14:51, Jeanette C. <julien@mail.upb.de> wrote:
Hey hey,
I read the string variables could be both i-rate and k-rate, or changeable at performance-time. Somehow this doesn't work for me:
if condition
  kdate date
  Sfilename sprintfk "%d.wav", kdate
  ...
endif

Using printks to print kdate, whenever the branch is executed, shows that kdate changes. I didn't figure out a way to print Sfilename, since printks doesn't accept an Svariable argument.

Any hints or another mechanism to generate changing filenames would be very welcome.

Best wishes,

Jeanette

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

Don't worry, you're gonna be alright,
But Cinderella's got to go <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

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

Date2017-11-09 13:12
From"Jeanette C."
SubjectRe: [Csnd] Svariable at k-rate?
Nov 8 2017, Rory Walsh has written:

> How about:
>
> if metro(1) == 1 then
>  kdate date
>  Sfilename sprintfk "%d.wav", kdate
>  printks Sfilename, 0
> endif
...
Hey hey Rory,
this does work, but somehow the next conditional block that actually
uses fout to record to a file always uses the same filename, eventhough
I see the filename changing. Is the filename paraeter of fout always
i-rate?

I'm thinking about moving the recording code into a second instrument,
trigger by the event opcode. When later-on using turnoff, will that
properly stop the recording?

Best wishes,

Jeanette

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

With you I get so high
Lost in the crystal sky
You are this melody
That's where you take me <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

Date2017-11-09 14:05
FromRory Walsh
SubjectRe: [Csnd] Svariable at k-rate?
That's what I normally do. You can then pass the filename to the instrument so fout can pick up the string at init-time, which is what it wants.

On 9 November 2017 at 13:12, Jeanette C. <julien@mail.upb.de> wrote:
Nov 8 2017, Rory Walsh has written:

How about:

if metro(1) == 1 then
 kdate date
 Sfilename sprintfk "%d.wav", kdate
 printks Sfilename, 0
endif
...
Hey hey Rory,
this does work, but somehow the next conditional block that actually
uses fout to record to a file always uses the same filename, eventhough
I see the filename changing. Is the filename paraeter of fout always
i-rate?

I'm thinking about moving the recording code into a second instrument,
trigger by the event opcode. When later-on using turnoff, will that
properly stop the recording?

Best wishes,

Jeanette

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

With you I get so high
Lost in the crystal sky
You are this melody
That's where you take me <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

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