Difference between revisions of "Stompbox Real Sensors"

From CCRMA Wiki
Jump to: navigation, search
m (First Circuit: Potentiometer)
 
(78 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<font size=5>Lab 2: Controlling an Effect with Real Sensors</font><br>
 
<font size=5>Lab 2: Controlling an Effect with Real Sensors</font><br>
 +
Designed by Edgar Berdahl
 +
 
Due on Wednesday, July 20th at 9AM
 
Due on Wednesday, July 20th at 9AM
  
  
 +
== Log In ==
 +
Log in to your kit as usual.
  
 +
Don't forget to run
 +
''sudo pkill pd''
 +
to stop any default patch from running.
  
  
  
* hook up button
 
* hook up pots
 
* hook up LED
 
* change to ring modulator
 
  
 +
== Appendix: Install Stompbox Firmware onto your Arduino Nano ==
 +
* Use the USB cable to plug the Arduino Nano into the Beagle Board.
 +
* From the terminal, run the command <tt>arduino &</tt> to start up the Arduino software.
 +
* From the menu Tools|Board choose <tt>Arduino Duemilanove or Nano w/ 328</tt>
 +
* From the menu Tools|Serial port choose <tt>/dev/ttyUSB0</tt>
 +
* Open the sketch <tt>/home/ccrma/pd/stompbox/startup-stompbox/FirmataAllInputs_ExceptOnePWMOut/FirmataAllInputs_ExceptOnePWMOut.pde</tt>
 +
* Press the '''Verify''' button.
 +
* Check the Arduino messages window to make sure that the code successfully compiled. (Usually, it will say something like <tt>Done compiling</tt> and <tt>Binary sketch size ...</tt>)
 +
* Press the '''Upload''' button (looks like an arrow pointing to the right) to install the firmware on the Arduino.
 +
* Check the Arduino messages window to make sure that you have successfully uploaded the firmware.
  
  
  
  
 
 
 
 
== Download software ==
 
 
* Make a Lab2/ folder for this lab.
 
 
* Download the following:
 
** [http://arduino.cc/en/Main/Software Arduino Software]
 
*** If you have never used an Arduino with your computer before, you need to install the FTDI driver that comes with the Arduino software; this enables your computer to recognize the USB serial communication chip on the Arduino.
 
** Firmata [http://firmata.org/wiki/Download firmware]  (use firmata2.0beta3.zip)
 
** Either [http://ccrma.stanford.edu/courses/250a/250a_maxuino-005.zip Maxuino] or [http://ccrma.stanford.edu/courses/250a/250a_pduino-0.5.zip Pduino].
 
  
 
== Power Connections ==
 
== Power Connections ==
* In order to run circuits on the breadboard, we need to get power to it. The Arduino gets 5V from the USB connection, so in this section you will make the 5V accessible to the breadboard.
+
* In order to run circuits on the breadboard, you need to get power to it. The Arduino gets 5V from the USB connection, so in this section you will make the 5V accessible to the breadboard.
 
* Make sure that your Arduino is mounted at the very end of the breadboard with the higher-numbered rows, as shown in the following picture. In that case, the GND and 5V pins will end up in the 19th row. (Otherwise if your Arduino isn't mounted this way, you simply won't be able to rely on the row numbers, but you can still figure out how to wire things up!)
 
* Make sure that your Arduino is mounted at the very end of the breadboard with the higher-numbered rows, as shown in the following picture. In that case, the GND and 5V pins will end up in the 19th row. (Otherwise if your Arduino isn't mounted this way, you simply won't be able to rely on the row numbers, but you can still figure out how to wire things up!)
 +
* Recall first that that holes in the solderless bread board are wired together as shown:
 +
 +
[[Image:Breadboard.png]]
 +
 
* Using short jumpers, connect the GND row to the blue "GND" bus on the breadboard, and connect the 5V row to the red "power" bus on the breadboard.
 
* Using short jumpers, connect the GND row to the blue "GND" bus on the breadboard, and connect the 5V row to the red "power" bus on the breadboard.
 
* Connect the "GND" and "power" busses from both sides of the breadboard together as shown.
 
* Connect the "GND" and "power" busses from both sides of the breadboard together as shown.
Line 43: Line 47:
  
 
[[Image:circuit0.jpg]]
 
[[Image:circuit0.jpg]]
 +
  
  
Line 48: Line 53:
 
== First Circuit: Potentiometer ==
 
== First Circuit: Potentiometer ==
  
Now you will build the following voltage-divider circuit, to connect one potentiometer to analog input A0.
+
Now you will build the following voltage divider circuit, to connect one potentiometer to analog input A0.
  
 
[[Image:pot-A0.jpg]]
 
[[Image:pot-A0.jpg]]
  
For some help on placing the wires, please see the following picture. In order to ensure the correct orientation, ensure that the text on the potentiometer is facing *away* from the Arduino (see also oblique picture in next section).
+
For some help on placing the wires, please see the following picture. In order to ensure the correct orientation, ensure that the text on the potentiometer is facing '''away''' from the Arduino (see also oblique picture in next section).
 
[[Image:circuit2.jpg]]
 
[[Image:circuit2.jpg]]
 +
 +
 +
  
 
== Add A Second Potentiometer ==
 
== Add A Second Potentiometer ==
  
Now connect a second potentiometer to analog input A3 using the same circuit.
+
Now connect a second potentiometer to analog input A3 using the same voltage divider circuit.
  
 
[[Image:SBcircuit3-direct.jpg]]
 
[[Image:SBcircuit3-direct.jpg]]
Line 67: Line 75:
 
[[Image:SBcircuit3.jpg]]
 
[[Image:SBcircuit3.jpg]]
  
== Mount your Arduino Nano on your breadboard==
 
  
We will be powering the Nano and the breadboard with current from the USB port, which is good for up to 500mA of 5 V±5%-- probably enough for most input circuits, although not enough if you plan to run a lot of LEDs or motors.
 
* The Nano should sit at the bottom of the breadboard, so that the pins lie in rows 49-64 on either side.
 
* Using jumper wires, connect the row 52 pin (GND) on the left side of the Nano to the blue ground (GND) rail.
 
* Connect the row 52 pin (+5V) on the right side of the Nano to the red Power rail.
 
* Use jumper wires to connect the power and GND rails on the left side of the breadboard to the right.
 
  
[[Image:Lab2-2.jpg]]
 
  
== Buttons, Switches and LEDs ==
+
== Add A Button ==
  
* Build the circuit that is detailed in the following figures. Use components and jumpers to construct your circuits on the solderless bread-board.
+
Most stomp boxes have a button, so we include that as well according to the following circuit:
  
[[Image:Breadboard.png]]
+
[[Image:SBbutton-circuit.jpg]]
  
* Here's how to wire a simple 2-resistor circuit on the solderless bread-board (for example R1 = 10K, R2 = 10K):
+
The corresponding picture of the bread board is shown below:
  
[[Image:Jumper.png]]
+
[[Image:SBcircuit5.jpg]]
  
What will A0 read?
 
  
(How do you know what resistor you have? Use the [http://www.dannyg.com/examples/res2/resistor.htm resistor calculator]!)
 
  
  
=== Build the Button and LED Circuit ===
+
== Add An LED ==
We'll start our tutorial with three simple light circuits.
+
  
* In the first one, the LED is permanently on.
+
Finally, we add a light-emitting diode (LED) for fun and to help with debugging. Recall that current can only flow in one direction through a diode. One good trick to remember for LEDs is that the longer leg (the anode) points toward the power supply. The 220 Ohm resistor limits the amount of current that can flow through the LED.
* In the second, the LED only lights up when a button is pressed and a circuit is completed.
+
* In the third example, we'll replace the manual switch with an Arduino pin (set to output mode), so we can control the LED from our program.
+
  
[[Image:3Buttons.gif]]
+
[[Image:LEDPWMSchematic.jpg]]
  
==== Power a LED (always on) ====
+
[[Image:SBcircuit6.jpg]]
  
[[Image:Lab2-3.jpg]]
 
  
Build the following circuit on your breadboard. Use a 220Ohm resistor (red red brown gold).
 
  
Because the LED is a diode, it has a set voltage drop across the leads; exceeding this causes heat to build up and the LED to fail prematurely. So! It is always important to have a resistor in series with the LED.
 
  
Also, another consequence of the LED being a diode is that it has directionality. The longer lead, the anode, should be connected towards power; the shorter, cathode, should be connected towards ground. (In the photo, the longer lead has a bent "knee.")
+
== Test The Tremolo Effect ==
  
==== Make a light switch ====
+
Now you will test a very simple tremolo effect.
  
Next, we'll insert a switch into the circuit. The momentary switches in your kit are "normal open", meaning that the circuit is interrupted in the idle state, when the switch is not pressed. Pressing the switch closes the circuit until you let go again.
+
* Connect headphones or some small loudspeakers to the ''audio out'' jack on the Beagle Board. (It is the one closer to the middle of the board.)
 +
* Connect an input audio source, such as a small MP3 player or instrument the audio output of the jack on the Beagle Board.
 +
* Start pd by running <tt>pd &</tt>
 +
* Open the patch <tt>~/pd/stompbox/startup-stompbox/startup-stompbox.pd</tt> using the File|Open menu option.
 +
* Start audio signal computation by checking the ''compute audio'' button in the main pd window.
 +
* The oscillator's output should be displayed by the horizontal slider and LED in real time. (If not, please go back and make sure you carried out all of the previous instructions.)
  
[[Image:Lab2-4.jpg]]
+
[[Image:SBsimple-stompbox.png]]
  
Use a multimeter to see what happens to the voltage on either side of the LED when you press the switch.
 
  
==== Toggling LED with PD or Max ====
+
* Verify that turning the potentiometer connected to input pin A3 on the Arduino adjusts the value A3 shown in the main patch window. This should also change the output volume of the effect.
 +
* Verify that turning the potentiometer connected to input pin A0 on the Arduino adjusts the oscillator frequency.
  
[[Image:Lab2-5.jpg]]
+
* Look inside the subpatch <tt>pd user-interface</tt>, which access the Arduino, and figure out how you could access data coming from the other analog inputs. Would you need to add an outlet to the subpatch?
 +
* Verify that when you press the button, the ''mode'' checkbox changes its state. Modify the effect to so that the mode checkbox implements a bypass switch. We will ask some volunteers in class the following morning to explain how to do this.
  
In the third example, we'll replace the manual switch with an Arduino pin (set to output mode), so we can control the LED from our program. The safe way to do this is to let the Arduino pin sink current - if we toggle the pin low, it acts as ground and current flows through the resistor and the LED as it did in the previous examples. When we take the pin high, to 5V, there is no potential difference and no current flows - the LED stays off.
 
  
* In the ArduinoLab patch, press the "toggling LED with software" button in the upper right to preset the outputs properly. The patch expects you to connect the LED to digital pin 2 (D2).
 
  
  
Optional: Try changing your patch so the light stays on when you press the mouse button, and stays off when you press it again. After that, change your patch so the light blinks on/off. Then, have your patch button switch the light between on and blinking.
+
== Build A Wah Effect ==
  
=== Sensing buttons in software  ===
+
* Open the file ''wahwah.pd'' and play around with the filter parameters for a while.
 +
* Note that there is no way to adjust the parameters without a graphical user interface. Take the ''pd user-interface'' object from the previous patch, and modify it to control the Wah effect parameters in a sensible way. Get ready to rock out!
 +
* Optional: Find a potentiometer that can be adjusted with your foot (e.g. talk to Edgar) and wire it into the circuit to make the wah effect control complete!
 +
* Alternative optional activity: Look inside how the filters are adjusted and make your own filter design.
  
We've used code to trigger output - what about the other direction, sensing physical input in code? Just as easy. Here is a simple switch circuit:
 
  
[[Image: switch.png]] [[Image: Lab2-6.jpg]]
 
 
When the switch is open, the Arduino pin (set to input mode) is pulled to 5V - in software, we'll read Arduino.HIGH. When the switch is closed, the voltage at the Arduino pin falls to 0V - in software, we'll read Arduino.LOW. The pull-up resistor is used to limit the current going through the circuit. In software, we can check the value of the pin and switch between graphics accordingly.
 
  
* In the ArduinoLab patch, press the "sensing buttons in software" button to preset the outputs properly. The patch expects you to connect the switch to digital pin 4 (D4).
 
  
=== Fading LEDs (optional) ===
+
== Optional: Build A New Effect ==
  
What about those "breathing" LEDs on Mac Powerbooks? The fading from bright to dim and back is done using pulse-width modulation (PWM). In essence, the LED is toggled on and off rapidly, say 1000 times a second, faster than your eye can follow. The percentage of time the LED is on (the duty) controls the perceived brightness. To control an LED using PWM, you'll have to connect it to one of the pins that support PWM output - 9, 10 or 11 on the Arduino. Then write a patch that cycles the PWM values.
+
* Build a new effect whose parameters are adjustable by the potentiometers and button. We will ask for volunteers to demonstrate this the following morning in class. You can build on what you did in lab 1 if you like.
  
* In the ArduinoLab patch, press the "Fading LEDs" button to preset the outputs properly. The patch expects you to connect the LED to digital pins 9-11 (D9-11).
+
* Think about the result
* In your Arduino Kit, you have a RGB LED which has four leads (it's white when not lit); it's basically like 3 LEDs sharing the same ground. Use PWM and this [[http://blog.ncode.ca/?p=38 pin out information]] to make the LED cycle through a rainbow of colors.
+
** do the controls allow the entire space of parameters to be explored?
 
+
** is it easy to choose any desired set of parameters?
[[Image: Lab2-7.jpg]]
+
** does the effect sound good?
 
+
== Using Analog Sensors ==
+
 
+
Now we will work with the continuous input values provided by analog sensors - potentiometers, accelerometers, distance rangers, etc.
+
 
+
=== Make a Light Dimmer ===
+
 
+
In this example we'll build a light dimmer: a knob connected to a light so that when you turn the knob, the light increases or decreases in brightness. We'll use a potentiometer. The potentiometer has three terminals - the resistance between the first and the third terminal is constant (10k Ohms in our case). The resistance between terminals 1 and 2 (and between 2 and 3) varies as you turn the shaft of the potentiometer. If you apply 5V to terminal 1, connect terminal 3 to Ground, you will get a continuously varying voltage at terminal 2 as you turn the shaft (Why that is the case will become clearer once you've learned about voltage dividers further below).
+
 
+
* Connect the middle pin of the potentiometer to analog input 0, the other two to +5V and ground.
+
* Through a 220Ohm resistor, connect an LED to pin 9(anode or long side to resistor, cathode to pin 9) 
+
* In the ArduinoLab patch, press the "Light Dimmer" button to preset the outputs properly. The patch expects you to connect the LED to digital pin 9 (D9) and the potentiometer to analog pin 0 (A0). Use the PWM controls under output controls in the ArduinoLab patch to control the lightness and dimness of the LED.
+
 
+
 
+
 
+
 
+
 
+
[[Image: Lab2-8.jpg]]
+
 
+
* Optional: hook up two LEDs, one red one green. as you turn in one direction, red gets brighter; in the other, green gets brighter. In the middle, both are off.
+
 
+
=== Drawing a graph of analog input ===
+
Let's understand better what the values are that we are reading from the analog input. To do so, we will use a slider graph to show how the analog values are changing in time.
+
 
+
Leave the potentiometer part of your circuit, you may take off the LED part if you want to. Use A0 or A1 to graph the analog input in the ArduinoLab patch.
+
 
+
 
+
=== Thresholding with a Range Sensor (optional) ===
+
 
+
Thresholding is the process of turning continuous data into a discrete yes/no decision.
+
 
+
To learn about thresholding, we'll connect the IR range sensor. The circuit is trivial: just connect red to 5V, black to ground, and yellow to analog input A0.
+
 
+
Take a look at the data the sensor returns with sensor_graph_02 - when the field of view of the sensor is clear (no obstacle - point it at the ceiling), it returns a low voltage. Move your hand high over the sensor, then start lowering it - you should see the output voltage rise, until you are about 4" away. The sensor has a range of operation of 4"-30".
+
+
Let's do something useful with that data. Imagine a smart cookie jar that reminds you not to snack in between meals. We could put an IR ranger into the lid. Whenever a hand comes too close, our program could play a warning sound or flash a warning light. Write a patch to manage this!
+
 
+
=== Tilt control with an Accelerometer ===
+
In this example, we'll simulate the motion of a ball on a tilting plane in software and control the tilt through a sensor. Think of it as a first step to build your own electronic game of Labyrinth. The right sensor to use is an accelerometer. Accelerometers can report on both static and dynamic acceleration -- think of static acceleration as the angle the accelerometer is held with respect to the ground (the acceleration measured here is due to gravity). Dynamic acceleration occurs when you shake the sensor.
+
 
+
[[Image:Lab2-9.jpg]]
+
 
+
The accelerometer in your kit is a 2-axis, +-2g sensor (1g is the acceleration due to gravity). It comes with 0.1" header pins that fit into the breadboard. The connections you need to make are VCC to power from the Arduino, GND to ground, and X, and Y to the first two analog input pins on the Arduino board. You can ignore the Z axis and ST (self test) pin.
+
 
+
Push the accelerometer into the breadboard and make the connections as shown:
+
 
+
[[Image:accel_on_board.jpg]]
+
 
+
 
+
 
+
Now, get a feel for the data the accelerometer provides. Use the Light Dimmer presets, which will track analog values on A0 and A1. Then pick up the Arduino+accelerometer board and tilt it in various directions. Start by holding it so that the accelerometer board is parallel to the ground. Find in which direction the X reading increases and decreases; do the same for the Y reading.  Are the labels on the accelerometer board correct?
+
 
+
=== Voltage Dividers ===
+
 
+
In your kit, the potentiometer, IR distance ranger, and accelerometer are especially easy to work with since they directly output a changing voltage that can be read by one of Arduino's analog input pins.
+
 
+
 
+
Other sensors don't give you a varying output voltage per se, but instead change their resistance. Examples in your kit are the force sensitive resistor (FSR) and the bend or flex sensor. It is easy to get a changing voltage based on a changing resistance through a voltage divider circuit ([http://en.wikipedia.org/wiki/Voltage_divider Wikipedia page]). The idea is that you put two resistors in series between power and ground: one that changes resistance (your sensor), and one of a known, fixed resistance. At the point in between the two resistors, you can measure how much the voltage has dropped through the first resistor. This value changes as the ratio of resistances between variable and fixed resistors change. More formally:
+
 
+
[[Image:res_divider.png]]
+
 
+
* potentiometer:
+
 
+
[[Image:Pot.png]]
+
 
+
* force-sensitive resistor (FSR):
+
 
+
[[Image:FSR.png]]
+
 
+
Try both circuits.  Test the resistance range of your sensor.  If you want 2.5 volts to be the middle, make the comparison resistor (33k in the diagram) the "average" value of the FSR's resistance. Test this with a multimeter.
+
 
+
* Bend Sensor
+
[[Image:Bend_sensor.png]]
+
 
+
== Putting it all Together ==
+
 
+
* Create a patch to make sounds based on button and sensor values from the Arduino. You can try to adapt your patches from Lab 1, or come up with a new patch.
+
 
+
* Try to make a simple musical interaction. Think about music -
+
 
** does it have dynamics?
 
** does it have dynamics?
** can you turn the sound off?
+
** would you want to use it live?
** can it be expressive?
+
*** If not, what is missing still?
 
+
 
+
 
+
  
  
  
== Appendix: Install Firmata onto your Arduino Nano ==
 
* Install the Arduino software
 
** Unarchive the file, and move it to your applications folder.
 
** Install the FTDI driver that comes with the Arduino software so that your computer will recognize the Arduino when it is plugged into the USB port.
 
* Unarchive the Firmata firmware that you downloaded previously.
 
* Connect your Arduino Nano to your computer using a USB cable.
 
* Open StandardFirmata the Arduino software pull-down menus Examples|Firmata.
 
* Use Tools->Board and Tools->Serial Port to select the Arduino Nano (Atmega 328) and USBserial tty port, then hit the Play button to verify and compile the program.
 
* Upload the Firmata firmware to your Arduino Nano using upload button, the fourth square button from the left (the one with the sideways arrow).
 
* Close the Arduino program. (This is important because it frees up the USB serial port so that Max or PD can talk to the Arduino board next.)
 
  
 +
== Important Note ==
 +
Some small amount of the text and images here was taken from prior laboratory exercises for the course [https://ccrma.stanford.edu/courses/250a/ Music 250A]. We regret that we do not know who contributed these elements, but these people are likely to include Wendy Ju, Bill Verplank, Michael Gurevich, and possibly more.
  
  
<center>[[250a 2009]]</center>
+
<center>[[Stompbox 2011]]</center>
[[Category:250a]][[Category:PID]]
+
[[Category:Stompbox 2011]][[Category:PID]]

Latest revision as of 13:11, 24 July 2012

Lab 2: Controlling an Effect with Real Sensors
Designed by Edgar Berdahl

Due on Wednesday, July 20th at 9AM


Log In

Log in to your kit as usual.

Don't forget to run sudo pkill pd to stop any default patch from running.



Appendix: Install Stompbox Firmware onto your Arduino Nano

  • Use the USB cable to plug the Arduino Nano into the Beagle Board.
  • From the terminal, run the command arduino & to start up the Arduino software.
  • From the menu Tools|Board choose Arduino Duemilanove or Nano w/ 328
  • From the menu Tools|Serial port choose /dev/ttyUSB0
  • Open the sketch /home/ccrma/pd/stompbox/startup-stompbox/FirmataAllInputs_ExceptOnePWMOut/FirmataAllInputs_ExceptOnePWMOut.pde
  • Press the Verify button.
  • Check the Arduino messages window to make sure that the code successfully compiled. (Usually, it will say something like Done compiling and Binary sketch size ...)
  • Press the Upload button (looks like an arrow pointing to the right) to install the firmware on the Arduino.
  • Check the Arduino messages window to make sure that you have successfully uploaded the firmware.



Power Connections

  • In order to run circuits on the breadboard, you need to get power to it. The Arduino gets 5V from the USB connection, so in this section you will make the 5V accessible to the breadboard.
  • Make sure that your Arduino is mounted at the very end of the breadboard with the higher-numbered rows, as shown in the following picture. In that case, the GND and 5V pins will end up in the 19th row. (Otherwise if your Arduino isn't mounted this way, you simply won't be able to rely on the row numbers, but you can still figure out how to wire things up!)
  • Recall first that that holes in the solderless bread board are wired together as shown:

Breadboard.png

  • Using short jumpers, connect the GND row to the blue "GND" bus on the breadboard, and connect the 5V row to the red "power" bus on the breadboard.
  • Connect the "GND" and "power" busses from both sides of the breadboard together as shown.

Circuit0-big.jpg


Viewed from further away, your breadboard should now look like the following:

Circuit0.jpg



First Circuit: Potentiometer

Now you will build the following voltage divider circuit, to connect one potentiometer to analog input A0.

Pot-A0.jpg

For some help on placing the wires, please see the following picture. In order to ensure the correct orientation, ensure that the text on the potentiometer is facing away from the Arduino (see also oblique picture in next section). Circuit2.jpg



Add A Second Potentiometer

Now connect a second potentiometer to analog input A3 using the same voltage divider circuit.

SBcircuit3-direct.jpg


Again, ensure that the text on the potentiometer is facing *away* from the Arduino (see the red boxes in the following figure):

SBcircuit3.jpg



Add A Button

Most stomp boxes have a button, so we include that as well according to the following circuit:

SBbutton-circuit.jpg

The corresponding picture of the bread board is shown below:

SBcircuit5.jpg



Add An LED

Finally, we add a light-emitting diode (LED) for fun and to help with debugging. Recall that current can only flow in one direction through a diode. One good trick to remember for LEDs is that the longer leg (the anode) points toward the power supply. The 220 Ohm resistor limits the amount of current that can flow through the LED.

LEDPWMSchematic.jpg

SBcircuit6.jpg



Test The Tremolo Effect

Now you will test a very simple tremolo effect.

  • Connect headphones or some small loudspeakers to the audio out jack on the Beagle Board. (It is the one closer to the middle of the board.)
  • Connect an input audio source, such as a small MP3 player or instrument the audio output of the jack on the Beagle Board.
  • Start pd by running pd &
  • Open the patch ~/pd/stompbox/startup-stompbox/startup-stompbox.pd using the File|Open menu option.
  • Start audio signal computation by checking the compute audio button in the main pd window.
  • The oscillator's output should be displayed by the horizontal slider and LED in real time. (If not, please go back and make sure you carried out all of the previous instructions.)

SBsimple-stompbox.png


  • Verify that turning the potentiometer connected to input pin A3 on the Arduino adjusts the value A3 shown in the main patch window. This should also change the output volume of the effect.
  • Verify that turning the potentiometer connected to input pin A0 on the Arduino adjusts the oscillator frequency.
  • Look inside the subpatch pd user-interface, which access the Arduino, and figure out how you could access data coming from the other analog inputs. Would you need to add an outlet to the subpatch?
  • Verify that when you press the button, the mode checkbox changes its state. Modify the effect to so that the mode checkbox implements a bypass switch. We will ask some volunteers in class the following morning to explain how to do this.



Build A Wah Effect

  • Open the file wahwah.pd and play around with the filter parameters for a while.
  • Note that there is no way to adjust the parameters without a graphical user interface. Take the pd user-interface object from the previous patch, and modify it to control the Wah effect parameters in a sensible way. Get ready to rock out!
  • Optional: Find a potentiometer that can be adjusted with your foot (e.g. talk to Edgar) and wire it into the circuit to make the wah effect control complete!
  • Alternative optional activity: Look inside how the filters are adjusted and make your own filter design.



Optional: Build A New Effect

  • Build a new effect whose parameters are adjustable by the potentiometers and button. We will ask for volunteers to demonstrate this the following morning in class. You can build on what you did in lab 1 if you like.
  • Think about the result
    • do the controls allow the entire space of parameters to be explored?
    • is it easy to choose any desired set of parameters?
    • does the effect sound good?
    • does it have dynamics?
    • would you want to use it live?
      • If not, what is missing still?



Important Note

Some small amount of the text and images here was taken from prior laboratory exercises for the course Music 250A. We regret that we do not know who contributed these elements, but these people are likely to include Wendy Ju, Bill Verplank, Michael Gurevich, and possibly more.


Stompbox 2011