è da poco che mi sono buttato su queto piccolo gingillo ma dalle mille potenzialità..
Per ora mi limito a fare dei piccoli circuiti e niente di più diciamo che sto studiando le funzionalità..
quello che mi è venuto in mente è trasformarlo in una centralina drum-midi..già su internet si trova qual cosa ma a pochi canali..diciamo nulla di che ma io forrei fare una cosa completa cominciando da otto canali..
io sono in possesso del modello uno per intenderci:
ho provato uno schema di programazzione girando per internet ma non riesco a farlo funzionare!! qualcuno di voi lo sa programmare ? che vi pare come idea?
vi scrivo le linee comando che ho trovato girando per la rete :
Proto1
// Variables:
byte note = 0; // The MIDI note value to be played
void setup() {
// Set MIDI baud rate:
Serial.begin(31250);
}
void loop() {
// play notes from F#-0 (30) to F#-5 (90):
for (note = 30; note < 90; note ++) {
//Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
noteOn(0x90, note, 0x45);
delay(100);
//Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
noteOn(0x90, note, 0x00);
delay(100);
}
}
// plays a MIDI note. Doesn't check to see that
// cmd is greater than 127, or that data values are less than 127:
void noteOn(byte cmd, byte data1, byte data2) {
Serial.write(cmd);
Serial.write(data1);
Serial.write(data2);
}
const int switchPin = 10; // The switch is on Arduino pin 10
const int middleC = 60; // Middle C (MIDI note value 60) is the lowest note we'll play
const int LEDpin = 13; // Indicator LED
// Variables:
byte note = 0; // The MIDI note value to be played
int AnalogValue = 0; // value from the analog input
int lastNotePlayed = 0; // note turned on when you press the switch
int lastSwitchState = 0; // state of the switch during previous time through the main loop
int currentSwitchState = 0;
void setup() {
// set the states of the I/O pins:
pinMode(switchPin, INPUT);
pinMode(LEDpin, OUTPUT);
// Set MIDI baud rate:
Serial.begin(31250);
blink(3);
}
void loop() {
// My potentiometer gave a range from 0 to 1023:
AnalogValue = analogRead(0);
// convert to a range from 0 to 127:
note = AnalogValue/8;
currentSwitchState = digitalRead(switchPin);
// Check to see that the switch is pressed:
if (currentSwitchState == 1) {
// check to see that the switch wasn't pressed last time
// through the main loop:
if (lastSwitchState == 0) {
// set the note value based on the analog value, plus a couple octaves:
// note = note + 60;
// start a note playing:
noteOn(0x90, note, 0x40);
// save the note we played, so we can turn it off:
lastNotePlayed = note;
digitalWrite(LEDpin, HIGH);
}
}
else { // if the switch is not pressed:
// but the switch was pressed last time through the main loop:
if (lastSwitchState == 1) {
// stop the last note played:
noteOn(0x90, lastNotePlayed, 0x00);
digitalWrite(LEDpin, LOW);
}
}
// save the state of the switch for next time
// through the main loop:
lastSwitchState = currentSwitchState;
}
// plays a MIDI note. Doesn't check to see that
// cmd is greater than 127, or that data values are less than 127:
void noteOn(byte cmd, byte data1, byte data2) {
Serial.write(cmd);
Serial.write(data1);
Serial.write(data2);
}
// Blinks an LED 3 times
void blink(int howManyTimes) {
int i;
for (i=0; i< howManyTimes; i++) {
digitalWrite(LEDpin, HIGH);
delay(100);
digitalWrite(LEDpin, LOW);
delay(100);
}
}
fonte : http://itp.nyu.edu/physcomp/Labs/MIDIOutput



