Cleverthumbnailer is a Python2 application that analyses songs and creates short audio thumbnails of them.
Given a full length piece of music in WAVE format (
*.wav), cleverthumbnailer attempts to generate a short extract most representative of the track in general. It bases this decision on three factors:
- Segment Detection. Using the QMUL Segmenter algorithm, distinct musical sections of a piece are found. In western pop music, this algorithm detects transitions between verses, choruses, and bridges. In western classical music, segment boundaries are often found at key changes/modulations.
- RMS Energy profiling. The varying dynamics of a piece of music are
calculated by tracking the RMS energy over the course of a piece. Sections of a piece that are loud (by default) or have a high amount of dynamic variation (
--dynamicflag) are preferred for inclusion in the audio snippet generated.
- Applause detection. An algorithm that determines spectral centroid over time is used to detect applause within a recording. Periods of applause are avoided in the resulting audio thumbnail.
- Install dependencies
- MacOS (homebrew):
brew install python sox
- Ubuntu/Debian (apt):
apt-get install python2.7 python-numpy python-setuptools sox
- CentOS (yum):
yum install python-devel numpy python-setuptools python-enum sox
- MacOS (homebrew):
- Install qm-segmenter-python
python2 setup.py install
Cleverthumbnailer is a command-line python application, and will create an audio thumbnail file in the same format and directory as some input file, using sensible defaults, by typing
cleverthumbnailer inputfile.wav. Optional command-line arguments can be provided to override these defaults, and a brief overview of these is given by typing 'cleverthumbnailer -h'.
Command Line arguments
A more detailed explanation of the application's command line arguments is given as follows:
||Input wav file to be processed (one only). Cleverthumbnailer supports uncompressed 8 or 16-bit WAVE/BWF files using the Python2
||Show help message on command line|
||Increase logging verbosity level|
||Only log errors|
||Fade in and out times (seconds)|
||Crop time (seconds) — the amount of time at the beginning and end of a track to ignore when choosing thumbnails|
||Thumbnail length (seconds)|
||Length of additional lead-in audio to include prior to calculated thumbnail start|
||Rate sections by dynamic range rather than max loudness when choosing thumbnails|
||Use applause detection|
||Output file path|
The code in this repository was created by Jon Tutcher in 2015 for BBC Research & Development.
QM-DSP was created by Queen Mary University of London; the segmenter module used here was developed by Mark Levy and Chris Cannam.
Cleverthumbnailer also includes and makes use of the Python appdirs module, credits for which are included in appdirs.py.
This project is licensed under the GNU GPLv2 license. For terms and conditions, see LICENSE.