SPB Git

Repository Public

in_patch_pad.sonata 1.8 KB 59 lines

1// ORIX Sonata2// File: Examples/in_patch_pad.sonata3// Description: A pad built as a patch graph: three saws a few cents apart and a sub sine through a low-pass that an LFO opens and closes slowly, with a soft attack and a long release.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// category: Instruments9// title: Patch: Detuned Pad10// teaches: graph blocks, detuning with cents ratios, lfo node, adsr as amplitude, patch release11//12// expect: notes 2913// expect: tracks 214// expect: duration 34.2857s15// expect: deterministic16instrument DriftPad {17    model patch18    release 2.5s19    gain -6dB20    graph {21        node env = adsr(attack: 600ms, decay: 1s, sustain: 0.8, release: 2.2s)22        // 1.004 and 0.996 are about 7 cents above and below.23        node saws = saw(freq: note.freq) + saw(freq: note.freq * 1.004) + saw(freq: note.freq * 0.996)24        node sub = sine(freq: note.freq * 0.5) * 0.525        node sweep = lfo(rate: 0.15Hz, shape: 0, amp: 1)26        node tone = lowpass(in: saws * 0.3 + sub, cutoff: 900Hz + sweep * 500, q: 1.2)27        out tone * env * note.velocity * 0.628    }29}3031composition "Patch: Detuned Pad" {32    tempo 70bpm33    key E minor3435    instrument pad: DriftPad {36        gain -6dB37        for c in [chord(E3, min9), chord(C3, maj7), chord(A2, min7), chord(B2, sus4)] {38            chord c duration 2bars velocity 0.739        }40        chord [E2, B2, E3, G3, B3] duration 2bars velocity 0.641        effects {42            chorus lush(mix: 0.4)43            reverb hall(mix: 0.35)44        }45    }4647    instrument bells: Glockenspiel {48        gain -14dB49        pan 0.450        rest 2bars51        for n in [B5, G5, E5, D5, E5, G5, B5, E6] {52            play n duration 1/1 velocity 0.453        }54        effects {55            delay echo(time: note_value(3/8), feedback: 0.5, mix: 0.4)56        }57    }58}59
Files main
Menu

Theme