AutoPocket: New Beat Detective clone for Reaper (demo video)

AdamWathan

Member
Apr 12, 2002
3,807
2
38
Cambridge, Ontario, Canada
Visit site
Alright so after fumbling around struggling to get the proper "edit smoothing" behavior in Reaper, I resorted to coding some actions myself to get the behavior I missed from Beat Detective in Pro Tools, while adding a ton of functionality people have been asking for in Beat Detective for years.

The bulk of it is this action:

SWS/AdamWathan: Fill gaps between selected items (advanced)

It's purpose is to intelligently fill the gaps between items that have been cut up and repositioned in the timeline, usually for drum editing purposes (ie. cutting all the hits and snapping them to the grid.) It does this by trimming the starts of items left to fill gaps, time stretching items if the gap is too big, etc. all according to preferences laid out by the user in the initial dialog.

Here's a YouTube video demonstrating my entire drum editing workflow using what I've added to Reaper. Skip to about 6:00 for the details about the action itself:



awfillgapsdialog.png


Trigger Pad: This is a leading pad added to the beginning of each chunk and subtracted from the end of the previous chunk. The snap offset is adjusted to compensate so that your media will still snap to the transient. It is a sort of safety buffer. Imagine you have a section where the snare and ride hits at the same time, but the ride is a tiny bit early. Dynamic split cut at the snare transient though for one of a variety of reasons. This buffer would ensure that the ride transient is preserved directly before the snare and that it is cut out of the previous item. It basically just lets you be lazier when checking the quality of your splits ;)

Crossfade Length: This is the length of the crossfade created between the tail of any item and the beginning of the next item. It is always placed to the left and is in addition to any trigger pad (ie. a trigger pad of 5ms and a crossfade length of 5ms will result in a minimum of 10ms between the start of the crossfade and the transient in the next item.)

Maximum Gap: This is the maximum allowable gap before the code attempts to time stretch the previous item. If you set a max gap of 20ms and the code detects a gap of 50ms, it will timestretch the previous item until either a) the gap has been reduced to 20ms, or b) the Maximum Stretch value has been reached. If the detected gap is less than the Maximum Gap, the following item is simply trimmed back to fill it with no stretching applied whatsoever.

Maximum Stretch: This is the maximum amount that an item will stretch. The value corresponds with the "Rate" value displayed in a media item when timestretching it, so 0.85 means the item will stretch to a maximum rate of 0.85 In my experience, it usually sounds better to allow more stretching than it does to allow a larger Maximum Gap, so don't be afraid to set this value low. A value of 0 will let the item stretch as much as it needs to while a value of 1 will disable stretching entirely.

Preserve Transient: This is the amount of the item you want to prevent from stretching no matter what. Stretching the initial attack of a media item usually sounds poor, so this will prevent that initial attack from stretching and only stretch the tail of the item. If this is set to 35ms for example, a split is placed 35ms after the transient and only the item to the right of the split will be stretched, leaving the initial attack untouched. A value of 0 disables this function completely. The default value of 35ms is usually pretty good.

Transient Crossfade Length: This is simply the length of the crossfade used when splitting at the "Preserve Transient" point.

Fade Shape: This determines the shape of the fades used when performing any crossfades. It is an integer from 0 to 5, the following chart explains which is which.

fadeshapeguide.png


Mark possible artifacts?: This is a value of 0 (no) or 1 (yes). If 1 is entered, the action will insert a marker everywhere that the gap exceeded the maximum allowable gap AND the maximum stretch value was reached, which means it had to trim the start of the following item more than expected. This allows you to easily identify areas where there might be an audible glitch so you can listen to them with special attention and either time stretch more to fix it, or copy and paste a better hit from a different part of the song.
 
Last edited by a moderator:
Interesting..

Reaper deals with lots of files and crossfades a hell of a lot better than Sonar, but it's never had BD so I've stayed away. Might be worth coming back to it, just for editing.
 
Alright so I did a quick little demo explaining the new feature I added, but I'll explain it here in text first.

Basically what I did was add a timestretching component. I know I know, it's blasphemy, but here me out. A lot of the time if two hits are played too close together and you pull them apart and backfill in between, you will hear a noticeable little snit. What I usually do in these situations, is if the gap is too big and I know I'm going to get a noticeable artifact, I will time stretch the first item a little bit in order to shrink the gap, and then backfill.

So the way it works is as follow. You are prompted for a "Max Gap" time, and a "Max Stretch Factor" value. The Max Gap is in seconds, and you just set this to whatever you think the maximum allowable gap is in your material where backfilling it won't sound glitchy. The Max Stretch Factor is how much you want to allow the items to stretch if the gap is too big. So say you set it to 0.85, the most it will stretch the item is down to 0.85 playrate (making the item 1/0.85 longer). 0.5 is half for example.

If you have 2 items with a 50ms gap, and you set the max gap to 25ms, it will stretch the first item until the gap is only 25ms or the max stretch factor is reached, then backfill the rest of the gap from the other item.

So a stretch factor of 1 means no time stretching will ever occur and it will function exactly like Beat Detective. The other extreme is a stretch factor of 0 and max gap of 0, which means it will stretch as much as necessary to fill the space between the items. It is very flexible and with the elastique 2 Pro algorithm in Reaper, it sounds great!

The problem with Elastic Audio has always been that it always stretched items in both directions. So even if doing it BD style would result in no gap and sound great, EA would still compress the first item. The problem with BD, is that if the gap is too big, it will still backfill it which results in a duplication of too much material and creates an audible glitch.

AutoPocket combines the best of both worlds by never compressing audio, and only stretching it when necessary to avoid the glitches you would get in Beat Detective.

Here's a quick demonstration, ignore how bad my commentary is! ;)

http://www.adamwathan.com/reaper/AutoPocketPro.swf
 
This is really awesome. Is there any chance you're gonna make a full package of modifications at any point? It would be awesome to just be able to complete a few simple steps and have a version of reaper working with the more "user-transferable" changes i.e. things that would be of use to many people.

I can imagine some serious annoyances keeping it up to date with all the new releases of reaper though
 
So the ground work is done, I have ported the code from Python to C++ and successfully compiled it within the SWS Extensions. So next SWS update will include this feature! ;)

Anyone have any better suggestions on the name? The term "AutoPocket" refers to the collection of actions I put in the toolbar, but since my code doesn't actually do any of the "pocketing" it seems sort of wrong. The split + quantize is what pockets it of course, my code does all the ugly dirty work of cleaning up after you and making sure everything is filled, stretched, crossfaded, etc. however necessary to give the best result...

So maybe some name that alludes to the filling of the gaps? It can be useful for lots of non-drum editing stuff as well! ;)