Search:
Intro Physical Computing Fall 2005

registered authors login here

For more on PMWiki, see pmwiki.org

Talking To AMIDI Device
 

Link to the lab description

For the MIDI lab I wrote some code that used a potentiometer and button to manage a sequence of notes. In a nutshell, my code works like this:

  • Reads from potentiometer
  • If button is pressed, it compares this value to the last value stored
  • if they are different, the previous note is incremented/decremented by 1 as necessary
  • the resulting note is sent out
  • I also have a smoothing function on the analog in

So basically what it does is it plays the same note over and over again. When you push the button, it determines what the next note should be based on the pot and then (as long as the button is held down) plays each note along the way to get to the new note. if you release the button before it gets to the new note, the program repeats the note that you stopped on.

In a sense, this is perhaps less functional than a normal musical instrument, in that on a normal intrument you can play any note you want immediately. But this logic might be nice if for some reason you need a toy to produce sounds in this pattern.

Andy


I tried to get the lab working with the hex inverter and regular 20mhz clock, and failed. Then I tried with a powered 20mhz clock that I borrowed from Peter Kerlin, and failed again. Then I finally got success with no hex inverter and using a regular 20mhz clock with no capacitors.

Here's a strange thing that happened: I was messing around with some of Tom's code that I found online, pitch bending and making wierd noises, using a switch and pot. At some point in messing up the code, I removed the switch, and noticed that the serial output to midi now seemed to be controlled by my hand's proximity to the PIC. If I left it alone, silence. If I put my finger close to (but not touching) the PIC, then I got sound through MIDI.

Ed


finally got to the midi lab last week. made every mistake possible. i wired the 5 pin socket wrong, tried the 4mhz clock and failed (of course), tried the hex inverter set up with the 16mhz clock and failed (of course). i got to the point where an led at the midi out pin pulsed showing i had midi info going out, but still no output. it finally came down to a bad midi cable (which leif kringle told me was common). finally got it to work with no hex inverter and 16mhz clock. eventually i was able to control note and key pressure with pots....

Toshi


Gilad and I worked together to use our newly bought polar sensors to make a midi instrument. We had two of them, so we set it up so that two people could play simultaneously. The phase shift effect of two people's heartbeats turned out to be very interesting. We used a 16mhz clock with no trouble.

Christian

Edit Page - Page History - Printable View - Recent Changes - Search