From d8230c7cd103cb0c21ef35c6660fdabacfeac797 Mon Sep 17 00:00:00 2001 From: Miika Alonen Date: Fri, 3 Nov 2023 17:45:32 +0200 Subject: [PATCH] Added null to sound() --- src/API.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/API.ts b/src/API.ts index 7854c10..62f2cb4 100644 --- a/src/API.ts +++ b/src/API.ts @@ -28,6 +28,7 @@ import { import { Speaker } from "./StringExtensions"; import { getScaleNotes } from "zifferjs"; import { OscilloscopeConfig, blinkScript } from "./AudioVisualisation"; +import { SkipEvent } from './classes/SkipEvent'; interface ControlChange { channel: number; @@ -1879,8 +1880,9 @@ export class UserAPI { // Trivial functions // ============================================================= - sound = (sound: string | string[]) => { - return new SoundEvent(sound, this.app); + sound = (sound: string | string[] | null | undefined) => { + if(sound) return new SoundEvent(sound, this.app); + else return new SkipEvent(); }; snd = this.sound;