Repository Public
1// ORIX Sonata2// File: Examples/lang_voices_and_parallel.sonata3// Description: Three ways to play several things at once in one track: a chord, parallel statements that all start together, and voice blocks that are independent lines; a guitar plays bass, inner part and melody alone.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// category: Language9// title: Voices and Parallel10// teaches: voice blocks, parallel blocks, chord versus voices, how the cursor advances by the longest11//12// expect: notes 6313// expect: tracks 114// expect: duration 20.0000s15// expect: deterministic16composition "Voices and Parallel" {17 tempo 84bpm18 key D major1920 instrument guitar: NylonGuitar {21 gain -4dB22 // 1. A chord: one statement, one duration.23 chord [D3, A3, D4, F#4] duration 1/12425 // 2. parallel: every statement starts at the cursor, with its own length and loudness.26 parallel {27 play D2 duration 1/1 velocity 0.928 play A3 duration 1/2 velocity 0.529 play F#4 duration 1/4 velocity 0.730 }3132 // 3. voices: three independent lines; the cursor moves on by the longest (two bars).33 repeat 2 {34 voice {35 play D2 duration 1/236 play A2 duration 1/237 play B2 duration 1/238 play G2 duration 1/239 }40 voice {41 for n in [A3, D4, A3, D4, A3, C#4, A3, C#4, B3, D4, B3, D4, B3, D4, B3, D4] {42 play n duration 1/8 velocity 0.4543 }44 }45 voice {46 rest 1/447 play F#4 duration 1/448 play A4 duration 1/249 play G4 duration 3/850 play F#4 duration 1/851 play E4 duration 1/252 }53 }54 // After the voices the cursor is at bar 7 for every line.55 chord [D2, A2, D3, F#3, A3, D4] duration 1/156 effects {57 reverb room(mix: 0.2)58 }59 }60}61