User:DDomingu1398/ENES-100/project 1

My Instructor's course page which points to this.

Project Preference
The project we decided to work on is Electronic Music Interface. The concept of the project is to make music that is being processed from a synthesizer to a beat bearing board.

Problem Statement
The project that we will be working on is Electronic Music Interface. What we have planned on doing is to figure out some connections on how we can make a synthesizer or a keyboard transfer notes that produce a melody through an Arduino and a MIDI to a beat bearing board.

https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/System_block_diagram_3.jpg/800px-System_block_diagram_3.jpg

Project Plan
First we had some questions on:
 * 1) How would the connections be assembled?
 * 2) How to connect the synthesizer with the MIDI and the Arduino?
 * 3) What are some programs we can use to make coding to generate melodies?
 * 4) How to make a connection from the Arduino and the MIDI into the Beat Bearing Board?

Week 1 Narrative
First thing my group and I did was to do some research on the past group that work on this project and get some idea on what we are dealing with. After looking at diagrams and information we decided to give a task to every member of the group. My first task was to see in the keyboard I have at home would work to connect it with the MIDI and the Arduino. The reason why we want to make a connection to the MIDI and the Arduino is so that we can control the keyboard and make it play different notes without us touching the keyboard. My other task was to also do some research on coding. Coding is a very important concept in this project because we are trying to control the keyboard with the Arduino so by putting codes into the Arduino we can generate different notes and even melodies into the keyboard. We also explored the past tools that were used by the past group and it gave us a better understanding on how we should start our project. They had a method of a connection but it cant be done because in their method they used FPGA which is a programing device that we are not allowed to use. So what we have come up with is to make a connection from the Keyboard into the Arduino and MIDI and from the Arduino & MIDI straight into the Beat Bearing Board. Before the Ardunio & MIDI is connected into the Beat Bearing we have to program the Arduino by doing some coding from the computer into the Arduino and MIDI.

 File:Arduinouno9.JPG|The Arduino Uno SMD File:Midibreakout.JPG|MIDI Breakout board File:Midishieldright.JPG|MIDI shield File:Keyboard519.JPG|Casio CTK 519 Keyboard File:Midicable.JPG|MIDI cable File:Usbcable2.JPG|USB cable 

Week 2 Narrative
Last week we successfully got to connect our synthesizer to an Arduino. what we are trying to accomplish this week is trying to figure out a wiring connection that connects the beat bearing board to the Arduino. We haven't really been able to connect the Arduino and the MIDI to the beat bearing board because when the Arduino and the MIDI are connected both of them use up all the ports to connect each other. Thanks to my partner Jack, we found out a pin that we could hook the lead to the pins of the Midi Shield which insert into the Arduino connections we need access to. This could probably be achieved using regular leads bent into a hook shape to wrap around the midi shield pins; though they wouldn't be as secure. My task has also consisted of trying to find out a way to program the Arduino with coding so that it can transfer its information into the MIDI so that it can send information to the Keyboard to play different notes. We are still far from getting a connection from the Arduino to the beatbearing but we can already start finding melodies that can be programed and transferred to the Keyboard.

For week three we can try to make a connection with the beatbearing to the Arduino by using a bread board. If we can reproduce this connection we might be able to get everything connected. Because by using the pins we can connect the Arduino to the MIDI and the bread board. The connection we will try to use is down below

Week 3 Narrative
There has been a lot of testing with different coding so that the Arduino can play different notes. There is still a problem on trying to figure out a way to start the keyboard whenever a different code is inserted. There are many ways that have been attempted to start different notes on the piano. In order to make a not start the code 'NoteOn 0x90" should be inserted before any not that wants to be played. But everytime this coding is inserted the keyboard doesn't play it. Sometimes is plays it and some others it doesn't. Maybe resenting the arduino might be helpful because it might have so much information upload on it.

Here are steps on how to upload code to the arduino/MIDI shield

1.Place MIDI shield on top of arduino

2.Plug arduino into computer via USB cable

3.Enter code into arduino software

4.Upload code onto arduino

5.Turn on keyboard

6.Switch to tone-map G (press "Transpose/Tune/MIDI" button until the tone map screen appears in the viewing window, press the "+" key so the window says "Tone map G)

7.Plug in "out" side of MIDI cable into "out" port on MIDI shield

8.Plug in the "in" side of the MIDI cable into the "in" port of the keyboard

Week 4 Narrative
During week 4 there has been good results towards the coding part of the project. First there was a question on whether the Arduino stores all the information in it and if all the information that has been upload it on it would have to be reset. Ms. Campo explained that an Arduino doesn't have to be reset because everytime it is uploaded all the past information will be replaced by the new coding that would be inserted. After this was known there were no worries on trying to reset the arduino but the same note was playing on the keyboard. Then my friend Jack told me to always ake sure that all the information I upload needs to be for Arduino Uno because most of the time people change the type of Arduino they want to use so then I changed it into Arduino One. After this was on I saw that whenever I plug in an Arduino into the computer a new USB was inseted but as a new name for the Arduinos. Before whenever I would upload a code I would make it go into another port but not to the port of the Arduino that goes connected in the Piano. Then the new port was chosen a coding was inserted to see if it would play the melody. In the end the coding for the Arduino was a success. The coding that was inserted is the following.

void setup { Serial.begin(31250); //MIDI protocol baud rate is 31250 bits per second } void loop { // channel 0 alto sax (65) 0xC0,0x41 Serial.write(0xC0); Serial.write(0x41); // channel 1 piano 0 0xC1,0x00 Serial.write(0xC1); Serial.write(0x00); // channel 9 drums 0 Serial.write(0xC9); Serial.write(0x00);

//t=0 ... from www.music-software-development.com/midi-tutorial.html noteOn(0x90, 0x48, 0x40); // start sax noteOn(0x91, 0x3C, 0x40); //start piano noteOn(0x91, 0x43, 0x40); //start piano noteOn(0x91, 0x4C, 0x40); //start piano noteOn(0x99, 0x23, 0x7F); //start bass drum delay(414); //t=1 noteOn(0x90, 0x48, 0x00); //stop sax noteOn(0x99, 0x23, 0x00); //stop bass drum noteOn(0x90, 0x4A, 0x40); //start sax delay(414); //t=2 noteOn(0x90, 0x4A, 0x00); //stop sax noteOn(0x90, 0x4C, 0x40); //start sax noteOn(0x99, 0x23, 0x7F); //start bass drum delay(414); //t=3 noteOn(0x90, 0x4C, 0x00); //stop sax noteOn(0x99, 0x23, 0x00); //stop bass drum noteOn(0x90, 0x4F, 0x40); //start sax delay(414);

//t=4 noteOn(0x90, 0x4F, 0x00); //start sax noteOn(0x91, 0x3C, 0x40); //play cord again noteOn(0x91, 0x43, 0x40); //play cord again noteOn(0x91, 0x4C, 0x40); //play cord again delay(2000); //End song //Wait 2 seconds after the last note is struck to repeat } void noteOn(int cmd, int pitch, int velocity) { //Sets what each of the 3 values in the "noteOn" function does Serial.write(cmd); //All MIDI protocol messages start with 0x90 to signify the start of a MIDI message Serial.write(pitch); //The note. Middle C (0x3C), for example Serial.write(velocity); //Length of time the note is played. Values range from 0 to 127 (0x64), for example }