#ratio #pitch #music #lattice #tuning #lattices #intonation

johnston

A utility for generatating JI pitch lattices

7 unstable releases (3 breaking)

0.4.0 Sep 5, 2021
0.3.0 May 23, 2021
0.2.1 Mar 19, 2020
0.2.0 Feb 25, 2020
0.1.1 Jul 19, 2019

#355 in Audio


Used in johnston-cli

MIT license

15KB
401 lines

Johnston

ci build Crates.io

A library for working with JI pitch lattices. Very much a work in-progess.

Started in Common Lisp, then Clojure and back. old repo

Example

Generate a lattice

use johnston::{lattice::LatticeDimension, pitch::Pitch};

fn main() {
    let pitch = Pitch::new((5, 4));
    let lattice_dimension = LatticeDimension::new(pitch);
    let notes = lattice_dimension.take(6);
	
    for note in notes {
        println!("{:?}", note);
    }
}
Pitch { cents: 386.3137, ratio: Ratio { numerator: 5, denominator: 4 }, limit: 5, ordinal: Otonal }
Pitch { cents: 772.6274, ratio: Ratio { numerator: 25, denominator: 16 }, limit: 5, ordinal: Otonal }
Pitch { cents: 1158.9412, ratio: Ratio { numerator: 125, denominator: 64 }, limit: 5, ordinal: Otonal }
Pitch { cents: 345.25482, ratio: Ratio { numerator: 625, denominator: 512 }, limit: 5, ordinal: Otonal }
Pitch { cents: 731.56854, ratio: Ratio { numerator: 3125, denominator: 2048 }, limit: 5, ordinal: Otonal }
Pitch { cents: 1117.8822, ratio: Ratio { numerator: 15625, denominator: 8192 }, limit: 5, ordinal: Otonal }

Dependencies

~180KB