Repository Public
1// ORIX Sonata2// File: Examples/euclidean_bells.sonata3// Description: Bells, tubular bells and glockenspiel each repeat a different Euclidean rhythm; the cycles have different lengths, so the combination keeps changing.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// expect: notes 1189// expect: tracks 410// expect: duration 17.8846s11// expect: deterministic12pattern cycle_of(pitch: Pitch, hits: Number, steps: Number, times: Number, vel: Velocity) {13 repeat times {14 rhythm(pitch, euclid(hits, steps), step: 1/16, vel: vel)15 }16}1718composition "Euclidean Bells" {19 tempo 104bpm20 key D pentatonic_minor2122 bus room {23 effects {24 reverb plate(mix: 100%, decay: 2.5s)25 }26 gain -8dB27 }2829 // 16, 12 and 10 steps: the three layers realign only after 240 sixteenths.30 instrument low: TubularBells {31 gain -9dB32 pan -0.433 send room -6dB34 cycle_of(D3, 3, 16, 8, 0.7)35 }3637 instrument middle: Bell {38 gain -12dB39 send room -6dB40 cycle_of(A4, 5, 12, 10, 0.55)41 rest 1/242 }4344 instrument high: Glockenspiel {45 gain -14dB46 pan 0.447 send room -4dB48 cycle_of(F5, 3, 10, 12, 0.5)49 rest 1/250 }5152 instrument drum: SubKick {53 gain -8dB54 repeat 8 {55 play C2 duration 1/256 rest 1/257 }58 }59}60