From the wild and wacky brain of Robert Randolph, this one is for editing drum tracks and that sort of thing. Split some items, snap them to the grid, and then let this script try to intelligently fill in any gaps you've left.

It uses a combination of RMS and a couple of max/min lengths to split and stretch the "tails" of your items while leaving the transient alone.

I found a bit of a bug after running the script the first time. I set a toolbar button to run the script (at the top of the window), and it seems the script opens the windows where the mouse cursor was...cutting off the top of the window and making me unable to click the toolbar buttons (or any of the menu) beneath the window.

I found a bit of a bug after running the script the first time. I set a toolbar button to run the script (at the top of the window), and it seems the script opens the windows where the mouse cursor was...cutting off the top of the window and making me unable to click the toolbar buttons (or any of the menu) beneath the window.

For testing purposes, I imported a drum loop into Reaper. The original tempo is 100 BPM.
I split it on the transients, afterwards, I set the timebase to beat positions only.
Then I change the BPM to 120 and the "desired" gaps appear.
Now, when I run the script, nothing happens. Are the gaps too big?

For testing purposes, I imported a drum loop into Reaper. The original tempo is 100 BPM.
I split it on the transients, afterwards, I set the timebase to beat positions only.
Then I change the BPM to 120 and the "desired" gaps appear.
Now, when I run the script, nothing happens. Are the gaps too big?

Nothing happens at all?

- If you enable "Place markers when no split point is found" it should drop a bunch of them telling you why it didn't do anything for each item.

- It is possible for a gap to be too big, depending on your settings - if the final stretched rate of the split item would be less than "min. stretch rate" it will skip it rather than dragging your audio out that far.

There's one thing I wonder in your GIF. There, the transients are kept intact and the tail is stretched. However, that doesn't happen here. Here, the item remains the same, but instead little snippets are inserted into the gaps.

- Your items are pretty quiet, so with a higher threshold it's probably not finding a place to split before it hits the "protect left" value and gives up. I can make the slider go lower if that would help.

- I'm seeing a couple of items in your test project that it doesn't like, for some reason. If I select everything, it skips them, but selecting those items specifically seems to work fine... I have no idea why.

- If you turn on both of the marker options, is every item at least ending up with a marker now? The previous version was failing and not even doing that much.

The problem is that I actually have to look through the item for the last position where the RMS is higher than __ dB. I have it looking through each channel, sample by sample, and then keeping a rolling average of the last 200ms or whatever worth of samples to calculate an RMS with.

I think it must be messing up splitting the samples for each channel, but I'm not sure how or why. I might just have it sum the channels or average them instead...

Alrighty, I rewrote a bunch of the audio code and it appears to be playing nicely with everything now. Here's a version for testing if anybody has a few minutes. It should work on both mono and stereo items: