Csound Csound-dev Csound-tekno Search About

[Csnd] Passing diskin a filename?

Date2013-01-30 23:08
From"Art Hunkins"
Subject[Csnd] Passing diskin a filename?
I need the event opcode to pass a filename to diskin in the called 
instrument.

The filename is "1.wav".

The problem? Event (or schedkwhen for that matter) does not take a string as 
an argument.

Also, if I simply pass the numeric variable "1", I see no way of converting 
that to the string "1.wav". What am I missing?

(I would like to pass filenames "1.wav" through maybe "10.wav" to the same 
called instrument, BTW.)

Art Hunkins 


Date2013-01-30 23:18
FromSteven Yi
SubjectRe: [Csnd] Passing diskin a filename?
Hi Art,

You could maybe use strset/strget to convert from an string to an index:

http://csounds.com/manual/html/strset.html
http://csounds.com/manual/html/strget.html

to format a number into a string as you mentioned, you can use:

http://csounds.com/manual/html/sprintf.html

and use a format string of "%d.wav".

steven

On Wed, Jan 30, 2013 at 11:08 PM, Art Hunkins  wrote:
> I need the event opcode to pass a filename to diskin in the called
> instrument.
>
> The filename is "1.wav".
>
> The problem? Event (or schedkwhen for that matter) does not take a string as
> an argument.
>
> Also, if I simply pass the numeric variable "1", I see no way of converting
> that to the string "1.wav". What am I missing?
>
> (I would like to pass filenames "1.wav" through maybe "10.wav" to the same
> called instrument, BTW.)
>
> Art Hunkins
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>

Date2013-01-30 23:19
FromJustin Smith
SubjectRe: [Csnd] Passing diskin a filename?
as one option, you could name the files diskin.1 diskin.2 etc. and then you only need supply 1, 2, etc as numeric arguments and csound will find the files

The file type can be resolved from the header, so .wav is not necessary for csound (though it can be awkward for the user if you are used to the extension of a filename describing the content).




On Wed, Jan 30, 2013 at 3:08 PM, Art Hunkins <abhunkin@uncg.edu> wrote:
I need the event opcode to pass a filename to diskin in the called instrument.

The filename is "1.wav".

The problem? Event (or schedkwhen for that matter) does not take a string as an argument.

Also, if I simply pass the numeric variable "1", I see no way of converting that to the string "1.wav". What am I missing?

(I would like to pass filenames "1.wav" through maybe "10.wav" to the same called instrument, BTW.)

Art Hunkins


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-01-31 07:28
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] Passing diskin a filename?
AttachmentsNone  None