Writing the code
The coding for the guitar is based on a very simple premise but allows for a complete individual interpretation on how you want to play the guitar and how you want the guitar to sound.
The program we are writing as an example will showcase some possibilities, but utimately, you should be brave and tinker around to get the guitar to sound how you want. The beauty of music is to express yourself the way you want to. This is your moment! Combining coding and music is an exciting combination of awesome.
The ports
There is not a lot to plug in for this build. You will connect the distance sensor into port D. You will also add the color sensor plugged into port C.
The following screenshot illustrates this:
The basic layout of the program will follow this structure for each of the colored items on your guitar fretboard.
You will start by adding the yellow event block called when...