New zifferjs version and fixes for arpeggio

This commit is contained in:
2023-12-09 01:56:40 +02:00
parent 657bde733d
commit 35c8c1beaa
4 changed files with 11 additions and 8 deletions

View File

@ -222,16 +222,18 @@ export class AbstractEvent {
value = Array.isArray(value) ? value.concat(kwargs) : [value, ...kwargs];
}
if (Array.isArray(value)) {
this.values["noteLength"] = value;
this.values.dur = value.map((v) =>
this.app.clock.convertPulseToSecond(v * 4 * this.app.clock.ppqn),
);
} else {
this.values["noteLength"] = value;
this.values.dur = this.app.clock.convertPulseToSecond(
value * 4 * this.app.clock.ppqn,
);
}
if(this.current) {
value = Array.isArray(value) ? value[this.index%value.length] : value;
this.current.duration = value;
}
return this;
};
}