| 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 |