How do I get full use of a potenteometer?

Hello all…

how would I go about using the full span of a potentiometer.

my project is a midi controller and I want to add 2 Pot Knobs to change the midi messages being sent from a button/finger drum pad.

This is the code that i have so far. I have tryed a few different versions but have not been successful in dividing the pot into the amount of midi messages in the array to then catch that number when the pot is turned.

in a perfect world I will eventually have all of the midi messages as a scroll able array so to speak.

A Corse Pot knob to get to the general message and a fine tune Pot knob to set a variable eg. velocity, after touch length, pitchbend

Now that i look at the code i can tell i am far off. The bit of code i have would be applyed to the fine tune pot.

Im still clueless on how to get full use of the potentiometer to scroll through all 8 sections of the array.

Can anybody help?

String cmds[8] = "Note On, Note Off, After Touch, Continuous Controller, Patch Change, Channel Pressure, Pitch Bend, Non-Musical Commands";

int val = analogRead(CMDpotPin);
          if ((val > 128) && (val < 255)) { 
      if (val > 144) {
      Serial.println("NoteOn ");
      Serial.println("NoteOff ");

Here is a bit of code using switch case statements with ellipses to choose from a range of numbers. Note the use of character arrays instead of (hated for good reasons) String class.

const byte anaIn = A0;
char* message = "";
char* messageArray[8] = {
    "on", "off","medium","high","low","right","left","over"};

void setup()

void loop()
    int potVal = analogRead(anaIn);
    case 0 ... 100:
        message = messageArray[0];
    case 101 ... 200:
        message = messageArray[1];
    case 201 ... 300:
        message = messageArray[2];
    case 301 ... 400:
        message = messageArray[3];
    case 401 ... 500:
        message = messageArray[4];
    case 501 ... 600:
        message = messageArray[5];
        case 601 ... 700:
        message = messageArray[6];
        case 701 ... 800:
        message = messageArray[7];
        message = "over range";
    Serial.print("     ");

yes sir thx alot....

exactly what i needed..

@Nick: comments on the code generated for a switch/case using ellipses?