SPB Git

Repository Public

microtonal.sonata 1.4 KB 47 lines

1// ORIX Sonata2// File: Examples/microtonal.sonata3// Description: Microtonality: quarter tones, a 19-tone equal temperament scale built arithmetically, and a non-standard tuning reference.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// expect: notes 299// expect: tracks 210// expect: duration 10.0000s11// expect: deterministic12// Step n of an equal division of the octave in `divisions` parts, above a root.13fn edo(root: Pitch, n: Number, divisions: Number) -> Pitch {14    return root + 12st * n / divisions15}1617composition "Microtonal" {18    tempo 72bpm19    // A4 = 432 Hz for the whole piece.20    tuning 432Hz2122    instrument harp: Harp {23        gain -6dB24        // 19-EDO ascending, one octave.25        for n in 0..=19 {26            play edo(C4, n, 19) duration 1/1627        }28        rest 1/829        // Quarter-tone neighbours around E4.30        for offset in [0cents, 50cents, 0cents, -50cents, 0cents] {31            play E4 + offset duration 1/832        }33        // Just major triad written as cent offsets from equal temperament.34        chord [C4, E4 - 13.7cents, G4 + 2cents] duration 1/135        effects {36            reverb hall(mix: 0.25)37        }38    }3940    instrument strings: Viola {41        gain -10dB42        rest 2bars43        // A slow glissando of a neutral third, as a pitch bend.44        play C4 duration 1/1 bend { 0s: 0st, 2s: 3.5st }45    }46}47
Files main
Menu

Theme