Modding Sampler Style 49

Hey there !

I’m trying to mod @chrisk 's Sampler Style 49 (itself derived from Sampler Style) to make it a bit more like a “”“real”“” instrument.

The first step was to crossfade a bit to remove the clicking sounds that happened whenever a sample hadn’t completely finished playing. That was easy enough thanks to another thread on this forum. The result is this :

sampler-voice no clicking.pd (4.1 KB)

I’m stuck on the second step though : make it so that samples last only as long as a key is pressed.
Ideally, I’d also like to make it so that the volume of each sample is dependent on the velocity.

My first instinct was to use this old Critter & Guitari tutorial and apply the same technique: multiply the volume of the sample voice by the velocity of the key.

sampler-voice velocity test.pd (4.4 KB)

However, I realised that the patch isn’t “truly” polyphonic, i.e. that there aren’t multiple sample voices running in parallel. When you pressed a key, then a second one, and released the second key, the first would also stop playing. It doesn’t seem like much, but it makes it unplayable.

My guess is that I’d need to edit the info passed into the tabread4 array and change the location of the playback in the array when a key is released.

However, that’s where my very limited knowledge of pd runs out.

Can anyone with a bit more experience point me to a possible solution? Thanks a lot!

…and then add the possibility to record the samples direct with the build in mic. That would be really useful! :slight_smile: