-
Notifications
You must be signed in to change notification settings - Fork 5
Combinatorics
Ziffers has a built in support to create combinatoric patterns from the given melody. Given numbers of permutation, combination or iteration transforms the melody to a enumeration that will repeat certain parts of the melody.
Combinations are played on the fly so it is also possible to play large permutations that would play for years:
zplay "e 0 1 2 3 4 5 6 7 8 9 E T", scale: :chromatic, permutation: 12
Each cycle from the combination can also be transformed using Transformations, like reverse, retrograde etc.
For smaller enumerations (like 10000 combinations etc.), the whole melody can still be transformed using transform_enum: true, but it will try to create an array of arrays from the enumeration which can lead to program failure if the enumeration is too big to fit into the memory.
Create permutation from the melody
z1 "q 0 1 2 3", permutation: 2
Create combination from the melody
z1 "q 0 1 2 3", combination: 2
Create repeated permutation or combination
z1 "q 0 1 2 3", permutation: 2, repeated: true
# or
z1 "q 0 1 2 3", combination: 2, repeated: true
Iterate melody in n-parts
z1 "q 0 1 2 3", iteration: 2 # Plays 0 1 1 2 2 3
z2 "q 0 1 2 3 4", iteration: 3 # Plays 0 1 2 1 2 3 2 3 4
------------------------------------ See more stuff from the menu --------------------------------------->