Csound Csound-dev Csound-tekno Search About

[Csnd] getting MANY audiofiles into Csound

Date2005-09-17 13:36
From"david kamp"
Subject[Csnd] getting MANY audiofiles into Csound
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

Date2005-09-17 17:43
FromPrent Rodgers
SubjectRe: [Csnd] getting MANY audiofiles into Csound
David,

If you find a way to automate the management of sample files, let me 
know. To solve this problem, I wrote a program (in Pascal of course), 
that reads a set of text files with the note names, file names, and 
pitches, and created a file that I then refer to when preprocessing my 
source file with another program (in Pascal), which in turn generates 
the Csound .csd file. The result is a Csound input file that contains 
only the samples required by the notes in the current version of the 
piece. It might have one or two notes, or tens of thousands in a final 
work. If it only has a few, the .csd will only have a few sample files 
that are loaded. If it is a finished piece, the .csd may require 
hundreds of sample files.

The basic method I used for the McGill University Master Samples was to 
build a text file that has all the information on each instrument's 
samples. Then when I generate my .csd file, I look at that file to find 
the samples for each instrument, and each note in the piece. The text 
file, which I have since hand edited to correct intonation and lead in 
times for samples, looks like this:

; instrument number
; |  mono=1 or stereo=2
; |  |  base note
; |  |  |  loop 0=no 1=yes
; |  |  |  | start sample earlier (in milliseconds)
; |  |  |  | |    cent adjustment value
; |  |  |  | |    |   File name
   2  1  67 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H G3.aif
   2  1  69 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H A3.aif
   2  1  71 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H B3.aif
   2  1  74 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H D4.aif
   2  1  77 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H F4.aif
   2  1  80 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H G#4.aif
   2  1  84 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H C5.aif
   2  1  87 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H D#5.aif
   2  1  91 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H G5.aif
   2  1  93 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H A5.aif
   2  1  96 0    0 0   McGill/Partition C/HARP-HARMONC/HARP-H C6.aif
   3  1  37 0    0 0   McGill/Partition C/HARP/HARP C#1.aif
   3  1  39 0    0 0   McGill/Partition C/HARP/HARP D#1.aif

Then at score generation time, my preprocessor source asks for an 
instrument number. I keep track of all the notes and what sample they 
will need at performance time, and make sure to include that sample file 
name in the final .csd file. It was a tremendous amount of work to make 
the text file, and process all the samples, but I've been getting years 
of enjoyment out of the resulting composing environment. I did most of 
this work in 1997 for one sample library, and then again in 2000 for the 
McGill collection. When I started using samples I was quickly 
overwhelmed by the sheer number of files that had to be included for 
multi-instrument, multiple samples per instrument orchestras. Especially 
back in 1997 with 100 mHz processors and 8 MB of RAM, when limiting the 
number of samples to process was critical. It's less important now with 
faster processors and more memory.

Since my goal was to exploit microtonality, tuning each sample was 
especially important. The McGill collection has some terrible intonation 
in some instruments. What's that old joke about "how do you tell the 
piccolo player is playing out of tune?"

Prent Rodgers

david kamp wrote:
> 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?

-- 
Music that's "Fake but Accurate"!
Web page: http://prodgers13.home.comcast.net
Podcast: http://podcast1024.libsyn.com
Another Podcast: http://BumperMusic.blogspot.com
Music: http://www.soundclick.com/PrentRodgers

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

Date2005-09-18 05:25
Fromjlato@mail.utexas.edu
SubjectRe: [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