~*~..Sardines.~~*
an underwater sound explorer

'Sardines' was inspired by the schools of sardines I saw at the Monterey Bay Aquarium in California. The synchronized and rapid propagating motions displayed by these common yet mysterious creatures left me standing in front of the beautiful blue tank, mesmerized, for a good half-hour. 'Sardines' attempts to capture aspects of these movements through both graphical and musical progression, while allowing the user to interact with the creative process.




Design: Each "fish" is assigned a note out of a chord or scale/mode. Each fish can only play one note at a time, but the flock as a whole constantly plays an aggregated combination of these individual notes, creating something of a sparkling "chord space." Currently, there are four different chord spaces available: pentatonic, major, dorian, and a mystery mode. The intervals between the pitch classes within each chord space determines the visual distance between each fish and its neighbors. Therefore, there are four different "configurations" the fish can swim in. Turning of the fish in the x-z plane corresponds to transposition of the chord space.




To simulate the synchronous and propagating movements, I referred to some preexisting models of flocking behavior by Ian Couzin* and Craig Reynolds**. I implemented a few simple rules inspired by their models:

1. Each fish maintains a constant distance away from its neighbors.
2. Each fish only responds to its nearest neighbor(s)' movement.
3. When a predator comes, run!

As per the first rule, the visual distance between each fish and its nearest neighbors stays constant through all the turning and swimming the flock might go through. Analogously, the intervals between the pitches the fish are playing also stay constant throughout all the transpositions the chord space may go through in response to the turns.

As per the second rule, whenever the first few fish decide to make a turn of direction (<--> transpose the chord space), they do so and "activate" their nearest neighbors to do the same, which will then send the message to their neighbors, and so on, setting off a chain-reaction that propagates throughout the flock. The transition process in-between displays a mixture of the initial and goal states, with some of the fish done turning (transposing) while others are still in the process or have yet to turn, and this intermediate state is of much aesthetic interest in 'Sardines.'

As per the third rule, when the user clicks somewhere in the middle of the flock, the fish (especially those closest to the cursor) will quickly swim away, and soon regroup into a possibly different configuration (<--> chord space) to continue their swimming.




User Manual:

Below is a quick summary of the visual-musical correspondences:

   fish <--> note
school of fish <--> chord space
   inter-fish distance <--> pitch-class interval
       swimming <--> playing notes
                    turn in direction <--> transposition of chord space

Keyboard control:

'1' - rotate camera to the left
'2' - rotate camera to the right
'3' - shift camera view up
'4' - shift camera view down
'5' - zoom camera out
'6' - zoom camera in
'7' - swim/turn to the right
'8' - swim/turn into the screen
'9' - swim/turn to the left
'0' - swim/turn out of the screen
'c' - change chord space (will randomly choose from major, dorian, or mystery)
'r' - reset chord space to pentatonic
'a' - auto-swim
'q' - quit

Mouse control:

Left click somewhere in the middle of the flock to make fish scatter and then regroup.


Download:   source file

*Ian Couzin: http://icouzin.princeton.edu/
**Craig Reynolds: http://www.red3d.com/cwr/boids/


Author: Hana Shin
Credits: RtAudio by Gary P. Scavone,
MCD-API and Raka framework by Ge Wang
Last Modified: 12-12-13