tune 0.4.0

Create synthesizer tuning files for microtonal scales.
Documentation

Create synthesizer tuning files for microtonal scales.

Installation

cargo install -f tune

Usage

Create scl files

  • 12-TET
    tune scl equal 1:12:2
    tune scl equal 100c
    
  • Bohlen-Pierce
    tune scl equal 1:13:3
    
  • Equal temperament with step size of 5 sixth tones
    tune scl equal 5:36:2
    tune scl equal 5/3:12:2
    tunc scl equal {500/3}c
    
  • 7-note Pythagorean (lydian mode)
    tune scl rank2 3/2 7
    tune scl rank2 1.5 7
    
  • 7-note quarter-comma meantone (major mode)
    tune scl rank2 1:4:5 6 1
    
  • 8-note harmonic series
    tune scl harm 8
    
  • Custom just intonation scale
    tune scl cust -n "Just intonation" 9/8 5/4 4/3 3/2 5/3 15/8 2
    

Create kbm files

  • Start scale at C5 at its usual frequency

    tune kbm 60
    
  • Start scale at C5, 20 cents higher than usual

    tune kbm 60+20c
    
  • Start scale at A5 at 450 Hz

    tune kbm 69@450Hz
    
  • Start scale at C5, A5 should sound at 450 Hz

    tune kbm -r 60 69@445Hz
    

Dump pitches of a scale

  • 7-note Pythagorean (D dorian mode)
    tune dump 62 rank2 3/2 4 3
    
    Output:
    ..
    62 | 293.665 Hz | MIDI 62 | D     5
    63 | 330.373 Hz | MIDI 64 | E     5 | +3.910c
    64 | 348.047 Hz | MIDI 65 | F     5 | -5.865c
    65 | 391.553 Hz | MIDI 67 | G     5 | -1.955c
    66 | 440.497 Hz | MIDI 69 | A     5 | +1.955c
    67 | 495.559 Hz | MIDI 71 | B     5 | +5.865c
    68 | 522.071 Hz | MIDI 72 | C     6 | -3.910c
    69 | 587.330 Hz | MIDI 74 | D     6
    ..
    

Expressions

Ordered by precedence:

  1. <num>:<denom>:<int> evaluates to int^(num/denom)
  2. <num>/<denom> evaluates to num/denom
  3. <cents>c evaluates to 2^(cents/1200)
  4. {<expr>} evaluates to expr