Csound Csound-dev Csound-tekno Search About

Re: [Csnd] getting MANY audiofiles into Csound

Date2005-09-18 17:16
FromMichael Gogins
SubjectRe: [Csnd] getting MANY audiofiles into Csound
You can also use the SoundFont opcodes. There are tools for creating one's own SoundFonts. Doing it this way would enable your samples to be used in Csound and also in other SoundFont enabled software.

Regards,
Mike

-----Original Message-----
From: jlato@mail.utexas.edu
Sent: Sep 18, 2005 12:25 AM
To: csound@lists.bath.ac.uk, david kamp 
Subject: Re: [Csnd] getting MANY audiofiles into Csound

Hi,

I don't know of any elegant way to import many samples (I'd love to know if
there is a good way), but here are 2 suggestions.
If you can play back the sampled files with loscil, convert them all to AIFF
format and use a deferred table size.  At least that way you don't need to
calculate the table sizes.
Also, if you use a score preprocessor (esp. something like Python and/or Blue),
you could create a short script that would create all the tables and calculate
the sizes for you.  This is the approach I would take.
John Lato

Quoting david kamp :

> hello everybody.
> My first post to this list, been reading it for a while though,
> great people and lots of info here...
> 
> my question is:
> Is there an elegant way to automate sample importing with csound?
> Lets say i want to get a folder with lots of wave files to be ready for
> processing, do i really have to calculate the power of two, and type
> everything manually?
> 
> Isnt something like batch processing possible?
> Im using csound with Windows XP by the way...
> 
> Any suggestions? How do you do it?
> --
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
> 



-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk



-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2005-09-18 21:36
FromDavid Akbari
SubjectRe: [Csnd] getting MANY audiofiles into Csound
On Sep 18, 2005, at 12:16 PM, Michael Gogins wrote:

> You can also use the SoundFont opcodes. There are tools for creating 
> one's own SoundFonts. Doing it this way would enable your samples to 
> be used in Csound and also in other SoundFont enabled software.
>
> Regards,
> Mike
>

It's too bad the only software you can actually make SoundFonts with is 
only for PC... otherwise this is a good solution.

I usually find the following to be an efficient mechanism for 
implementing the playback of audio files





sr		=	44100
kr		=	441
ksmps	=	100
nchnls	=	2

gifn1	ftgen	1, 0, 131072, 1, "/loops/dl_break0.aif", 0, 4, 0

		instr	1

atabl		init	0

itabsz	tableng	1
andx		phasor	1 / (itabsz / sr)
andx		=	andx * itabsz

		vtaba		andx, 1, atabl
atabl		=	atabl * 32767

	outs	atabl, atabl

		endin


f0	8888




However, it would be nice if the tablera, tabra, vtaba, and vtabra 
could accept deferred size GEN tables. As if you try to make the ftgen 
use a deferred size (as of CVS Sept 18 2005) Csound5 returns the 
following error:

new alloc for instr 1:
INIT ERROR in instr 1: deferred-size ftable 1.000000 illegal here

The reason I say this is because the DISKIN opcodes uses a little less 
than 30% CPU whereas the above illustrated technique uses only 2-3% (on 
my system). This is consistent across optimized and un-optimized 
versions of Csound4 and 5 as well as versions compiled at both single 
and double precision.

For the purposes of this thread, I have also been experimenting with 
loading an array of S-type variables into a GEN23 but I was 
unsuccessful with that...

Maybe to implement getting MANY files into Csound you could load a .txt 
file into an array which contains a numerical index for each file that 
you would define in your ORC with the use of an strset opcode...

Are there any GEN routines at present that deal with S-type variables?? 
I can think of a whole mess of reasons you'd want an array of strings 
or symbols...


-David

-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2005-09-18 22:04
FromSteven Yi
SubjectRe: [Csnd] getting MANY audiofiles into Csound
AttachmentsNone