ITP Notebook

Musical Garden

December 09, 2020

Code of MusicICM: Media

Musical Garden

The Musical Garden is an experiment in making music by planting and tending to a virtual garden. The two interactions are planting seeds and watering. Plants produce spacial audio that depends on which “soil” they are planted in. The user’s mouse acts as the audio listener, so plants near to the mouse will be louder.

Try it out or view the source.

Plant Rules

Each seed type represents an oscillator waveform: circle = sine, square = square, equilateral triangle = triangle, right triangle = sawtooth. Each type has its own L-System rules for how to grow.

Ground Rules

Each ground area dictates how the plants should play audio. They define which synth the plant should use (incorporating the base oscillator type) and what to do when the plant is watered. They also attach audio effects specific to that area.

Brown/Purple Circles

  • Uses Tone.MonoSynth
  • Plants play melody based on the current L-System Sentence where [ means increase the note value and ] means increase the note value
  • This means that shorter plants have shorter melodies

Blue Squares

  • Uses Tone.FMSynth
  • Plants placed in this area add a note to a sequence played left to right — the note value is determined by the Y position and the time is determined by the X position.
  • Watering increases note duration and modulates the FM Synth

Red Diamonds

  • Uses Tone.MembraneSynth
  • Each plant loops one note on a random (within a set) interval — this generates polyrhythms between different plants.
  • Watering increases the synths decay time and also randomizes the note.

Brown/Yellow Triangles

  • Uses Tone.MonoSynth
  • Each plant adds a voice to a chord that changes at random intervals, so all plants in this area are playing one note of the same chord.
  • Watering increases the filter frequency and adds delay once the plant has stopped growing.

Black Squares (The Void)

  • Uses Tone.MonoSynth
  • Each plant is assigned a random frequency
  • Watering adds vibrato
  • Placing a plant changes the vibrato rate for the whole area