Adding back removed modify function
This commit is contained in:
@ -133,6 +133,20 @@ export class SoundEvent extends AudibleEvent {
|
|||||||
velocity = (value: number) => this.updateValue("velocity", value);
|
velocity = (value: number) => this.updateValue("velocity", value);
|
||||||
vel = this.velocity;
|
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 => {
|
update = (): void => {
|
||||||
const [note, _] = noteFromPc(
|
const [note, _] = noteFromPc(
|
||||||
this.values.key || "C4",
|
this.values.key || "C4",
|
||||||
|
|||||||
Reference in New Issue
Block a user