Tag Archive | agent-based modeling

Further Experiments in Agent-based Musical Composition

Photo by whistler1984 @Flickr.

Editor’s Note:  WARNING: THE FOLLOWING POST IS INTERACTIVE!!!  This week’s post is especially designed by one of our regulars, Andreas Duus Pape, to spark conversation and provoke debate on its comment page.  I  have directly solicited feedback and commentary from several top sound studies scholars, thinkers, artists, and musicians, who will be posting at various times throughout the day and the week–responding to Andreas, responding to each other, and responding to your comments.  Look for commentary by Bill Bahng Boyer (NYU), Maile Colbert(Binaural/Nodar, Faculdade de Belas Artes da Universidade do Porto), Nick Knouf (Cornell University), Primus Luta (AvantUrb, Concrète Sound System), Alejandro L. Madrid (University of Illinois at Chicago), Tara Rodgers (University of Maryland), Jonathan Skinner (ecopoetics),  Jonathan Sterne (McGill University), Aaron Trammell (Rutgers University, Sounding Out!) and yours truly (Binghamton University, Sounding Out!).  Full bios of our special respondents follow the post. We wholeheartedly wish to entice you this Monday to play. . .and listen. . .and then share your thoughts via the comment page. . .and play again. . .listen again. . .read the comments. . .and share more thoughts. . .yeah, just go ahead and loop that.  –JSA, Editor-in-Chief

I’m a musician and an economist. Sometimes you will find me playing acoustic folk rock and blues on guitar, harmonica and voice. And at other times I will be at work, where I apply my expertise in game theory to the computer modeling of social phenomena. I create simulations of people interacting – such as how people decide which way to vote on an issue such as a tax levy, or how people learn to sort objects given to them in an experiment. In these simulations, the user can set up characteristics of the environment, such as the number of people and their individual goals. After things are set up, users watch these interactions unfold. The simulation is a little story, and one need only tweak the inputs to see how the story changes.

As a musician, I was curious if a program that generates social stories could be refashioned to generate musical pieces. I wanted to build a music-generation engine that the listener could tweak in order to get a different piece each time. But not just any tune – a piece with some flow, some story. I like that tension between randomness and structure. On one hand, I want every song to vary in unpredictable ways; on the other hand, I want to create music and not structureless noise.

I created a basic story of predators and prey, whimsically naming the prey “Peters,” represented by rabbits, and the predators “Wolves.” My simulation depicts a plain in the savannah with a green oasis. The prey seek the oasis and the predators seek the prey. Each character has its own goals and the closer they are to achieving them, the happier they are. Both predators and prey want to have stomachs full of food, so naturally they want to be close to their target (be it prey or oasis). As they travel through the savannah, they learn what choices (directions of movement) make them happier, and use this experience to guide them.

Photo by bantam10 @Flickr

So how does this story become music? To this question there are two answers: a technical one and an intuitive one. The intuitive answer is that in real life the story of predators and prey plays out geographically on the savannah, but musically this is a story that plays out over a sonic landscape. To elaborate, I abstracted the movement of the prey and predator on the geography of the plain into the musical geometry of a sonic landscape. The farther north an agent travels, the higher the pitch. And, the farther east an agent travels the longer the duration. In other words, as an agent travels to the northwest, she makes longer-lasting tones that are higher pitched. I also mapped happiness to volume, so that happy agents make louder tones. Finally, so that each agent would have a distinct voice as they traveled through this space, I chose different instruments for each agent.

In the video below I assigned the “church organ” sound to prey, and the “brass section” sound to predators.

Ultimately, there are some things that I like about this piece and others that I do not.

As a harmonica player, I improvise by creating and resolving tension. I think this piece does that well. The predator will pursue the prey into a quiet, low-pitch corner, creating a distant, rumbling sound – only to watch prey escape to the densely polyphonic northwest corner. There is an ebb and flow to this chase that I recognize from blues harmonica solos. In contrast to my experience as a harmonica player, however, I have found that some of the most compelling parts of the dynamics come from the layering of notes. The addition of notes yields a rich sonic texture, much like adding notes to a chord on an organ.

Unfortunately, for largely technical reasons, there is a lack of coherent rhythm and pacing. The programming platform (agent-based modeling software called NetLogo) is not designed to have the interface proceed in real-time. Basically, the overall speed of the piece can change as the processing load increases or decreases. I found that as agents learnt more about their surroundings (and more system resources are allocated to this “memory”), they became slower and slower. To fix this, I capped the size of their memory banks so that they would forget their oldest memories. The closest I have come to a rhythmic structure is by ordering the way that the agents play. This technique makes the piece have a call-and-response feel. If only the piece to had a coherent rhythm,  then I could imagine playing harmonica along with it.

