 			encoders[i].B = !encoders[i].B;
 			if (encoders[i].B && !encoders[i].A) {
 				encoders[i].value -= 1;
-			if (encoders[i].value < encoders[i].min_value)
-				encoders[i].value = encoders[i].min_value;
+				if (encoders[i].value < encoders[i].min_value)
+					encoders[i].value = encoders[i].min_value;
+#ifdef DEBUG
+				Serial1.print("encoder ");
+				Serial1.print(i, DEC);
+				Serial1.print("value change (-1): ");
+				Serial1.println(encoders[i].value, DEC);
+#endif
+			}
 		}
 	}
 

		// like report the state change over midi
		if (sw != buttons[i].sw) {
			buttons[i].sw = sw;
		}
	}

	// this needs to do something with the new value	
	for (i = 0; i < STRINGS; ++i) {
		strings[i].value = analogRead(strings[i].pin);
	}
}

#include <Adafruit_MCP23017.h>

// NOTE: dacb has edited the Adafruit library to include a call to 
// Wire.setClock after Wire.begin to increase the i2c clock to 1.7M
// which is an allowed rate in the MCP23017 datasheet

#undef DEBUG
#define DEBUG
