---
title: Posts tagged Java
canonical: https://0110.be/tags/Java
markdown_url: https://0110.be/tags/Java.md
page: 0
posts_per_page: 30
total_posts: 37
filters:
  tag: Java
previous:
next: https://0110.be/tags/Java.md?page=1
---

# Posts tagged Java

## [Low impact runner: a music based bio-feedback system](https://0110.be/posts/Low_impact_runner%3A_a_music_based_bio-feedback_system.md)

- Published: 2022-10-01T00:00:00Z
- Updated: 2025-11-29T14:22:46Z
- Author: Joren
- ID: 490
- Canonical: https://0110.be/posts/Low_impact_runner%3A_a_music_based_bio-feedback_system

- Tags: [IPEM](https://0110.be/tags/IPEM.md), [Java](https://0110.be/tags/Java.md), [Research papers](https://0110.be/tags/Research%20papers.md), [UGent](https://0110.be/tags/UGent.md)

<div style="float:right;margin-left:10px">
<video  width="320" autoplay muted loop>
<source src="https://0110.be/files/attachments/490/lir-demo.mp4">
</video><br>
<small>Fig: schema of the low impact runner system.</small>
</div>

I have been lucky to have been involved in an interdisciplinary research project around the *low impact runner*: a music based bio-feedback system to reduce tibial shock in over-ground running. In the beginning of October 2022 the PhD defence of Rud Derie takes place so it is a good moment to look back to this collaboration between several branches of Ghent University: [IPEM](https://www.ugent.be/lw/kunstwetenschappen/ipem/en) , [movement and sports science](https://www.ugent.be/ge/bsw/en) and [IDLab](https://www.ugent.be/ea/idlab/en).

The idea behind the project was to first select runners with a high foot-fall impact. Then an intervention would slightly nudge these runner to a running style with lower impact. A lower repetitive impact is expected to reduce the chance on injuries common for runners. A system was invented in which musical bio-feedback was given on the measured impact. The schema to the right shows the concept.

I was involved in development of the first hardware prototypes which measured acceleration on the legs of the runner and the development of software to receive and handle these measurement on a tablet strapped to a backpack the runner was wearing. This software also logged measurements, had real-time visualisation capabilities and allowed remote control and monitoring over the network. Finally measurements were send to a Max/MSP sonification engine. These prototypes of software and hardware were replaced during a valorization project but some parts of the software ended up in the final Android application.

<center>
<video width="60%" autoplay muted loop>
<source src="https://0110.be/files/attachments/490/low_impact_runner-system.mp4">
</video><br>
<small>Video: the left screen shows the indoor positioning system via UWB (ultra-wide-band) and the right screen shows the music feedback system and the real time monitoring of impact of the runner. Video by Pieter Van den Berghe</small>

</center>
Over time the first wired sensors were replaced with wireless Bluetooth versions. This made the sensors easy to use and also to visualize sensor values in the browser thanks to the Web Bluetooth API. I have experimented with this and made two demos: a [low impact runner visualizer](bt.html) and one [with the conceptual schema](bt_bg.html).

<center>
<video width="60%" autoplay muted loop>
<source src="https://0110.be/files/attachments/490/bt_html_interface.mp4">
</video><br>
<small>Vid: Visualizing the Bluetooth Low Impact Runner sensor in the browser.</small>
</center>

The following three studies shows a part of the trajectory of the project. The first paper is a validation of the measurement system. Secondly a proof-of-concept study is done which finally greenlights a larger scale intervention study.

1.  Van den Berghe, P., Six, J., Gerlo, J., Leman, M., & De Clercq, D. (2019). *Validity and reliability of peak tibial accelerations as real-time measure of impact loading during over-ground rearfoot running at different speeds*. Journal of Biomechanics, 86, 238-242.

2.  Van den Berghe, P., Lorenzoni, V., Derie, R., Six, J., Gerlo, J., Leman, M., & De Clercq, D. (2021). *Music-based biofeedback to reduce tibial shock in over-ground running: A proof-of-concept study*. Scientific reports, 11(1), 1-12.

3.  Van den Berghe, P., Derie, R., Bauwens, P., Gerlo, J., Segers, V., Leman, M., & De Clercq, D. (2022). *Reducing the peak tibial acceleration of running by music‐based biofeedback: A quasi‐randomized controlled trial*. Scandinavian Journal of Medicine & Science in Sports

There are quite a number of other papers but I was less involved in those. The project also resulted in two PhD's:

-   *Motor retraining by real-time sonic feedback: understanding strategies of low impact running* (2021) by Pieter Van den Berghe
-   *Running on good vibes: music induced running-style adaptations for lower impact running* (2022) by Rud Derie

I am also recognized as co-inventor on the [low impact runner system patent](https://worldwide.espacenet.com/patent/search/family/062816385/publication/WO2020002275A1?q=WO2020002275A1) and there are concrete plans for a commercial spin-off. To be continued...

![Conceptual schema](https://0110.be/files/photos/490/li-jogger-schema.png)

![Music feedback schema](https://0110.be/files/photos/490/music_feedback_schema.jpg)

![Screening and selection](https://0110.be/files/photos/490/screening_selection_schema.jpg)

![Screenshot of the smartphone app](https://0110.be/files/photos/490/Screenshot_20220407-155541_pixel_quite_black_landscape.png)

---

## [Synchronizing Multimodal Recordings Using Audio-To-Audio Alignment - In Journal on Multimodal User Interfaces](https://0110.be/posts/Synchronizing_Multimodal_Recordings_Using_Audio-To-Audio_Alignment_-_In_Journal_on_Multimodal_User_Interfaces.md)

- Published: 2015-08-06T00:00:00Z
- Updated: 2025-11-29T19:45:17Z
- Author: Joren
- ID: 434
- Canonical: https://0110.be/posts/Synchronizing_Multimodal_Recordings_Using_Audio-To-Audio_Alignment_-_In_Journal_on_Multimodal_User_Interfaces

- Tags: [Code](https://0110.be/tags/Code.md), [Java](https://0110.be/tags/Java.md), [Music Information Retrieval](https://0110.be/tags/Music%20Information%20Retrieval.md), [Panako](https://0110.be/tags/Panako.md), [Research papers](https://0110.be/tags/Research%20papers.md), [UGent](https://0110.be/tags/UGent.md)

The article titled *"Synchronizing Multimodal Recordings Using Audio-To-Audio Alignment"* by Joren Six and Marc Leman has been accepted for publication in the [Journal on Multimodal User Interfaces](https://www.springer.com/computer/hci/journal/12193). The article will be published later this year. It describes and tests a method to synchronize data-streams. Below you can find the abstract, pointers to the software under discussion and an author version of the article itself.

### Synchronizing Multimodal Recordings Using Audio-To-Audio Alignment <br><small><small>An Application of Acoustic Fingerprinting to Facilitate Music Interaction Research</small></small>

> **Abstract:** *Research on the interaction between movement and music often involves analysis of multi-track audio, video streams and sensor data. To facilitate such research a framework is presented here that allows synchronization of multimodal data. A low cost approach is proposed to synchronize streams by embedding ambient audio into each data-stream. This effectively reduces the synchronization problem to audio-to-audio alignment. As a part of the framework a robust, computationally efficient audio-to-audio alignment algorithm is presented for reliable synchronization of embedded audio streams of varying quality. The algorithm uses audio fingerprinting techniques to measure offsets. It also identifies drift and dropped samples, which makes it possible to find a synchronization solution under such circumstances as well. The framework is evaluated with synthetic signals and a case study, showing millisecond accurate synchronization.*

To read the article, consult the author version of [Synchronizing Multimodal Recordings Using Audio-To-Audio Alignment](https://0110.be/files/attachments/434/2015.synchronized-recording.pdf). The data-set used in the case study is available here. It contains a [recording of balanceboard data, accelerometers, and two webcams](https://0110.be/files/attachments/434/SyncDataset.zip) that needs to be synchronized. The final publication is available at Springer via [10.1007/s12193-015-0196-1](http://dx.doi.org/10.1007/s12193-015-0196-1)

The algorithm under discussion is included in [Panako](http://panako.be) an audio fingerprinting system but is also available for download here. The [SyncSink application](https://0110.be/files/attachments/434/SyncSink-1.4.jar) has been packaged separately for ease of use.

To use the application start it with double click the [downloaded SyncSink JAR-file](https://0110.be/files/attachments/434/SyncSink-1.4.jar). Subsequently add various audio or video files using drag and drop. If the same audio is found in the various media files a time-box plot appears, as in the screenshot below. To add corresponding data-files click one of the boxes on the timeline and choose a data file that is synchronized with the audio. The data-file should be a CSV-file. The separator should be ',' and the first column should contain a time-stamp in fractional seconds. After pressing Sync a new CSV-file is created with the first column containing correctly shifted time stamps. If this is done for multiple files, a synchronized sensor-stream is created. Also, [ffmpeg](http://ffmpeg.org) commands to synchronize the media files themselves are printed to the command line.

This work was supported by funding by a Methusalem grant from the Flemish Government, Belgium. Special thanks goes to Ivan Schepers for building the balance boards used in the case study. If you want to cite the article, use the following BiBTeX:

<pre>
@article{six2015multimodal,
      author      = {Joren Six and Marc Leman},
      title       = {{Synchronizing Multimodal Recordings Using Audio-To-Audio Alignment}},
      issn        = {1783-7677},
      volume      = {9},
      number      = {3},
      pages       = {223-229},
      doi         = {10.1007/s12193-015-0196-1},
      journal     = {{Journal of Multimodal User Interfaces}}, 
      publisher   = {Springer Berlin Heidelberg},
      year        = 2015
 }
</pre>

![SyncSink Synchronize media files. A user-friendly interface to synchronize media and data files.  First a reference media-file is added using drag-and-drop. The audio steam of the reference is extracted and plotted on a timeline as the topmost box. Subsequently other media-files are added. The offsets with respect to the reference are calculated and plotted. CSV-files with timestamps and data recorded in sync with a stream can be attached to a respective audio stream. Finally, after pressing Sync!, the data and media files are modified to be exactly in sync with the reference.](https://0110.be/files/photos/434/syncsink_synchronize_media_files.png)

![Synchronized streams in Sonic Visualizer. Here you can see two channel audio synchronized with accelerometer data (top, green) and balanceboard data (bottom, purple).](https://0110.be/files/photos/434/sonic_visualizer_waveform.png)

![The synchronized data from the two webcams, accelerometer and balanceboard in ELAN. From top to bottom the synchronized streams are two video-streams, balance-board data (red), accelerometer-data (green) and audio (black).](https://0110.be/files/photos/434/elan_analysis.png)

![Conceptual drawing used as a basis for the SyncSync application. A reference stream (blue) can be synchronized with streams one and two. It allows a workflow where streams are started and stopped (red) or start before the reference stream (green).](https://0110.be/files/photos/434/drift_and_stuff.png)

![A microcontroller fitted with an electret microphone and a microSD card slot. It can record audio in real-time together with sensor data.](https://0110.be/files/photos/434/teensy_audio.jpg)

![Multimodal recording system diagram. Each webcam has a microphone and is connected to the pc via USB. The dashed arrows represent analog signals. The balance board has four analog sensors but these are simplified to one connection in the schematic. The analog output of the microphones is also recorded through the DAQ. An analog accelerometer is connected with a microcontroller which also records audio.](https://0110.be/files/photos/434/system_diagram.png)

![Two streams of audio with fingerprints marked. Some fingerprints are present in both streams (green, O) while others are not (red, x). Matching fingerprints have the same offset, indicated by the dotted lines.](https://0110.be/files/photos/434/sync_two_streams_landmarks.png)

- [2015.synchronized-recording.pdf](https://0110.be/files/attachments/434/2015.synchronized-recording.pdf)

- [SyncDataset.zip](https://0110.be/files/attachments/434/SyncDataset.zip)

- [SyncSink-1.4.jar](https://0110.be/files/attachments/434/SyncSink-1.4.jar)

---

## [SINGmaster Android App uses TarsosDSP](https://0110.be/posts/SINGmaster_Android_App_uses_TarsosDSP.md)

- Published: 2015-04-24T00:00:00Z
- Updated: 2015-07-10T12:09:11Z
- Author: Joren
- ID: 431
- Canonical: https://0110.be/posts/SINGmaster_Android_App_uses_TarsosDSP

- Tags: [Code](https://0110.be/tags/Code.md), [Java](https://0110.be/tags/Java.md), [Muziek](https://0110.be/tags/Muziek.md), [TarsosDSP](https://0110.be/tags/TarsosDSP.md), [UGent](https://0110.be/tags/UGent.md)

<img src="https://0110.be/files/attachments/431/singmaster_logo.png" width="80px" alt="Singmaster logo" style="float:right">TarsosDSP is a real-time audio processing library written in Java. Since version 2.0 it is compatible with Android. Judging by the number of forks of the [TarsosDSP GitHub repository](https://github.com/JorenSix/TarsosDSP) Android compatibility increased the popularity of the library. Now the first Android application which uses TarsosDSP has found its way to the Google Play store. Download and play with [SINGmaster](https://play.google.com/store/apps/details?id=bg.singmaster.gui) to see an application of the pitch tracking capabilities within TarsosDSP. The SINGmaster description:

> *"SING master is a smart phone app that helps you to learn how to sing. SING master presents a collection of practical exercises (on the most important building blocks of melodies). Colours and sounds guide you in the exercise. After recording, SING master gives visual feedback : you can see and hear your voice. This is important so that you can identify where your mistakes are."*

Another application in the Play Store that uses TarsosDSP is [CuePitcher](https://play.google.com/store/apps/details?id=io.github.mindosoft.cuepitcher).


![SINGMaster screenshot](https://0110.be/files/photos/431/singmaster.png)

![SINGMaster in action](https://0110.be/files/photos/431/singmaster_other.png)

- [singmaster\_logo.png](https://0110.be/files/attachments/431/singmaster_logo.png)

---

## [TarsosLSH in a Photomosaic Web App](https://0110.be/posts/TarsosLSH_in_a_Photomosaic_Web_App.md)

- Published: 2015-01-07T00:00:00Z
- Updated: 2015-01-07T08:52:18Z
- Author: Joren
- ID: 428
- Canonical: https://0110.be/posts/TarsosLSH_in_a_Photomosaic_Web_App

- Tags: [0110.be](https://0110.be/tags/0110.be.md), [Code](https://0110.be/tags/Code.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [UGent](https://0110.be/tags/UGent.md)

TarsosLSH is a Java library implementing Locality-sensitive Hashing (LSH), a practical nearest neighbor search algorithm for high dimensional vectors that operates in sublinear time. The open source software package is authored by me and is available on GitHub: [TarsosLSH on GitHub](https://github.com/JorenSix/TarsosLSH).

With TarsosLSH, Joseph Hwang and Nicholas Kwon from Rice University created an [Image Mosaic web application](http://image-mosaic.appspot.com/). The application chops an uploaded photo into small blocks. For each block, a color histogram is created and compared with an index of color histograms of reference images. Subsequently each block is replaced with one of the top three nearest neighbors, creating a mosaic. Since high dimensional nearest neighbor search is needed, this is an ideal application for TarsosLSH. The application somewhat proves that TarsosLSH can be used in practical applications, which is comforting.


![The Starry Night, by Van Ghogh in Mosaic as created by the mosaic webapplication.](https://0110.be/files/photos/428/StarryNights.png)

![The Starry Night, by Van Ghogh - Original](https://0110.be/files/photos/428/the-starry-night-1889_original.jpg)

---

## [Constant-Q Transform in Java with TarsosDSP](https://0110.be/posts/Constant-Q_Transform_in_Java_with_TarsosDSP.md)

- Published: 2013-10-09T00:00:00Z
- Updated: 2020-11-17T09:01:43Z
- Author: Joren
- ID: 363
- Canonical: https://0110.be/posts/Constant-Q_Transform_in_Java_with_TarsosDSP

- Tags: [Code](https://0110.be/tags/Code.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), [TarsosDSP](https://0110.be/tags/TarsosDSP.md)

The DSP library for Taros, aptly named TarsosDSP, now includes an implementation of a *Constant-Q Transform* (as of version 1.6). The Constant-Q transform does essentially the same thing as an FFT, but has the advantage that each octave has the same amount of bins. This makes the Constant-Q transform practical for applications processing music. If, for example, 12 bins per octave are chosen, these can correspond with the western musical scale.

Also included in the newest release (version 1.7) is a way to visualize the transform, or other musical features. The visualization implementation is done together with Thomas Stubbe.

The example application below shows the Constant-Q transform with an overlay of pitch estimations. The corresponding waveform is also shown.

<div align="center">
<a href="http://0110.be/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/ConstantQ-latest.jar"><img src="https://0110.be/files/attachments/363/constantq-visualization-java.png" alt="Constant-Q transform in Java"/></a>

</div>
Find your oven fresh baked binaries at the [TarsosDSP Release Repository](http://tarsos.0110.be/releases/TarsosDSP/).\
The source code can be found at the [TarsosDSP GitHub repository](https://github.com/JorenSix/TarsosDSP).


- [constantq-visualization-java.png](https://0110.be/files/attachments/363/constantq-visualization-java.png)

---

## [Tarsos, a Modular Platform for Precise Pitch Analysis of Western and Non-Western Music - In Journal Of New Music Research](https://0110.be/posts/Tarsos%2C_a_Modular_Platform_for_Precise_Pitch_Analysis_of_Western_and_Non-Western_Music_-_In_Journal_Of_New_Music_Research.md)

- Published: 2013-08-22T00:00:00Z
- Updated: 2015-06-05T08:10:05Z
- Author: Joren
- ID: 331
- Canonical: https://0110.be/posts/Tarsos%2C_a_Modular_Platform_for_Precise_Pitch_Analysis_of_Western_and_Non-Western_Music_-_In_Journal_Of_New_Music_Research

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

<img src="https://0110.be/files/attachments/331/jnmr.cover.jpg" style="float:right"/> The journal paper *Tarsos, a Modular Platform for Precise Pitch Analysis of Western and Non-Western Music* by Six, Cornelis, and Leman was published in a special issue about Computational Ethnomusicology of [the Journal of New Music Research (JNMR)](http://www.tandfonline.com/toc/nnmr20/current) on the 20th of august 2013. Below you can find the abstract for the article, and pointers to audio examples, the Tarsos software, and the author version of the article itself.

> **Abstract:** This paper presents Tarsos, a modular software platform used to extract and analyze pitch organization in music. With Tarsos pitch estimations are generated from an audio signal and those estimations are processed in order to form musicologically meaningful representations. Tarsos aims to offer a flexible system for pitch analysis through the combination of an interactive user interface, several pitch estimation algorithms, filtering options, immediate auditory feedback and data output modalities for every step. To study the most frequently used pitches, a fine-grained histogram that allows up to 1200 values per octave is constructed. This allows Tarsos to analyze deviations in Western music, or to analyze specific tone scales that differ from the 12 tone equal temperament, common in many non-Western musics. Tarsos has a graphical user interface or can be launched using an API - as a batch script. Therefore, it is fit for both the analysis of individual songs and the analysis of large music corpora. The interface allows several visual representations, and can indicate the scale of the piece under analysis. The extracted scale can be used immediately to tune a MIDI keyboard that can be played in the discovered scale. These features make Tarsos an interesting tool that can be used for musicological analysis, teaching and even artistic productions.

To read the full text you can either download "Tarsos, a Modular Platform for Precise Pitch Analysis of Western and Non-Western Music, Author version":\[2013.08.20.tarsos_jnmr_author_version.pdf\]. Or obtain the published version of [Tarsos, a Modular Platform for Precise Pitch Analysis of Western and Non-Western Music, published version](http://www.tandfonline.com/doi/full/10.1080/09298215.2013.797999)

Ladrang Kandamanyura (slendro pathet manyura), is the name of the piece used in the article throughout section 2. The album on which the piece can be found is available at [wergo](http://www.wergo.de/shop/en_UK/Audio_CDs/1000088/show,223736,n.html). Below a thirty second fragment is embedded. You can also "download":\[08.\_Ladrang_Kandamanyura_10s-20s_up.wav\] the thirty second fragment to analyse it yourself.

<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F9912709%3Fsecret_token%3Ds-pZJk8&secret_url=true"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F9912709%3Fsecret_token%3Ds-pZJk8&secret_url=true" type="application/x-shockwave-flash" width="100%"></embed> </object>

Below the BibTex entry for the article is embedded.

\`\`\`ruby\
\@article{six2013tarsos_jnmr,\
author = {Six, Joren and Cornelis, Olmo and Leman, Marc},\
title = {Tarsos, a Modular Platform for Precise Pitch Analysis\
of Western and Non-Western Music},\
journal = {Journal of New Music Research},\
volume = {42},\
number = {2},\
pages = {113-129},\
year = {2013},\
doi = {10.1080/09298215.2013.797999},\
URL = {http://www.tandfonline.com/doi/abs/10.1080/09298215.2013.797999}\
}\
\`\`\`


- [jnmr.cover.jpg](https://0110.be/files/attachments/331/jnmr.cover.jpg)

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

- [2013.08.20.tarsos\_jnmr\_author\_version.pdf](https://0110.be/files/attachments/331/2013.08.20.tarsos_jnmr_author_version.pdf)

---

## [FMA 2013 - Computer Assisted Transcripton of Ethnic Music](https://0110.be/posts/FMA_2013_-_Computer_Assisted_Transcripton_of_Ethnic_Music.md)

- Published: 2013-06-14T00:00:00Z
- Updated: 2014-02-25T09:22:13Z
- Author: Joren
- ID: 377
- Canonical: https://0110.be/posts/FMA_2013_-_Computer_Assisted_Transcripton_of_Ethnic_Music

- Tags: [Computational ethnomusicology](https://0110.be/tags/Computational%20ethnomusicology.md), [Computational musicology](https://0110.be/tags/Computational%20musicology.md), [Folk Music Analysis (FMA) conference](https://0110.be/tags/Folk%20Music%20Analysis%20%28FMA%29%20conference.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [Research papers](https://0110.be/tags/Research%20papers.md), [Tarsos](https://0110.be/tags/Tarsos.md), [featured](https://0110.be/tags/featured.md)

At [the third international workshop on Folk Music Analysis (FMA2013)](http://www.elab-oralculture.nl/fma2013) we presented a poster titled "Computer Assisted Transcription of Ethnic Music":\[A0-Poster.png\]. The workshop took place in Amsterdam, Netherlands, June 6 and 7, 2013.

In the extended abstract, also titled "Computer Assisted Transcription of Ethnic Music":\[FMA_2013.computer_assisted_transcription.pdf\], it is described how the Tarsos software program now has features aiding transcription. Tarsos is especially practical for ethnic music of which the tone scale is not known beforehand. [The proceedings of FMA 2013](http://igitur-archive.library.uu.nl/math/2013-0604-200726/UUindex.html) are available as well.

<div style="text-align:center">
"<img src="https://0110.be/files/attachments/377/A0-Poster.jpg" width="450" alt="Computer Assited Transcription of Ethnic Music poster">":\[A0-Poster.jpg\]

</div>
During the conference there also was an interesting panel on transcription. The following people participated: John Ashley Burgoyne, moderator (University of Amsterdam), Kofi Agawu (Princeton University), Dániel P. Biró (University of Victoria), Olmo Cornelis (University College Ghent, Belgium), Emilia Gómez (Universitat Pompeu Fabra, Barcelona), and Barbara Titus (Utrecht University). Some pictures can be found below.


![](https://0110.be/files/photos/377/IMG_20130607_140442.jpg)

![](https://0110.be/files/photos/377/IMG_20130607_152620.jpg)

- [A0-Poster.pdf](https://0110.be/files/attachments/377/A0-Poster.pdf)

- [FMA\_2013.computer\_assisted\_transcription.pdf](https://0110.be/files/attachments/377/FMA_2013.computer_assisted_transcription.pdf)

- [A0-Poster.jpg](https://0110.be/files/attachments/377/A0-Poster.jpg)

- [FMA\_2013.computer\_assisted\_transcription.pdf](https://0110.be/files/attachments/377/FMA_2013.computer_assisted_transcription.pdf)

- [IMG\_20130607\_152620.jpg](https://0110.be/files/attachments/377/IMG_20130607_152620.jpg)

- [IMG\_20130607\_140442.jpg](https://0110.be/files/attachments/377/IMG_20130607_140442.jpg)

---

## [TarsosLSH - Locality Sensitive Hashing (LSH) in Java](https://0110.be/posts/TarsosLSH_-_Locality_Sensitive_Hashing_%28LSH%29_in_Java.md)

- Published: 2013-04-17T00:00:00Z
- Updated: 2020-11-17T09:06:57Z
- Author: Joren
- ID: 356
- Canonical: https://0110.be/posts/TarsosLSH_-_Locality_Sensitive_Hashing_%28LSH%29_in_Java

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

TarsosLSH is a Java library implementing Locality-sensitive Hashing (LSH), a practical nearest neighbour search algorithm for multidimensional vectors that operates in sublinear time. It supports several Locality Sensitive Hashing (LSH) families: the Euclidean hash family (L<sub>2</sub>), city block hash family (L<sub>1</sub>) and cosine hash family. The library tries to hit the sweet spot between being capable enough to get real tasks done, and compact enough to serve as a demonstration on how <abbr title="Locality-sensitive Hashing">LSH</abbr> works. It relates to the Tarsos project because it is a practical way to search for and compare musical features.

### Quickly Getting Started with TarsosLSH

Head over to the [TarsosLSH release repository](https://0110.be/releases/TarsosLSH/) and download the latest [TarsosLSH library](https://0110.be/releases/TarsosLSH/TarsosLSH-latest/TarsosLSH-latest.jar). Consult the [TarsosLSH API documentation](https://0110.be/releases/TarsosLSH/TarsosLSH-latest/TarsosLSH-latest-Documentation/). If you, for some reason, want to build from source, you need [Apache Ant](http://ant.apache.org/) and [git](http://git-scm.com/) installed on your system. The following commands fetch the source and build the library and example jars:

    <code>git clone https://JorenSix@github.com/JorenSix/TarsosLSH.git
    cd TarsosLSH/build
    ant  #Builds the core TarsosLSH library
    ant javadoc #build the API documentation
    </code>

\
When everything runs correctly you should be able to run the command line application, and have the latest version of the TarsosLSH library for inclusion in your projects. Also, the Javadoc documentation for the API should be available in TarsosLSH/doc. Drop me a line if you use TarsosLSH in your project. Always nice to hear how this software is used.

The fastest way to get something on your screen is executing this on your command line: `java - jar TarsosLSH.jar` this lets LSH run on a random data set. The full reference of the command line application is included below:

    Name
        TarsosLSH: finds the nearest neighbours in a data set quickly, using LSH.
    Synopsis    
        java - jar TarsosLSH.jar [options] dataset.txt queries.txt 
    Description
        Tries to find nearest neighbours for each vector in the 
        query file, using Euclidean (L2) distance by default.

        Both dataset.txt and queries.txt have a similar format: 
        an optional identifier for the vector and a list of N 
        coordinates (which should be doubles).

        [Identifier] coord1 coord2 ... coordN
        [Identifier] coord1 coord2 ... coordN

        For an example data set with two elements and 4 dimensions:

        Hans 12 24 18.5 -45.6
        Jane 13 19 -12.0 49.8

        Options are:

        -f cos|l1|l2 
            Defines the hash family to use:
                l1  City block hash family (L1)
                l2  Euclidean hash family(L2)
                cos Cosine distance hash family
        -r radius 
            Defines the radius in which near neighbours should
            be found. Should be a double. By default a reasonable
            radius is determined automatically.
        -h n_hashes
            An integer that determines the number of hashes to 
            use. By default 4, 32 for the cosine hash family.
        -t n_tables
            An integer that determines the number of hash tables,
            each with n_hashes, to use. By default 4.
        -n n_neighbours
            Number of neighbours in the neighbourhood, defaults to 3.
        -b 
            Benchmark the settings. 
        --help 
            Prints this helpful message.
    Examples
        Search for nearest neighbours using the l2 hash family with a radius of 500
        and utilizing 5 hash tables, each with 3 hashes.

        java - jar TarsosLSH.jar -f l2 -r 500 -h 3 -t 5 dataset.txt queries.txt

### Source Code Organization

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.

### Further Reading

This section includes a links to resources used to implement this library.

-   The [LSH-page](http://www.mit.edu/~andoni/LSH/) maintained by Alexandr Andoni contains pointers to good resources:
    -   [Locality-Sensitive Hashing Scheme Based on p-Stable Distributions](http://theory.lcs.mit.edu/~indyk/nips-nn.ps) a chapter by Alexandr Andoni, Mayur Datar, Nicole Immorlica, Piotr Indyk, and Vahab Mirrokni which appeared in the book Nearest Neighbor Methods in Learning and Vision: Theory and Practice, by T. Darrell and P. Indyk and G. Shakhnarovich (eds.), MIT Press, 2006.
    -   [Similarity Search in High Dimensions via Hashing](http://theory.csail.mit.edu/~indyk/vldb99.ps) The original LSH Paper for hamming distance by Gionis, Aristides and Indyk, Piotr and Motwani, Rajeev.

-   [Locality-Sensitive Hashing for Finding Nearest Neighbors](http://www.slaney.org/malcolm/yahoo/Slaney2008-LSHTutorial.pdf) a good introduction of <abbr title="Locality-sensitive Hashing">LSH</abbr> by Malcom Slaney & Michael Casey

-   [Finding Similar Items](http://i.stanford.edu/~ullman/mmds/ch3.pdf), Chapter Three of "Mining of Massive Datasets" by Anand Rajaraman and Jeff Ullman is a textbook introducing the LSH concept.

-   [Szudzik pairing functions](http://szudzik.com/ElegantPairing.pdf) by Matthew Szudzik. Explains how integer hashes can be combined deterministically to form a reversible, unique new hash.


---

## [Flanger Audio Effect in Java](https://0110.be/posts/Flanger_Audio_Effect_in_Java.md)

- Published: 2013-02-04T14:41:06Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 338
- Canonical: https://0110.be/posts/Flanger_Audio_Effect_in_Java

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

The DSP library for Taros, aptly named TarsosDSP, now includes an example demonstrating the [flanging audio effect](http://en.wikipedia.org/wiki/Flanging). Flanging, essentialy mixing the signal with a varying delay of itself, produces an interesting interference pattern.

<div align="center">
<a href="https://0110.be/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/Flanging-latest.jar"><img src="https://0110.be/files/attachments/338/Flanger_Effect_in_Java.png" alt="Pitch estimation synthesizer"/></a>

</div>
The flanging example works on wav-files or on input from microphone. Try it yourself, download\
[Flanging.jar](https://0110.be/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/Flanging-latest.jar), the executable jar file. Below you can check what flanging sounds like with various parameters.

<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F77772715">
</iframe>
The source code of the Java implementation can be found on the [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP).


- [Flanger\_Effect\_in\_Java.png](https://0110.be/files/attachments/338/Flanger_Effect_in_Java.png)

---

## [TarsosDSP Christmas Edition: Jingle Cats](https://0110.be/posts/TarsosDSP_Christmas_Edition%3A_Jingle_Cats.md)

- Published: 2012-12-21T14:38:52Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 373
- Canonical: https://0110.be/posts/TarsosDSP_Christmas_Edition%3A_Jingle_Cats

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

The DSP library for Taros, aptly named TarsosDSP, now includes an example showing how to synthesize cat sounds. The inspration came from this [youtube video](http://www.youtube.com/watch?v=vEg4SEch27w)

To hear what exactly it does, listen to the following audio example.

<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F72084966">
</iframe>
There is also a command line interface, the following command does

<code>\
java -jar Catify-latest.jar in.mid\
</code>

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

    ----------------------------------------------------
    Name:
        TarsosDSP catify'er
    ----------------------------------------------------
    Synopsis:
        java -jar Catify-latest.jar input.mid
    ----------------------------------------------------
    Description:

The source code of the Java implementation of the catify'er can be found on the [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP).


---

## [TarsosDSP Pitch Estimation Synthesizer](https://0110.be/posts/TarsosDSP_Pitch_Estimation_Synthesizer.md)

- Published: 2012-12-19T15:07:10Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 359
- Canonical: https://0110.be/posts/TarsosDSP_Pitch_Estimation_Synthesizer

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

The DSP library for Taros, aptly named TarsosDSP, now includes an example showing how to synthesize pitch estimations. The goal of the example is to show which errors are made by different pitch detectors.

<div align="center">
<a href="https://0110.be/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/Resynthesizer-latest.jar"><img src="https://0110.be/files/attachments/359/Pitch_Estimation_Synthesizer.png" alt="Pitch estimation synthesizer"/></a>

</div>
To test the application, download and execute the [Resynthesizer.jar](http://tarsos.0110.be/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/Resynthesizer-latest.jar) file and load an audio file. For the moment only 44.1kHz mono wav is allowed. To hear what exactly it does, compare the following two audio fragments:

<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F71830992">
</iframe>
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F71831213">
</iframe>
There is also a command line interface, the following command does pitch tracking, and follows the envelope of `in.wav` and immediately plays it on the default audio device. If you want to save the audio, see the command line options. The "flute example":\[flute.wav\] is provided for your convenience.

<code>\
java -jar Resynthesizer-latest.jar in.wav\
</code>

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

    ----------------------------------------------------
    Name:
        TarsosDSP resynthesizer
    ----------------------------------------------------
    Synopsis:
        java -jar CommandLineResynthesizer.jar [--detector DETECTOR] [--output out.wav] [--combined combined.wav] input.wav
    ----------------------------------------------------
    Description:
        Extracts pitch and loudnes from audio and resynthesises the audio with that information.
        The result is either played back our written in an output file. 
        There is als an option to combine source and synthezized material
        in the left and right channels of a stereo audio file.

        input.wav       a readable wav file.

        --output out.wav        a writable file.

        --combined combined.wav     a writable output file. One channel original, other synthesized.
        --detector DETECTOR defaults to FFT_YIN or one of these:
                    YIN
                    MPM
                    FFT_YIN
                    DYNAMIC_WAVELET
                    AMDF

The source code of the Java implementation of the synthesizer can be found on the [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP).


- [Pitch\_Estimation\_Synthesizer.png](https://0110.be/files/attachments/359/Pitch_Estimation_Synthesizer.png)

- [flute.wav](https://0110.be/files/attachments/359/flute.wav)

---

## [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)

---

## [ICMC 2012 - Sound to Scale to Sound, a Setup for Microtonal Exploration and Composition](https://0110.be/posts/ICMC_2012_-_Sound_to_Scale_to_Sound%2C_a_Setup_for_Microtonal_Exploration_and_Composition.md)

- Published: 2012-08-31T00:00:00Z
- Updated: 2014-02-13T10:53:56Z
- Author: Joren
- ID: 369
- Canonical: https://0110.be/posts/ICMC_2012_-_Sound_to_Scale_to_Sound%2C_a_Setup_for_Microtonal_Exploration_and_Composition

- Tags: [Computational ethnomusicology](https://0110.be/tags/Computational%20ethnomusicology.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [Presentation](https://0110.be/tags/Presentation.md), [Tarsos](https://0110.be/tags/Tarsos.md), [featured](https://0110.be/tags/featured.md)

<img src="https://0110.be/files/attachments/369/ICMC_Logo.png" width="120px" alt="Logo Universiteit Utrecht" style="float:right">At this years ICMC Conference, [ICMC 2012](http://www.icmc2012.si/) we presented a paper describing a way to experiment with tone scales and how to use Tarsos as a compositional tool. What follows are some pointers to the presentation, paper and to other interesting talks that were presented there.

ICMC 2012 was organized in Ljubljana from the 9 to 14 septembre and had a very dense program of talks, posters, presentations, demos and concerts.

<blockquote>
Since 1974 the International Computer Music Conference has been the major international forum for the presentation of the full range of outcomes from technical and musical research, both musical and theoretical, related to the use of computers in music. This annual conference regularly travels the globe, with recent conferences in the Americas, Europe and Asia. This year we welcome the conference to Slovenia for the first time.

</blockquote>
### Sound to Scale to Sound, a Setup for Microtonal Exploration and Composition

Our contribution to the conference was a paper titled "Sound to Scale to Sound, a Setup for Microtonal Exploration and Composition":\[icmc2012_submission_45.pdf\].

If you want to cite our work, this BibTeX entry is included for your convenience:

\`\`\`ruby\
\@inproceedings{cornelis2012sound_to_scale,\
author = {Olmo Cornelis and Joren Six},\
title = {{Sound to Scale to Sound, a Setup for Microtonal Exploration and Composition}},\
booktitle = {{Proceedings of the 2012 International Computer Music Conference,\
(ICMC 2012)}},\
year = {2012},\
publisher = {The International Computer Music Association}\
}\
\`\`\`

### Program highlights

What follows are a number of pointers to my personal program highlights.

Verena Thomas presented two very well polished software tools. One to detect patterns in scores, called motifviewer and a tool to search in score databases in a multi-modal way. The [Probado tool](http://probado.iai.uni-bonn.de:8080/) does score-to-audio alignment and much more.

[Gibber](http://www.charlie-roberts.com/gibber/) is an impressive live-coding environment with an easy syntax. Since it is all done with javascript you can start playing with it immediately. [Overtone](http://overtone.github.com/) Another live-coding environment, presented at the conference by Sam Aaron, was equally impressive. It is programmed using the Closure language.

At ICMC there were a number of tools to assist in composition. One of those is [The Bach Project](http://www.bachproject.net/bach/home_page.html), by Andrea Agostini. Togheter with CatART by Diemo Swartz it forms a very expressive platform to work with sound, which was demonstrated by Aaron Einbond and Christopher Trapani in their paper titled *Precise Pitch Control In Real Time Corpus-Based Concatenative Synthesis*. Diemo Swartz presented work on Audio Mosaicing, it can be seen as a follow-up to [AuidioGuild](http://crca.ucsd.edu/~ben/audioGuide/) by Ben Hackbarth.

I also got to know the work by [Thomas Grill](http://grrrr.org), on his website a nice piece of software can be found a Python implementation of the [Non Stationary Gabor Transform (NSGT)](http://grrrr.org/research/software/nsgt/). Another software system I got to know is the functional signal processing programming language [FAUST](http://en.wikipedia.org/wiki/FAUST_(programming_language))

My personal highlights of the concert programme include the works by Johannes Kreidler, Aura Pon, Daniel Mayer, Alexander Schubert and the remarkable performance by Dexter Ford. The concept behind Soundlog by Johannes Kretz was also interesting.


- [ICMC\_Logo.png](https://0110.be/files/attachments/369/ICMC_Logo.png)

- [2012.09.08-Sound\_to\_Scale\_to\_Sound\_\_a\_Setup\_for\_Microtonal\_Exploration\_and\_Composition.odp](https://0110.be/files/attachments/369/2012.09.08-Sound_to_Scale_to_Sound__a_Setup_for_Microtonal_Exploration_and_Composition.odp)

- [icmc2012\_submission\_45.pdf](https://0110.be/files/attachments/369/icmc2012_submission_45.pdf)

---

## [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>


---

## [Echo or Delay Audio Effect in Java With TarsosDSP](https://0110.be/posts/Echo_or_Delay_Audio_Effect_in_Java_With_TarsosDSP.md)

- Published: 2012-02-23T15:33:11Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 398
- Canonical: https://0110.be/posts/Echo_or_Delay_Audio_Effect_in_Java_With_TarsosDSP

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

The DSP library for Taros, aptly named TarsosDSP, now includes an implementation of an audio echo effect. An echo effect is very simple to implement digitally and can serve as a good example of a DSP operation.

<div align="center">
"![Echo or delay effect in Java](https://0110.be/files/attachments/398/echo_or_delay_effect.png "Echo or delay effect in Java")":\[Delay.jar\]

</div>
The implementation of the effect can be seen below. As can be seen, to achieve an echo one simply needs to mix the current sample `i` with a delayed sample present in `echoBuffer` with a certain decay factor. The length of the buffer and the decay are the defining parameters for the sound of the echo. To fill the echo buffer the current sample is stored (line 4). Looping through the echo buffer is done by incrementing the position pointer and resetting it at the correct time (lines 6-9).

\`\`\`java\
//output is the input added with the decayed echo\
audioFloatBuffer\[i\] = audioFloatBuffer\[i\] + echoBuffer\[position\] \* decay;\
//store the sample in the buffer;\
echoBuffer\[position\] = audioFloatBuffer\[i\];\
//increment the echo buffer position\
position;\
//loop in the echo buffer\
if(position == echoBuffer.length)\
position = 0;\
\`\`\`

To test the application, download and execute the "Delay.jar":\[Delay.jar\] file and start singing in a microphone.

The source code of the Java implementation can be found on the [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP/).


![](https://0110.be/files/photos/398/echo_or_delay_effect.png)

- [Delay.jar](https://0110.be/files/attachments/398/Delay.jar)

- [echo\_or\_delay\_effect.png](https://0110.be/files/attachments/398/echo_or_delay_effect.png)

---

## [Spectrogram in Java with TarsosDSP](https://0110.be/posts/Spectrogram_in_Java_with_TarsosDSP.md)

- Published: 2012-02-14T14:31:04Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 384
- Canonical: https://0110.be/posts/Spectrogram_in_Java_with_TarsosDSP

- Tags: [Code](https://0110.be/tags/Code.md), [Computational musicology](https://0110.be/tags/Computational%20musicology.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [TarsosDSP](https://0110.be/tags/TarsosDSP.md)

This is post presents a better version of the [spectrogram implementation](https://0110.be/artikels/lees/Tarsos_Spectrogram). Now it is included as an example in TarsosDSP, a small java audio processing library. The application show a live spectrogram, calculated using an FFT and the detected fundamental frequency (in red).

<div align="center">
<a href="https://0110.be/files/attachments/384/Spectrogram.jar"><img src="https://0110.be/files/attachments/384/spectrogram.png" alt="Spectrogram and pitch detection in Java"/></a>

</div>
To test the application, download and execute the "Spectrogram.jar":\[Spectrogram.jar\] file and start singing in a microphone.

There is also a command line interface, the following command shows the spectrum for `in.wav`:

<code>\
java -jar Spectrogram.jar in.wav\
</code>

The source code of the Java implementation can be found on the [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP/).


![](https://0110.be/files/photos/384/spectrogram.png)

- [Spectrogram.jar](https://0110.be/files/attachments/384/Spectrogram.jar)

- [spectrogram.png](https://0110.be/files/attachments/384/spectrogram.png)

---

## [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)

---

## [Tarsos CLI:  Detect Pitch](https://0110.be/posts/Tarsos_CLI%3A__Detect_Pitch.md)

- Published: 2012-02-03T15:00:06Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 390
- Canonical: https://0110.be/posts/Tarsos_CLI%3A__Detect_Pitch

- 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), [Tarsos](https://0110.be/tags/Tarsos.md)

<img src="http://tarsos.0110.be/attachment/cons/210/tarsos_logo_small.png"  alt="Tarsos Logo" style="float:right;margin-left:5px;"/>Tarsos contains a couple of useful command line applications. They can be used to execute common tasks on lots of files. [Dowload Tarsos](http://tarsos.0110.be/attachment/tarsos.jar) and call the applications using the following format:

`java -jar tarsos.jar command [argument...] [--option [value]...]`

The first part `java -jar tarsos.jar` tells the Java Runtime to start the correct application. The first argument for Tarsos defines the command line application to execute. Depending on the command, required arguments and options can follow.

`java -jar tarsos.jar detect_pitch in.wav --detector TARSOS_YIN`

To get a list of available commands, type `java -jar tarsos.jar -h`. If you want more information about a command type `java -jar tarsos.jar command -h`

## Detect Pitch

Detects pitch for one or more input audio files using a pitch detector. If a directory is given it traverses the directory *recursively*. It writes CSV data to standard out with five columns. The first is the start of the analyzed window (seconds), the second the estimated pitch, the third the saillence of the pitch. The name of the algorithm follows and the last column shows the original filename.

    Synopsis
    --------
    java -jar tarsos.jar detect_pitch [option] input_file...

    Option                                  Description                            
    ------                                  -----------                            
    -?, -h, --help                          Show help                              
    --detector <PitchDetectionMode>         The detector to use [VAMP_YIN |        
                                              VAMP_YIN_FFT |                       
                                              VAMP_FAST_HARMONIC_COMB |            
                                              VAMP_MAZURKA_PITCH | VAMP_SCHMITT |  
                                              VAMP_SPECTRAL_COMB |                 
                                              VAMP_CONSTANT_Q_200 |                
                                              VAMP_CONSTANT_Q_400 | IPEM_SIX |     
                                              IPEM_ONE | TARSOS_YIN |              
                                              TARSOS_FAST_YIN | TARSOS_MPM |       
                                              TARSOS_FAST_MPM | ] (default:        
                                              TARSOS_YIN) 

The output of the command looks like this:

    Start(s),Frequency(Hz),Probability,Source,file
    0.52245,366.77039,0.92974,TARSOS_YIN,in.wav
    0.54567,372.13873,0.93553,TARSOS_YIN,in.wav
    0.55728,375.10638,0.95261,TARSOS_YIN,in.wav
    0.56889,380.24854,0.94275,TARSOS_YIN,in.wav


---

## [TarsosDSP used in jAM - Java Automatic Music Transcription](https://0110.be/posts/TarsosDSP_used_in_jAM_-_Java_Automatic_Music_Transcription.md)

- Published: 2011-12-12T09:13:14Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 399
- Canonical: https://0110.be/posts/TarsosDSP_used_in_jAM_-_Java_Automatic_Music_Transcription

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

<img src="https://0110.be/files/attachments/399/jAMlogo.png" width="40" alt="jAM logo" style="float:right">TarsosDSP, a small Java DSP library, has been used in a bachelor thesis: [Entwicklung eines Systems zur automatischen Notentranskription von monophonischem Audiomaterial](http://saeft.com/jAM/assets/Bachelorarbeit.pdf) by Michael Wager.

The goal of the thesis was to develop an automatic transcription system for monophonic music. You can download the latest version of [jAM - Java Automatic Music Transcription](http://saeft.com/jAM/index.php/index/download).

If you want to use TarsosDSP, please consult the [TarsosDSP page on github](https://github.com/JorenSix/TarsosDSP) or read [more about TarsosDSP](https://0110.be/tag/TarsosDSP) here.


---

## [Kinderuniversiteit - Muziek onder de microscoop!](https://0110.be/posts/Kinderuniversiteit_-_Muziek_onder_de_microscoop%21.md)

- Published: 2011-12-12T08:41:21Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 326
- Canonical: https://0110.be/posts/Kinderuniversiteit_-_Muziek_onder_de_microscoop%21

- Tags: [Dutch](https://0110.be/tags/Dutch.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [Presentation](https://0110.be/tags/Presentation.md)

Zondag 18 december 2011 gaf ik een workshop voor de [Gentse kinderuniversiteit](http://kinderuniversiteit.be). Het thema van de kinderuniversiteit was [Muziek onder de microscoop](http://www.kinderuniversiteit.be/event/muziek-onder-de-microscoop). De teaser voor de workshop is hier te vinden:

<blockquote>
<img src="https://0110.be/files/attachments/326/logo-with-arrow.png" width="110" alt="Logo kinderuniversiteit" style="float:left"><b>WORKSHOP - Muziek (ont)luisteren op de computer</b>\
Is het mogelijk om piano te spelen op een tafel? Kan een computer luisteren naar muziek en er van genieten? Wat is muziek eigenlijk, en hoe werkt geluid?<br>\
Tijdens deze workshop worden de voorgaande vragen beantwoord met enkele computerprogramma's!

</blockquote>
Concreet worden enkele componenten van geluid (en bij uitbreiding, muziek) gedemonstreerd met computerprogrammaatjes gemaakt in het conservatorium:

-   "Geluidssterkte":\[SoundDetector.jar\]: een decibel-meter met een bepaalde drempelwaarde. Probeer zo luid mogelijk te doen en zie hoe moeilijk het is om, eens een bepaald niveau bereikt is, in decibel te stijgen.

-   "Toonhoogte":\[UtterAsterisk.jar\]: een klein spelletje om toonhoogte aan te tonen. Probeer zo juist mogelijk te zingen of te fluiten en vergelijk je score.

-   "Percussie":\[PercussionDetector.jar\]: dit programma reageert op handgeklap. Hoe kan je het onderscheid maken tussen bijvoorbeeld een fluittoon en handgeklap?

De foto's hieronder geven een sfeerbeeld.


![](https://0110.be/files/photos/326/DSC01069.jpg)

![](https://0110.be/files/photos/326/DSC01067.jpg)

![](https://0110.be/files/photos/326/DSC01053.jpg)

![](https://0110.be/files/photos/326/DSC01064.jpg)

![](https://0110.be/files/photos/326/DSC01072.jpg)

![](https://0110.be/files/photos/326/DSC01068.jpg)

- [logo-with-arrow.png](https://0110.be/files/attachments/326/logo-with-arrow.png)

- [UtterAsterisk.jar](https://0110.be/files/attachments/326/UtterAsterisk.jar)

- [PercussionDetector.jar](https://0110.be/files/attachments/326/PercussionDetector.jar)

- [PitchDetector.jar](https://0110.be/files/attachments/326/PitchDetector.jar)

- [SoundDetector.jar](https://0110.be/files/attachments/326/SoundDetector.jar)

---

## [Robust Audio Fingerprinting with Tarsos and Pitch Class Histograms](https://0110.be/posts/Robust_Audio_Fingerprinting_with_Tarsos_and_Pitch_Class_Histograms.md)

- Published: 2011-11-09T14:46:36Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 378
- Canonical: https://0110.be/posts/Robust_Audio_Fingerprinting_with_Tarsos_and_Pitch_Class_Histograms

- Tags: [Code](https://0110.be/tags/Code.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), [featured](https://0110.be/tags/featured.md)

The aim of acoustic fingerprinting is to generate a small representation of an audio signal that can be used to identify or recognize similar audio samples in a large audio set. A robust fingerprint generates similar fingerprints for perceptually similar audio signals. A piece of music with a bit of noise added should generate an almost identical fingerprint as the original. The use cases for audio fingerprinting or acoustic fingerprinting are myriad: detection of duplicates, identifying songs, recognizing copyrighted material,...

Using a pitch class histogram as a fingerprint seems like a good idea: it is unique for a song and it is reasonably robust to changes of the underlying audio (length, tempo, pitch, noise). The idea has probably been found a couple of times independently, but there is also a reference to it in the literature, by Tzanetakis, 2003: [Pitch Histograms in Audio and Symbolic Music Information Retrieval](http://marsyas.info/pdfs/0000/0008/jnmr03gtzan.pdf):

> Although mainly designed for genre classification it is possible that features derived from Pitch Histograms might also be applicable to the problem of content-based audio identification or audio fingerprinting (for an example of such a system see (Allamanche et al., 2001)). We are planning to explore this possibility in the future.

Unfortunately they never, as far as I know, did explore this possibility, and I also do not know if anybody else did. I found it worthwhile to implement a fingerprinting scheme on top of the Tarsos software foundation. Most elements are already available in the Tarsos API: a way to detect pitch, construct a pitch class histogram, correlate pitch class histograms with a pitch shift,... I created a GUI application which is presented here. It is, probably, the first open source acoustic / "audio fingerprinting system based on pitch class histograms":\[AudioFingerprinter.jar\].

<center>
<a href="https://0110.be/files/attachments/378/AudioFingerprinter.jar" title="Audio fingerprinter based on pitch class histograms"><img src="https://0110.be/files/attachments/378/x360-dc445.audio_fingerprinting_query.png" alt="Audio fingerprinter based on pitch class histograms"></a>

</center>
It works using drag and drop and the idea is to find a needle (an audio file) in a hay stack (a large amount of audio files). For every audio file in the haystack and for the needle pitch is detected using an optimized, for speed, Yin implementation. A pitch class histogram is created for each file, the histogram for the needle is compared with each histogram in the hay stack and, hopefully, the needle is found in the hay stack.

Unfortunately I do not have time for rigorous testing (by building a large acoustic fingerprinting data set, or an other decent test bench) but the idea seems to work. With the following modifications, done with [audacity effects](http://audacity.sourceforge.net/onlinehelp-1.2/menu_effect.htm) the needle was still found a hay stack of 836 files :

-   A 10% speedup

-   15 and 30 seconds removed form the needle (a song of 4 minutes 12 seconds)

-   White noise added

-   Reversed the audio (This is, I believe, a rather unique property of this fingerprinting technique)

-   GSM reencoded

The following modifications failed to identify the correct song:

-   A one semitone pitch shift

-   A two semitone pitch shift

-   60 seconds removed from the needle

The original was also found. No failure analysis was done. The hay stack consists of about 100 hours of western pop, the needle is also a western pop song. If somebody wants to pick up this work or has an acoustic fingerprinting data set or drop me a line at

<script type="text/javascript">
<!--
document.write("<a href='mailto:&#106;&#111;&#114;&#101;&#110;&#46;&#115;&#105;&#120;&#64;&#104;&#111;&#103;&#101;&#110;&#116;&#46;&#98;&#101;'>&#106;&#111;&#114;&#101;&#110;&#46;&#115;&#105;&#120;&#64;&#104;&#111;&#103;&#101;&#110;&#116;&#46;&#98;&#101;</a>")
// -->
</script>
.

The source code is available, as always, on the [Tarsos GitHub page](https://github.com/JorenSix/Tarsos).


![Audio Fingerprinting Results](https://0110.be/files/photos/378/audio_fingerprinting_results.png)

![Audio Fingerprinting Query](https://0110.be/files/photos/378/audio_fingerprinting_query.png)

![Large scale results](https://0110.be/files/photos/378/larger_scale_results.png)

- [x360-dc445.audio\_fingerprinting\_query.png](https://0110.be/files/attachments/378/x360-dc445.audio_fingerprinting_query.png)

- [AudioFingerprinter.jar](https://0110.be/files/attachments/378/AudioFingerprinter.jar)

---

## [Dual-Tone Multi-Frequency (DTMF) Decoding with the Goertzel Algorithm in Java](https://0110.be/posts/Dual-Tone_Multi-Frequency_%28DTMF%29_Decoding_with_the_Goertzel_Algorithm_in_Java.md)

- Published: 2011-09-27T09:07:26Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 343
- Canonical: https://0110.be/posts/Dual-Tone_Multi-Frequency_%28DTMF%29_Decoding_with_the_Goertzel_Algorithm_in_Java

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

<a href="https://0110.be/files/attachments/343/GoertzelDTMF.jar"><img style="float:right;margin-left:5px" src="https://0110.be/files/attachments/343/goertzel_DTMF_java_7.png" alt="DTMF Goertzel in JAVA"/></a>The DSP library of Tarsos, aptly named TarsosDSP, now contains an implementation of the Goertzel Algorithm. It is implemented using pure Java.

The [Goertzel algorithm](http://en.wikipedia.org/wiki/Goertzel_algorithm) can be used to detect if one or more predefined frequencies are present in a signal and it does this very efficiently. One of the classic applications of the Goertzel algorithm is decoding the tones generated on by touch tone telephones. These use [DTMF (Dual tone multi frequency)-signaling](http://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling).

To make the algorithm visually appealing a Java Swing interface has been created(visible right). You can try this application by running the "Goertzel DTMF Jar-file":\[GoertzelDTMF.jar\]. The souce code is included in the jar and is avaliable as a separate "zip file":\[GoertzelDTMF_src.zip\]. The [TarsosDSP github page](https://github.com/JorenSix/TarsosDSP) also contains the source for the [Goertzel algorithm Java implementation](https://github.com/JorenSix/TarsosDSP/blob/master/src/be/hogent/tarsos/dsp/pitch/Goertzel.java).


![DTMF detection of 9](https://0110.be/files/photos/343/goertzel_DTMF_java_9.png)

![DTMF detection of 2](https://0110.be/files/photos/343/goertzel_DTMF_java_2.png)

- [goertzel\_DTMF\_java\_7.png](https://0110.be/files/attachments/343/goertzel_DTMF_java_7.png)

- [GoertzelDTMF.jar](https://0110.be/files/attachments/343/GoertzelDTMF.jar)

- [GoertzelDTMF\_src.zip](https://0110.be/files/attachments/343/GoertzelDTMF_src.zip)

---

## [Rendering MIDI Using Arbitrary Tone Scales - Revisited](https://0110.be/posts/Rendering_MIDI_Using_Arbitrary_Tone_Scales_-_Revisited.md)

- Published: 2011-09-20T14:14:02Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 408
- Canonical: https://0110.be/posts/Rendering_MIDI_Using_Arbitrary_Tone_Scales_-_Revisited

- Tags: [Code](https://0110.be/tags/Code.md), [Computational musicology](https://0110.be/tags/Computational%20musicology.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md)

Tarsos can be used to render MIDI files to audio (WAV) files using arbitrary tone scales. This functionallity can be used to (automatically) verify tone scale extraction from audio files. Since I could not find a dataset with audio and corresponding tone scales creating one using MIDI seemed a good idea.

MIDI files can be found in spades (for example on [piano-midi.de](http://www.piano-midi.de/midi_files.htm) or [kunstderfuge.com](http://kunstderfuge.com)), tone scales on the other hand are harder to find. Luckily there is one massive source, the [Scala Tone Scale Archive](http://www.huygens-fokker.org/scala/downloads.html#scales): *A large collection of over 3700 tone scales*.

Using Scala tone scale files and a midi files a *Tone Scale - Audio* dataset can be generated. The quality of the audio depends on the (software) synthesizer and the [SoundFont](http://en.wikipedia.org/wiki/SoundFont) used. Tarsos currently uses the [Gervill synthesizer](https://gervill.dev.java.net/). Gervill is a pure Java software synthesizer with support for 24bit SoundFonts and the MIDI tuning standard.\
<br/>

### How To Render MIDI Using Arbitrary Tone Scales with Tarsos

A recent version of the JRE (Java Runtime Environment) needs to be installed on your system if you want to use Tarsos. Tarsos itself can be downloaded in the form of the "MIDI and Scala to Wav - JAR Package":\[MidiToWav.jar\].

To test the program you can use "a MIDI file":\[MIDI_file.mid\] and "a Scala file":\[persian.scl.txt\] and drag and drop those on the graphical interface.

<center>
<img src="https://0110.be/photo/cons/216/MIDI_and_Scala_to_WAV.png" alt="Midi to WAV screen shot"/>

</center>
The result should sound like this:

<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F23757999"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F23757999" type="application/x-shockwave-flash" width="100%"></embed> </object>

To summarize: by rendering audio with MIDI and Scala tone scale files a dataset with tone scale - audio information can be generated and tone scale extraction algorithms can be tested on the fly.


![Drag and drop MIDI and scala files](https://0110.be/files/photos/408/MIDI_and_Scala_to_WAV.png)

![Create WAV files](https://0110.be/files/photos/408/MIDI_and_Scala_to_WAV_processing.png)

- [MidiToWav.jar](https://0110.be/files/attachments/408/MidiToWav.jar)

- [MIDI\_file.mid](https://0110.be/files/attachments/408/MIDI_file.mid)

- [persian.scl.txt](https://0110.be/files/attachments/408/persian.scl.txt)

---

## [PeachNote Piano](https://0110.be/posts/PeachNote_Piano.md)

- Published: 2011-09-08T06:32:37Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 407
- Canonical: https://0110.be/posts/PeachNote_Piano

- Tags: [Code](https://0110.be/tags/Code.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [PeachNote Piano](https://0110.be/tags/PeachNote%20Piano.md), [Presentation](https://0110.be/tags/Presentation.md)

<img style="float:right;margin-left:5px" src="https://0110.be/photo/cons/212/PeachNote_Schema.png" alt="PeachNote Piano Schema"/>This is about PeachNote Piano, a project only tangentially related to Tarsos. PeachNote Piano aims to capture as many piano practice sessions as possible and offer useful services using this data. The system does this by capturing and redirecting MIDI events on a Bluetooth enabled smartphone. It is done together with [Vladimir Viro](http://www.peachnote.com/about.html) and builds on the existing [PeachNote](http://peachnote.com) infrastructure.

The schema - right - shows the components of the PeachNote Piano system. At the bottom you have a MIDI keyboard connected to the MIDI-Bluetooth-bridge. A smartphone (middle left) receives these MIDI events via Bluetooth and controls the communication to the server (top left). An alternative path goes through a standard computer (top right).

The Arduino based Bluetooth to MIDI bridge is an improvement on the work by [Peter Brinkmann](http://nettoyeur.noisepages.com/). The video below shows communication between USB-MIDI, Bluetooth MIDI and MIDI IN/OUT ports.

As an example application of the PeachNote Piano system we implemented a "Continue a Melody" service which works as follows: a user plays something on a keyboard, maybe just a few notes, and pauses for a few seconds. In the meantime, the server searches through a large database of MIDI piano recordings, finds the longest fuzzy match for the user's most recent input, and, after a short silence on the users part, starts streaming the continuation of the best matched performance from the database to the user. This mechanism, in fact, is way of browsing a music collection. Users may play a known leitmotiv or just improvise something, and the system continues playing a high quality recording, "replying" to the musical proposition of the user.

<object style="height: 390px; width: 640px">
<param name="movie" value="http://www.youtube.com/v/zDWon8l8Cx4?version=3"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/zDWon8l8Cx4?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></object>

### More technical details

The melody matching is done on the server, which is implemented in Javascript in the Node.js framework. The whole dataset (about 350 hours of piano recordings) resides in memory in two representations: as a sequence of pitches, and as a sequence of "densities" at the corresponding places of the pitch sequence dataset. This second array is used to store the rough tempo information (number of notes per second) absent in the pitch sequence data.\
By combining the two search criteria we can achieve reasonable approximation of the tempo-aware search without its computational complexity.

The implementation of the hardware is based on the open-source electronic prototyping platform Arduino. Optocoupled MIDI ports (IN/OUT) and the BlueSMiRF Bluetooth module were attached to the main board, as can be seen in the middle left block of the schema. The BlueTooth module is configured to use the Serial Port Profile (SPP) which emulates RS-232. The software on the Arduino manages bi-directional, low latency message passing between three serial ports: USB (through an FTDI chip), BlueTooth and the hardware MIDI-IN and OUT port.

The standard Arduino firmware has been replaced with firmware that implements the "Universal Serial Bus Device Class Definition for MIDI Devices": when attached to a computer via USB, the Arduino shows up as a standard MIDI device, which makes it compatible with all available MIDI software. The software client currently works on the Android smartphone platform. It is represented using the middle right block in the schema. The client can send and receive MIDI events over its Bluetooth port. Pairing, connecting and communicating with the device is done using the [Amarino software library](http://www.amarino-toolkit.net/). The client communicates with the Peachnote Piano server using TCP sockets implemented on the Dalvik Java runtime.


![Finished enclosure](https://0110.be/files/photos/407/IMG_20110827_014141.jpg)

![Building a Bluetooth - MIDI shield](https://0110.be/files/photos/407/IMG_20110827_003652.jpg)

![Assembled](https://0110.be/files/photos/407/IMG_20110827_014024.jpg)

![PeachNote Piano in action](https://0110.be/files/photos/407/peachnote.jpg)

![PeachNote Schema](https://0110.be/files/photos/407/PeachNote_Schema.png)

---

## [Makam Recognition with the Tarsos API](https://0110.be/posts/Makam_Recognition_with_the_Tarsos_API.md)

- Published: 2011-09-01T08:13:21Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 406
- Canonical: https://0110.be/posts/Makam_Recognition_with_the_Tarsos_API

- Tags: [Code](https://0110.be/tags/Code.md), [Computational ethnomusicology](https://0110.be/tags/Computational%20ethnomusicology.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)

This article describes how to do makam recognition with a script that uses the Tarsos API.

The task we want to do is to find the tone scales most similar to the one used in recorded music. To complete this task you need a small set of theoretical scales and a large set of music, each brought in one of the scales. To make it more concrete, an example of Turkish classical music is used.

In an [article by Bozkurt](http://dl.acm.org/citation.cfm?id=1688013) pitch histograms are used for - amongst other tasks - makam recognition. A maqam defines rules for a composition or performance of classical Turkish music. It specifies melodic shapes and pitch intervals, the scale. The task is to identify which of nine makams is used in a specific song. A simplified, generalized implementation of this task is shown here. In our implementation there is no tonic detection step. Also here we use only theoretical descriptions of the tone scales as a template and do not construct a template using the audio itself, as is done by Bozkurt. Ioannidis Leonidas wrote an interesting [master thesis about makam recognition](http://www.mtg.upf.edu/static/media/Ioannidis-Leonidas-Master-Thesis-2010.pdf). Since no knowledge of the music itself is used the approach is generally applicable.

The following is an implementation in [Scala](http://scala-lang.org) a general purpose programming language that is interoperable with Jave . The first step is to write the Scala header. This is just some boilerplate code to be able to run the script from the command line - it assumes a UNIX-like environment and tarsos.jar in the same directory:

\`\`\`ruby\
#!/bin/sh\
exec scala -cp tarsos.jar -savecompiled "\$0" "\$@"\
!#\
import be.hogent.tarsos.util.\_\
//other import statements\
\`\`\`

The second step constructs the templates the capability of Tarsos to create\
theoretical tone scale templates using Gaussian kernels is used, line 8. See the attached images for some examples.

\`\`\`ruby\
val makams = List( "hicaz","huseyni","huzzam","kurdili_hicazar",\
"nihavend","rast","saba","segah","ussak")

var theoreticKDEs = Map\[java.lang.String,KernelDensityEstimate\]()\
makams.foreach{ makam =\>\
val scalaFile = makam + ".scl"\
val scalaObject = new ScalaFile(scalaFile);\
val kde = HistogramFactory.createPichClassKDE(scalaObject,35)\
kde.normalize\
theoreticKDEs = theoreticKDEs + (makam -\> kde)\
}\
\`\`\`

The third and last step is matching. First a list of audio\
files is created by recursively iterating a directory and matching each file to\
a regular expression. Next, starting from line 4, each audio file is processed.\
The internal implementation of the YIN pitch detection\
algorithm is used on the audio file and a pitch class histogram is created\
(line 6,7). On line 10 normalization of the histogram is done, to\
make the correlation calculation meaningful. Line 11 until 15 compare the\
created histogram from the audio file with the templates calculated beforehand.\
The results are stored, ordered and eventually printed on line 19.

\`\`\`ruby\
val directory = "/home/joren/turkish_makams/"\
val audio_pattern = ".\*.(mp3\|wav\|ogg\|flac)"\
val audioFiles = FileUtils.glob(directory,audio_pattern,true).toList

audioFiles.foreach{ file =\>\
val audioFile = new AudioFile(file)\
val detectorYin = PitchDetectionMode.TARSOS_YIN.getPitchDetector(audioFile)\
val annotations = detectorYin.executePitchDetection()\
val actualKDE = HistogramFactory.createPichClassKDE(annotations,15);\
actualKDE.normalize\
var resultList = List\[Tuple2\[java.lang.String,Double\]\]()\
for ((name, theoreticKDE) \<- theoreticKDEs){\
val shift = actualKDE.shiftForOptimalCorrelation(theoreticKDE)\
val currentCorrelation = actualKDE.correlation(theoreticKDE,shift)\
resultList = (name -\> currentCorrelation) :: resultList\
}\
//order by correlation\
resultList = resultList.sortBy{\_.\_2}.reverse\
Console.println(file + " is brought in tone scale " + resultList(0).\_1)\
}\
\`\`\`

A complete version of this script can is available: "Tone scale matching script":\[guess_makam.scala\] Results of the script when ran on Bozkurt's dataset can be seen in the attached spreadsheet ("openoffice format":\[makam_recognition_results.ods\] or "excel format":\[makam_recognition_results.xls\]).


![Theoretical template](https://0110.be/files/photos/406/template_ussak.png)

![Other theoretical template](https://0110.be/files/photos/406/template_segah.png)

![Actual Hicaz song overlayed with a theoretical template](https://0110.be/files/photos/406/hicaz.png)

- [guess\_makam.scala](https://0110.be/files/attachments/406/guess_makam.scala)

- [makams.zip](https://0110.be/files/attachments/406/makams.zip)

- [makam\_recognition\_results.ods](https://0110.be/files/attachments/406/makam_recognition_results.ods)

- [makam\_recognition\_results.xls](https://0110.be/files/attachments/406/makam_recognition_results.xls)

---

## [Latex export functions](https://0110.be/posts/Latex_export_functions.md)

- Published: 2011-06-17T08:02:51Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 402
- Canonical: https://0110.be/posts/Latex_export_functions

- Tags: [Computational ethnomusicology](https://0110.be/tags/Computational%20ethnomusicology.md), [HoGent](https://0110.be/tags/HoGent.md), [Java](https://0110.be/tags/Java.md), [Tarsos](https://0110.be/tags/Tarsos.md)

Tarsos, a software package to analyse pitch organization in music, contains a new output modality. It is now possible to export a pitch class histogram and a pitch class interval matrix to latex from within Tarsos. This makes documenting tone scales more efficient.

An example for "a pitch class histogram and pitch class interval matrix":\[latex_export.pdf\] can be seen. Also available is the "latex source code":\[latex_export.tex\].


![Latex export of a pitch class histo.](https://0110.be/files/photos/402/latex_export_pitch_class_histo.png)

![Latex export of a pitch class interval matrix](https://0110.be/files/photos/402/latex_export_p_c_interval_matrix.png)

- [latex\_export.tex](https://0110.be/files/attachments/402/latex_export.tex)

- [latex\_export.pdf](https://0110.be/files/attachments/402/latex_export.pdf)

- [MR.1954.1.19-4.dat](https://0110.be/files/attachments/402/MR.1954.1.19-4.dat)

---

## [Resynthesis of Pitch Detection Annotations on a Flute Piece](https://0110.be/posts/Resynthesis_of_Pitch_Detection_Annotations_on_a_Flute_Piece.md)

- Published: 2011-06-16T14:43:10Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 403
- Canonical: https://0110.be/posts/Resynthesis_of_Pitch_Detection_Annotations_on_a_Flute_Piece

- Tags: [Code](https://0110.be/tags/Code.md), [Computational ethnomusicology](https://0110.be/tags/Computational%20ethnomusicology.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)

Tarsos, a software package to analyse pitch organization in music, contains a new output modality. Now it is possible to export resynthesized pitch annotations, detected by a pitch detection algorithm and compare those with the original sound. This can be interesting to see which errors a pitch detection algorithm makes.

Below you can listen to an example of synthesized pitch detection results compared with the original flute piece. The file starts with only the original flute sound (on the right channel) and gradually changes so only the synthesized annotations (on the left channel) can be heard.

<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F17260613&amp;show_comments=true&amp;auto_play=false&amp;color=ff7700"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F17260613&amp;show_comments=true&amp;auto_play=false&amp;color=ff7700" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="http://soundcloud.com/joren_six/flute-resynth">Resynthesis of Pitch Detection Annotations on a Flute Piece</a> by <a href="http://soundcloud.com/joren_six">Joren Six</a></span>


- [flute\_resynth.wav](https://0110.be/files/attachments/403/flute_resynth.wav)

---

## [PulseAudio Support for Sun Java 6 on Ubuntu](https://0110.be/posts/PulseAudio_Support_for_Sun_Java_6_on_Ubuntu.md)

- Published: 2011-05-27T09:59:31Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 394
- Canonical: https://0110.be/posts/PulseAudio_Support_for_Sun_Java_6_on_Ubuntu

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

This article describes how to make sun-java6 play nice with the PulseAudio sound sytem on Ubuntu with an x64 processor architecture. With some changes the method should also work with other operating systems and other platforms.

The default way sun-java6 operates with respect to sound on Ubuntu is, well unrespectfull. When playing audio it claims an audio device, which then can not be used any more by other applications trying to access the same device. This is far from ideal. Also changing audio interfaces (by e.g. plugging in a USB audio interface) goes wrong most of the time.

<center>
<img src="https://0110.be/files/attachments/394/pulseaudio_logo.png" alt="PulseAudio ear-candy">

</center>
These problems are addressed by PulseAudio and there is a way to make sun-java6 aware of PulseAudio on Ubuntu. The OpenJDK does this automatically but it has some other, unrelated, issues. If you want to use PulseAudio with java6 on Ubuntu x64 you need copy "pulse-java.jar":\[pulse-java.jar\] and platform dependent "libpulse-java.so":\[libpulse-java.so\] file to correct JVM directories. To make it easy you can execute these commands:

\`\`\`ruby\
wget http://tarsos.0110.be/attachment/cons/255/libpulse-java.so\
sudo cp libpulse-java.so /usr/lib/jvm/java-6-sun/jre/lib/amd64

wget http://tarsos.0110.be/attachment/cons/256/pulse-java.jar\
sudo cp pulse-java.jar /usr/lib/jvm/java-6-sun/jre/lib/ext\
\`\`\`

From this moment on the "PulseAudio Mixer" is available for Java applications. Sharing, switching and assigning audio devices to Java programs is as a result smooth. To use the PulseAudio Mixer by default you need to change sound.properties which can be found at `/usr/lib/jvm/java-6-sun/jre/lib/sound.properties`. Details can be found [here](http://www.mail-archive.com/universe-bugs@lists.ubuntu.com/msg146425.html).


- [libpulse-java.so](https://0110.be/files/attachments/394/libpulse-java.so)

- [pulse-java.jar](https://0110.be/files/attachments/394/pulse-java.jar)

- [pulseaudio\_logo.png](https://0110.be/files/attachments/394/pulseaudio_logo.png)

---

## [TarsosDSP: a small JAVA audio processing library](https://0110.be/posts/TarsosDSP%3A_a_small_JAVA_audio_processing_library.md)

- Published: 2011-03-25T15:58:59Z
- Updated: 2013-12-05T18:19:15Z
- Author: Joren
- ID: 392
- Canonical: https://0110.be/posts/TarsosDSP%3A_a_small_JAVA_audio_processing_library

- Tags: [Code](https://0110.be/tags/Code.md), [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), [featured](https://0110.be/tags/featured.md)

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.

Its aim is to provide a simple interface to some audio (signal) processing algorithms implemented in JAVA.

To make some of the possibilities clear I coded some examples.

-   "TarsosDSP UtterAsterisk":\[UtterAsterisk.jar\] a game that shows real-time pitch detection with YIN.

-   "TarsosDSP Sound Detector":\[SoundDetector.jar\] is simply to show how to react when (loud) sound is available.

-   "TarsosDSP Percussion Detector":\[PercussionDetector.jar\] is capable of detecting percussion onsets using the method described [here](http://arrow.dit.ie/cgi/viewcontent.cgi?article=1018&context=argcon). It plays a sound from [freesound.org](http://freesound.org) when percussion is detected.

The [source code of TarsosDSP](https://github.com/JorenSix/TarsosDSP) is available on github.

### Presentation at Newline

Saturday the 25th of March TarsosDSP was presented at [Newline](http://0x20.be/Newline/Schedule), a small conference organized by [whitespace](http://0x20.be). Here you can download "the slides I used to present TarsosDSP":\[tarsosDSP_presentation.pdf\], I also created "an introductory text on sound and Java":\[sound_and_java.pdf\].

<object style="height: 390px; width: 640px">
<param name="movie" value="http://www.youtube.com/v/_abJ00qHkXI?version=3"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/_abJ00qHkXI?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></object>


![Percussion detection](https://0110.be/files/photos/392/Percussion_Detector.png)

![UtterAsterisk](https://0110.be/files/photos/392/UtterAsterisk.png)

![Sound Detector](https://0110.be/files/photos/392/SoundDetector.png)

- [PitchDetector.jar](https://0110.be/files/attachments/392/PitchDetector.jar)

- [PercussionDetector.jar](https://0110.be/files/attachments/392/PercussionDetector.jar)

- [tarsosDSP\_presentation.pdf](https://0110.be/files/attachments/392/tarsosDSP_presentation.pdf)

- [sound\_and\_java.pdf](https://0110.be/files/attachments/392/sound_and_java.pdf)

- [UtterAsterisk.jar](https://0110.be/files/attachments/392/UtterAsterisk.jar)

- [SoundDetector.jar](https://0110.be/files/attachments/392/SoundDetector.jar)

---

[Older posts](https://0110.be/tags/Java.md?page=1)
