New zifferjs version and fixes for arpeggio
This commit is contained in:
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@ -288,7 +288,8 @@ export class Player extends AbstractEvent {
|
||||
|
||||
lead = () => this.voiceleading();
|
||||
|
||||
arpeggio(indexes: string|number[]) {
|
||||
arpeggio(indexes: string|number[], ...rest: number[]) {
|
||||
if(typeof indexes === "number") indexes = [indexes, ...rest];
|
||||
if (this.atTheBeginning()) this.ziffers.arpeggio(indexes);
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user