Modular-Muse Interface Objects
The modular-muse library includes a set of interface objects which make it easy to connect to the board and read the inputs into Pd. These objects with work with any Arduino compatible device as long as the Arduino is programmed with the modular-muse firmware.
The [mm] object is what communicates between the Sound Clippy (or Arduino) board and Pd. Once connected to the [mm] object the Sound Clippy board sends data over a serial port connection about the state of its inputs.
Tutorial: Connecting to the Sound Clippy board
The [mm-digital] object is for reading the state of the digital pins on the Sound Clippy board. The 12 pins can all be read separately and be used to trigger audio file playback, sound envelopes, enable/disable effects among other things.
To read a digital pin create a new object and type
where the # is the port number you want to read. The digital pins on the Sound Clippys board are on the side of the board that looks a little like a piano:
the digital inputs are labeled with D2-D13.
The [mm-digital] object has two outputs. The left outlet reperesnts the currents state of the pin and outputs a number, a 0 or a 1 depending on if the port is open or connected to ground in hardware.
This value of 1 or 0 can be used directly to turn on and off objects with an on/off state like the metronome object or the [mm-adsr~] object.
While the right outlet sends a “bang” message when the value changes from 0 to 1. This is good for triggering events
Take a look at the digital input examples for more ideas – or read about creating a paper piano hardware controller.
The [mm-analog] object is for reading the value at the analog inputs to the Sound Clippy board. The 8 analog inputs can all be read in separately and used to control different parameters – or even multiple parameters. For more info about interfacing to the analog inputs in hardware see: Analog Inputs for Expressive Control
With an analog input connected its time to map it to an audio parameter. From the examples, open the patch “analog-filter” and connect the board. Analog port 0 is configured to control the cutoff frequency of the filter between 200 and 2000 Hz.
This was created by creating a new object and typing:
[mm-analog 0 200 2000]
There are three numbers after the object name [mm-analog]. These are called creation arguments. For this object the first is the port number, next is the low value and finally is the high value. These values can be set accordingly depending on what the sensor is going to be used for. In this case a low-pass filter cutoff frequency is being set between 200 and 2000 Hz.
The analog sensor is automatically calibrated to use the range specified in the [mm-analog] object. The object will keep track of the lowest and highest values seen by the analog port and will map the output to be within the specified range.
To calibrate the sensor – click the “calib” button (or send a bang to the “calibrate” inlet) and exercise the sensors full range. e.g. if its a light sensor, cover it for full darkness and shine a light on it to get the upper end.
Now that you know how to use and map analog inputs to any range – think about the elements of sound again – what do you want to be able to control? Try controlling some different audio effects or sound synthesis parameters!