Showing posts with label Chaos. Show all posts
Showing posts with label Chaos. Show all posts

January 7, 2021

Dancing Musical Chaos

Point by glowing point, the image swirls into view. As it builds up on the computer screen, it begins to resemble a delicate, stylized butterfly with translucent wings held lazily askew.


It's called the Lorenz attractor, named for Edward N. Lorenz, who in 1963 discovered this curious form encoded in a set of equations describing air flows in the atmosphere. The computer image arises out of a chaotic—in the mathematical sense—system.

For a given starting point, the computer calculates the coordinates of each successive point as the dynamical system described by the equations evolves. It displays these points as luminous dots on the screen. They appear to sprinkle themselves randomly across the display, but gradually a distinctive butterfly pattern emerges.

Different starting coordinates typically lead to radically different sequences of calculated points. The overall pattern, however, can always be identified as the Lorenz butterfly. It's an example of both the sensitive dependence on initial conditions and the distinctive patterns that are characteristic of chaotic systems.

In the early 1990s when Diana Dabby was a graduate student in electrical engineering at the Massachusetts Institute of Technology, she could imagine using the mathematics of chaos to compose music. She envisioned "riding the back of the attractor" to create musical variations that stray in unexpected ways yet do not wander so far as to lose all ties with the original music.

A concert pianist before she came to MIT, Dabby devised a scheme for using the Lorenz attractor to generate variations on the sequences of notes in a piece of music. Her initial experiments were done on Bach's Prelude in C from the first book of The Well-Tempered Clavier. Audio (Tracks 3, 4, 5).

The x coordinates of the points that make up the Lorenz attractor for a given starting point fall within a certain range of numbers. Dabby's idea was to list the pitches of all the notes or chords of a musical piece and assign them one by one, in order, to the x coordinates of points belonging to the attractor. In this way, she paired up each of the pitches in the original music with a particular range of x values.

Then she could choose a second starting point only slightly different from the first to produce a new "trajectory", or sequence of points, making up the Lorenz attractor. Because this new trajectory generally does not track the original one perfectly, the x coordinates of the two trajectories differ and the musical notes corresponding to these new x coordinates may occasionally change from those in the original piece.

You can imagine that the initial "mapping" step lays down the musical landscape, and the second trajectory, representing the variation, takes a slightly different path through this terrain. Because the landscape incorporates features of the original musical piece, any variations created in this way usually sound consistent with the source piece. Indeed, no variation can include a pitch not present in the original.

"The musical variations that result can be close to the original, mutate almost beyond recognition, or achieve degrees of variability between these extremes," Dabby noted. "The technique can also be used to infuse a given work with the attributes of another, so that, for instance, a work by Bach can acquire attributes of a work by Gershwin."

To Dabby, this method of producing musical variations served as an idea generator. It brought a fresh perspective to familiar music. A musician could interact with the variation-producing software to select, edit, and record particularly pleasing passages, even weave them into new compositions.

Dabby applied the technique not only to works by Bach but also to a Gershwin piece and some of her own compositions. She also explored the use of chaotic mappings to create rhythmic variations via the y variable of a Lorenz attractor.

"Once variations of an entire piece are available, the composition can change with successive listenings, from performance to performance, or even within the same concert," Dabby remarked. "In a broad sense, the music has become dynamic. It changes with time much the same way as a river changes from day to day, season to season, yet is still recognized in its essence."


Inspired by Dabby's example, computer scientist Elizabeth Bradley and Joshua Stuart developed a similar scheme for dance. They used chaos to generate variations on movement sequences.

"We map a progression of symbols representing the body positions in a dance piece, martial arts form, or other motion sequence onto a chaotic attractor, establishing a symbolic dynamics that links the movement progression and the attractor geometry," Bradley and Stuart reported in the article "Using Chaos to Generate Variations on Movement Sequences," published in the  December 1998 Chaos.

The researchers used special symbols to represent human body postures, encoding those positions by defining an axis and angle of rotation (given in the form of a mathematical expression called a quaternion) for each of the main joints. They then mapped a given motion sequence—whether a ballet jump or sequence of karate moves—onto a chaotic attractor. Following a new trajectory around the attractor produced a variation of the original motion sequence.

