---
title: Posts tagged WSOLA
canonical: https://0110.be/tags/WSOLA
markdown_url: https://0110.be/tags/WSOLA.md
page: 0
posts_per_page: 30
total_posts: 5
filters:
  tag: WSOLA
previous:
next:
---

# Posts tagged WSOLA

## [Phase Vocoding: Time Stretching and Pitch Shifting with TarsosDSP Java](https://0110.be/posts/Phase_Vocoding%3A_Time_Stretching_and_Pitch_Shifting_with_TarsosDSP_Java.md)

- Published: 2012-12-13T00:00:00Z
- Updated: 2020-11-17T09:02:35Z
- Author: Joren
- ID: 355
- Canonical: https://0110.be/posts/Phase_Vocoding%3A_Time_Stretching_and_Pitch_Shifting_with_TarsosDSP_Java

- Tags: [HoGent](https://0110.be/tags/HoGent.md), [TarsosDSP](https://0110.be/tags/TarsosDSP.md), [WSOLA](https://0110.be/tags/WSOLA.md)

The DSP library for Taros, aptly named TarsosDSP, now includes an implementation of a *pitch shifting algorithm* (as of version 1.4) and a time stretching algorithm. Combined, the two can be used for something like [phase vocoding](http://en.wikipedia.org/wiki/Phase_vocoder). With a phase vocoder you can load an audio snippet, change the pitch and duration and e.g. create a library of snippets. E.g. by recording one piano key stroke, it is possible to generate two octaves of samples of different lengths, and use those in stead of synthesized samples. The following example application shows exactly that, implemented in the java programming language.

The example application below shows how to pitch shift and time stretch a sample to create a sample library with the TarsosDSP library.

<div align="center">
<a href=/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/SampleExtractor-latest.jar"><img src="https://0110.be/files/attachments/355/_Extract___Modify_Samples.png" alt="Pitch shifting in Java"/></a>

</div>
Find your oven fresh baked binaries at the [TarsosDSP Release Repository](https://0110.be/releases/TarsosDSP/).


- [\_Extract\_\_\_Modify\_Samples.png](https://0110.be/files/attachments/355/_Extract___Modify_Samples.png)

---

## [Tarsos 1.0: Transcription Features](https://0110.be/posts/Tarsos_1.0%3A_Transcription_Features.md)

- Published: 2012-12-05T00:00:00Z
- Updated: 2020-11-17T09:00:24Z
- Author: Joren
- ID: 335
- Canonical: https://0110.be/posts/Tarsos_1.0%3A_Transcription_Features

- Tags: [Computational ethnomusicology](https://0110.be/tags/Computational%20ethnomusicology.md), [Computational musicology](https://0110.be/tags/Computational%20musicology.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [Music Information Retrieval](https://0110.be/tags/Music%20Information%20Retrieval.md), [Tarsos](https://0110.be/tags/Tarsos.md), [WSOLA](https://0110.be/tags/WSOLA.md), [featured](https://0110.be/tags/featured.md)

Today marks the reslease of Tarsos 1.0 . The new Tarsos release contains practical transcription features. As can be seen in the screenshot below, a time stretching feature makes it easy to loop a certain audio fragment while it is playing in a slow tempo. The next loop can be played with by pressing the `n` key, the one before by pressing `b`.

Since the pitch classes can be found in a song, and there is a feature that lets you play a `MIDI` keyboard in the tone scale of the song under analysis, transcription of ethnic music is made a lot easier.

<div align="center">
<a href="http://0110.be/releases/Tarsos/Tarsos-latest/Tarsos-latest.jar">\
<img src='https://0110.be/files/attachments/335/Tarsos-1.0.png' alt="Tarsos 1.0" width="400px"/>\
</a>

</div>
The new release of Tarsos can be found in the [Tarsos release repository](http://0110.be/releases/Tarsos/). From now on, nightly releases are uploaded there automatically.


---

## [Pitch Shifting - Implementation in Pure Java with Resampling and Time Stretching](https://0110.be/posts/Pitch_Shifting_-_Implementation_in_Pure_Java_with_Resampling_and_Time_Stretching.md)

- Published: 2012-11-05T00:00:00Z
- Updated: 2020-11-17T09:07:53Z
- Author: Joren
- ID: 370
- Canonical: https://0110.be/posts/Pitch_Shifting_-_Implementation_in_Pure_Java_with_Resampling_and_Time_Stretching

- Tags: [Code](https://0110.be/tags/Code.md), [Command Line Application](https://0110.be/tags/Command%20Line%20Application.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [TarsosDSP](https://0110.be/tags/TarsosDSP.md), [WSOLA](https://0110.be/tags/WSOLA.md), [featured](https://0110.be/tags/featured.md)

The DSP library for Taros, aptly named TarsosDSP, now includes an implementation of a *pitch shifting algorithm* (as of version 1.4). The goal of pitch shifting is to change the pitch of a piece of audio without affecting the duration. The algorithm implemented is a combination of resampling and time stretching. Resampling changes the pitch of the audio, but affects the total duration. Consecutively, the duration of the audio is stretched to the original (without affecting pitch) with time stretching. The result is very similar to [phase vocoding](http://en.wikipedia.org/wiki/Phase_vocoder).

The example application below shows how to pitch shift input from the microphone in real-time, or pitch shift a recorded track with the TarsosDSP library.

<div align="center">
<a href="https://0110.be/releases/TarsosDSP/TarsosDSP-1.4/TarsosDSP-1.4-Examples/PitchShift-1.4.jar"><img src="https://0110.be/files/attachments/370/pitch-shift-in-java.png" alt="Pitch shifting in Java"/></a>

</div>
To test the application, download and execute the [PitchShift.jar](https://0110.be/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/PitchShift-latest.jar) file and load an audio file. For the moment only 44.1kHz mono wav is allowed. To get started you can try "this piece of audio":\[08.\_Ladrang_Kandamanyura_10s-20s.wav\].

There is also a command line interface, the following command lowers the pitch of `in.wav` by two semitones.

    java -jar in.wav out.wav -200

    ----------------------------------------------------
     _______                       _____   _____ _____  
    |__   __|                     |  __ \ / ____|  __ \ 
       | | __ _ _ __ ___  ___  ___| |  | | (___ | |__) |
       | |/ _` | '__/ __|/ _ \/ __| |  | |\___ \|  ___/ 
       | | (_| | |  \__ \ (_) \__ \ |__| |____) | |     
       |_|\__,_|_|  |___/\___/|___/_____/|_____/|_|     

    ----------------------------------------------------
    Name:
        TarsosDSP Pitch shifting utility.
    ----------------------------------------------------
    Synopsis:
        java -jar PitchShift.jar source.wav target.wav cents
    ----------------------------------------------------
    Description:
        Change the play back speed of audio without changing the pitch.

            source.wav  A readable, mono wav file.
            target.wav  Target location for the pitch shifted file.
            cents       Pitch shifting in cents: 100 means one semitone up, 
                    -100 one down, 0 is no change. 1200 is one octave up.

The resampling feature was implemented with libresample4j by Laszlo Systems. 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.


- [pitch-shift-in-java.png](https://0110.be/files/attachments/370/pitch-shift-in-java.png)

- [08.\_Ladrang\_Kandamanyura\_10s-20s.wav](https://0110.be/files/attachments/370/08._Ladrang_Kandamanyura_10s-20s.wav)

---

## [TarsosDSP Release 1.0](https://0110.be/posts/TarsosDSP_Release_1.0.md)

- Published: 2012-04-24T14:25:32Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 352
- Canonical: https://0110.be/posts/TarsosDSP_Release_1.0

- Tags: [Code](https://0110.be/tags/Code.md), [Command Line Application](https://0110.be/tags/Command%20Line%20Application.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [Music Information Retrieval](https://0110.be/tags/Music%20Information%20Retrieval.md), [TarsosDSP](https://0110.be/tags/TarsosDSP.md), [WSOLA](https://0110.be/tags/WSOLA.md), [featured](https://0110.be/tags/featured.md)

After about a year of development and several revisions TarsosDSP has enough features and is stable enough to slap the 1.0 tag onto it. A 'read me', manual, API documentation, source and binaries can be found on the [TarsosDSP release directory](http://tarsos.0110.be/releases/TarsosDSP/). The source is present in the\
What follows below is the information that can be found in the read me file:

<p>
TarsosDSP is a collection of classes to do simple audio processing. It features an implementation of a percussion onset detector and two pitch detection algorithms: Yin and the Mcleod Pitch method. Also included is a Goertzel <acronym title="Dual tone multi frequency"><span class="caps">DTMF</span></acronym> decoding algorithm and a time stretch algorithm (<span class="caps">WSOLA</span>).

</p>
<p>
Its aim is to provide a simple interface to some audio (signal) processing algorithms implemented in pure <span class="caps">JAVA</span>. Some <a href="http://tarsos.0110.be/tag/TarsosDSP">TarsosDSP example applications</a> are available.

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

</p>
    <code>AudioInputStream inputStream = AudioSystem.getAudioInputStream(testFile);
    AudioDispatcher dispatcher = new AudioDispatcher(inputStream,stepSize,overlap);
    dispatcher.addAudioProcessor(new HighPass(startFrequency, sampleRate, overlap));
    dispatcher.addAudioProcessor(new LowPassFS(stopFrequency, sampleRate, overlap));
    dispatcher.addAudioProcessor(new FloatConverter(format));
    dispatcher.addAudioProcessor(new WaveformWriter(format,stepSize, overlap, "filtered.wav"));
    dispatcher.run();
    </code>

<h3>
Quickly Getting Started with TarsosDSP

</h3>
<p>
Head over to the <a href="http://tarsos.0110.be/releases/TarsosDSP/">TarsosDSP release repository</a> and download the latest <a href="http://tarsos.0110.be/releases/TarsosDSP/TarsosDSP-1.0.jar">TarsosDSP library</a>. To get up to speed quickly, check the <a href="http://tarsos.0110.be/releases/TarsosDSP/TarsosDSP-1.0-Examples/">TarsosDSP Example applications</a> for inspiration and consult the <a href="http://tarsos.0110.be/releases/TarsosDSP/TarsosDSP-1.0-Documentation/"><span class="caps">API</span> documentation</a>. If you, for some reason, want to build from source, you need <a href="http://ant.apache.org/">Apache Ant</a> and <a href="http://git-scm.com/">git</a> installed on your system. The following commands fetch the source and build the library and example jars: <br />

    <code>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
    </code>

<br />\
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 <span class="caps">API</span> 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.

</p>
<h3>
Source Code Organization and Examples of TarsosDSP

</h3>
<p>
The source tree is divided in three directories:

</p>
<ul>
<li>
<code>src</code> contains the source files of the core <span class="caps">DSP</span> libraries.

</li>
<li>
<code>test</code> contains unit tests for some of the <span class="caps">DSP</span> functionality.

</li>
<li>
<code>build</code> contains <span class="caps">ANT</span> build files. Either to build Java documentation or runnable <span class="caps">JAR</span>-files for the example applications.

</li>
<li>
<code>examples</code> contains a couple of example applications with a Java Swing user interface:

<ul>
<li>
<a href="http://tarsos.0110.be/artikels/lees/TarsosDSP%253A_a_small_JAVA_audio_processing_library">SoundDetector</a> show how you loudness calculations can be done. When input sound is over a defined limit an event is fired.

</li>
<li>
<a href="http://tarsos.0110.be/artikels/lees/TarsosDSP%253A_a_small_JAVA_audio_processing_library">PitchDetector</a> this demo application shows real-time pitch detection. When pitch is detected the hertz value is printed together with a probability.

</li>
<li>
<a href="http://tarsos.0110.be/artikels/lees/TarsosDSP%253A_a_small_JAVA_audio_processing_library">PercussionDetector</a> 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.

</li>
<li>
<a href="http://tarsos.0110.be/artikels/lees/TarsosDSP_sample_application%253A_Utter_Asterisk">UtterAsterisk</a> a game with the goal to sing as close to a melody a possible. Technically it shows real-time pitch detection with <span class="caps">YIN</span> or <span class="caps">MPM</span>.

</li>
<li>
<a href="http://tarsos.0110.be/artikels/lees/Spectrogram_in_Java_with_TarsosDSP">Spectrogram in Java</a> shows a spectrogram and detected pitch, either live or from an audio file. It is interesting to see which frequencies are picked as fundamentals.

</li>
<li>
<a href="http://tarsos.0110.be/artikels/lees/Dual-Tone_Multi-Frequency_%2528DTMF%2529_Decoding_with_the_Goertzel_Algorithm_in_Java">Goertzel <acronym title="Dual tone multi frequency"><span class="caps">DTMF</span></acronym> decoding</a> an implementation of the Goertzel Algorithm. A fancy user interface shows what goes on under the hood.

</li>
<li>
<a href="http://tarsos.0110.be/artikels/lees/Audio_Time_Stretching_-_Implementation_in_Pure_Java_Using_WSOLA">Audio Time Stretching -- Implementation in Pure Java Using <span class="caps">WSOLA</span></a> an implementation of a time stretching algorithm. <acronym title="Waveform Similarity Overlap Add"><span class="caps">WSOLA</span></acronym> 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.

</li>
</ul>
</li>
</ul>


---

## [Audio Time Stretching - Implementation in Pure Java Using WSOLA](https://0110.be/posts/Audio_Time_Stretching_-_Implementation_in_Pure_Java_Using_WSOLA.md)

- Published: 2012-02-06T14:52:34Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 372
- Canonical: https://0110.be/posts/Audio_Time_Stretching_-_Implementation_in_Pure_Java_Using_WSOLA

- Tags: [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [Tarsos](https://0110.be/tags/Tarsos.md), [TarsosDSP](https://0110.be/tags/TarsosDSP.md), [WSOLA](https://0110.be/tags/WSOLA.md)

The DSP library for Taros, aptly named TarsosDSP, now includes an implementation of a time stretching algorithm. The goal of time stretching is to change the duration of a piece of audio without affecting the pitch. The algorithm implemented is described in [An Overlap-add Technique Based On Waveform Similarity (WSOLA) for High Quality Time-Scale Modification of Speech](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.202.5460&rep=rep1&type=pdf).

<div align="center">
<a href="https://0110.be/files/attachments/372/TimeStretch.jar"><img src="https://0110.be/files/attachments/372/time_stretching_in_java.png" alt="Time Stretching (WSOLA) in Java"/></a>

</div>
To test the application, download and execute the "WSOLA jar":\[TimeStretch.jar\] file and load an audio file. For the moment only 44.1kHz mono wav is allowed. To get started you can try "this piece of audio":\[08.\_Ladrang_Kandamanyura_10s-20s.wav\].

There is also a command line interface, the following command doubles the speed of `in.wav`:

<code>\
java -jar TimeStretch.jar in.wav out.wav 2.0\
</code>

     _______                       _____   _____ _____  
    |__   __|                     |  __ \ / ____|  __ \ 
       | | __ _ _ __ ___  ___  ___| |  | | (___ | |__) |
       | |/ _` | '__/ __|/ _ \/ __| |  | |\___ \|  ___/ 
       | | (_| | |  \__ \ (_) \__ \ |__| |____) | |     
       |_|\__,_|_|  |___/\___/|___/_____/|_____/|_|     

    ----------------------------------------------------
    Name:
        TarsosDSP Time stretch utility.
    ----------------------------------------------------
    Synopsis:
        java -jar TimeStretch.jar source.wav target.wav factor
    ----------------------------------------------------
    Description:
        Change the play back speed of audio without changing the pitch.

            source.wav  A readable, mono wav file.
            target.wav  Target location for the time stretched file.
            factor      Time stretching factor: 2.0 means double the length, 0.5 half. 1.0 is no change.

The source code of the Java implementation of WSOLA can be found on the [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP/blob/master/src/be/hogent/tarsos/dsp/filters/WaveformSimilarityBasedOverlapAdd.java).


- [time\_stretching\_in\_java.png](https://0110.be/files/attachments/372/time_stretching_in_java.png)

- [08.\_Ladrang\_Kandamanyura\_10s-20s.wav](https://0110.be/files/attachments/372/08._Ladrang_Kandamanyura_10s-20s.wav)

- [TimeStretch.jar](https://0110.be/files/attachments/372/TimeStretch.jar)

---
