---
title: YIN Pitch Tracker in JAVA
canonical: https://0110.be/posts/YIN_Pitch_Tracker_in_JAVA
markdown_url: https://0110.be/posts/YIN_Pitch_Tracker_in_JAVA.md
id: 66
published_at: '2010-04-09T00:00:00Z'
updated_at: '2020-11-17T09:04:25Z'
author: Joren
tags:
- name: 0110.be
  markdown_url: https://0110.be/tags/0110.be.md
- name: Code
  markdown_url: https://0110.be/tags/Code.md
- name: Cultuur
  markdown_url: https://0110.be/tags/Cultuur.md
- name: Muziek
  markdown_url: https://0110.be/tags/Muziek.md
- name: Projecten
  markdown_url: https://0110.be/tags/Projecten.md
---

# YIN Pitch Tracker in JAVA

To make [Tarsos](http://0110.be/) more portable I wrote a pitch tracker in pure JAVA using the [YIN algorithm](http://recherche.ircam.fr/equipes/pcm/cheveign/ps/2002_JASA_YIN_proof.pdf) based on the implementation in C of [aubio](http://aubio.org). The implementation also uses some code written by Karl Helgasson and Teun de Lange of the [Jazzperiments project](http://www.jazzperiments.com/jazzperiments.html).

It can be used to perform real time pitch detection or to analyse files. To use it as a real time pitch detector just start the "JAR-file":\[pitch_detector_yin.jar\] by double clicking. To analyse a file execute one of the following. The first results in a list of annotations (text), the second shows the annotations graphically.

\`\`\`ruby\
java -jar pitch_detector_yin.jar flute.novib.mf.C5B5.wav\
java -jar pitch_detector_yin.jar ---file flute.novib.mf.C5B5.wav\
\`\`\`

The provided "flute sample":\[flute.novib.mf.C5B5.wav\] is from [*The Musical Samples* library of the University of Iowa](http://theremin.music.uiowa.edu/MIS.html) and converted to mono wav. The source code of the pitch tracker can be found below.

**Update:** the Yin implementation in Java has been incorporated into the [TarsosDSP project](https://github.com/JorenSix/TarsosDSP). An open source, Real-Time Audio Processing Framework in Java.


![Pitch detection](https://0110.be/files/photos/66/pitch_tracker_screenshot.png)

- [pitch\_detector\_yin.jar](https://0110.be/files/attachments/66/pitch_detector_yin.jar)

- [pitch\_detector\_yin\_src.zip](https://0110.be/files/attachments/66/pitch_detector_yin_src.zip)

- [flute.novib.mf.C5B5.wav](https://0110.be/files/attachments/66/flute.novib.mf.C5B5.wav)