In effect, the choreographic software took an animation as input and generated an animation as output.


The researchers also had to adjust for the capabilities of the human body. "While musical instruments can play arbitrary pitch sequences, subject to instrument range and performer ability, both kinesiology and aesthetics impose a variety of constraints on consecutive body postures in dance and martial arts genres," Bradley and Stuart noted.

To smooth out abrupt transitions introduced by the chaotic mapping, the researchers developed schemes that captured and enforced particular dance styles. They dubbed the resulting software Chaographer.

The researchers showed the computer-generated animations to hundreds of people, including dancers and martial artists. "The consensus is that the variations not only resemble the original pieces but also are, in some sense, pleasing to the eye," Bradley and Stuart concluded. "They are both different from the originals and faithful to the dynamics of the genre. There are no jarring transitions or out-of-character moves."

They added, "Showing these results in a classroom is an enormously effective way to motivate students to learn the mathematics of rigid-body dynamics, chaos, and context-dependent grammars."

Originally posted January 11, 1999

December 10, 2013

Pinball Chaos

Sending a steel ball speeding across a tilted board studded with bumpers can be an addictive pastime—a tantalizing blend of skill to keep the ball in play and unpredictability in the ball's erratic path, rebound by rebound.


The pinball machine can serve as a model of deterministic chaos—a system that embodies a sensitive dependence on initial conditions. Balls with slightly different starting points end up following very different paths when they ricochet through the array of bumpers. Moreover, any uncertainty in a ball's initial position makes it difficult to predict where the ball will be even after just a few bounces.


Mathematician Henri Poincaré introduced this notion of "sensitive dependence on initial conditions" in the early part of the 20th century, when he tangled with the intricacies of predicting planetary motion.

In his 1908 essay "Science and Method," Poincaré wrote, ". . . it may happen that small differences in the initial conditions produce very great ones in the final phenomena. A small error in the former will produce an enormous error in the latter. Prediction becomes impossible, and we have the fortuitous phenomenon."

Decades later, mathematician and meteorologist Edward N. Lorenz discovered the same effect embodied in equations used to model weather systems. At a meeting in 1972 he presented a paper with the provocative title "Does the Flap of a Butterfly’s Wings in Brazil Set Off a Tornado in Texas?"

"I avoided answering the question," he writes in his 1993 autobiography, The Essence of Chaos, "but noted that if a single flap could lead to a tornado that would not otherwise have formed, it could equally well prevent a tornado that would otherwise have formed."

Nonetheless, the term "butterfly effect" soon entered the lexicon to describe the unpredictable, even potentially drastic, consequences of a small change.

Lorenz also tells a story about pinball machines—the earlier kind without flippers or flashing lights, with nothing but arrays of pins to disturb the motion of the ball.

One spring in the 1930s during his undergraduate years at Dartmouth College, Lorenz recounts, a few pinball machines appeared in local drugstores and eateries.

"Soon many students were occasionally winning, but more often losing, considerable numbers of nickels," he writes. "Before long the town authorities decided that the machines violated the gambling laws and would have to be removed, but they were eventually persuaded, temporarily at least, that the machines were contests of skill rather than games of chance, and were therefore perfectly legal."

If that were true, however, students should have been able to perfect their skills and become regular winners, Lorenz notes. That didn't happen because of the deterministic chaos inherent in the pinball machine.

The Exploratorium in San Francisco gives you two chances to study pinball chaos. The Tinkering Studio includes a do-it-yourself model, where you can place various objects in different positions on a sloping table to investigate their effect on the trajectories of spring-projected balls.


Controlling just the initial speed of the ball, it is remarkably difficult to get a ball to follow the same path and come to rest at a given location at the bottom, even with just a few circular bumpers on the table.

Not too far away, you can also try your skill on arcade-style pinball, but with an Exploratorium twist. You don't need any coins to play, and the sides of the machine are transparent so that you can see what goes on inside.


References:

Lorenz, E.N. 1993. The Essence of Chaos. University of Washington Press.

Peterson, I. 1993. Newton’s Clock: Chaos in the Solar System. W.H. Freeman.

______. 1990. Islands of Truth: A Mathematical Mystery Cruise. W.H. Freeman.

Photos by I. Peterson