|
| 1 | +import type { Envelope } from "./envelope"; |
| 2 | + |
| 3 | +export interface SoundPreset { |
| 4 | + channel: number; |
| 5 | + amplitude: number; |
| 6 | + pitch: number; |
| 7 | + duration: number; |
| 8 | +} |
| 9 | + |
| 10 | +export interface Preset { |
| 11 | + name: string; |
| 12 | + description: string; |
| 13 | + env: Envelope; |
| 14 | + sound: SoundPreset; |
| 15 | +} |
| 16 | + |
| 17 | +// `T` values >= 128 enable auto-repeat of the pitch envelope (bit 7 set). |
| 18 | +// 132 = 128 + 4 cs per step, 134 = 128 + 6, etc. |
| 19 | +export const PRESETS: Preset[] = [ |
| 20 | + { |
| 21 | + name: "Piano", |
| 22 | + description: "Quick attack, gentle decay, slow fade through sustain", |
| 23 | + env: { n: 1, t: 1, pi1: 0, pi2: 0, pi3: 0, pn1: 0, pn2: 0, pn3: 0, |
| 24 | + aa: 127, ad: -2, as: -1, ar: -10, ala: 126, ald: 80 }, |
| 25 | + sound: { channel: 1, amplitude: 1, pitch: 100, duration: 40 }, |
| 26 | + }, |
| 27 | + { |
| 28 | + name: "Pluck", |
| 29 | + description: "Snappy string-like pluck", |
| 30 | + env: { n: 1, t: 1, pi1: 0, pi2: 0, pi3: 0, pn1: 0, pn2: 0, pn3: 0, |
| 31 | + aa: 127, ad: -8, as: -1, ar: -20, ala: 126, ald: 40 }, |
| 32 | + sound: { channel: 1, amplitude: 1, pitch: 100, duration: 30 }, |
| 33 | + }, |
| 34 | + { |
| 35 | + name: "Bell", |
| 36 | + description: "Sharp attack, long ringing decay", |
| 37 | + env: { n: 1, t: 1, pi1: 0, pi2: 0, pi3: 0, pn1: 0, pn2: 0, pn3: 0, |
| 38 | + aa: 127, ad: -1, as: -1, ar: -8, ala: 126, ald: 110 }, |
| 39 | + sound: { channel: 1, amplitude: 1, pitch: 130, duration: 80 }, |
| 40 | + }, |
| 41 | + { |
| 42 | + name: "Pad", |
| 43 | + description: "Slow rising drone", |
| 44 | + env: { n: 1, t: 1, pi1: 0, pi2: 0, pi3: 0, pn1: 0, pn2: 0, pn3: 0, |
| 45 | + aa: 5, ad: -1, as: 0, ar: -3, ala: 100, ald: 90 }, |
| 46 | + sound: { channel: 1, amplitude: 1, pitch: 100, duration: 100 }, |
| 47 | + }, |
| 48 | + { |
| 49 | + name: "Bass", |
| 50 | + description: "Punchy low-end thump", |
| 51 | + env: { n: 1, t: 1, pi1: 0, pi2: 0, pi3: 0, pn1: 0, pn2: 0, pn3: 0, |
| 52 | + aa: 80, ad: -3, as: -1, ar: -15, ala: 110, ald: 70 }, |
| 53 | + sound: { channel: 1, amplitude: 1, pitch: 60, duration: 30 }, |
| 54 | + }, |
| 55 | + { |
| 56 | + name: "Drum", |
| 57 | + description: "Short percussive hit", |
| 58 | + env: { n: 1, t: 1, pi1: 0, pi2: 0, pi3: 0, pn1: 0, pn2: 0, pn3: 0, |
| 59 | + aa: 127, ad: -30, as: -20, ar: -30, ala: 126, ald: 40 }, |
| 60 | + sound: { channel: 1, amplitude: 1, pitch: 30, duration: 5 }, |
| 61 | + }, |
| 62 | + { |
| 63 | + name: "Vibrato", |
| 64 | + description: "Looping ±½-semitone wobble around the note", |
| 65 | + env: { n: 1, t: 130, pi1: 1, pi2: -1, pi3: 1, pn1: 2, pn2: 4, pn3: 2, |
| 66 | + aa: 127, ad: -2, as: -1, ar: -10, ala: 126, ald: 100 }, |
| 67 | + sound: { channel: 1, amplitude: 1, pitch: 100, duration: 60 }, |
| 68 | + }, |
| 69 | + { |
| 70 | + name: "Trill", |
| 71 | + description: "Looping alternation between two notes a whole step apart", |
| 72 | + env: { n: 1, t: 136, pi1: 8, pi2: -8, pi3: 0, pn1: 1, pn2: 1, pn3: 0, |
| 73 | + aa: 127, ad: -2, as: 0, ar: -10, ala: 126, ald: 100 }, |
| 74 | + sound: { channel: 1, amplitude: 1, pitch: 100, duration: 60 }, |
| 75 | + }, |
| 76 | + { |
| 77 | + name: "Siren", |
| 78 | + description: "Looping octave sweep up and back down", |
| 79 | + env: { n: 1, t: 132, pi1: 2, pi2: -2, pi3: 0, pn1: 24, pn2: 24, pn3: 0, |
| 80 | + aa: 127, ad: -2, as: 0, ar: -2, ala: 126, ald: 100 }, |
| 81 | + sound: { channel: 1, amplitude: 1, pitch: 80, duration: 80 }, |
| 82 | + }, |
| 83 | + { |
| 84 | + name: "Arpeggio", |
| 85 | + description: "Looping major triad: root → 3rd → 5th", |
| 86 | + env: { n: 1, t: 138, pi1: 16, pi2: 12, pi3: -28, pn1: 1, pn2: 1, pn3: 1, |
| 87 | + aa: 127, ad: -2, as: 0, ar: -10, ala: 126, ald: 100 }, |
| 88 | + sound: { channel: 1, amplitude: 1, pitch: 80, duration: 100 }, |
| 89 | + }, |
| 90 | + { |
| 91 | + name: "Laser", |
| 92 | + description: "Fast downward pitch sweep — classic zap", |
| 93 | + env: { n: 1, t: 1, pi1: -12, pi2: -4, pi3: -1, pn1: 8, pn2: 8, pn3: 8, |
| 94 | + aa: 127, ad: -1, as: -2, ar: -30, ala: 126, ald: 100 }, |
| 95 | + sound: { channel: 1, amplitude: 1, pitch: 200, duration: 20 }, |
| 96 | + }, |
| 97 | + { |
| 98 | + name: "Wobble", |
| 99 | + description: "Slow looping pitch wobble, sustained pad timbre", |
| 100 | + env: { n: 1, t: 140, pi1: 2, pi2: -2, pi3: 0, pn1: 4, pn2: 4, pn3: 0, |
| 101 | + aa: 20, ad: -1, as: 0, ar: -5, ala: 110, ald: 90 }, |
| 102 | + sound: { channel: 1, amplitude: 1, pitch: 90, duration: 100 }, |
| 103 | + }, |
| 104 | +]; |
0 commit comments