Explore musical tunings and create synthesizer tuning files for microtonal scales.
Overview
tune
is planned to be part of a larger ecosystem for microtonal software in Rust.
So far, tune
offers a CLI and an API with the following features:
- Pitch conversions
- Convert between linear and logarithmic ratios
- Determine the frequency for a given note in a custom tuning system
- Determine the note for a given frequency in a custom tuning system
- Find fractional approximations for frequency ratios
- Export scales
- To Scala (scl and kbm) format
- As Midi Tuning Standard (MTS) Sysex Messages
Installation
Usage
Create scl files
- 12-TET
- Bohlen-Pierce
- Equal temperament with step size of 5 sixth tones
- 7-note Pythagorean (lydian mode)
- 7-note quarter-comma meantone (major mode)
- 8-note harmonic series
- Custom just intonation scale
Create kbm files
-
Start scale at C4 at its usual frequency
-
Start scale at C4, 20 cents higher than usual
-
Start scale at A4 at 450 Hz
-
Start scale at C4, A4 should sound at 450 Hz
Dump pitches of a scale
-
7-note Pythagorean (D dorian mode)
Output:
> 62 | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | )
-
As JSON
Output:
.. , , ..
-
Conversion between scales: What are the pitch differences between Pythagorean and quarter-comma meantone tuning?
Output:
> 62 | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | ) | | | | | )
Create a Midi Tuning Standard Sysex message
- 19-TET
Output:
Expressions
Ordered by precedence:
<num>:<denom>:<int>
evaluates toint^(num/denom)
<num>/<denom>
evaluates tonum/denom
<cents>c
evaluates to2^(cents/1200)
{<expr>}
evaluates toexpr