Skip to content

yannics/cl-cycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cl-cycle

Cycle generator

This library generates cycle from a numeric sequence especially for the musical purpose, like some composers have used in their respective compositions (see Olivier Messiaen with its symmetrical permutations, also Gérard Grisey or Jean Barraqué, and Iannis Xenakis for its cribles rythmiques). This library extends this principle with mathematical algorithms, simply to explore this research field in a musical context.

Briefly, this is some prospecting tools that fit in a heuristic perspective, intended to serve as a musical discourse, according to the theme of cyclicity. Thus, it is possible to consider the construction of musical representations of mathematical ideas, recognizing that musical experience can not be reduced to a symbolic system. In other words, it must be possible to report an association between network composition, performance and listening ...

The result of each algorithm is the cycle itself if it exists – except for the SYMMETRIC-GROUP and the RHYTHMIC-SIEVE which are a list of cycles. Some of them can be prepended by its path if it exists. This concerns only the algorithms KAPREKAR-CONSTANT, PEA-PATTERN, LORENZ-DISCRETISATION and COLLATZ-CONJECTURE.

The following keywords allow formatting if needed the result as argument of :r, i.e. the keyword argument of the involved function:

  • :seq -----> (append path cycle)

  • :lst -----> (list path cycle)

  • :path ----> path

  • :cycle ---> cycle

The default keyword value is set by the global variable *cycle-default-value* as :seq.

Algorithms

[ KAPREKAR-CONSTANT ]

The Kaprekar's algorithm consists to associate any number x to another number K(x) generated as follow:

  • According to the digits of x in radix n, one forms the number x1 by ranking in increasing order these digits and the number x2 by ranking in decreasing order.

  • Then K(x) = x2 - x1.

The process is iterated until a cyclic redundancy.


[ RHYTHMIC-SIEVE ]

Kind of Metabole according to Iannis Xenakis, rhythmic sieve rely on the construction of a matrix to generate two cycles: one by horizontal shift (i) and one by vertical shift (j).

This example illustrates the process of permutation by a vertical shift of the sieve in the matrix.


[ PEA-PATTERN ]

Primarily developed by John Conway, the pea pattern is a variation of a look-and-say sequence by counting the elements of a seed from the lowest number to the highest iteratively until the effectiveness of a cycle.


[ SYMMETRIC-GROUP ]

  1. Mathematical overview

https://doczz.fr/doc/1976848/permutations-et-cycles

  1. Musical application

http://www.entretemps.asso.fr/Nicolas/TextesNic/Barraque.html


[ SYMMETRIC-PERMUTATION ]

Highlighted by Olivier Messiaen, symmetric permutations constitute a system of numbered durations that consists in changing the order of its durations in order to obtain a limited number of rhythmic cells.

The order of durations (on a gray background) is switched according to the procedure of a given list (on a white background) which is re-ordered at each step.


[ KREUZSPIEL-PERMUTATION ]

https://digital.lib.washington.edu/researchworks/handle/1773/23571

In 1951, Karlheinz Stockhausen wrotes Kreuzspiel (Jeux croisés) which uses the crossing technique inspired by Olivier Messiaen called des extrêmes au centre as a kind of retrogradation en éventail. This consists to take the first and the last values of a sequence and places them in the middle (or optionally at a given indexed place) by opposite crossing.


[ CIRCULAR-PERMUTATION ]

This algorithm consists of moving the first element of a list to the tail of this list. This is done n times with n equal to the length of the list, whose relevance in the context of this library is to perform a circular permutation cycle from a given radix to another.


[ LORENZ-DISCRETISATION ]

https://www.chaos-math.org/en/chaos-vii-strange-attractors.html

In 1970, Birman, Guckenheimer, and Williams propose a model of dynamic discretization of Lorenz attractors, characterized by the periodicity of the orbits by a return to a point already crossed – i.e. a cycle.

Let i be an element in the interval [0, 1] and I the set of points ordered in time calculated from i to t0, each point at t+1 is calculated as follows:

  • i(t+1) = 2i(t) if i(t) < 1;
  • i(t+1) = 2i(t)-1 if i(t) > 1;

until i(tn+1) is element of I.

Model of Birman, Guckenheimer and Williams. Initially i=0.2.


[ COLLATZ-CONJECTURE ]

In 1928, Lothar Collatz invented a sequence built from a positive integer according to the following rules:

  • if x(n) is even, then x(n+1) is equal to x(n) divided by 2;
  • if x(n) is odd, then x(n+1) is equal to 1 plus x(n) multiplied by 3.

The series thus constructed always ends – until the contrary is proved – by a trivial cycle (4 2 1) for positive integers. This hypothesis is called Syracuse conjecture.


[ INTERLACE-CYCLE ]

Based on the principle of ornamental interlace, each pattern is repeated some times according to the least common multiple to generate a complete cycle.

The result is a list where each element groups the circular permutations of each pattern, i.e. the number of voices equal to the number of patterns.


[ EUCLIDEAN-RHYTHM ]

http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf

Application of Bjorklund's algorithm of uniformly distributing some rhythmic impacts in a given interval of rhythmic units – according to Euclid's algorithm determining the greatest common divisor (GCD) [Book VII of the Elements of Euclid].


[ CAMPANOLOGY-PERMUTATION ]

As a musical study of bells, campanology focuses on the ringing methods according to the two following rules:

  1. Each bell sounds exactly once in each row.
  2. In any change, each bell can move at most one position.

The algorithm provides a trivial solution – called the 'hunting group' – by permuting consecutive pairs and alternating the starting position between the first and the second position.

White, A., & Wilson, R. (1995). The Hunting Group. The Mathematical Gazette, 79(484), 5–16. https://doi.org/10.2307/3619985

Thanks to Dom Aversano for relating to this algorithm.


[ DISCRETE-LOGARITHM ]

The discrete logarithm forms a cyclic group A computed with its reciprocal modular exponential g^i mod p from i=1 to i=|A| such as g^1 mod p = g^(|A|+1) mod p. Or in other words, for any positive interger e, the modular exponential g^(1 + e mod |A|) mod p is always member of A.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published