Re: [Csnd] A random reading

I’ve a few instruments I’ve toyed with over the years that do things similar to what you’re looking for. I will have to spend some time to clean up a file and add comments for a recent inst, but here is an older one that could probably be extended to meet your needs. It’s fascinating that everyone has different solutions and we all use different opcodes and techniques.

This instrument reads random files from a directory and outputs an extract. If there is just one file in the directory, all the samples will be from the same file. The starting point could be taken from a line set to the duration of the p3 statement if you want to successively sample from the same file.

To vary each sample’s duration, it may be easiest to vary the attack and decay of the envelope, or randomly set the duration (iseg) of each loop.