Repository Public
1// ORIX Sonata2// File: Examples/physical_models.sonata3// Description: Physical-model instruments defined in the piece: a long-ringing metal string, a small bright drum of four modes and a breathy pipe, each derived from an engine.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// expect: notes 259// expect: tracks 310// expect: duration 9.0000s11// expect: deterministic12// A plucked steel string with very little damping and a struck excitation near the bridge.13instrument LongString {14 model plucked_string15 preset steel_guitar16 damping 0.00417 brightness 0.818 excitation pluck(position: 0.12)19}2021// A drum-like body: four inharmonic modes of a circular membrane (ratios 1, 1.59, 2.14, 2.30).22instrument Membrane {23 model modal_percussion24 preset woodblock25 partials [1, 1.59, 2.14, 2.3]26 decay 0.627 hardness 0.428}2930// A soft, noisy flute pipe.31instrument AirPipe: PanFlute {32 noise 0.533 breath 0.634}3536composition "Physical Models" {37 tempo 80bpm38 key E minor3940 instrument string: LongString {41 gain -8dB42 pan -0.343 for n in [E3, B3, E4, G4, B4, E5] {44 play n duration 1/445 }46 chord [E3, B3, E4] duration 1bar47 effects {48 reverb hall(mix: 0.2)49 }50 }5152 instrument drum: Membrane {53 gain -6dB54 rest 1/255 repeat 4 {56 play E3 duration 1/857 play E3 duration 1/8 velocity 0.558 play B3 duration 1/459 }60 }6162 instrument pipe: AirPipe {63 gain -8dB64 pan 0.365 rest 1bar66 play B4 duration 1/267 play G4 duration 1/468 play A4 duration 1/469 play E4 duration 1bar70 effects {71 reverb hall(mix: 0.3)72 }73 }74}75