Loopify

Loopify
A command-line tool for creating a half length glitch-free loop from an input file.

Currently, only supports 16-bit input files, and 16-bit WAV or FLAC output files.

Usage
Syntax: loopify input.wav output.wav   [SYNC_FRAME]

XFADE_FRAMES : The number of sample frames(e.g.stereo sample pairs) to crossfade XFADE_CURVE : The slope of the xfade curve. SYNC_FRAME : The sample frame where the xfade should end (optional).

Standard loop without specifying SYNC_FRAME:
 * --|--| -> |X-|
 * a    |b     |    |b  /a\|
 * a    |b     |    |b  /a\|

If SYNC_FRAME > 0: |o sync If SYNC_FRAME > 0 and XFADE_FRAMES = 0: |---o sync
 * --|--| -> |---X---|
 * a    |b     |    |b / \ a|
 * a    |b     |    |b / \ a|
 * a    |b     |    |b  |  a|
 * a    |b     |    |b  |  a|
 * a    |b     |    |b  |  a|

Crossfade is performed using this formula : out = in_a * t^p + in_b * (1 - t) ^ p Where t runs from 0 to 1 during the cross fade and p is the fade curve: p = 0.5 equal power fade (at t=0.5, inputs are multiplied with sqrt(0.5) ~ 0.707, ~ -3dB) p = 1.0 linear fade      (at t=0.5, inputs are multiplied with 0.5, ~ -6dB) p = 2.0 exponential fade (at t=0.5, inputs are multiplied with 0.25, ~ -12dB)