Chorder, Part III
This post is part of a series of notes and exercises for a summer camp on making musical instruments with Arduino and Pure Data.
Currently our chorder writes messages like this to the serial port:
60 62 64 0
This looks like a I chord in the C major scale. The 0 means it should stop playing.
We now write a Pure Data patch that interprets these messages and generates the appropriate MIDI commands.
Note2
Let’s start by making an abstraction that plays or stops a particular MIDI note. Call it note2. It will behave a lot like note from our pentatouch. Create it in the following way:
- Add an
inlet midi_numberfor the note’s MIDI number. - Feed the MIDI number into the leftmost inlet of a
noteoutobject. - Add an
inlet statefor the note’s state, which will be 0 or 1. - Feed the state into a
selectobject that chooses between 0 and 1. - Feed the 0 branch into a
float 0object, which will serve as the stopping velocity. - Feed the 1 branch into a
float 100object, which will serve as the playing velocity. - Feed both velocities into the middle inlet of the
noteoutobject.
Save your abstraction in note2.pd.
Main
With note2 in place, creating the main patch will be much simpler. Follow these steps:
- Add the
devices,open, andclosemessages as you have done previously. - Add a
comport 9600object and wire the messages to it as you have done previously. - Feed the outlet of
comportto arepack 4object. Each message has four numbers in it. - Feed the outlet of
repackinto anunpack float float float floatobject. This separates the message into four individual numbers. - Add a
note2object. - Feed the first number of the Arduino message to the left inlet of the
note2object. - Similarly feed the second number into the left inlet of the
note2object. And the third. - Feed the state (the fourth outlet) into the right inlet of the
note2object.
Test your instrument. Touching the clips should produce I, ii, iii, VI, V, vi, and vii chords. Then find some fruit and vegetables to create your inputs.
Challenges
After you get your chorder working, answer the following questions on a piece of scratch paper.
- Investigate some chord progressions in the major scale commonly found in popular music. Identify one whose sound pleases you.
- Experiment with your own chord progressions. What’s one you like? Compose a short, repeating progression and be prepared to play it for the group.