Getting Started with the Muscle SpikerShield Pro
Hey everyone! I’m Pablo, a junior from Nido de Aguilas High School in Santiago, Chile. In my free time, I like to doodle and run.
My project is a multi-channel version of the experiment that my colleague and friend Cristian developed: it consists of using the SpikerShield Pro’s ability to get data from multiple channels to create a musical instrument. In this instrument, flexing a muscle is analogous to playing a key in a keyboard. Obviously, the amount of channels limits this keyboard to six notes, but according to my limited musical knowledge, this is enough to create a coherent melody. In fact, the Arduino program currently has four settings which can be accessed using the red button: Mary Had a Little Lamb, Frere Jacques, major pentatonic scale and the minor blues scale. All the notes are in arrays with six elements, each corresponding to a channel. To add more possibilities, holding the white button in the board makes all the notes in the current setting one octave higher. You can download my code here.
The “loop” part of the code works by reading the red button, white button, and all six channels. First, it decides which set of notes to use for that iteration of the loop, which is controlled by the red button, then it checks if the white button has been clicked, which affects the pitch of the final note it plays. The last step is to decide which tone to actually play, which the code does by selecting the largest reading of all the muscles. Now, you might be thinking that playing music with two vastly different muscles, say your forehead and your forearm, will never work because a signal from the forearm will always be bigger than the signal of even the strongest forehead flex. However, the SpikerShield Pro can control the gain from each individual channel (the little white knobs) which can make a channel more or less sensitive to a signal, so every muscle has a fair chance of being played.
One challenge I faced when I developed this project is the lack of documentation of this particular product for novice programmers. Most of the times I’ve played around with an Arduino, I’ve relied extensively on the built-in tutorials and online resources, but this time I only had the board’s schematic, which at first glance bears a closer resemblance to black spaghetti than a discernible circuit and the default program which sends the signals from the board to Spike Recorder. Running the aforementioned program was not a challenge, but reading the code, not being fully aware of what it was, proved to be confusing. I only started making progress once Tim Marzullo showed me an outdated sketch meant for this shield. However, with this project in the open, I doubt this is a problem other users will face; the heart of the code — presenting the sensor’s readings as an array and mapping those raw values to a usable scale — can be used for most projects.
The second biggest challenge was and still is, my absolute ignorance about music theory. I never learned to play an instrument, and the most complicated song I managed to play is “Hot Crossed Buns”, though that is probably a skill I’ve lost. I’ve always enjoyed music, but much like hot dogs, I preferred to enjoy the finished product rather than learning how it is made. After adding the melody of Mary Had a Little Lamb and Frere Jacques, I did not know what other songs to add. After a fair amount of research, I came upon pentatonic scales, which are comprised of five notes.
Though the musical aspect is worth examining, what attracted me more is its role in many musical traditions, ranging from the ancient Greeks to the Andes. During the 19th century, composers like Debussy used the simplicity of the scale to create a folksy in their composition, resulting in music like La fille aux cheveux de lin. Later on, rock, blues, and jazz artists adopted the scale as a tool for their respective styles of improvisation. I think this is the area where my particular instrument shows the most potential because it is only capable of playing one note at a time, and also because flexing muscles to create sound is very intuitive. However, this is a hypothesis I will let the reader confirm.