Read this post if you already have Firmata on your board. If you don’t know how to upload it or if you’ve never heard about the Arduino IDE, please read this post first.
The point of Pduino is to have as much control as possible over the board and its inputs, by letting Pure Data control which inputs should be turned on (and more). This would normally require to update the Arduino sketch.
Pduino is two-fold : one half is the Arduino program called Firmata, and the other half is the [arduino] object in Pure Data. The first lets the later have full control over the board.
To install Pduino, you’ll need to :
- download the archive from Hans-Christoph Steiner’s website,
- extract the content of the archive to your Pd/Extra or Pd/Externals folder (it doesn’t actually matter as long as you know where it is),
- add a reference to the path to the Pduino folder in Pure Data by clicking on “File” -> “Path…” -> “New…” (if Pd doesn’t know where to look for it it won’t let you create the [arduino] object).
Now if you have uploaded Firmata onto your board, you can plug it and start discovering Pduino. A very good start is to open the [arduino-test] patch in the Pduino folder. It looks like this :
The first thing to do after opening “arduino-test” is to open the connection with the board. This is done with the light green horizontal radio in the upper left corner. My board was on port 4, but yours may be on another one. You can monitor the success or failure of the connection by looking at the main Pd window. If it didn’t work you’ll an error message similar to :
error: [comport]: could not open device COM2:
Once you have opened the right port, you can set the pins you need with the pink grid to the right. Each pin on the board can be controlled from this grid. To build a footcontroller that works like any multi-effects guitar pedal, you’ll need only two kinds of pins : digital input pins (that takes on two values, 0 or 1) and analog input pins. The digital pins are those connected to a simple switch or button, and the analog pins are connected to potentiometers (to control the volume, or to make an expression pedal). Please note that an Arduino board has a few digital-only pins, and another set of pins that can be either analog or digital depending on your needs.
To open, say, Pin 2 in analog mode, click in the box at the intersection of the first column and the 4th row in the grid. You’ll see that this sends a message to the [arduino] object : “pinMode 2 analog”. You can actually open any pin by simply sending a message to the [arduino] object. “pinMode 4 input” will open Pin 4 for digital input, “pinMode 12 analog” will open Pin 12 for analog input, and so on. This will make your life easier when you make your own patch around the [arduino] object if you need to open several pins on startup.
If you have any button or pot connected to your board, you can open the relevant pins and look at the lower part of the “arduino-test” patch. The output of the analog pins is on the left-hand side of the patch. If you have connected a pot to your board, you should see the value change in one number box as you move the pot. The ouput of the digital pins is in the lower right corner of the patch. It concists of a set of toggle boxes. If you have connected a switch/button to your board, you should see a cross appear when you press the button and vanish when you release it (or the other way around depending on the wiring of the button).
You guessed it : if your pot and your button can change the values in a number box and a toggle box, you can control just about anything in any Pd patch with your Arduino board! Sweet. That was the easy part. Now go get your soldering iron and your drill and make a nice pedal with lots of buttons and pots to trigger even nicer effects for your guitar😉 .