Hello. I have code I believe is heading in right direction. I want to listen to single cycle waveforms, one after another. Explore?
My code works but bothers me. I feel I should not need an f table for every .WAV file. I believe one strategy might be to deallocate an f-table and specify a new input file while the other one is playing. I would need a total of two f-tables for this strategy.
I could not come up with a way to use only two f-tables. Here is the code that works. I believe the secret lies in knowing how to write the score.
It it possible to use two f-tables to play a number of sample files, one after another? Is there a better way?
i’d say if the sound files are not too large, and you need to have them
in ftables (rather than using diskin), it is a good idea to put each
sound in a seperate table (as you did). you can automatize this process
by the directory opcode and a while loop.
i don’t see why you use two instruments instead of one, passing the
table number as p4:
loscil gkamp, gkfrq, p4
Hi there, welcome! It’s not uncommon for my Csound projects to have many f-tables of WAV files.
Piggybacking off what Joachim said, here’s example code of using the directory opcode and a while loop from the Cabbage forum. That way you don’t need to hand code each f-table.
While I agree 200% with the advice given, if you were to persist with your approach there is a tablecopy opcode that you might use. And also note that tables can be created in the orchestra using ftgen
Thank you all. There are some things about CSound that I am still trying to get my head around. The possibility that CSound can see what’s coming and prepare for it. The implication being that this preparation is done in a background thread. Perhaps even look ahead (in the score)?
I see there is the ability to deallocate tables from the score. I did not know about ftgen. This reinforces the notion that a smooth performance is one that efficiently manages resources if a lot of tables are needed. Management that possibly needs done ahead of time.
I wound up using a single table for all of the waveforms and there did not seem to be any noticeable gap between them.
I think the directory read strategy is the right way to go. That way I don’t have to rewrite the score for every new group of waveforms.