Skip to content
forked from JorenSix/TarsosDSP

TarsosDSP is a Java library for audio processing. Its aim is to provide an easy-to-use interface to practical audio (signal) processing algorithms.

Notifications You must be signed in to change notification settings

Ultar/TarsosDSP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TarsosDSP “Malaryta” distribution

TarsosDSP is a Java library for audio processing. Its aim is to provide an easy-to-use interface to practical audio (signal) 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.

The following example filters a band of frequencies of an input file testFile. It keeps the frequencies form startFrequency to stopFrequency.

AudioInputStream inputStream = AudioSystem.getAudioInputStream(testFile);
AudioDispatcher dispatcher = new AudioDispatcher(inputStream,stepSize,overlap);
dispatcher.addAudioProcessor(new LowPassFS(stopFrequency, 44100));
dispatcher.addAudioProcessor(new HighPass(startFrequency, 44100));
dispatcher.addAudioProcessor(new WaveformWriter(format, "filtered.wav"));
dispatcher.run();

Quickly Getting Started with TarsosDSP

The original version of TarsosDSP was built using Apache Ant. But it was decided to move it to Apache Maven and publish in main Maven repository. Such a library can be widely used and it will be easier from a piblic maven repository.

The original version is on Ant still, it will be changed as fast as the main developer will became used to Maven. The code in the both versions is the same.

Getting the Malaryta version

“Malaryta” release is built only from source code. 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://github.com/rikkimongoose/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

“Malaryta” release is provided to you by RikkiMongoose (idea, documents, git things) and Ultar (converting to maven, refactoring).

We hope it will became the main branch as soon as possible.

Talking about the title – Malaryta is the capital of Malaryta Raion of Brest Region in Republic of Belarus. Both of developers spent their childhood in Brest, and we think that title Maloryta is as strange as Ubuntu or Whistler.

Getting the original version

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. If you, for some reason, want to build from source, 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/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

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 in TarsosDSP/doc. Drop me a line if you use TarsosDSP in your project. Always nice to hear how this software is used.

Source Code Organization

Malaryta release

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

  • TarsosDSP/src contains the source files of the core DSP libraries.
  • TarsosDSP/test contains unit tests for some of the DSP functionality.
  • TarsosDSP/target/site/apidocs contains help documentation for DSP library
  • TarsosDSP/target contains MAVEN build files.
  • TarsosDSPExamples/src/main contains a couple of example applications with a Java Swing user interface.
  • TarsosDSPExamples/target contains builded versions example applications.

Original verison

The source tree is divided in three directories:

  • src contains the source files of the core DSP libraries.
  • test contains unit tests for some of the DSP functionality.
  • build contains ANT build files. Either to build Java documentation or runnable JAR-files for the example applications.
  • examples contains a couple of example applications with a Java Swing user interface.

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.

  • SoundDetector show how you loudness calculations can be done. When input sound is over a defined limit an event is fired.
  • PitchDetector this demo application shows real-time pitch detection. When pitch is detected the hertz value is printed together with a probability.
  • PercussionDetector show the percussion (onset) dectection. Clapping your hands causes an event. This demo application also shows the influence of the two parameters on the algorithm.
  • UtterAsterisk a game with the goal to sing as close to a melody a possible. Technically it shows real-time pitch detection with YIN or MPM.
  • Spectrogram in Java shows a spectrogram and detected pitch, either live or from an audio file. It is interesting to see which frequencies are picked as fundamentals.
  • Goertzel DTMF decoding an implementation of the Goertzel Algorithm. A fancy user interface shows what goes on under the hood.
  • Audio Time Stretching – Implementation in Pure Java Using WSOLA an implementation of a time stretching algorithm. WSOLA makes it possible to change the play back speed of audio without changing the pitch. The play back speed can be changed at any moment, even when there is audio playing.
  • Audio Feature Extraction a command line application to do simple feature extraction.
  • Audio Synthesis a command line application to do simple audio synthesis.
  • Pitch Shifting an example application that does pitch shifting, either in real-time on a microphone input, or on recorded audio. Also included is a command line application to do pitch shifting.

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 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 licence.

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 SoundTouch – an open-source audio processing library was used.

The FFT implementation used within TarsosDSP is by Piotr Wendykier and is included in his 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 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.

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.

About

TarsosDSP is a Java library for audio processing. Its aim is to provide an easy-to-use interface to practical audio (signal) processing algorithms.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%