---
title: Rendering MIDI Using Arbitrary Tone Scales
canonical: https://0110.be/posts/Rendering_MIDI_Using_Arbitrary_Tone_Scales
markdown_url: https://0110.be/posts/Rendering_MIDI_Using_Arbitrary_Tone_Scales.md
id: 334
published_at: '2010-06-29T12:58:41Z'
updated_at: '2013-12-05T18:19:15Z'
author: Joren
tags:
- name: Computational ethnomusicology
  markdown_url: https://0110.be/tags/Computational%20ethnomusicology.md
- name: HoGent
  markdown_url: https://0110.be/tags/HoGent.md
- name: Music Information Retrieval
  markdown_url: https://0110.be/tags/Music%20Information%20Retrieval.md
- name: Tarsos
  markdown_url: https://0110.be/tags/Tarsos.md
- name: featured
  markdown_url: https://0110.be/tags/featured.md
---

# Rendering MIDI Using Arbitrary Tone Scales

<img src="http://tarsos.0110.be/photo/cache/x96-e52dd.120_Cents_difference.bach_120.png?1277822210"  style="float:right"/>

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, 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 "Tarsos JAR Package":\[tarsos.jar\].

Currently Tarsos has a Command Line Interface. An example with the files you can find attached:

\`\`\`ruby\
java -jar tarsos.jar ---midi BWV_1007.mid ---scala 120.scl ---out bach.wav\
\`\`\`

The result of this command should yield an audio file that sounds like "the cello suites of bach in a nonsensical tone scale with steps of 120 cents":\[bach_BWV_1007_120.mp3\]. Executing tone scale extraction on the generated audo yields the expected result. In <a href="https://0110.be/article/view_photo/1734?page=1" rel="tiny-show">the pich class histogram</a> every 120 cents a peak can be found.

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.

This method also has some limitations. Because audio is rendered there is no (background) noise, no fluctuations in pitch and timbre,... all of which are present in recorded audio. So testing testing tone scale extraction algorithms on recorded audio remains advised.


![120 Cents difference](https://0110.be/files/photos/334/bach_120.png)

- [bach\_BWV\_1007\_120.mp3](https://0110.be/files/attachments/334/bach_BWV_1007_120.mp3)

- [120.scl.txt](https://0110.be/files/attachments/334/120.scl.txt)

- [BWV\_1007.mid](https://0110.be/files/attachments/334/BWV_1007.mid)

- [tarsos.jar](https://0110.be/files/attachments/334/tarsos.jar)
