add null as possible note for rest

This commit is contained in:
2023-10-09 21:16:19 +02:00
parent f92b7d7480
commit 5de6bee171

View File

@ -267,9 +267,11 @@ export class SoundEvent extends AudibleEvent {
public cut = (value: number) => this.updateValue("cut", value); public cut = (value: number) => this.updateValue("cut", value);
public clip = (value: number) => this.updateValue("clip", value); public clip = (value: number) => this.updateValue("clip", value);
public n = (value: number) => this.updateValue("n", value); public n = (value: number) => this.updateValue("n", value);
public note = (value: number | string) => { public note = (value: number | string | null) => {
if (typeof value === "string") { if (typeof value === "string") {
return this.updateValue("note", noteNameToMidi(value)); return this.updateValue("note", noteNameToMidi(value));
} else if (typeof value == null || value == undefined) {
return this.updateValue("note", 0).updateValue("gain", 0);
} else { } else {
return this.updateValue("note", value); return this.updateValue("note", value);
} }