TarsosDSP
!https://github.com/JorenSix/TarsosDSP/actions/workflows/gradle.yml/badge.svg(TarsosDSP build status)!
h1. 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. The library tries to hit the sweet spot between being capable enough to get real tasks done but compact and simple enough to serve as a demonstration on how DSP algorithms works.
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(Dual tone multi frequency) 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":http://0110.be/tag/TarsosDSP are available. Head over to the "TarsosDSP release directory":http://0110.be/releases/TarsosDSP/ for freshly baked binaries and code smell free (that is the goal anyway), oven-fresh sources.
h2. Quickly Getting Started with TarsosDSP
The source code of TarsosDSP is compatible with Java 11.
Add this to your build.gradle file:
repositories {
maven {
name = "TarsosDSP repository"
url = "https://mvn.0110.be/releases"
}
}
dependencies {
implementation 'be.tarsos.dsp:core:2.5'
implementation 'be.tarsos.dsp:jvm:2.5'
}
Add this to your pom.xml file:
be.0110.repo-releases
0110.be repository
https://mvn.0110.be/releases
be.tarsos.dsp
core
2.5
be.tarsos.dsp
jvm
2.5
h2. Citing TarsosDSP
Some information about TarsosDSP can be found in the paper "TarsosDSP, a Real-Time Audio Processing Framework in Java":http://0110.be/files/attachments/411/aes53_tarsos_dsp.pdf, by Joren Six, Olmo Cornelis, and Marc Leman, in Proceedings of the 53rd AES Conference (AES 53rd), 2014. If you use TarsosDSP in academic research, please cite this paper.
bc. @inproceedings{six2014tarsosdsp, author = {Joren Six and Olmo Cornelis and Marc Leman}, title = {{TarsosDSP, a Real-Time Audio Processing Framework in Java}}, booktitle = {{Proceedings of the 53rd AES Conference (AES 53rd)}}, year = 2014 }
h3. Building TarsosDSP with Gradle
To build TarsosDSP from source the @gradlew@ script should get you started. The following commands fetch the source and builds the library:
git clone --depth 1 https://JorenSix@github.com/JorenSix/TarsosDSP.git
cd TarsosDSP
./gradlew build
h2. Source Code Organization & Developing
The library is separated into three module folders: 1) the main core functionality is found in @core/src/main/java@, TarsosDSP example applications are found in @examples/src/main/java@, JVM audio I/O in @jvm/examples/src/main@.
h2. TarsosDSP Examples
To see TarsosDSP in action thre are a number of examples. These examples have either a graphical user interface or a command line interface. To see a window in which you can start all GUI examples the jar file needs to be started without arguments:
gradle shadowJar
java -jar examples/build/libs/examples-all.jar
To use the command line examples, execute the jar with the example name as first argument. For example @java -jar examples/build/libs/examples-all.jar feature_extractor pitch audio.mp3@ starts the @feature_extractor@ application to extract pitch from an audio file.
To get a list of all command line examples: @java -jar examples/build/libs/examples-all.jar list@
h2. Credits
"TarsosDSP":http://0110.be/tag/TarsosDSP was developed at "University College Ghent, School of Arts":http://schoolofartsgent.be between 2009 and 2013, from late 2013 the project is supported by "University Ghent, IPEM":http://www.ipem.ugent.be.
The TarsosDSP borrows algorithms from various other libraries or research paper. Below a complete list of credits can be found.
- The onset detector implementation is based on a "VAMP plugin example":http://vamp-plugins.org/code-doc/PercussionOnsetDetector_8cpp-source.html by Chris Cannam at Queen Mary University, London. The method is described in "Drum Source Separation using Percussive Feature Detection and Spectral Modulation":http://eprints.nuim.ie/699/1/ELE-Bob9.pdf 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":http://recherche.ircam.fr/equipes/pcm/cheveign/ps/2002_JASA_YIN_proof.pdf and the GPL'd "aubio implementation":http://aubio.org 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":http://miracle.otago.ac.nz/tartini/papers/A_Smarter_Way_to_Find_Pitch.pdf 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":http://online.physics.uiuc.edu/courses/phys193/NSF_REU_Reports/2005_reu/Real-Time_Time-Domain_Pitch_Tracking_Using_Wavelets.pdf by Eric Larson and Ross Maddox. The implementation within TarsosDSP is based on the implementation in the "Dynamic Wavelet Algorithm Pitch Tracking library":http://www.schmittmachine.com/dywapitchtrack.html 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":http://mir.cs.nthu.edu.tw/users/litbee/RelatedPaper/[WSOLA]An%20overlap-add%20technique%20based%20on%20waveform%20similarity%20(WSOLA)%20for%20high-quality%20time-scale%20modifications%20of%20speech.pdf 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":http://www.surina.net/soundtouch/ was used.
- The FFT implementation used within TarsosDSP is by Piotr Wendykier and is included in his GPL'd "JTransforms library":https://sites.google.com/site/piotrwendykier/software/jtransforms. 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":https://github.com/dnault-laszlo/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":http://www-ccrma.stanford.edu/~jos/resample/
- Various FFT window functions are done by Damien Di Fede and Corban Brook for the GPL'd "Minim":http://code.compartmental.net/tools/minim/ project.
- Beat induction based on onsets and saliences is done using code from "Simon Dixon's BeatRoot system":http://www.eecs.qmul.ac.uk/~simond/beatroot/.The software is licensed under the GPL. The algorithm is documented in the 2001 JNMR paper "Automatic Extraction of Tempo and Beat From Expressive Performances":http://www.tandfonline.com/doi/abs/10.1076/jnmr.30.1.39.7119#.UbcsROcW0r0 and in the 2007 JNMR article "Evaluation of the Audio Beat Tracking System BeatRoot":http://www.tandfonline.com/doi/full/10.1080/09298210701653310#.UbcsgecW0r0
- 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":http://www-student.elec.qmul.ac.uk/people/juan/Documents/Duxbury-DAFx-2003.pdf 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":http://www.wellesley.edu/Physics/brown/pubs/cq1stPaper.pdf by Judith C. Brown, "An Efficient Algorithm for the Calculation of a Constant Q Transform":http://www.wellesley.edu/Physics/brown/pubs/effalgV92P2698-P2701.pdf, by Judith C. Brown and Miller S. Puckette, and "The Constant Q Transform":http://wwwmath1.uni-muenster.de/logik/org/staff/blankertz/constQ/constQ.pdf by Benjamin Blankertz
- The Haar Wavelet Transform implemented in TarsosDSP is based on the pseudocode found in "Wavelets Made Easy" by Yves Nievergelt.
- The lifting scheme wavelet package is developed by "Ian Kaplan":http://www.bearcave.com/software/java/wavelets/basiclift.html and is based on the concepts explained in Ripples in Mathematics: The Discrete Wavelet Transform by A. Jensen and A. la Cour-Harbo, Springer. It is only slightly modified for easy use in TarsosDSP
- The frequency domain pitch shifter is developed by "Stephan M. Bernsee":http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/Transformbasiclift.html and is based on the concepts explained in Pitch Shifting Using The Fourier Transform. For the moment it is a rather direct translation of the c implementation. It was released under a ' Wide Open License'. As the name of the license suggests, it is a license withouth much restrictions.
- The granulator is developed for "the beads project":http://www.beadsproject.net/. It was released under a GPL-license.
h2. Changelog