SPB Git

Repository Public

ha_two_five_one.sonata 2.4 KB 76 lines

1// ORIX Sonata2// File: Examples/ha_two_five_one.sonata3// Description: The ii-V-I cadence in six keys descending by whole steps, with rootless shell voicings in the piano and a walking bass computed from each root.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// category: Harmony9// title: Two Five One10// teaches: chord(), functions returning lists, transposing a progression in a loop11//12// expect: notes 19213// expect: tracks 314// expect: duration 21.8182s15// expect: deterministic16// The three chords of a ii-V-I in the major key of `tonic`.17fn two_five_one(tonic: Pitch) -> List<Chord> {18    return [chord(tonic + 2st, min7), chord(tonic + 7st, dom7), chord(tonic, maj7)]19}2021// Third and seventh only: the "shell" that defines a seventh chord.22fn shell(c: Chord) -> Chord {23    return [c[1], c[3]]24}2526composition "Two Five One" {27    tempo 132bpm28    key C major29    swing 64%3031    let tonics = [C3, Bb2, Ab2, Gb2, E2, D2]3233    instrument piano: GrandPiano {34        gain -6dB35        pan -0.1536        for tonic in tonics {37            let cadence = two_five_one(tonic + 12st)38            chord shell(cadence[0]) duration 3/8 velocity 0.639            chord shell(cadence[0]) duration 1/8 velocity 0.440            chord shell(cadence[1]) duration 3/8 velocity 0.641            chord shell(cadence[1]) duration 1/8 velocity 0.442            chord cadence[2] duration 1/1 velocity 0.5543        }44    }4546    instrument bass: DoubleBass {47        gain -4dB48        articulation pizzicato49        for tonic in tonics {50            let cadence = two_five_one(tonic)51            // Root and fifth of ii, root and third of V, then the tonic walks down.52            play cadence[0][0] duration 1/453            play cadence[0][2] duration 1/454            play cadence[1][0] duration 1/455            play cadence[1][1] duration 1/456            play cadence[2][0] duration 1/457            play cadence[2][2] duration 1/458            play cadence[2][1] duration 1/459            play cadence[2][0] - 2st duration 1/460        }61    }6263    instrument ride: Ride {64        gain -16dB65        pan 0.366        repeat 12 {67            play F#2 duration 1/468            play F#2 duration 1/8 velocity 0.669            play F#2 duration 1/8 velocity 0.470            play F#2 duration 1/471            play F#2 duration 1/8 velocity 0.672            play F#2 duration 1/8 velocity 0.473        }74    }75}76
Files main
Menu

Theme