One last comment on pitch: while an earlier version of this piece mapped each step in space to a semitone, things sounded too mechanical. Even though this was the easiest and most intuitive decision from a technical standpoint, it was aesthetically lacking, so I have now integrated traditional musical scales. The minor scale, in my opinion, is the most interesting as it makes the predator/prey dynamic sound appropriately foreboding.

Photo by deivorytower @Flickr.

You can play this piece yourself. Simply go to this link with Java enabled in your browser (recommended: Google Chrome). Pressing “Setup” then “Go” will create your own run of the piece. As it is running, you can adjust the slider above the graphic window to change the speed. Press “Go” again to stop the model, adjust any parameters you wish and press “Setup” and “Go” again to see how the piece changes. Here are some parameters to try: instA and instB to change the instruments associated with prey and predators; PlayEveryXSteps to change the pace of the piece (higher results in a slower paced piece); Num-PackAs and Num-PackBs changes the number of prey and predators; the vertical PeterVol and WolfVol adjust the overall volume of prey and predators.

In regards to my version of “Peter and the Wolf,” I have a number of things that I’m curious about.

First, how does this relate to what you think of as music? Do you like listening to it? Which elements do you like and which do you dislike? For example, what do you think about about the tension and rhythm – do you agree the first works and that the second could be improved? Would you listen to this for enjoyments’ sake, and what would it take for this to be more than a novelty? What do you think about the narrative that drives the piece? I chose the predator and prey narrative, admittedly, on a whim. Do you think there might be some other narrative or agent specific goals that might better drive this piece? Is there any metaphor that might better describe this piece? As a listener do you enjoy the experience of being able to customize and configure the piece? What would you like to have control over that is missing here? Would you like more interaction with the piece or less interaction?

Finally, and perhaps most importantly, what do you think of the premise? Can simple electronic agents (albeit ones which interact socially) aspire to create music? Is there something promising in this act of simulation? Is music-making necessarily a human activity and is this kind of work destined to be artificial and uncanny?

Thanks for listening. I look forward to your thoughts.

“The Birth of Electronic Man.” Photo by xdxd_vs_xdxd @Flickr.

– – –

Andreas Duus Pape is an economist and a musician. As an economist, he studies microeconomic theory and game theory–that is, the analysis of strategy and the construction of models to understand social phenomena–and the theory of individual choice, including how to forecast the behavior of agents who construct models of social phenomena. As a musician, he plays folk in the tradition of Dylan and Guthrie, blues in the tradition of Williamson and McTell, and country in the tradition of Nelson and Cash. Pape is an assistant Professor in the department of Economics at Binghamton University and is a faculty member of the Collective Dynamics of Complex Systems (CoCo) Research Group.

– – –

Guest Respondents on the Comment Page (in alphabetical order)

Bill Bahng Boyer is a doctoral candidate in music at New York University who is completing a dissertation on public listening in the New York City subway system.

Maile Colbert  is an intermedia artist with a concentration in sound and video, living and working between New York and Portugal. She is an associated artist at Binaural/Nodar.

Nicholas Knouf is a Ph.D. candidate in information science at Cornell University.

Primus Luta is a writer and an artist exploring the intersection of technology and art; he maintains his own AvantUrb site and is a founding member of the live electronic music collective Concrète Sound System.

Alejandro L. Madrid is Associate Professor of Latin American and Latino Studies at the University of Illinois at Chicago and a cultural theorist and music scholar whose research focuses on the intersection of modernity, tradition, globalization, and ethnic identity in popular and art music, dance, and expressive culture from Mexico, the U.S.-Mexico border, and the circum-Caribbean.

Tara Rodgers is an Assistant Professor of Women’s Studies and a faculty fellow in the Digital Cultures & Creativity program at the University of Maryland. As Analog Tara, she has released electronic music on compilations such as the Le Tigre 12″ and Source Records/Germany, and exhibited sound art at venues including Eyebeam (NYC) and the Museum of Contemporary Canadian Art (Toronto).

Jonathan Skinner founded and edits the journal ecopoetics, which features creative-critical intersections between writing and ecology. Skinner also writes ecocriticism on contemporary poetry and poetics.

Jonathan Sterne teaches in the Department of Art History and Communication Studies and the History and Philosophy of Science Program at McGill University. His latest book, Mp3 The Meaning of a Format comes out this fall from Duke University Press.

Jennifer Stoever-Ackerman is co-founder, Editor-in-Chief and Guest Posts Editor for Sounding Out! She is also Assistant Professor of English at Binghamton University and a former Fellow at the Society for the Humanities at Cornell University (2011-2012).

