Thread: MPL Align takes
View Single Post
Old 07-22-2016, 05:06 PM   #1
Human being with feelings
mpl's Avatar
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,525
Default MPL Align takes

Align takes is a Lua script for REAPER. Algorithm is based on matching RMS envelopes of dub takes and some reference take using stretch markers.

How to use it?
  • select items/takes
  • press 'Get'
  • move slider

Here is very nice video review by Antonio Petrole:

You need to have at least 2 items placed on different tracks one under another. The reference item/take is upper take. You can also simultaneously work with any count of takes. The upper take will be also reference item/take for them. "Can I give to this script any audio?" No. You need to prepare item/takes manually OR just click "Get" button and see what special "prepare" function will do.
Perfect situation:
  • ref. and dub takes with takerate = 1
  • ref. and dub takes without stretch markers
  • ref. and dub takes without snap offset
  • ref. and dub takes are not loop sourced
  • reference take edges over dub takes edges (so every point of dub take is beetween ref.take position and ref.take end)
After you pressed "Get" button, you should see ugly waveforms in script window. If you see vertical lines on syllables/transients, then congratulations - your takes ready to match each other. Move slider and see what happen. If you didn`t see then - try to play with settings, which are explained further. Press "+" button to extend window and change preferences.

Green knobs are parameters for detection syllables and transients start/end positions (I call them 'points' further, they represented as vertical lines on the waveform graph). RMS envelope ('envelope' further) of course have some window, so aligning non-macro stuff like drums is not a good example for this tool. Basically points added when envelope rise/fall (envelope always rising/falling so green knobs let you define when exactly to add points, i.e. define conditions for adding).
  • Scaling. Let you define how much do you wanna compress signal for detection. It does NOT compress actual take audio. More compression = rise/fall settings more sensitive. No compression = better for transient-like detection.
  • Threshold is linear "noise floor" for detected points, so it leave only points if the signal at this moment upper than threshold. It is represented on the graph. Lower threshold = more points.
  • Rise area. If signal rise/fall by value defined with Rise/Fall and Rise/Fall2 in this area, point will be added. Short time = more points. Long time = better for smooth vocal stuff.
  • Rise/Fall - linear gain/attenuation factor when checking Rise area for scaled envelope. Lower value = more points.
  • Rise/Fall2 - linear gain/attenuation factor when checking Rise area for original envelope. Lower value = more points.
  • Filter area - minimal space beetween detected points. Long time = less points.

Red knob is a parameter for main algorithm.
  • Search area means how far possible stretch markers can be moved from the detected points. Short time = tiny alignment.

Blue knobs are parameters for building envelope
  • First selector allow to change type envelope beetween RMS envelope and FFT (sum of spectrum bins values) envelope.
  • Second selector allow to change algorithm. First algo get every block beetween 3 closest points and find best fit by moving center point. Second algo use same technique, but get blocks one-by one and calculate best fit potential stretch markers position relative to previously stretched blocks (sorry cant explain better even on my native Russian).
  • RMS window is how much samples taken to calculate average for every envelope point. Lower window = better point detection. Higher window = better for long phrases and non-transient-look stuff.
  • FFT size is number of FFT bins.
  • HP and LP control FFT edges.
  • Smooth knob control smoothing final envelope for detection rise/fall points. More smooth = slightly better performance.

With version 1.110+ you can also save your presets and share them to others (configuration is stored within script path).

Source. Script accessible via ReaPack extension also.
Version without GUI acts like an single action (using defaults setting it get/prepare takes on start > calculate points > calculate best fit > add points as stretch markers)

Requirements: Reaper 5.20+ / SWS 2.7.3+
Donate is you like it. Thanks.


SoundCloud | MPL Scripts discussion | ReaPack | Donate

Last edited by mpl; 12-14-2018 at 01:38 PM.
mpl is offline   Reply With Quote