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

@ -43,7 +43,7 @@
"tone": "^14.8.49",
"unique-names-generator": "^4.7.1",
"vite-plugin-markdown": "^2.1.0",
"zifferjs": "^0.0.46",
"zifferjs": "^0.0.47",
"zyklus": "^0.1.4",
"zzfx": "^1.2.0"
}

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;
};
}

View File

@ -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;
}

View File

@ -4028,10 +4028,10 @@ yaml@^2.1.1:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
zifferjs@^0.0.46:
version "0.0.46"
resolved "https://registry.yarnpkg.com/zifferjs/-/zifferjs-0.0.46.tgz#d19fa6d75c9763b77189e31e347f33329a3d80be"
integrity sha512-vByLmDl4jxkVWpQ/wetqYRWWUJLUMtfJ6Ds9UsD4XsWPjSyGP3T2s8dmLPszs9YXK0mpBlSRdhlXhyRoIqBjYQ==
zifferjs@^0.0.47:
version "0.0.47"
resolved "https://registry.yarnpkg.com/zifferjs/-/zifferjs-0.0.47.tgz#393cfe235187e80e970b7281e29c9e4813184f07"
integrity sha512-gc5H9QNuPysiB5zqjXkMfempDf08ydA+gVPPm9sQKifmoc7GtjJQ0mU7TNc1BAGPI2ipJcIop1a+r71y5SbQmQ==
zyklus@^0.1.4:
version "0.1.4"