jtol_lzw

Gigout Toccata regenerated

 
 

This is a Max for Live implementation of jtol.lzw. It is available on GitHub. An alternative, and maybe older, version is available here (MacOS – 23.8Mb – august 13th 2019).
More explanation about the algorithm can be found here. There are still a lot of ideas to add but it is already interesting to compare its results with google’s magenta devices powered by tensorflow.

This algorithm is based on a markovian approach segmenting and analyzing multi-scale recursivity of pitches, time position and duration of midi notes sequences. Those three dimensions are not correlated for the moment; that is good for creativity, and surprises, but less for accuracy with the initial sequence. The outcome of the algorithm are a dictionary and a sequence that can later be used to generate new sequences of any length following the same pseudo-repetition orders at any time scale. I always found that simple approach very efficient for sequences of discrete musical elements along one dimension such as melody, chord progressions, some rhythms; perfect for music. This nevertheless has its weaknesses since it is not possible to change the order of the stochastic model. The right one changes over time and is automatically found by definition. One has then to find other controls, both in the analysis and synthesis, to enhance variety.
Using pre-existing data to generate a new one is far from new. The best examples are probably bayesian or connectionist approaches. They make use of pre-existant information, the one learned by an ANN for instance or analyzed by some probabilistic technique. The question of where, or when, the initial state for creation happens rises here. Does this initial state implies an emerging creative system ? Moreover in a human context; can a composer, alongside his tools, totally reject all cultural background ? Pierre Boulez got his own answer.
The initial algorithm only consists on re-organizing bricks of information; its novelty comes from a variety of scales while the smallest ones, units, remains identity. The latter, together with its inter-relationship, provides the inner common character between the analyzed and generated piece. This is the reason why I provided in this page a few examples of various scrambled notes. The algorithm, based on data compression, will later have the option to be lossy or accurate. That allows the amount of entropy and thus fuzziness in the outcome. This allows getting more than just a re-organization of data. This does not add randomness but rather allows a less accurate analysis. This works pretty well when the input’s entropy (microscopic/macroscopic scales) is too low because of its short length or it is too repetitive. That is often the case with drum loops for instance.
These overall social questions are far from new but they remain the next steps questions about sampling and quote in music. Questions about reproduction, processing, and eventually how is an art piece defined as authentic. They are what interests me here: artificial creativity with autonomous production concepts. For example, dual coronagraphs, lloyds mirror and the keys to the kingdom make use of a similar approach.

 
 

+++++++++++++++++++++++++++++++++++++++++++++++++++

 
 

• Let us see how to use the device. First load a midi file onto Live:

jtol_lzw insert midi clip

• Then, open window device:
 
jtol_lzw open window device

The interface looks like this:
 
jtol_lzw interface offline

• A midi clip from the same track as the device must be selected. This is useful for watching clips while keeping an eye on the device page. min items chooses the minimum amount of items (notes) to be generated in a new midi clip. versions chooses the number of new midi clips to be generated.
 
jtol_lzw interface offline

The current generator engines, shown above, are called rand. They scramble the dimensions of the midi clip; pitch, position, duration and velocity. But it is possible to change the engine for each dimension. Available engines are rand for scrambling, sec for looping data within the sequence and regen for lzw.
 
• Choosing the latter enlarges the window showing additional options.
 

jtol_lzw interface offline + regen
jtol.lzw maxforlive screenshot _ Olivier Pasquet _2019


When the regen engine is selected, group allows grouping events together. Those will be analyzed, then re-synthesized, as entities. The entropy factor consists on changing the lossless factor of the algorithm. The more lossy, the more recurrences will be found and the less “accurate” transitions will be. But more recursive data will occur.
analysis type can either be horizontal or, horizontal and vertical, in the midi clip. horizontal and vertical analysis is not ready yet. second order level treats the data at a larger scale. The organization offered by the algorithm permits several levels of processes. This is not ready yet.
 
 
• Launch the calculation by pressing regenerate. The number of clip being build will appear:
 
jtol_lzw interface offline + regen

• Generated clips will be inserted into new scenes. Each clip keeps all the automation from the initial clip.
 
jtol_lzw insert midi clip done

 
 

+++++++++++++++++++++++++++++++++++++++++++++++++++

 
 

Here are some examples using the johann sebastian bach toccata and fugue in d minor and eugène gigout‘s toccata in b minor. Their obvious horizontal and vertical symmetries make it visually and orally easy to understand what happens in the algorithm.

Johann Sebastian Bach Toccata and Fugue in D minor, BWV 565 piano roll
johann sebastian bach toccata and fugue in d minor, bwv 565 piano roll

regenerated Johann Sebastian Bach Toccata and Fugue in D minor, BWV 565 piano roll _ Olivier Pasquet _2019
regenerated johann sebastian bach toccata and fugue in d minor, bwv 565 piano roll

Eugène Gigout Toccata in B minor piano roll
eugène gigout toccata in b minor piano roll

regenerated Eugène Gigout Toccata in B minor piano roll _ Olivier Pasquet _2019
regenerated eugène gigout toccata in b minor piano roll

regenerated Eugène Gigout Toccata in B minor piano roll _ Olivier Pasquet _2019
regenerated eugène gigout toccata in b minor piano roll

 
 

+++++++++++++++++++++++++++++++++++++++++++++++++++

 
 

Initial Bach’s Toccata
Initial Gigout’s Toccata
Regenerated Bach’s Toccata
Regenerated Gigout’s Toccata
Another regenerated Bach’s Toccata (with a small note off problem in the beginning but the rest is fine)
Regenerated Gigout’s Toccata
Error occurred when trying to fetch the file using wp_remote_get(). cURL error 7: Failed to connect to www.opasquet.fr port 443: Connection refused
All scrambled in Bach’s Toccata for comparison
Error occurred when trying to fetch the file using wp_remote_get(). cURL error 7: Failed to connect to www.opasquet.fr port 443: Connection refused
Regenerated Gigout’s Toccata
Error occurred when trying to fetch the file using wp_remote_get(). cURL error 7: Failed to connect to www.opasquet.fr port 443: Connection refused
Some dimensions scrambled, not all, in Bach’s Toccata
Error occurred when trying to fetch the file using wp_remote_get(). cURL error 7: Failed to connect to www.opasquet.fr port 443: Connection refused
Regenerated Gigout’s Toccata
Error occurred when trying to fetch the file using wp_remote_get(). cURL error 7: Failed to connect to www.opasquet.fr port 443: Connection refused
Regenerated Bach’s Toccata including a small amount of repetitions coming from loops in the graph
Error occurred when trying to fetch the file using wp_remote_get(). cURL error 7: Failed to connect to www.opasquet.fr port 443: Connection refused
Regenerated Bach’s Toccata including more repetitions