Repository Public
1// ORIX Sonata2// File: Examples/multitrack_band.sonata3// Description: A full mix: Euclidean drums on a compressed bus, bass, keys and a lead, with sends to a shared reverb.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// expect: notes 1629// expect: tracks 610// expect: duration 9.5455s11// expect: deterministic12const bars = 41314pattern drum_bar(pitch: Pitch, hits: List<Bool>, vel: Velocity) {15 rhythm(pitch, hits, step: 1/16, vel: vel)16}1718composition "Multitrack Band" {19 tempo 110bpm20 key E minor21 seed 20262223 bus drums {24 gain -2dB25 effects {26 compressor drums27 saturation tape(mix: 0.4)28 }29 }3031 bus hall {32 effects {33 reverb hall(mix: 100%, predelay: 20ms)34 eq(low_cut: 180Hz)35 }36 gain -8dB37 }3839 instrument kick: Kick {40 output drums41 gain -3dB42 repeat bars {43 drum_bar(C2, euclid(5, 16), 0.95)44 }45 }4647 instrument snare: Snare {48 output drums49 gain -7dB50 send hall -14dB51 repeat bars {52 drum_bar(D2, rotate(euclid(2, 16), 12), 0.85)53 }54 }5556 instrument hats: ClosedHat {57 output drums58 gain -14dB59 pan 0.360 repeat bars {61 for i in 0..16 {62 play F#2 duration 1/16 velocity if i % 4 == 2 then 0.7 else 0.35 + random() * 0.1563 }64 }65 }6667 instrument bass: PickBass {68 gain -6dB69 for root in [E2, C2, G2, D2] {70 repeat 2 {71 play root duration 3/1672 play root duration 1/16 staccato velocity 0.673 play root + 12st duration 1/8 velocity 0.774 rest 1/875 }76 }77 effects {78 compressor gentle79 }80 }8182 instrument keys: SynthKeys {83 gain -12dB84 pan -0.2585 send hall -8dB86 for c in [chord(E3, min7), chord(C3, maj7), chord(G3, major), chord(D3, sus4)] {87 chord c duration 1/2 velocity 0.688 chord invert(c, 1) duration 1/2 velocity 0.589 }90 }9192 instrument lead: SynthLead {93 gain -11dB94 pan 0.1595 send hall -6dB96 rest 1bar97 let notes = scale(E4, pentatonic_minor)98 repeat 3 {99 repeat 6 {100 play choose(notes) duration choose([1/8, 1/8, 1/4]) velocity 0.6 + random() * 0.3101 }102 rest 1/4103 }104 effects {105 delay echo(time: note_value(3/16), mix: 0.25)106 }107 }108109 master {110 sample_rate 48000Hz111 peak_limit -1dB112 effects {113 eq(low_cut: 30Hz, high_gain: 1dB)114 }115 }116}117