Quickly clearing tables when loading samples from SDcard


#1

Hey guys,
I'm building a drum machine patch and having lots of luck with it so far. The one issue I'm having is that switching between samples I have loaded on the SDcard is somewhat glitchy. Basically, the table/load object only writes the table for the length of the file it's loaded in. This is in theory very nice, because it's faster than writing the entire table. But if a longer sound was previously loaded, the end of that sound will play after the current one ends, leaving phantom "tails" on some short sounds. :unamused:

The first solution I came up with was to just clear the whole table by loading in a long file of silence before loading any new files. That's what I'm doing in this patch:

It's a bit fiddly because it uses pulselength and delayedpulse to manage string values, but it does work. However, it causes a big lag and squealy noises before the new sample loads. Now I'm adding selective muting to silence those squeals and so on, but I also can't scroll through sounds as quickly as I could before.

I'm not sure what the best solution is, so I thought I'd ask here first. I could try writing zeroes from within the patch rather than loading external silence. I could use 2 tables and round-robin between them to preload sounds. Or I could just go back and add silence to all the .raw files and make them the same length! What do you guys think makes the most sense?

Here's a quick video of the patch in action, before cleanup and subpatching things into some sensible order: