TarsosDSP

TarsosDSP is a Java library for audio processing. Its aim is to provide an easy-to-use interface to practical music processing algorithms implemented, as simply as possible, in pure Java and without any other external dependencies. TarsosDSP features an implementation of a percussion onset detector and a number of pitch detection algorithms: YIN, the Mcleod Pitch method and a “Dynamic Wavelet Algorithm Pitch Tracking” algorithm. Also included is a Goertzel DTMF decoding algorithm, a time stretch algorithm (WSOLA), resampling, filters, simple synthesis, some audio effects, and a pitch shifting algorithm.

To show the capabilities of the library, TarsosDSP example applications are available. Head over to the TarosDSP release directory for freshly baked binaries and code smell free (that is the goal anyway), oven-fresh sources.

Quickly Getting Started with TarsosDSP

Head over to the TarsosDSP release repository and download the latest TarsosDSP library. To get up to speed quickly, check the TarsosDSP Example applications for inspiration and consult the API documentation.

TarsosDSP is also published in the main Maven repository. This makes it easier to use TarsosDSP in Maven projects.

TarsosDSP Example Applications

TarsosDSP contains some ready made example applications. Most have a Java Swing user interface. They show which functionality is present in the library and how to use it.

Developing TarsosDSP

If you want to build from source, or want to improve TarsosDSP follow the instructions below. Contributions to TarsosDSP are more than welcome, if you have a an algorithm to add or find a bug, do not hesitate to send me a message.

TarsosDSP is in the transition between Apache Maven and Apache Ant and currently supports both. The instructions below detail how you can build from source. Which build system you use is upto you. I find Ant a bit simpler. When everything runs correctly you should be able to run all example applications and have the latest version of the TarsosDSP library for inclusion in your projects. Also the Javadoc documentation for the API should be available.

TarsosDSP with Ant

To you need Apache Ant and git installed on your system. The following commands fetch the source and build the library and example jars:

git clone https://JorenSix@github.com/JorenSix/TarsosDSP.git
cd TarsosDSP
#link the source files at the expected locations
test -f src || ln -s TarsosDSP/src/main/java/ src
test -f examples || ln -s TarsosDSPExamples/src/main/java/ examples
test -f tests || ln -s TarsosDSP/src/test/java tests 
cd build
ant tarsos_dsp_library #Builds the core TarsosDSP library
ant build_examples #Builds all the TarsosDSP examples
ant javadoc #Creates the documentation in TarsosDSP/doc

TarsosDSP with Maven

To build from source, you need Apache Maven and git installed on your system. The following commands fetch the source and build the library and example jars:

git clone https://JorenSix@github.com/JorenSix/TarsosDSP.git
cd TarsosDSP/TarsosDSP
mvn install #Builds the core TarsosDSP library
mvn javadoc:javadoc #Builds the javadoc for TarsosDSP library
cd ../TarsosDSPExamples
mvn install #Builds all the TarsosDSP examples

Source Code Organization & Developing

The library is separated to 2 projects: TarsosDSP (main core) and TarsosDSPExamples (examples). They have different POM’s and are built independently.

To make development with eclipse easy, symlink the following and make them source files in your TarsosDSP eclipse project.


test -f src || ln -s TarsosDSP/src/main/java/ src
test -f examples || ln -s TarsosDSPExamples/src/main/java/ examples
test -f tests || ln -s TarsosDSP/src/test/java tests 

Credits

Tarsos and TarsosDSP are developed at University College Ghent, Faculty of Music
http://cons.hogent.be

The onset detector implementation is based on a VAMP plugin example by Chris Cannam at Queen Mary University, London. The method is described in Drum Source Separation using Percussive Feature Detection and Spectral Modulation by Dan Barry, Derry Fitzgerald, Eugene Coyle and Bob Lawlor, ISSC 2005.

For the implementation of the YIN pitch tracking algorithm. Both the the YIN paper and the GPL’d aubio implementation were used as a reference. Matthias Mauch (of Queen Mary University, London) kindly provided the FastYin implementation which uses an FFT to calculate the difference function, it makes the algorithm up to 3 times faster.

The Average Magnitude Difference (AMDF) pitch estimation algorithm is implemented by Eder Souza and adapted for TarsosDSP by myself.

For the MPM pitch tracking algorithm, the paper titled A Smarter Way To Find Pitch by Philip McLeod and Geoff Wyvill was used.

The Dynamic Wavlet pitch estimation algorithm is described in Real-Time Time-Domain Pitch Tracking Using Wavelets by Eric Larson and Ross Maddox. The implementation within TarsosDSP is based on the implementation in the Dynamic Wavelet Algorithm Pitch Tracking library by Antoine Schmitt, which is released under the MIT open source license, a license compatible with the GPL.

The audio time stretching algorithm is described in An Overlap-Add Technique Based on Waveform Similarity (WSOLA) For Hight Quality Time-Scale Modifications of speech by Werner Verhelst and Marc Roelands. As a reference implementation the WSOLA implementation by Olli Parviainen in the LGPL SoundTouch – an open-source audio processing library was used.

The FFT implementation used within TarsosDSP is by Piotr Wendykier and is included in his GPL’d JTransforms library. JTransforms is the first, open source, multithreaded FFT library written in pure Java.

The sample rate conversion feature is implemented by Laszlo systems in the GPL’d libresample4j library. libresample4j is a Java port of Dominic Mazzoni’s libresample 0.1.3, which is in turn based on Julius Smith’s Resample 1.7 library.

Various FFT window functions are done by Damien Di Fede and Corban Brook for the GPL’d Minim project.

Beat induction based on onsets and saliences is done using code from Simon Dixon’s BeatRoot system software is licensed under the GPL. The algorithm is documented in the 2001 JNMR paper Automatic Extraction of Tempo and Beat From Expressive Performances and in the 2007 JNMR article Evaluation of the Audio Beat Tracking System BeatRoot

A complex domain onset detection function is implemented using Aubio as an inspiration. Aubio, by Paul Brossiers contains very clean object oriented c-code, the cleanest c-code I have ever seen. The algorithm is described in Complex Domain Onset Detection for Musical Signals by Christopher Duxbury, Mike E. Davies, and Mark B. Sandler, in Proceedings of the Digital Audio Effects Conference, DAFx-03, pages 90-93, London, UK, 2003

An implementation of the Constant-Q transform by Karl Helgason for the GPL’d RasmusDSP project has been adapted for use in TarsosDSP. More information about the Constant-Q transform can be found in the following papers Calculation of a Constant Q Spectral Transform by Judith C. Brown,
An Efficient Algorithm for the Calculation of a Constant Q Transform, by Judith C. Brown and Miller S. Puckette, and
The Constant Q Transform by Benjamin Blankertz

Changelog

Version 1.0
2012-04-24

First release which includes several pitch trackers and a time stretching algorithm, amongst other things. Downloads and javadoc API can be found at the TarsosDSP release directory

Version 1.1
2012-06-4

Changed how the audio dispatcher stops. Added StopAudioProcessor.
Added FastYin implementation by Matthias Mauch
Added AMDF pitch estimator by Eder Souza

Version 1.2
2012-08-21

Modified the interface of PitchDetector to return a more elaborate result structure with pitch, probability and a boolean “is pitched”.
Added an implementation of an envelope follower or envelope detector.

Version 1.3
2012-09-19

TarsosDSP can do audio synthesis now. The first simple unit generators are included in the library.
It has a new audio feature extraction feature, implemented in the FeatureExtractor example.
Added ASCII-art to the source code (this is the main TarsosDSP 1.3 feature).

Version 1.4
2012-10-31

Included a resample feature, implemented by libresample4j. Together with the WSOLA implementation, it can be used for pitch shifting (similar to Phase Vocoding). A pitch shifting example (both with a CLI and a UI) is added in the 1.4 version of the TarsosDSP library as well.

Version 1.5
2013-04-30

Converted TarsosDSP to maven. This is known as the Malaryta-release. The “Malaryta” release is provided to you by RikkiMongoose (idea, documents, git things) and Ultar (converting to maven, refactoring). Malaryta is the capital of Malaryta Raion, Brest Region in the Republic of Belarus. Both of developers spent their childhood in Brest, and think that title Malaryta is as strange as Ubuntu or Whistler. The 1.5 release also includes various FFT window functions from the cool Minim project by Damien Di Fede.

Version 1.6
2013-06-12

This release features practical onset and beat detection algorithms. A complex domain onset detection and a spectral flux onset detection algorithm are added. This release also includes a way to guess a beat from onsets. Parts of the BeatRoot system, by Simon Dixon, are included to this end. Also included in this release is an implementation of the Constant-Q transform.

Version 1.7
2013-10-08

This release adds the ability to extract the MFCC from an audio signal. Also an example of the Constant-Q transform is added, together with a reusable visualization class library.