Add original synthesized game audio and document sound provenance

This commit is contained in:
2026-10-15 00:03:23 +09:00
parent 05bc16e364
commit 16380eac79
11 changed files with 184 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
export const SOUND_MUTED_KEY = 'ssessesse:sound-muted';
export const SOUND_MASTER_VOLUME = 0.35;
export const SOUND_EVENT_HISTORY = 128;
export const SOUND_MAX_VOICES = 32;
export interface SoundPart {
wave: OscillatorType | 'noise'; from: number; to: number; duration: number; volume: number; delay?: number;
}
// Original synthesis recipes: no recordings, samples, borrowed melodies or voices.
export const SOUNDS = {
click: [{ wave: 'sine', from: 900, to: 540, duration: .055, volume: .18 }],
charge: [{ wave: 'sine', from: 140, to: 480, duration: .48, volume: .2 }, { wave: 'triangle', from: 210, to: 720, duration: .38, volume: .1, delay: .06 }],
blast: [{ wave: 'noise', from: 2200, to: 400, duration: .22, volume: .3 }, { wave: 'sine', from: 320, to: 65, duration: .18, volume: .22 }],
guard: [{ wave: 'triangle', from: 840, to: 650, duration: .2, volume: .2 }, { wave: 'sine', from: 1260, to: 980, duration: .24, volume: .09 }],
beam: [{ wave: 'sawtooth', from: 90, to: 180, duration: .6, volume: .1 }, { wave: 'noise', from: 700, to: 3600, duration: .65, volume: .24 }],
dodge: [{ wave: 'noise', from: 3800, to: 250, duration: .18, volume: .15 }, { wave: 'sine', from: 1200, to: 300, duration: .12, volume: .1, delay: .08 }],
cutscene1: [{ wave: 'sawtooth', from: 65, to: 260, duration: .7, volume: .11 }, { wave: 'noise', from: 300, to: 2300, duration: .6, volume: .18 }],
cutscene2: [{ wave: 'noise', from: 2400, to: 120, duration: .4, volume: .45 }, { wave: 'sine', from: 150, to: 35, duration: .5, volume: .35 }],
cutscene3: [{ wave: 'noise', from: 650, to: 100, duration: .55, volume: .18 }, { wave: 'triangle', from: 100, to: 40, duration: .45, volume: .16 }],
win: [{ wave: 'sine', from: 440, to: 660, duration: .2, volume: .2 }, { wave: 'triangle', from: 660, to: 880, duration: .35, volume: .18, delay: .18 }],
loss: [{ wave: 'triangle', from: 330, to: 165, duration: .38, volume: .16 }, { wave: 'sine', from: 165, to: 82, duration: .45, volume: .16, delay: .24 }],
draw: [{ wave: 'sine', from: 380, to: 380, duration: .18, volume: .14 }, { wave: 'sine', from: 380, to: 380, duration: .2, volume: .1, delay: .25 }],
} satisfies Record<string, readonly SoundPart[]>;
export type SoundId = keyof typeof SOUNDS;