Drive piano digit shortcuts from server instrument metadata

This commit is contained in:
Jage9
2026-02-24 19:44:01 -05:00
parent 60c0ced7b7
commit a588148039
3 changed files with 37 additions and 13 deletions

View File

@@ -15,6 +15,22 @@ export const PIANO_INSTRUMENT_OPTIONS = [
export type PianoInstrumentId = (typeof PIANO_INSTRUMENT_OPTIONS)[number];
/** Returns whether a runtime string is one of the supported piano instrument ids. */
export function isPianoInstrumentId(value: string): value is PianoInstrumentId {
return (
value === 'piano' ||
value === 'electric_piano' ||
value === 'guitar' ||
value === 'organ' ||
value === 'bass' ||
value === 'violin' ||
value === 'synth_lead' ||
value === 'brass' ||
value === 'nintendo' ||
value === 'drum_kit'
);
}
type VoiceRuntime = {
gain: GainNode;
panner: StereoPannerNode | null;