add null as possible note for rest
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user