Added powerTowers and cubeDance to tonnetz and added some generative funcitons for ziffers

This commit is contained in:
2023-12-25 00:55:56 +02:00
parent 30983147ea
commit 95650c5d01
5 changed files with 83 additions and 13 deletions

View File

@ -336,6 +336,56 @@ export class Player extends AbstractEvent {
return this;
}
cubeDance(tonnetz: TonnetzSpaces = [3, 4, 5], repeats: number = 3) {
if (this.atTheBeginning()) this.ziffers.cubeDance(tonnetz, repeats);
return this;
}
powerTowers(tonnetz: TonnetzSpaces = [3, 4, 5], repeats: number = 3) {
if (this.atTheBeginning()) this.ziffers.powerTowers(tonnetz, repeats);
return this;
}
shuffle() {
if (this.atTheBeginning()) this.ziffers.shuffle();
return this;
}
deal(amount: number = this.ziffers.values.length) {
if (this.atTheBeginning()) this.ziffers.deal(amount);
return this;
}
from(value: number) {
if (this.atTheBeginning()) this.ziffers.from(value);
return this;
}
to(value: number) {
if (this.atTheBeginning()) this.ziffers.to(value);
return this;
}
between(value: number, value2: number) {
if (this.atTheBeginning()) this.ziffers.between(value, value2+1);
return this;
}
keep() {
this.ziffers.setRedo(0);
return this;
}
repeat(amount: number) {
this.ziffers.setRedo(amount);
return this;
}
every(amount: number) {
if (this.atTheBeginning()) this.ziffers.every(amount);
return this;
}
tonnetzChord(chord: string) {
if (this.atTheBeginning()) this.ziffers.tonnetzChords(chord);
return this;
@ -366,6 +416,15 @@ export class Player extends AbstractEvent {
return this;
}
rotate(amount: number = 1) {
// TODO: Only works for evaluated patterns (setRedo). Fix this for generative patterns. Mod by current cycle?
if (this.atTheBeginning()) {
this.ziffers.setRedo(0);
this.ziffers.rotate(amount);
}
return this;
}
listen(value: string) {
if(typeof value === "string") {
const cueTime = this.app.api.cueTimes[value];