Aaron Trammell is Multimedia Editor of Sounding Out! and a Ph.D. Candidate in Media and Communications at Rutgers University.

Experiments in Agent-based Sonic Composition

John Cage’s “Music of Changes,” which was composed using a random component from the iChing.
I perform and write music, normally acoustic, and usually for a single guitar, harmonica, and voice. I am traditional in my choice of instruments, they are basically “old” technology. On the other hand, I am also fascinated by the idea of robotics in music. The idea of artificial, autonomous music creators that work alongside human musicians. John Cage used the iChing to make choices about musical form in some of his compositions, including “Music of Changes” above, which has some of that flavor. It is music that is composed, not just performed, by a partially artificial means–by a non-human actor, the iChing.
In my work as an economist, I develop autonomous software programs that simulate economic actors in a process called agent-based modeling – the construction of independent pieces of software, which simulate real agents in the world, that interact and form patterns that transcend any single agent’s behavior. Recently I realized that agent-based modeling might be able to be applied to the construction of music: creating individual artificial decision makers which might together construct a piece of music that transcends what any one of them can do.
Think of a swarm of bees or a school of fish. Once biologists thought that schools of fish had a `leader fish,’ a single fish that would direct how the school would move. Biologists also once thought that the queen bee was the `leader’ of the hive, that it directed behavior of the bees in the hive. Both of these beliefs have been shown to be false. There is no leader in a school of fish. On the contrary, each fish responds to local information and then the co-ordination which arises on the school level emerges from this system of individual choices. The same with bees…the queen plays a part in the hive, like all the bees play parts, but there is no sense in which she directs the others. There is no bee that is in charge.
Here is a video of my colleague Hiroki Sayama’s `Swarm Chemistry’ in action. The specks you see on the screen are individual agents, dumb agents, who react to their environment, which is other local agents. There are no leaders here, there is only group behavior.

In this clip, you can see the swarms which emerge. The music is incidental in this clip; not a result of the swarm behavior.
I have begun an experiment in agent-based sonic composition with the idea of emergent behavior and agent-based modeling in mind. In this video I show my initial foray into this world:

The agents in this video are small triangles that seek a well, and eventually learn (sometimes more effectively, sometimes less effectively) where that well is. What I have done to add a sonic component is to assign each agent an instrument, and assign the agent’s proximity to the well to the pitch of the note they create.
“Random” sounds created by a computer are nothing new. And, frankly, I find them uninteresting. No depth, no humanity. But I think agent-based sonic composition might be something different. These agents are not simply random (although indeed, their behavior has something of a random component, or seemingly random component). They are goal-seeking, they are purposeful, and the sound they generate is a function of their effectiveness and path in pursuing that goal. I think this purposefulness can be heard in the sound the create. There certainly isn’t a melody, but there is a story being told, some kind of struggle being documented.

Swarms, too, are not simply random. Though swarms may be composed of elements have that have randomness in them, they are also structured. If Music is sound with structure, and complex systems is the study of emergent structure, there could be a genuinely interesting music that might emerge from a well-constructed agent-based approach to sonic composition.
I’m not convinced what I have is there yet. There are not interesting interactions between these agents, and there is not a structure to their sound that has depth – yet. Perhaps the next step is to tie the goals of the agents more explicitly to music making. Perhaps there can be melodic agent who moves on a predetermined path, and the other agents try to follow that agent, and hence the sound that comes out documents their struggle. Maybe the agents’ notes should be restricted to scales, so that it sounds less chromatic. Or, perhaps, as I suggest in the video, there can be some agents which control rhythm and others that control pitch.
To be clear: I wouldn’t just listen to this. I don’t know if I would call it “music” yet. But I think it may get there some day.

Andreas Duus Pape: is an economist and a musician.  As an economist, he studies microeconomic theory and game theory—that is, the analysis of strategy and the construction of models to understand social phenomena—and the theory of individual choice, including how to forecast the behavior of agents who construct models of social phenomena.  As a musician, he plays folk in the tradition of Dylan and Guthrie, blues in the tradition of Williamson and McTell, and country in the tradition of Nelson and Cash.  He plays acoustic guitar, harmonica, and voice: although the technology of his musical production is a hundred years old, his ideas are often quite modern, and he covers songs as old as early last century and as recent as this one.  Pape is also an assistant Professor in the department of Economics at Binghamton University, where he teaches microeconomic theory at the undergraduate and graduate level.  He is a faculty member of the Collective Dynamics of Complex Systems (CoCo) Research Group: http://coco.binghamton.edu and considers complex systems and agent-based modeling to be central to his research

%d bloggers like this: