Adapted from Keith Schwarzās Tone Matrix assignment, inspired by AndrĆ© Michelās Tone Matrix tool.
Learning objectives¶
Practice working with 1D arrays, 2D arrays, and
forloopsUse the modulo operator
%as a way to āwrap aroundā the end of an arrayBuild a simple user interface using Processing for a digital musical instrument
Write conditionals to test and check your own code
In this assignment, youāll build a digital musical instrument called a Tone Matrix that you play through a visual interface. The Tone Matrix is a square grid of lights, each of which starts out turned off. You turn lights on and off by clicking on cells in the grid.
Each light in the grid stands for a musical note at a specific point in time. Lights further to the left are played before lights further to the right. The row of a light sets which note is played: lights toward the bottom of the grid have a lower pitch than lights toward the top. All the lights on one row play the same note at different moments. And if several lights in the same column are on, they all play together when that columnās turn comes around.
Hereās a video of this in action:
Weāll get there in two parts. In Part 1, weāll build the sound generation logic as a single plucked āstring instrumentā you can hear. In Part 2, weāll build the grid that arranges those strings and notes.