Added null to sound()

This commit is contained in:
2023-11-03 17:45:32 +02:00
parent f39625a985
commit d8230c7cd1

View File

@ -28,6 +28,7 @@ import {
import { Speaker } from "./StringExtensions"; import { Speaker } from "./StringExtensions";
import { getScaleNotes } from "zifferjs"; import { getScaleNotes } from "zifferjs";
import { OscilloscopeConfig, blinkScript } from "./AudioVisualisation"; import { OscilloscopeConfig, blinkScript } from "./AudioVisualisation";
import { SkipEvent } from './classes/SkipEvent';
interface ControlChange { interface ControlChange {
channel: number; channel: number;
@ -1879,8 +1880,9 @@ export class UserAPI {
// Trivial functions // Trivial functions
// ============================================================= // =============================================================
sound = (sound: string | string[]) => { sound = (sound: string | string[] | null | undefined) => {
return new SoundEvent(sound, this.app); if(sound) return new SoundEvent(sound, this.app);
else return new SkipEvent();
}; };
snd = this.sound; snd = this.sound;