midi parameters jumping erratically ( Newbie SORRY)

Hi all Trying to build a midi controller that will have ten push buttons and a couple of pots. Interfacing with ableton. Just started with a pot on its own. I'm using a midi to usb converter cable. I have a 220 resitor in series with pin of midi plugand have checked pin config. I put ableton into midi map mode, turn pot and it seems to pick up ok. Take it out of map mode and the pot looks like its controlling the parameter apart from the fact thats its jumping like crazy irratically to different values. Where are these values coming from?

Help please. The code I copyed is below.

int val = 0; int val2 = 0;

void setup() { Serial.begin(31250); // Default speed of MIDI serial port }

void loop() { val = analogRead(1)/8; // Divide by 8 to get range of 0-127 for midi MIDI_TX(176,1,val); // 176 = CC command, 1 = Which Control, val = value read from Potentionmeter delay(10);

val2 = analogRead(0)/8; // Control point 2 MIDI_TX(176,2,val2); delay(10);

}

void MIDI_TX(unsigned char MESSAGE, unsigned char CONTROL, unsigned char VALUE) //pass values out through standard Midi Command { Serial.print(MESSAGE); Serial.print(CONTROL); Serial.print(VALUE);

I think you'd do better using Serial.write() rather than Serial.print().

dxw00d Thanks a million, FIXED!. Talk about a swift responce. Thanks again.

By the way I have a trackball that I'm going to use asweel as pushes, any advice or directions to code?

i am also very new at this, but from what i understand from your code, you are sending a signal every 10 miliseconds. It doesn't matter is the pot value has changed or not. It seems to me that it would be idea to check first if the pot value has changed. If it has, then send the message, if not, then check again (but not send any message!).

I also have some troubles with ableton. i have also been "building" some kind of midi controller and it also happens that it does quite strange things after i map it. I have to get my hands on some other software and try it...

@boguz Thanks for your relay , I think i see what your saying. Whats your controller have? I'm looking to use pushs, pots and a trackball. How would you code it? Thanks again

hey my controller has 8 "pads", 4 push buttons (with 2 options: click or click+hold), 4 pots and then one more push button (that changes the notes for the pads - major, minor or pentatonic scales).

You can take a look at the thread here: http://arduino.cc/forum/index.php/topic,98177.0.html

About the trackball i have no idea, but with the push buttons and the pots i think it should be quiet straight forward. How many are you planning to use?