From 109d7283b8b5b5ebdade684c422b1afbe7016fcd Mon Sep 17 00:00:00 2001 From: Miika Alonen Date: Thu, 31 Aug 2023 22:37:20 +0300 Subject: [PATCH] Adding back removed modify function --- src/classes/SoundEvent.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/classes/SoundEvent.ts b/src/classes/SoundEvent.ts index c726b96..b4222a6 100644 --- a/src/classes/SoundEvent.ts +++ b/src/classes/SoundEvent.ts @@ -133,6 +133,20 @@ export class SoundEvent extends AudibleEvent { velocity = (value: number) => this.updateValue("velocity", value); vel = this.velocity; + // ================================================================================ + // AbstactEvent overrides + // ================================================================================ + + modify = (func: Function): this => { + const funcResult = func(this); + if (funcResult instanceof Object) return funcResult; + else { + func(this.values); + this.update(); + return this; + } + }; + update = (): void => { const [note, _] = noteFromPc( this.values.key || "C4",