<-- | --> |
CECILIA offers some special sound information functions that are very useful for the development of modules that require to know beforehand the duration or size of a sound to be processed.
[sinfo <name of sound> info]where <name of sound> is the name given for the cfilein object
where info can be:
frames : the number of sample frames in the sound
dur : the duration of the sound in samples
sr : the sampling rate of the sound
chn : the number of channels in the sound
sinfo would be typically used in an orchestra to obtain information about the selected sound without having to "type" in the values specifically. The following statement encountered in the orchestra::
gilen = [sinfo source frames]
would be substituted at compile time by the number of frames in the
sound chosen with the cfilein object named source.
[findgenSize number]findgenSize is useful in the score for finding the power-of-2 size greater than the frame number of a given sound. If the cfilein object named source was used to select a sound of 456818 sample frames, the following statement encountered in the score:
f12 0 [findgenSize [sinfo source frames]] -1 "[source]" 0 0 0would return:
f12 0 524288 -1 "[source]" 0 0 0