Escolar Documentos
Profissional Documentos
Cultura Documentos
ALAN COUTO LOPES MARIANE GOMES DE CARVALHO VINCIUS JOS DE SOUZA LOPES SACRAMENTO
MIDI Glove
1. O PROJETO
Foi construda uma luva com sensores LDR colados em quatro dedos. Estes sensores captam estmulos a partir da luminosidade bloqueada ou no s no, os estmulos so convertidos em notas pelo programa desenvolvido na IDE do convertidos Arduino que os molda em tons e oitavas musicais, os estmulos pas musicais, passam por um software conversor de MIDI e depois tem as portas MIDI identificadas pelo software com os sons dos instrumentos musicais. O prottipo inicial foi desenvolvido pelo Analista de Sistema Bruno Analista Sistemas Ratnieks e publicado no Instructables.C s Instructables.Com. A estrutura na protoboard foi a seguinte para cada sensor LDR ligado nas portas analgicas:
Em relao ao software disponibilizado pelo autor, foram feitas modifica modificaes abaixo:
DE
void MIDI_TX(byte MESSAGE, unsigned char PITCH, unsigned char VELOCITY) { //status = MESSAGE + midichannel; //status = MESSAGE + pin; digitalWrite(13,HIGH); Serial.print(MESSAGE, BYTE); Serial.print(PITCH); Serial.print(VELOCITY); delay(30); digitalWrite(13,LOW); }
PARA
void MIDI_TX(byte MESSAGE, unsigned char PITCH, unsigned char VELOCITY) { //status = MESSAGE + midichannel; //status = MESSAGE + pin; digitalWrite(13,HIGH);
Serial.write(BYTE(MESSAGE));
Serial.print(PITCH); Serial.print(VELOCITY); delay(30); digitalWrite(13,LOW); }
DE
PARA
Valores variantes de 0 at 127.
2. LISTA DE MATERIAIS
1 Arduino board UNO com 4 ou mais portas analgicas; 4 Sensores LDR de 5mm; 4 Resistores de 1K; 5 Metros de fio com ncleo slido e de cobre; 1 Luva; 1 Protoboard; Cabos Jumper; 1 Cabo USB; 1 Folha de EVA; Cola; Tesoura.
3. LISTA DE SOFTWARE
SpiekenzieLabs Serial Midi Converter; LoopBe1 Free Virtual Midi PORT; FL Studio.
4. DIVULGAO DO PROTTIPO
O vdeo com a divulgao do prottipo desenvolvido pode ser acessado em: http://www.youtube.com/watch?v=KQYWfJ-4GSE&feature=youtu.be.
REFERNCIAS BIBLIOGRFICAS
Ratinieks,
B.
SNF
Glove
Version
1.0.
Disponvel
em:
Ratinieks, B. SNF Drumming MIDI Glove using Arduino and light sensors. Disponvel em: http://www.instructables.com/id/SNF-Drumming-MIDI-Gloveusing-Arduino-and-light-se/. Acessado em: Novembro, 2012.
SpiekenzieLabs
Serial
Midi
Converter.
Disponvel
em:
Acessado
ANEXO I Cronograma
// DESCRIPTION: // SNF Drumming Glove Code by Bruno Lacerda Ratnieks - bruno@sniffer.net // Sniffer Networks Ltda. // Arduino analog inputs are used to sense LDR hits then send to serial port // // // Required - Software: // 1. Serial MIDI converter // 2. FL Studio, Garage Band, Ableton Live etc . // // Code by Bruno Ratnieks // bruno@sniffer.net // February 2011 for SNF MIDI GLOVE PROJECT v1.0 unsigned char PadNote[4] = {45,55,60,67}; // MIDI notes from 0 to 127 (Mid C = 60) // Imagine a piano roll. 45 55 are keys located on the middle for example. // Tweak it to what sounds better to you. int CutOff = 40; // This is the minimal amount of analog reading before triggering the note! int MaxPlayTime[6] = {6500,6500,6500,6500}; // Cycles before a 2nd hit is allowed // Best value after lots of trial and error. #define midichannel 0; // MIDI channel from 0 to 15 (+1 in "real world")
//******************************************************************************************************************* // Internal Use Variables // // You should tweak here if it's not optimal yet. // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // Those values work perfectly when using the small LDR and 1K Resistor. So used it! // //******************************************************************************************************************* boolean activePad[6] = {0,0,0,0}; int PinPlayTime[6] = {0,0,0,0}; int ActivePadMinTime = 100; int PinPauseTimeDelay = 200; int PinPauseTime[4] = {0,0,0,0}; int PinAvailable[4] = {1,1,1,1}; unsigned char status; int pin = 0; int hitavg = 0; int maxread = 0; int debug = false; int noteOffset = 0; //******************************************************************************************************************* // Setup //******************************************************************************************************************* // Array of flags of pad currently playing // Counter since pad started to play
//******************************************************************************************************************* // Main Program //******************************************************************************************************************* void loop() { for(int pin=0; pin <= 3; pin++) { hitavg = analogRead(pin); // read the input pin if(debug) Serial.println(hitavg); if(hitavg < CutOff) { if(debug)Serial.println("hitavg < CutOff"); if(activePad[pin] == false) { if(debug) Serial.println("activePad[pin] == false"); if(PinAvailable[pin] == true) { if(debug) Serial.println("PinAvailable[pin] == true"); // Toca a nota full activePad[pin] = true; PinPauseTime[pin] = 0; MIDI_TX((0x90 | pin), PadNote[pin]+noteOffset, 127);
if(debug) Serial.println("NoteON"); } } } if(activePad[pin] == true) { if(debug)Serial.println("activePad[pin] == true"); PinPlayTime[pin] += 1; if(analogRead(pin) > CutOff && PinPlayTime[pin] > ActivePadMinTime) { if(debug) Serial.println("analogRead(pin) > PadCut == TRUE"); activePad[pin] = false; PinAvailable[pin] = 2; if(debug) Serial.println("NoteOFF, available is now false. active is false;");
MIDI_TX((0x80 | pin), PadNote[pin]+noteOffset, 50); PinPlayTime[pin] = 0; } } if(PinAvailable[pin] == 2 && PinPauseTime[pin] > PinPauseTimeDelay) { if(debug)Serial.println("PinAvailable[pin] == false && PinPauseTime[pin] > 10"); PinAvailable[pin] = true; } else if(PinAvailable[pin] == 2) { if(debug)Serial.println("PinPauseTime[pin] += 1;");
PinPauseTime[pin] += 1; } if(debug)delay(1000); } }
//******************************************************************************************************************* // Transmit MIDI Message //******************************************************************************************************************* void MIDI_TX(byte MESSAGE, unsigned char PITCH, unsigned char VELOCITY) { //status = MESSAGE + midichannel; //status = MESSAGE + pin; digitalWrite(13,HIGH); Serial.print(MESSAGE, BYTE); Serial.print(PITCH); Serial.print(VELOCITY); delay(30); digitalWrite(13,LOW); }