loopArena
agents
There are two main types of agents:
BeatAgents and NoteAgents.

NoteAgents play MIDI notes depending on their horizontal and vertical position in the loop-zones' raster.
BeatAgents play the drums of a connected drumcomputer.
Note- and BeatAgents can be dragged and activated and deactivated by touching them. NoteAgents have an additional handle which controls the duration of the played Note.
behaviour
The NoteAgents have the most complex behaviour: they constantly count beats, after a random number of beats they move in a random direction for one beat, then check the other agents' positions and move to a point where they would play a note in a harmonic interval to the previously played note.
After eight bars, all agents return back to the position where the user dropped them on the stage, playing the"motive" of the melody. Due to this, the musical result is not random, but plays around the users' input.

The BeatAgents work in a similar way, the difference is that their random movement is restricted to the x-axis. and controlled by rhythmic rules. This is because their vertical position does not change the pitch of the drum but the played drum itself.
For them, the loop zone is divided vertically into a raster of 10 possible
drums.