Added powerTowers and cubeDance to tonnetz and added some generative funcitons for ziffers
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -78,8 +78,17 @@ z1("s A=(0 (1,4)) B~(2 (3,8)) A B A B A")
|
||||
true,
|
||||
)}
|
||||
|
||||
## Generative functions
|
||||
|
||||
|
||||
* <ic>repeat(amount: number)</ic> Repeat the generated pattern without re-evaluating random patterns
|
||||
* <ic>shuffle()</ic> Shuffle the generated pattern
|
||||
* <ic>deal(amount: number): Shuffle the generated pattern and deal given number of elements
|
||||
* <ic>retrograde()</ic> Reverse the generated pattern
|
||||
* <ic>invert()</ic> Invert the generated pattern
|
||||
* <ic>between(start: number, end: number)</ic> Select a range of elements from the generated pattern
|
||||
* <ic>from(start: number)</ic> Select a range of elements from the start index to the end of the pattern
|
||||
* <ic>to(end: number)</ic> Select a range of elements from the beginning of the pattern to the end index
|
||||
* <ic>every(amount: number)</ic> Select every n-th element from the pattern
|
||||
|
||||
`;
|
||||
};
|
||||
|
||||
@@ -210,6 +210,8 @@ In addition to the transformations, Ziffers implements cyclic methods that can b
|
||||
* <ic>hexaCycle(tonnetz: number[], repeats: number = 3)</ic>: Cycles through chords in the hexa cycle
|
||||
* <ic>octaCycle(tonnetz: number[], repeats: number = 4)</ic>: Cycles through chords in the octa cycle
|
||||
* <ic>enneaCycle(tonnetz: number[], repeats: number = 3)</ic>: Cycles through chords in the ennea cycle
|
||||
* <ic>powerTowers(tonnetz: number[], repeats: number = 3)</ic>: Cycles trough chords using the power towers
|
||||
* <ic>cubeDance(tonnetz: number[], repeats: number = 3)</ic>: Cycles trough chords in a cube dance
|
||||
|
||||
HexaCycles are sequences of major and minor triads generated by the <ic>p</ic> and <ic>l</ic> transformations . Let's take the following example starting with a <ic>C</ic> chord: <ic>C -> Cm -> Ab -> Abm -> E -> Em</ic>. You can start on the chord of your choice.
|
||||
|
||||
@@ -262,15 +264,15 @@ As you can verify it manually, you will see that this is not the case. Upon reac
|
||||
To play the chords without jumps in our hexaCycle (although the prefix "hexa" would no longer have a precise meaning), we add a number of repetitions.
|
||||
|
||||
${makeExample(
|
||||
"HexaCycles with vitamins",
|
||||
`
|
||||
"HexaCycles with vitamins",
|
||||
`
|
||||
z1("0")
|
||||
.scale("chromatic")
|
||||
.hexaCycle([2,3,7],4)
|
||||
.sound("sine").out()
|
||||
.scale("chromatic")
|
||||
.hexaCycle([2,3,7],4)
|
||||
.sound("sine").out()
|
||||
`,
|
||||
true
|
||||
)}
|
||||
true
|
||||
)}
|
||||
|
||||
By default hexaCycles and enneaCycles have <ic>3</ic> repetitions, while octaCycles has <ic>4</ic> repetitions. We have specified a **chromatic scale** although this is the **default scale**. Try changing the **repeats and scales** when playing with different Tonnetz.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user