Repository Public
1// ORIX Sonata2// File: Examples/rh_swing_levels.sonata3// Description: The same ride pattern and walking line at 50 %, 58 %, 66.7 % and 72 % swing: straight eighths, a light lilt, triplet swing and a hard shuffle.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// category: Rhythm9// title: Four Degrees of Swing10// teaches: swing blocks, swing ratio, composition-wide patterns11//12// expect: notes 11313// expect: tracks 214// expect: duration 17.1429s15// expect: deterministic16pattern ride_bar() {17 play F#2 duration 1/4 velocity 0.718 play F#2 duration 1/8 velocity 0.619 play F#2 duration 1/8 velocity 0.420 play F#2 duration 1/4 velocity 0.721 play F#2 duration 1/8 velocity 0.622 play F#2 duration 1/8 velocity 0.423}2425pattern walk_bar(notes: List<Pitch>) {26 for n in notes {27 play n duration 1/8 velocity 0.7528 }29}3031composition "Four Degrees of Swing" {32 tempo 126bpm33 key Bb major3435 instrument ride: Ride {36 gain -12dB37 pan 0.338 for ratio in [50%, 58%, 66.7%, 72%] {39 swing ratio {40 repeat 2 {41 ride_bar()42 }43 }44 }45 }4647 instrument bass: DoubleBass {48 gain -4dB49 articulation pizzicato50 for ratio in [50%, 58%, 66.7%, 72%] {51 swing ratio {52 walk_bar([Bb1, D2, F2, G2, Ab2, G2, F2, D2])53 walk_bar([Eb2, G2, Bb2, C3, Db3, C3, Bb2, A2])54 }55 }56 play Bb1 duration 1/157 }58}59