Kassen wrote:
Michael wrote:
Altogether this creates 238 SndBufs, which appears to be more than ChucK can handle. Sample playback skips, repeats, or is otherwise corrupted. Removing some of the mappings improves playback.
That's rather a lot! :-)
When I read your mail I suspected that you were connecting all of those SndBuf's to the DAC, which would indeed cost quite a lot of CPU (only connecting the ones that you need when you need them and disconnecting them after that would save a lot in your case)... However looking at your file I don't see either a SndBuf or a dac at all. Those must be in another file.
Yep, every instance of Sample has a SndBuf chucked to dac https://github.com/heuermh/lick/blob/deab64e5b1eb1783e9a68bb508a0317c0287bf1...
So, let's talk about it; do you mean that simply allocating this amount of memory causes a large CPU load in and of itself? It shouldn't, IMHO only UGens and code should cost CPU. It could be that the garbage collection is going bonkers?
ChucK appears to be hitting one CPU on a two CPU machine pretty hard, but is only using 305M of RAM. Overall CPU usage on the machine is around 55%.
I don't think memory allocation should do this, at least not once it's allocated. 200 mono drumhits doesn't sound like a lot of memory to put into the ram of a computer these days, expecting it all to play *while* the samples are being pulled from the drive into ram might be a bit much.
Good point. I tried adding a 20 second wait between creating the BigMono object and all the samples and playing them, to allow for disk IO, and still get the playback problems. If anyone wants to play along at home, you'll need to download LiCK from github and the Big Mono drum kit from here http://www.analoguedrums.com and rename the .wav files according to the attached (some files in bigmono.zip are named incorrectly), or rename some other samples, or change the file paths in BigMono.ck to match your samples, or code-reuse by cut and paste BigMono.ck to a different ChucK class to match your samples. See e.g. https://github.com/heuermh/lick/blob/master/RolandTr606.ck Then $ chuck --loop & $ chuck + import.ck $ chuck + examples/bigMonoDemo.ck michael