Csound Csound-dev Csound-tekno Search About

Re: simultaneous "soundin" files

Date1997-02-25 09:53
FromGabriel Maldonado
SubjectRe: simultaneous "soundin" files
John Boyd wrote about simultaneous "soundin" files:
> 
> John et al..
> 
> How does csound load sample instruments like this?:
>........................
> I have an .orc file that has something like 175 different samples and
> I'm curious as to when csound reads these files in.  Does it simply load
> all the samples into memory 1st or does it open up file handles when
> they're needed during the performance?  I've been seeing some voices
> drop off during high tempo performances which makes me wonder whether a
> faster scsi2 harddrive would help.

Csound loads segments of each file only when required in performance
processing. The
soundin buffer length is declared in the file SOUNDIO.H:

#define	SNDINBUFSIZ  4096	/* soundin bufsize;   must be >
sizeof(SFHEADER), */

so only 4096 bytes of memory  are filled with each input file data at a
time.
Note that normal "soundin" UG does not operate correctly with input file
sampling 
rates different from current sr value. 

My new (optional) "soundin2" UG allows input file sampling rates of any
value and 
resample them with current sr value. It also allows krate interpolated 
pitch-shifting of the original soundfile.

The sintax of "soundin2" is:

a1      soundin2   ifilcod, iskptim, iformat, kfrqratio
a1, a2  soundin2   ifilcod, iskptim, iformat, kfrqratio

where kfrqratio is a multiplier factor of the base frequency (i.e. 
kfrqratio =1 to set the same frequency of the input file, kfrqratio =
1.5 
for a fifth above the base frequency and so on). 

Bye

Gabriel Maldonado

g.maldonado@agora.stm.it