<br><br><div class="gmail_quote">On Thu, Jan 26, 2012 at 15:22, Kassen <span dir="ltr"><<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">If you keep all of them in a big array then they are all indexed. Then</div>
you can have a array of 10 (or so) integers that keeps track of the<br>
current 10 in use. When a new sample needs playing you look up in that<br>
array what the oldest sample is, unchuck that, replace the number with<br>
the number of the new one and chuck the new one to dac. Then you just<br>
need to cover for re-triggering buffers that are already connected,<br>
but that's quite simple.<br>
<br>
That will work, but it won't deal with clicks for you. How hard clicks<br>
are to deal with will depend on how dense your drumming gets, compared<br>
to the length of the sample. If you are lucky you won't need to care<br>
at all.<br>
<br>
Yours,<br>
Kas.</blockquote><div><br></div><div>It's not too hard to create an instrument with noteOn / noteOff methods for each SndBuf.  A noteOn patches the instrument into a chain with a quick gain ramp up from zero, a noteOff ramps it down and sporks a thread to unpatch it after the ramp hits zero.  At least, that what I think I used to do... ;)</div>
<div><br></div></div>