Allow a sample to play for its length


#1

My instrument is a drum sampler. I originally set the release for each sample to be as long as the sample length, however I ran into problems when I was playing the same note multiple times within the length of the sample - the release was so long that the notes were playing over each other, so I set the release to be as short as it needs to be if the same note plays twice, however it immediately starts to release as soon as noteOff is triggered so it doesn’t play the full sample. This is not the expected behaviour of a drum sampler.

What is the best way, using JUCE that I can make it so that samples are allowed to play out for their duration but will immediately go into their release if the same note is played twice?


#2

I’d let the second drum hit/noteOn start a second voice and simultanesously turn the first one into a fast release mode, the crucial point being not allowing any silence between the hits. If it was a snare drum I’d sample the snare wires independently, and give them a rather steep decay, i.e just as they’re sounding and play that voice simultanesouly to the skin hits.


#3

I got the answer to this particular problem from the JUCE discord channel which was to ignore the noteOff so a note is only entering its release if the same note was being sent to the voice.

But thanks @oxxyyd for the good advice on how to make realistic sounding release


#4

Doesn’t make any sense to me…
Sounds like every other note starts the sample and every other releases it.