Instructables

Electronic Instrument

Featured
Picture of Electronic Instrument
front2.jpg
side.jpg
glitchmain3.jpg
schematic.jpg
This electronic instrument allows you to sequence and loop audio and MIDI data.  Most of the time I use it to sequence drum samples so I can play around with different beats and rhythms.  The really great thing about this instrument is that it is very portable, it fits in your hands easily, runs off a single 9 volt battery, and has a headphone jack that you can plug into.  If you connect it to your computer via usb you can also use it to send MIDI data, this way you can communicate with other electronic instruments or software environments that understand MIDI. 


Parts List:

(x1) Arduino Uno (Duemilanove is fine, but make sure it is ATMEL328P) Radioshack #276-128
(x1) Arduino ProtoShield Radioshack #276-140
(x1) PC Board with Copper Radioshack #276-147
(x9) High Tact Switch Radioshack #275-002  (I really liked the feel of these buttons, but they only come in a surface mount version, which makes them fairly difficult to solder because of the small leads.  Additionally, since these buttons are square it is harder to drill a hole for them in an enclosure.  If you are a beginner, you might want to use a different type of button, any of these momentary switches will work)
(x1) 10KOhm Audio Control Potentiometer with SPST Switch Radioshack #271-215 (this will be used to control volume and turn the device on/off)
(x1) 50K-Ohm Linear-Taper Potentiometer Radioshack #271-1716
(x2) 220µF 35V 20% Radial-lead Electrolytic Capacitor (or anything between 200 and 300 uF) Radioshack #272-1029
(x2) SPST PC-Mountable Submini Toggle Switch Radioshack #275-645
(x2) Silver Tone Knurled Knob (or any knob with 0.25" inner diameter) Radioshack #274-424
(x9) 1N914/4148-Type Diode (two packages) Radioshack #276-1122
(x3) 2K ohm 1/2W 5% Carbon Film Resistor (1 package)
(x10) 10K Ohm 1/4-Watt Carbon Film Resistor (2 packages) Radioshack #271-1335
(x8) 20K Ohm 1/4-Watt Carbon Film Resistor (2 packages)
(x1) 4.7K Ohm 1/4-Watt Carbon Film Resistor Radioshack #271-1330
(x1) 1K Ohm 1/4-Watt Carbon Film Resistor Radioshack #271-1321
(x1) 5K Ohm 1/4-Watt Carbon Film Resistor
(x1) 9V Alkaline Battery Radioshack #23-853
(x1) Heavy-Duty 9V Snap Connectors Radioshack #270-324
(x1) Amber Super-bright LED Indicator Radioshack #55050630
(x1) White Super-bright LED Indicator Radioshack #55050633
(x1) 1/8" Stereo In-Line Audio Jack Radioshack #274-274
(x1) LM386 Low Voltage Audio Power Amplifier (8-Pin DIP) Radioshack 276-1731
(1x) 8 Pin Socket 276-1995 Radioshack 276-1995

Additional materials:

22 Gauge Wire Radioshack #278-1224
Solder Radioshack #64-013
drill
plywood
polyurethane finish
sand paper
hot glue
super glue
four wood screws
Heat Shrink Wrap Radioshack #278-1610
Electrical Tape Radioshack #64-2375

I've included fritzing breadboard diagrams (divided into a few parts) and schematics for this project as well as all firmware.  You can find these documents throughout the body of this instructable or download them all in one zip file below.

 
Remove these adsRemove these ads by Signing Up

Step 1: Build enclosure

Picture of Build enclosure
IMG_1728.JPG
Screen shot 2012-03-23 at 12.30.51 PM.png
Screen shot 2012-03-23 at 12.31.11 PM.png
Screen shot 2012-03-23 at 12.34.33 PM.png
Screen shot 2012-03-23 at 8.24.14 PM.png
I used AutoCAD, Autodesk 123D Make, and CorelDRAW to design my project enclosure.  I've attached the AutoCAD, STL, and the EPS files for the enclosure I built below.  Then I sent my EPS files to a laser cutter and cut them out of 0.2" plywood.  I also cut a front panel out of 3mm acrylic.  If you do not have access to a laser cutter, you can buy a project enclosure or find a spare box and drill holes in it for all your components, be creative!

I wanted to sand off the scorched ends of the laser cut pieces so that the outside of the box had a consistent finish, so I also made a set of eps files with some extra length on the ends for sanding ("enclosure long").

I glued the pieces together with wood glue and cut a piece of acrylic for the front panel.

Step 2: Wire buttons

We need to wire the buttons to the Arduino so that we can monitor whether or not they have been pressed.  But if we use one input pin for each button we will need to use nine of the arduino's 20 pins.  In order to reduce this number down to only six pins, I used a technique called multiplexing.
As shown in figures 11 and 12, multiplexed buttons are wired such that each button shares a common lead with all the buttons in its row, and it shares the other lead with all the buttons in its column.  This way we can use the arduino to ground one row of buttons at a time (Arduino D8, D9, D10) and check to see if any of the columns are grounded by measuring the voltage of A0, A1, and A2.  Essentially, we will be measuring the states of the buttons row by row.  Since the Arduino is very fast, we will not be able to tell a difference in the response time of the buttons when they are multiplexed vs if we had dedicated one input pin to each button.
Multiplexing buttons does bring some complications.  Since current can flow in both directions through a button, if two buttons are depressed at the same time, current can flow through the circuit in ways we did not intend and make us think that four buttons are depressed.  In order to prevent this, each button is attached to a diode, ensuring current always flows through the buttons in one direction.
Buttons work in the same way as switches, they close an open circuit.  Most buttons have two leads (figure 9), but some (like the ones I used) have four leads because each side of the switch is split into two separate leads.  By comparing figures 9 and 10, you can see that both types of buttons are essentially the same, but if you use the four lead buttons, be sure to check the specs to locate two leads that are not connected to each other.

Solder a diode to one side of each switch, be sure that the "-" end (usually indicated with a stripe) is facing away from the switch.  Solder a (preferably black) wire to the other end of the diode and a (preferably red) wire to the other side of the switch.  Do this for all nine switches.  You may find it necessary to use hot glue, electrical tape, or heat shrink to reinforce/protect these connections.
Once soldered, mount each button in your project enclosure.

You can find the fritzing files for 2-lead button and 4-lead button multiplexing below.

Step 3: Prepare arduino shield

Picture of Prepare arduino shield
IMG_1779 1.JPG
IMG_1781 copy.jpg
IMG_1782 1.JPG
IMG_1783 copy.jpg
The Arduino proto-shields are a convenient way to attach circuits to an Arduino, but I like to trim them down a little bit first so they do not take up so much room in the project enclosure.   Start by trimming the pins down with a pair of wire cutters.  Next, cut off the six pin socket.  Finally, cut the sockets from the top of the board.

Step 4: Wire buttons on arduino shield - part 1

Picture of Wire buttons on arduino shield - part 1
IMG_1787.JPG
IMG_1790 copy.jpg
IMG_1791.JPG
Solder three 2kOhm resistors on the proto-shield so that they are five pins from analog pins 0, 1, and 2 (see figure 1) and cut away the excess lead wire.  On the underside of the board, solder the resistor leads farthest from analog pins 0, 1, and 2 together and connect them to 5V using a jumper wire.  Use three small jumper wires (I used the scrap wire from the resistor leads), connect analog pins 0, 1, and 2 to the three nearest soldering points.

Step 5: Wire buttons on arduino shield - part 2

Solder the red wires (the lead not connected to the diode) from the buttons to the protoboard.  Solder the leads from buttons 0, 3, and 6 in line with analog pin 2, buttons 1, 4, and 7 with analog pin 1, and buttons 2, 5, and 8 with analog pin 2.  Clip the excess wire from each of these connections and solder all the adjacent points togther on the underside of the board (see figure 2).  Each of the buttons should now be electrically connected to an analog pin and one of the 2k resistors.

Again, I've provided the circuit diagrams and fritzing documents for both 2-lead and 4-lead buttons.

Step 6: Wire buttons on arduino shield - part 3

Solder the black wires (the lead connected to the diode) from the buttons to the protoboard.  Solder the leads from buttons 0, 1, and 2 in line with digital pin 8 buttons 3, 4, and 5 with digital pin 9, and buttons 6, 7, and 8 with digital pin 10.  Clip the excess wire from each of these connections and solder all the adjacent points togther on the underside of the proto-shield (see figure 2).  Each of the buttons should now be electrically connected to one of the digital pins.

2-lead and 4-lead diagrams and fritzing are provided here, again.

Step 7: Sand enclosure

Picture of Sand enclosure
IMG_1921.JPG
IMG_1922.JPG
IMG_1923.JPG
This is a good time to sand down the enclosure if necessary.

Step 8: Mount and wire LEDs

Picture of Mount and wire LEDs
IMG_1941.JPG
IMG_1943 copy.jpg
IMG_1951.JPG
IMG_1953.JPG
IMG_1952.JPG
I mounted my indicator LEDs early so I could sand the tops down while finishing the wood in the rest of the enclosure.  Sanding down the top of LEDs gives them a frosted surface which makes them nice and diffuse.  I used some super glue to fit the LEDs inside two 5mm holes, I left the top parts sticking out so that it could be sanded flush with the enclosure surface.

Attach the shorter leads of both LEDs to each other (grounds) and connect to the ground pin of the arduino protoshield.  Attach a current limiting resistor to each of the longer leads of both LEDs.  The optimum resistor value can be calculated as follows:

R>=V/I
where:
R is resistance across the resistor measures in ohms
V is forward voltage in volts from LED specs
I is continuous forward current measured in amps from LED specs

For most through hole LEDs the forward voltage will be about 2-3.5V and the current will be 15-25mA.  You can check the datasheet of the LEDs you bought to calculate the lowest possible resistor values for your LEDs.  I chose to use resistors that were much higher than I needed, beacuse I didn't want the LEDs to be blindingly bright.  I ended up using a 1k resistor for the amber LED and a 4.7k resistor for the white LED, these values may be different depending on what type of LEDs you use and how bright you want them, but 1k is a good place to start.

I've attached the fritzing document which includes the LED wiring below.

Step 9: Tempo pot

Picture of Tempo pot
Screen shot 2012-04-04 at 2.16.59 PM.png
Screen shot 2012-04-04 at 2.17.07 PM.png
Solder three leads onto a 50kOhm linear taper pot.  Connect one side to ground (black wire), the other to 5V(red wire) and the middle pin(green wire) to analog pin 5 on the Arduino shield.

Step 10: DAC

DAC stands for "digital to analog converter."  We need a DAC because the audio data stored in the Arduino is digital, and we must convert it to an analog waveform before sending it to speakers.  A simple way to do this is to use something called an R2R resistor ladder.  You can think of it as a multi-leveled voltage divider.  It takes incoming digital bits (+5v and ground from Arduino), weights them, and sums them to produce a voltage level between ground and 5 volts.
The resistor ladder for this project is an 8-bit DAC.  As you can see in the schematic, Arduino PORT D (digital pins 0-7) output 8 pieces of data (one from each pin) which are sent to each junction of the DAC.  I soldered these resistors on a piece of copper plated protoboard I cut down to size.
I added two 0.1uF capacitors to the end of the resistor ladder to act as a low pass filter.  This type of filter will remove the higher frequencies caused by the low (8khz) sampling rate of the audio and smooth out the waveform.  You may choose to change the values of these capacitors depending on what you like.

There are 10 connections to the DAC, 8 digital input pins from the arduino, ground, and audio out.  The green wire in figure 6 is audio out, this wire will connect to the amplifier in the next step.  You can find the fritzing file below.

Step 11: Amplifier

Picture of Amplifier
Screen shot 2012-03-19 at 12.57.40 PM.png
IMG_2003.JPG
IMG_2004.JPG
IMG_2005.JPG
IMG_2011.JPG
I cut another piece of protoboard to create the amplifier circuit.  Many suggested wiring diagrams of the LM386 can be found on the datasheet; the simplest diagram is reproduced in figure 2.  I used a variant of this circuit which does not include the 0.05uf cap and 10ohm resistor.  Also, instead of a 10k potentiometer, I sent a fixed voltage to pin 3 of the LM386 using two resistors in a voltage divider configuration.  I only had a 220uf capacitor when I was putting my project together, so I used it instead of the 250uf.  Additionally, our audio out will be sent to another pot for volume control before being sent to speakers.

Find the fritzing file below.

Step 12: Wire volume(gain) control pot

Volume or gain of the audio signal will be controlled with the 10k audio taper pot with switch.  Connect the audio out from the amplifier and ground to either side of the potentiometer.  The middle is audio out, it will be hooked up directly to the audio jack.

Also connect a wire to the bottom and left leads on the back of the pot (figure 2).  This is the switch that will be used to connect to power later.

Step 14: Battery

Picture of Battery
IMG_1982.JPG
IMG_2014.JPG
Screen shot 2012-04-04 at 2.16.59 PM.png
Solder the red lead from the 9V battery connector to the top left swtich input on the volume control pot as shown in figure 2.  Then solder the bottom lead from the switch to a wire and connect that wire to Vin on the arduino shield.  This way, when the pot is turned clockwise it will click and connect these two leads.

Step 15: Headphone jack

Remove the plastic casing from the headphone jack.  Solder the audio out from the gain pot (middle lead) to both stereo channels of the headphone jack.  Solder ground to the jack.  You may want to use some hot glue to reinforce these connections and make sure that they do not short out.

Step 16: Install components in enclosure

Place all finished components in enclosure and secure with glue if necessary.  I used super glue to secure the headphone jack and switches.  Remove side pin from the pots (figures 3 and 4) and secure with nuts on outside of enclosure (figure 5).  Connect battery and fit inside enclosure.  Cover the exposed circuitry of the DAC and amplifier with electrical tape to prevent short circuits and fit inside enclosure.

Step 17: Screw on back

Picture of Screw on back
If necessary, screw back panel on.

Step 18: Firmware

Picture of Firmware
This instrument can do two different things:
-it can be used as a standalone audio device, with the audio data stored in the arduino's flash memory
-it can also be used to sequence MIDI through a usb connection to your computer

These two functions require two separate pieces of firmware which are described in more detail in the next two steps (download them below).  This means if you would like to use it as a MIDI instrument you need to load the MIDI firmware, then if you would like to switch over to audio you should load the audio firmware.

Step 19: Audio firmware

Picture of Audio firmware
The audio firmware is the most simple to set up.  Download the Arduino sketch provided below and load it onto your board.  Once the firmware is loaded, unplug the usb connection and turn off the device (turn the gain pot until it clicks off).  Turn the device on, after a moment you should see the white LED turn on.  Plug in your headphones and slowly turn up the gain pot while pressing one of the front panel buttons repeatedly until the volume is where you like (be careful not to turn up the volume too high!).  I've loaded 9 default sounds in the firmware, try out all the buttons and make sure you can hear all of them.

Once all of your audio is working correctly, flip the record switch, the white LED should turn off and the orange should turn on.  Play a short sequence with the buttons and flip the white switch again when you want to start looping the audio you've just played.  The white LED should start start blinking on the beat and you should hear your sequence looping.

Flip the mute switch to mute what you've recorded, flip it again to bring it back.

Flip the record switch to record additional audio on top of your recorded sequence, this time you will see the orange LED blinking with the beat.

Step 20: MIDI firmware

Picture of MIDI firmware
To use this device as a usb MIDI instrument you will need to run a serial to MIDI app.  I have written one in MaxMSP called "MIDIroute," if you don't have MaxMSP, download MaxMSP Runtime (it is free and located on the right side of the page).  In the app, you can select your MIDI out channel and change MIDI note and velocity values (see the comments).  When you have the instrument connected to your comp via usb and the app MIDIroute is initialized properly, you should see the grid light up orange as you press a button.  If you have just loaded the arduino firmware, you may need to quit Arduino and then briefly disconnect the usb connection to you computer and reconnect to establish a serial connection to MaxMSP.

Read the instructions on the last step to find out how all the controls should work.

Step 21: Editing the firmware

Picture of Editing the firmware
If you would like to make changes to the firmware, please read the comments I have provided.  The more important comments are written in the following format:

/*********************************************
IMPORTANT COMMENTS
*********************************************/

these comments will let you know how to make some simple changes such as:
-where to insert new stored audio data
-how to change the resolution of the sequencer (16 step, 32 step...)

Step 22: Prepare audio files

Picture of Prepare audio files
Screen shot 2012-04-06 at 4.14.03 PM.png
Screen shot 2012-04-06 at 4.16.10 PM.png
Screen shot 2012-04-06 at 4.26.09 PM.png
IMG_1767 copy.jpg
Customize your instrument by loading your own audio files onto it!  Since all audio is stored on the memory of the Arduino, you'll need to compress it heavily to get it to fit.  This device uses 8 KHz, 8-bit mono audio that has been converted into an array of bytes.  You're only going to be able to store about 4 seconds of audio total, so keep the nine samples very short!

Down sample the audio in iTunes:
-import your sample into iTunes
-open Preferences and select "Import Settings" (figure 1)
-select import using mp3 encoder and custom settings (figure 2), this will open another dialog box (figure 3)
-copy the settings from figure 3 - “Stereo Bit Rate” of 16 KHz, a “Sample Rate” of 8 KHz, and Mono “Channels”
-right click on the files you want to convert and select "create mp3 version", listen to it to get an idea of what it will sound like, 8kHz is very compressed, so high frequencies will be attenuated
-remember to change your iTunes settings back after you are done.

Convert to byte array:
-Download the Encode Audio Processing sketch below for mac, windows, or linux.  This program was provided by the people at high low tech
-open Encode Audio
-you will be prompted to select the file you wish to encode
-a dialog box will appear letting you know that the data has been saved to your clipboard

Insert in Arduino Firmware:
-paste the data into one of the sample# storage spaces (figure 4), it should be in the following form:

byte sample#[] PROGMEM = {PASTE HERE};

The position of the samples on the grid is given in figure 5.

Enjoy!

wmyers51 month ago

I was wanting to build something extremely similar to this, but i had hoped to be able to record input onto each of the pads. They dont necessarily need to be able to save after the unit is turned off, but i was curious if you had any thoughts on how to pull this off?

amandaghassaei (author)  wmyers51 month ago

this thing can record a bunch of button presses and then loop what you've played, is that what you mean?

No, I mean recording live audio through an input jack and then assigning it to one of the 9 buttons and then being able to press that button and play back the audio you just recorded, not a pre-recorded sample that is loaded onto the device from your computer. I was thinking more about this and realized how much more it complicates things (first off adding an input jack, then recording audio from it and FINALLY assigning it to a button). From there it would be nice to be able to maybe control the volume of each little sample/loop but that is a whole nother story! Sorry for all the comments, but I have been looking for something like this for so long and this is so close to what i want to build. I found another Arduino project that does the live recording I mentioned, but it doesnt have ANYWHERE near the memory capacity i was looking for where as i think your project might, any way to hybridize the two? The link for the other live sampling project is here: http://nootropicdesign.com/audiohacker/
amandaghassaei (author)  wmyers51 month ago

that thing looks cool. You just can store that much sound on the arduino's internal memory unfortunately. My instrument only has about 8-9 seconds of audio as well.

ThatCatMan3 months ago

Hey, could you make an instructable on JUST the project box, with all the sides, and the open top?

darenager5 months ago
Real nice, great design, great tutorial.
G-Silent8 months ago
Hi! Awesome project. I'm probably going to do this myself hehehe. Just a question: since you multiplexed the inputs, do the button react individually? as in can the buttona be pressed at the same time without issue? thanks
amandaghassaei (author)  G-Silent6 months ago
yes you can press as many buttons as you like at the same time, that's what the diodes are there for.
wizer6 months ago
Hi Amanda, sorry for so many questions on this. I'm kinda new to electronics and stumbling through this project. I've altered your design a little by adding 4 more buttons to make a 4x4 grid. Tonight I soldered all the diodes, wires and positive wires. It looks like you used a 5k resistor in your design per column? Typically I don't have any in stock. Before I buy some, do I need to adjust the value due to having 1 extra button per column? How do I work out the correct value resistor? -Tom
amandaghassaei (author)  wizer6 months ago
anything between 1k and 20k should work fine.
wizer7 months ago
Hey Amanda, Would this be a good alternative for the amp? http://www.ebay.co.uk/itm/130835477761
amandaghassaei (author)  wizer7 months ago
sure, you could also just get the lm386 chip and a couple of resistors and capacitors:
http://www.hobby-hour.com/electronics/lm386-20.gif
G-Silent8 months ago
Hi! Awesome project. I'm probably going to do this myself hehehe. Just a question: since you multiplexed the inputs, do the button react individually? as in can the buttona be pressed at the same time without issue? thanks
amandaghassaei (author)  G-Silent8 months ago
yes, the arduino only checks one button at a time, but it does it so fast that you would never know. it works with multiple inputs pressed at the same time. the key is the diodes, they prevent current from flowing in unintended ways when many buttons are pressed at once.
G-Silent8 months ago
Hi! Awesome project. I'm probably going to do this myself hehehe. Just a question: since you multiplexed the inputs, do the button react individually? as in can the buttona be pressed at the same time without issue? thanks
markgoebel10 months ago
Amanda!!! Fantastic news. I got the buttons to work. A fine lesson is diodes and having them face the same direction. Now that that is solved, I still am having some issues. In order to get this to work, I've had to delete ports from the serial object in Max. I also have to upload the Arduino sketch every time. Any thoughts?
amandaghassaei (author)  markgoebel10 months ago
you don;t have to delete the ports or reupload the firmware, you just need to follow these steps:
close everything, arduino and max
plug in arduino
open max
does that work?
Sorry for all my posts. After installing the Audio Firmware, playing around, then installing the MIDI firmware and turning on Max I have successfully been able to get the buttons to work without any messing with the Serial port. Thanks for all your help. Onto the next phase of soldering this together.
amandaghassaei (author)  markgoebel10 months ago
fantastic
No and I'm starting to think this is a bug in Max 6. I've already experienced other bugs in Max. I'll do some more research.
amandaghassaei (author)  markgoebel10 months ago
what is the bug?
Well, I have to delete ports a and b in the Serial object in Max 6 to get your patch to work with my breadboard. I shouldn't have to do that. I have seen others have a similar issue with the Serial object in Max 6. It's my guess since I'm new to this hobby.
Just for kicks I uploaded the audio firmware and clicked on the monitor and this is the printout I got. All the buttons light up LED 13 though... I was expecting 1's and 0's for on and off...

ÿ€ÀÀÀÀÀ€ÀÀÀÀÀÀ€À€ÀÀ€À€€ÀÀÀ€ÀÀÀÀÀ€À€ÀÀ€À€À€€€€ÀÀ€€À€€€ÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€€À€€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€ÀÀ€€À€À€À€À€ÀÀÀÀÀÀÀ€À€À€À€ÀÀÀÀ€€ÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀÀ€€ÀÀÀ€À€€À€ÀÀÀÀÀÀÀÀ€À€ÀÀÀÀ€ÀÀ€ÀÀÀÀÀ€€ÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀ€€ÀÀ€ÀÀÀ€À€ÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀ€€À€À€ÀÀÀÀÀÀ€À€ÀÀÀ€À€ÀÀÀÀ€€€À€ÀÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀ€ÀÀÀ€À€ÀÀ€À€ÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀ€ÀÀÀÀ€ÀÀ€ÀÀ€À€ÀÀÀÀÀ€À€€€ÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀÀ€À€€ÀÀ€ÀÀÀÀÀÀÀ€ÀÀ€€ÀÀÀ€€ÀÀ€ÀÀ€ÀÀÀÀ€€ÀÀ€À€€À€€ÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀÀÀÀÀ€€ÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀ€ÀÀÀ€ÀÀÀ€€€ÀÀÀÀÀ€ÀÀÀ€À€ÀÀÀ€ÀÀÀÀÀÀÀ€€ÀÀÀÀÀÀÀ€À€ÀÀ€€ÀÀÀÀ€À€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀ€À€ÀÀÀ€€À€€ÀÀÀÀÀÀÀ€À€€ÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€€ÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€À€ÀÀ€ÀÀÀÀÀÀÀÀ€À€€ÀÀ€À€ÀÀÀÀ€€À€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀ€€ÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀ€À€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀÀÀÀÀ€€ÀÀÀÀÀÀ€ÀÀÀ€ÀÀ€À€ÀÀÀÀÀ€ÀÀÀÀÀÀ€À€ÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀÀ€€ÀÀÀ€À€À€ÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀ€À€€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀ€ÀÀ€€À€ÀÀÀÀÀÀ€À€À€€À€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀ€ÀÀÀ€€À€ÀÀÀÀÀÀÀÀ€À€ÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀ€À€€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€À€ÀÀÀÀÀÀ€À€€À€ÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀ€ÀÀ€ÀÀÀÀÀ€ÀÀ€ÀÀÀ€€ÀÀÀÀÀÀÀ€€€€ÀÀ€ÀÀÀ€ÀÀÀÀÀÀÀ€€€À€ÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ€€ÀÀÀÀÀ€À€ÀÀÀÀÀÀ€ÀÀÀÀ€€€À€€À€ÀÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€€€ÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀ€€ÀÀÀ€€€ÀÀ€À€ÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€À€ÀÀÀÀ€ÀÀÀÀÀ€€ÀÀ€ÀÀÀ€ÀÀÀ€À€ÀÀÀÀÀÀ€€€ÀÀÀÀÀÀÀÀ€À€ÀÀÀÀÀÀ€€ÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀ€ÀÀ€€€À€€À€ÀÀ€ÀÀ€€ÀÀÀ€ÀÀÀÀÀÀ€€ÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€À€À€ÀÀÀÀ€€ÀÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀ€À€ÀÀÀÀ€À€ÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€€€ÀÀÀ€ÀÀÀ€€ÀÀÀÀÀÀÀÀ€ÀÀ€À€ÀÀÀÀ€€€À€ÀÀ€ÀÀÀÀÀ€ÀÀÀÀ€€ÀÀ€À€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀ€€ÀÀÀ€€ÀÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀ€À€ÀÀÀÀÀÀ€ÀÀÀÀ€À€ÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀ€À€ÀÀ€ÀÀÀÀÀÀÀÀÀ€€€ÀÀÀÀÀÀ€À€€ÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀ€À€ÀÀÀÀÀÀÀ€À€ÀÀÀ€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀ€ÀÀ€ÀÀÀÀ€À€ÀÀÀ€ÀÀ€ÀÀÀÀ€ÀÀ€€ÀÀÀ€À€ÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀ€€ÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€€ÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀ€ÀÀ€ÀÀÀÀÀÀÀÀ€€ÀÀ€À€€€ÀÀÀÀÀ€€€ÀÀ€€ÀÀÀÀÀ€ÀÀ€ÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀ€À€À€À€€ÀÀÀ€ÀÀ€À€€ÀÀÀÀÀ€À€ÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀ€À€€ÀÀÀÀÀ€ÀÀ€À€ÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀ€ÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀ€À€ÀÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀ€À€ÀÀÀÀ€ÀÀÀÀÀ€ÀÀ€€ÀÀÀ€À€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀÀÀ€€ÀÀÀÀ€ÀÀÀ€ÀÀÀ€ÀÀÀÀ€À€À€À€ÀÀ€€€€€À€À€€€À€€À€ÀÀ€ÀÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀÀÀÀ€€ÀÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀ€€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀ€À€€€ÀÀ€€ÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€€À€€ÀÀÀÀÀ€À€ÀÀÀ€ÀÀÀ€ÀÀ€ÀÀÀ€ÀÀÀ€ÀÀÀÀÀ€€€ÀÀÀÀÀ€ÀÀ€€ÀÀ€ÀÀÀÀÀÀÀÀÀ€€€À€ÀÀÀÀÀÀÀÀÀÀÀ€À€À€ÀÀ€ÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀÀ€À€ÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀ€ÀÀÀ€ÀÀÀ€À€ÀÀ€ÀÀÀ€À€€ÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€À€À€ÀÀÀ€À€ÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀ€ÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀ€ÀÀÀ€ÀÀ€À€€€€À€€€€ÀÀ€ÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀ€À€ÀÀ€ÀÀ€€€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀ€À€ÀÀ€ÀÀ€ÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀ€€À€ÀÀÀ€€ÀÀ€ÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀ€ÀÀ€ÀÀ€À€ÀÀÀ€À€€€ÀÀ€ÀÀÀ€À€ÀÀÀÀÀÀ€€€À€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀ€€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀ€ÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀÀÀ€ÀÀ€ÀÀ€ÀÀ€ÀÀÀ€€ÀÀ€€À€ÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ€À€€ÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀ€ÀÀ€À€ÀÀÀÀÀÀÀ€€€ÀÀÀÀÀÀÀÀÀ€ÀÀ€À€ÀÀ€ÀÀÀÀÀ€€ÀÀÀ€€ÀÀÀ€ÀÀÀÀÀ€À€ÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀ€À€À€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀ€À€€ÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€€ÀÀ€ÀÀÀÀÀÀ€€€À€ÀÀÀÀÀÀÀÀÀÀ€À€ÀÀ€À€À€ÀÀÀ€À€ÀÀÀÀÀÀÀÀ€€ÀÀÀÀÀÀÀÀ€€ÀÀÀ€À€ÀÀÀ€À€À€ÀÀÀÀ€€€€À€ÀÀ€€ÀÀ€€ÀÀÀÀÀÀÀ€À€ÀÀÀÀ€ÀÀÀÀÀÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€€€€ÀÀÀÀÀÀÀÀ€€ÀÀÀ€ÀÀÀÀÀÀ€À€€ÀÀ€À€À€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀ€ÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀ€ÀÀ€ÀÀ€€À€ÀÀ€ÀÀ€ÀÀÀÀÀÀ€ÀÀÀÀ€€ÀÀÀ€€ÀÀÀ€ÀÀ€ÀÀÀÀÀÀ€€À€À€ÀÀÀÀÀ€€ÀÀÀÀ€ÀÀ€€ÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀ€À€À€À€ÀÀÀÀ€ÀÀÀ€€ÀÀÀÀÀÀ€€ÀÀÀ€À€ÀÀÀ€ÀÀÀÀ€À€ÀÀÀÀ€€ÀÀÀÀ€À€ÀÀÀ€À€€À€À€€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€€ÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀ€ÀÀÀÀ€ÀÀÀÀ€ÀÀ€€À€€ÀÀÀ€ÀÀ€ÀÀÀ€À€ÀÀ€ÀÀ€ÀÀÀÀÀ€ÀÀÀ€ÀÀ€€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ€ÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀ€ÀÀÀ€À€ÀÀÀ€ÀÀ€À€ÀÀ€€À€ÀÀÀÀÀÀÀÀÀÀÀ€À€ÀÀ€ÀÀÀÀÀÀ€ÀÀ€ÀÀÀ€ÀÀ€ÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀ€ÀÀÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀ€ÀÀ€€ÀÀÀÀÀÀÀÀÀÀ€À€ÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀ€À€ÀÀÀÀÀÀÀ€ÀÀÀÀÀ€ÀÀÀ€ÀÀ€À€ÀÀÀÀ€ÀÀ€ÀÀÀÀÀÀ€€ÀÀ€€€ÀÀ€À€ÀÀÀ€ÀÀÀÀÀÀÀÀÀÀ€ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ€ÀÀ
This is the printout of the MIDI firmware...some buttons printed out while others didn't. Tx always came on.

K !ˆ€ˆ€ˆ€€€ˆ€€€˜˜˜˜¨ ¨ ¨ H@@@XPPPh```( €€€ˆ€ˆ€€    @@PP`` ( €€€ˆ€ˆ€€    @@PP`` (
Correction...all the buttons light up TX...not LED 13 Hahahaha.
markgoebel11 months ago
Thank you Amanda. I downloaded the newMIDIRoute.zip and I do see the print button. It shows all my MIDI ports. I don't have my project with me at the moment, but will update you when I get to it. Thanks again for your help.
amandaghassaei (author)  markgoebel11 months ago
cool, glad to hear it.
So, my unending saga continues. I see someone else built the Glitchbox and had success first time. Good for them! I received my new high tact switches today and plugged them into the breadboard. At first I had the same issues, but I toyed with the serial port in the maxpatch by deleting a b c and got sound all of a sudden but my buttons weren't 1 to 1. They were all all over the place and 3 lights would come on at the same time with their midi notes. Then I wiggled the wires around and the diodes and I had the same issues, but the midi notes were firing when I touched each diode. Then it all stopped working. Not sure what I'm doing wrong. I'm not sure if its the breadboard Im working on or the parts I'm using. I'm going to test the parts with a multimeter and see if I can trace the issue.
So, my unending saga continues. I see someone else built the Glitchbox and had success first time. Good for them! I received my new high tact switches today and plugged them into the breadboard. At first I had the same issues, but I toyed with the serial port in the maxpatch by deleting a b c and got sound all of a sudden but my buttons weren't 1 to 1. They were all all over the place and 3 lights would come on at the same time with their midi notes. Then I wiggled the wires around and the diodes and I had the same issues, but the midi notes were firing when I touched each diode. Then it all stopped working. Not sure what I'm doing wrong. I'm not sure if its the breadboard Im working on or the parts I'm using. I'm going to test the parts with a multimeter and see if I can trace the issue.
Ok, got home, hooked up my Arduino, loaded the MIDI firmware, closed Arduino, unhooked my USB, loaded Max/MSP, opened NewMIDIRoute.maxpat
plugged in USB, enabled metronome, looked at the print screen. "Read 0", tried changing MIDI ports. Same result. Then I reset Max and checked my MIDI ports listed and is says,

port a: Bluetooth-PDA-Sync
port b: Bluetooth-Modem
port c: MyiPhone....

This doesn't make sense to me. Not sure if this is correct. Doesn't seem like it should be. It seems to me like it should list a USB port connection...or a Bus 1 port, but since I'm new to this I don't know.

amandaghassaei (author)  markgoebel11 months ago
what do the .... mean, were those the only ports listed?
Oh hahaha. The .... was me paraphrasing the name it gave for my iPhone. Yes, these are the only ports listed when I hit the print button.
amandaghassaei (author)  markgoebel11 months ago
Do you have the arduino plugged into the comp?
I had my Arduino plugged in last night when I sent you this message. At the time I'm writing this message I do not have it plugged in and it's the same report. Looking closer I'm noticing in your patch you have ports for a b c d e...my report is not showing ports d and e. Hope this information is helpful.
amandaghassaei (author)  markgoebel11 months ago
If you have the arduino plugged in you will see it listed in the available ports, are you sure you had it plugged in?
I plugged it in and now it shows port d: usbmodem411 It does not reference Arduino directly, just the USB port.
amandaghassaei (author)  markgoebel11 months ago
well it should work then, are the tx and rx lights blinking on the arduino?
Ok...good news and bad news. I'm excited to tell you that I was able to get 3 out of 9 buttons to work. I had to manipulate the max patch and I got rid of ports a b c. I'm not entirely sure why I had to do that to get any buttons to work, but I did. So, I'm not sure if it's my wiring or if its my Arduino sketch. I am still waiting on those high tact switches from Taiwan so that I can officially say that my work will resemble your Fritzing sketch. I am just happy to get any buttons to work. Thanks for hanging in there with me. Would you mind taking a look at my Arduino sketch again to make sure it's correct?
I pulled my wires out and found some mistakes, but corrected them to your Fritzing sketch. Buttons 2, 3, 4, 5 and 8 work after I delete ports a b c. Nothing prints when I push buttons. The boxes on the patch that light up when I press the buttons on the breadboard are....Button 2 = Box 4, Button 3 = Box 1, Button 4 = Box 8, Button 5 = Box 5 ,Button 8= Box 6 So its not looking like its 1 to 1.
amandaghassaei (author)  markgoebel11 months ago
glad to hear it's starting to work! triple check your wiring, the arduino sketch looks good.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!