Hot Sale MIDI Shield for Cduino Sound Voice Module Board Development DIY Extension music player Freeship Cheap Wholesale

Customer Review 0Review(s) | Product Details
179 Units in Stock
Price :
US$10.72



Quantity: - +
Total :
US$10.72
VIP Center Learn more 0
Silver VIP 3% off
Gold VIP 5% off
PLATINUM vip 10% off


Introduction

  • The MIDI Breakout board gives your Arduino or any other microcontroller access to the powerful MIDI communication protocol. The MIDI protocol shares many similarities with standard asynchronous serial interfaces, so you can use the UART pins of your microcontroller to send and receive MIDI's event messages. The MIDI Breakout provides both MIDI-IN and MIDI-OUT connections, as well as a MIDI-THRU port. The MIDI-IN port is opto-isolated to prevent ground loops. The MIDI Breakout board can be mounted directly on top of an Arduino like a shield, connecting the MIDI-IN/THRU to the Arduino's hardware RX pin and the MIDI-OUT to TX. All of the Arduino's digital and analog pins, as well as power and ground busses, are broken out as well. The RUN/PGM switch allows you to program the Arduino over serial without having to remove the shield.

  • Mechanic Dimensions

  • 2.25 x 2.10 " (57.15 x 53.34 mm)

Usage

  • Hardware Installation

Programming

  • Firstly,we should program the arduino,attach the MIDI breadout to the arduino board,connect the USBtoMIDI cable to PC and MIDI breadout board,the PC can recognize the device,then open the HappyEO,press the buttom “option”,select the common item and select the USB Audio Device as the output device.Then select the MIDI input item and select the USB Audio Device item.

  • If you has select the USB AUDIO DEVICE item,select Wave table software synthesizers as the output device, you can hear the music with the ear phone from the arduino+MIDI Breakout board. And you can see the LEDs is flash.

  • If you select the USB AUDIO DEVICE as the output device,Happy EO can send the data and command to arduino when wo press the keyboard,the led will falsh when it receive data.

Test code

The code blew is standard code,you can change the code on the basis of your requirement.

// defines for MIDI Shield components only

#define KNOB1 0

#define KNOB2 1

#define BUTTON1 2

#define BUTTON2 3

#define BUTTON3 4

#define STAT1 7

#define STAT2 6

#define OFF 1

#define ON 2

#define WAIT 3byte incomingByte;byte note;byte velocity;intpot;byte byte1;byte byte2;byte byte3;intaction=2;//1 =note off ; 2=note on ; 3= waitvoidsetup(){pinMode(STAT1,OUTPUT);pinMode(STAT2,OUTPUT);pinMode(BUTTON1,INPUT);pinMode(BUTTON2,INPUT);pinMode(BUTTON3,INPUT);digitalWrite(BUTTON1,HIGH);digitalWrite(BUTTON2,HIGH);digitalWrite(BUTTON3,HIGH);for(inti=0;i<< span="">10;i++)// flash MIDI Sheild LED's on startup{digitalWrite(STAT1,HIGH);digitalWrite(STAT2,LOW);delay(30);digitalWrite(STAT1,LOW);digitalWrite(STAT2,HIGH);delay(30);}digitalWrite(STAT1,HIGH);digitalWrite(STAT2,HIGH);//start serial with midi baudrate 31250Serial.begin(31250);}voidloop(){//*************** MIDI OUT ***************//pot=analogRead(0);note=pot/8;// convert value to value 0-127 if(button(BUTTON1) || button(BUTTON2) || button(BUTTON3)){Midi_Send(0x90,note,0x45);while(button(BUTTON1)||button(BUTTON2)||button(BUTTON3));}//*************** MIDI LOOPBACK ******************//if(Serial.available()>0){byte1=Serial.read();byte2=Serial.read();byte3=Serial.read();Midi_Send(byte1,byte2,byte3);}//*************** MIDI IN ***************//if(Serial.available()>0){// read the incoming byte:incomingByte=Serial.read();// wait for as status-byte, channel 1, note on or off if (incomingByte== 144) // Note on{action=OFF;}elseif(incomingByte==128)// Note off{action=ON;}elseif(note==0&&action!=WAIT)// note on, wait for note value{note=incomingByte;}elseif(note!=0&&action!=WAIT)// velocity{velocity=incomingByte;if(action==ON){Midi_Send(0x90,note,velocity);}if(action==OFF){Midi_Send(0x80,note,velocity);}note=0;velocity=0;action=WAIT;}else{}}}voidMidi_Send(byte cmd,byte data1,byte data2){Serial.print(cmd,BYTE);Serial.print(data1,BYTE);Serial.print(data2,BYTE);}voidblink(){digitalWrite(STAT1,HIGH);delay(100);digitalWrite(STAT1,LOW);delay(100);}charbutton(charbutton_num){return(!(digitalRead(button_num)));}



Reviews

Create your own review

You can get 5 SmartArduino Points by commenting on the products( Login first ).

User Name: *
Comment Rank: 1 2 3 4 5 *
Confirm Text: captcha *
Content: *