Drum plugin: gaps between transients of each mic on each hit, sounds choppy

I have a personally recorded drum sample library. All mics (direct, overhead, and room) for each hit are separated into individual .wav files. So I have multiple files playing on each hit. The starting point of each hit is based on the direct mic’s transient since that’s where the transient happens first, which leaves a gap between the direct mic’s transient and the transients of the other mics, especially the room mics since they are farthest away from the drum kit.

I have a drum plugin that I made using JUCE and loaded the samples into it. When I solo the room mics and play the same piece (let’s say snare) fast enough, it sounds choppy because of that gap being played before each hit. It’s not as obvious with all the mics on because the direct and overhead mics play over the gap in the room mic since their transients happen earlier, but I don’t hear this issue in other drum plugins (using their libraries) when I solo the room mics. So I tried the only thing that I can think of, deleting the gaps and aligning the transients. It definitely got rid of the choppy sound and it sounds normal to the ear, but I’m not sure if this is the right way to go, especially since it’s difficult to make sure that enough of the gap is deleted so that the transient of each mic begins in the exact same spot.

When I load the samples into Battery or Slate Trigger, with the gaps included, there are no issues at all. Maybe right after a file is loaded they automatically find the transient and delete the gap, just a guess. My plugin doesn’t have any issues that I’m aware of, so I’m wondering if there is something in my plugin or the sample editing that I’m not taking into consideration when dealing with these gaps.

What exactly do you mean with choppy? Do you have multiple voices for each sample? Or do first stop a sample and play it from the beginning if it is triggered again? In that case, you will get a choppy sound, because the sample’s decay is interrupted.

Hi danielrurich,

By choppy I mean that when it’s played fast enough you mostly hear the gap before the transient, which as you suspected, may be a voice issue. I do have multiple voices that can play each sample, but not specifically for each sample. I just tested it again, and yes, it seems like it’s a voice issue. I had each voice’s canPlaySound() set to only play a specific piece (by piece I mean snare, tom, etc.), not by the individual sample of each piece. So if snare plays 5 samples at a time for each hit, and I have 20 voices for snare, the synth will take 5 voices from the 20. If another hit is played before the previous one ends, then it takes another 5, which makes it a total of 10 voices playing sounds, and so on. But it does not seem like its working the way I intended.

So what I did now is set each voice to only play a specific sample file instead of a random one each time based on the piece. So now each voice is restricted to play only 1 specific sample file, and now the choppy sound is gone, but now there is another issue. It seems like I’m confused with the way the voices are used and they way they are stolen. Once the synth has cycled through all the voices for one sample while they were still inactive, even after all those voices are cleared, the synth still goes to findVoiceToSteal() to steal a voice and I have no idea why. Every now and then it would still find a free voice, but after a few more hits it only tries to steal a voice because it can’t find any free voices. I made sure that each voice is cleared before trying again, and it still can’t find a free voice. Does clearCurrentNote() not guarantee that the voice will become inactive? I did not override findFreeVoice(), so it’s being used as JUCE intended. However, I did override findVoiceToSteal() to have an idea of how often a voice is getting stolen.

I think I might have an idea now where to start. I’m sorry I probably should’ve mentioned that I also have multiple velocity layers and round robins for each midi note. So the way I had it the first time, with voices set to each piece instead of individual sample files of each piece, it would almost always steal a voice because the synth would iterate through all of the velocity layers and round robins attached to the midi note that’s being played, while all I need is a few samples from 1 layer. Instead of separating what I need and don’t need outside the voices, I did it within the voices. So if a voice has a sound from the wrong layer or round robin, then it just won’t play it. Because of this, there are always voices being used even though most don’t end up playing any sound. That’s probably why it worked better when I gave each individual sample file a voice.

I’m still not sure why I’m having the voice steal issue though after giving each individual sample file a voice, even after clearing the voices. But there definitely seems to be an issue with the way I make the synth deal with different layers and round robins on the same midi note. So I will start there.