SPB Git

Repository Public

st_fft_test_tones.sonata 2.1 KB 89 lines

1// ORIX Sonata2// File: Examples/st_fft_test_tones.sonata3// Description: Test signals for WaveLab: pure sines at 100 Hz, 440 Hz, 1 kHz and 10 kHz one after the other, then all four together, from a patch with a fixed amplitude and the master limiter off, so the spectrum shows single lines at known frequencies.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//8// category: Studies9// title: FFT Test Tones10// teaches: fixed-frequency sine patch, peak_limit off, exact frequencies, reading a spectrum11//12// expect: notes 813// expect: tracks 414// expect: duration 12.0000s15// expect: deterministic16// A sine at `hz`, whatever note is played, with 10 ms fades to avoid clicks.17instrument Tone100 {18    model patch19    release 20ms20    graph {21        node env = adsr(attack: 10ms, decay: 0ms, sustain: 1, release: 10ms)22        out sine(freq: 100Hz) * env * 0.2523    }24}2526instrument Tone440 {27    model patch28    release 20ms29    graph {30        node env = adsr(attack: 10ms, decay: 0ms, sustain: 1, release: 10ms)31        out sine(freq: 440Hz) * env * 0.2532    }33}3435instrument Tone1k {36    model patch37    release 20ms38    graph {39        node env = adsr(attack: 10ms, decay: 0ms, sustain: 1, release: 10ms)40        out sine(freq: 1000Hz) * env * 0.2541    }42}4344instrument Tone10k {45    model patch46    release 20ms47    graph {48        node env = adsr(attack: 10ms, decay: 0ms, sustain: 1, release: 10ms)49        out sine(freq: 10000Hz) * env * 0.2550    }51}5253composition "FFT Test Tones" {54    // At 60 bpm one whole note lasts four seconds.55    tempo 60bpm5657    instrument a: Tone100 {58        play C4 duration 1/259        rest 3/260        play C4 duration 1/161    }6263    instrument b: Tone440 {64        rest 1/265        play C4 duration 1/266        rest 1/167        play C4 duration 1/168    }6970    instrument c: Tone1k {71        rest 1/172        play C4 duration 1/273        rest 1/274        play C4 duration 1/175    }7677    instrument d: Tone10k {78        rest 3/279        play C4 duration 1/280        play C4 duration 1/181    }8283    master {84        sample_rate 48000Hz85        // No limiter: nothing but the four sines reaches the output.86        peak_limit off87    }88}89
Files main
Menu

Theme