From 5de6bee171e265ba7e8be700e77a2c6622c0bbea Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Mon, 9 Oct 2023 21:16:19 +0200 Subject: [PATCH] add null as possible note for rest --- src/classes/SoundEvent.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/classes/SoundEvent.ts b/src/classes/SoundEvent.ts index 792e5da..f2be5f5 100644 --- a/src/classes/SoundEvent.ts +++ b/src/classes/SoundEvent.ts @@ -267,9 +267,11 @@ export class SoundEvent extends AudibleEvent { public cut = (value: number) => this.updateValue("cut", value); public clip = (value: number) => this.updateValue("clip", value); public n = (value: number) => this.updateValue("n", value); - public note = (value: number | string) => { + public note = (value: number | string | null) => { if (typeof value === "string") { return this.updateValue("note", noteNameToMidi(value)); + } else if (typeof value == null || value == undefined) { + return this.updateValue("note", 0).updateValue("gain", 0); } else { return this.updateValue("note", value); }