Gabriela's ITP Thesis Project

Monday, April 11, 2005

For Loops

I tested out my Pic code last week when I met with Luke, my Jitter teacher, and he noticed that the MIDI signal was not consistent with any of the pins (I have five switches attached to five input pins in my code). Today, I decided to use "MIDI Monitor," a program that allows you to monitor the MIDI signals coming in, to dissect what the direct problem is. I noticed that it seemed to be cycling through all five pin states, sending four note-off signals and one note-on, despite which switch was pushed. I came to the conclusion that this is because I have all of my code in conditional statements for each switch (I know that this should be avoided -- I just wanted to see if I could successfully send MIDI-out before I got too ambitious).

Thus, I created three arrays to hold all 5 switch states, all 5 pitch (MIDI-out) states and all 5 LED states (I have LEDs turning on on corresponding output pins). They are all being initiated by a for loop, which will go through all five, and triggered by a count variable, which can be passed to any of the three arrays. This seems like the best solution, and I am fairly confident it will work.

0 Comments:

Post a Comment

<< Home