#Piano on Galileo
- Intel Galileo Board
- Windows Image on microSD card
- MP3 Player Shield
- 16-Bit I/O Expander with Serial Interface We used this one
- 16 LEDS
- Speakers that take input through 3.5mm Audio Jack
- Computer Keyboard
- micro-USB Male to USB Female
- Place the MP3 Player Shield on top of your galileo board with the pins lined up
- Place the I/O Expander onto a breadboard and hook up its 8 GPA pins and 8 GPB pins to the 16 LEDs with the other end of the LEDs hooked to ground.Look Here for MCP23S17 Specs
- Hook up A0, A1, and A2 on the I/O Expander to GROUND on your Galileo.
- Hook up RESET on the I/O Expander to 3.3V on your Galileo.
- Hook up Vdd on the I/O Expander to 3.3V on your Galileo.
- Hook up Vss on the I/O Expander to GROUND on your Galileo.
- Hook up NC on the I/O Expander to GP10 on your Galileo.
- Hook up SCL on the I/O Expander to GP13 on your Galileo.
- Hook up SDA on the I/O Expander to GP11 on your Galileo.
- Plug the speakers into the MP3 Player Shield's 3.5mm Audio port and turn your speakers on
- Plug the Computer Keyboard into the USB Female end of the converter.
- Plug the micro-USB Male end of the converter into your Galileo Host USB port
There are two ways to run the project
- Using Telnet and your development computer to trigger keystrokes.
- You can either remote deploy or move the Piano.exe directly onto your Galileo (either way make sure it's on your Galileo)
- When in a telnet session connected to your Galileo, launch the Piano.exe (built from the project)
- You should now see the light-up sequence if you have correctly connected everything
- Now you should be able to play sounds using your keyboard input through telnet.
- Using an external keyboard and running it without a computer connection
- Make sure your Galileo has finished booting up and you have connected a keyboard to your Galileo's USB Host Port
- You can either remote deploy or move the Piano.exe directly onto your Galileo (either way make sure it's on your Galileo)
- (The next steps require a bit of blind typing)
- Using the keyboard connected to the Galileo, type "cd c:\LocationToFile" and hit enter to go into the folder containing Piano.exe
- Using the keyboard connected to the Galileo, type "Piano.exe" and hit enter to launch the program
- You should now see the light-up sequence if you have correctly connected everything.
- Now you should be able to play sounds using your keyboard input through telnet.
- Main.cpp
- KeyboardLightController.cpp and .h
- PianoLogic.cpp and .h
- SpiMidi.cpp and .h
- spi_missing.h
- stdafx.h
Main
- The main function that initializes the Galileo Pins to talk SPI to the Music Shield and reads input from the keyboard in order to trigger the sounds and lights
PianoLogic
- Houses all of the logic for the piano system such as keyUp, keyDown, Lighting, Playing a sound, reading the XML files, etc.
KeyboardLightController
- Houses all of the functionality to trigger the lighting through the GPIO port expander
spi_missing
- Creates a namespace that hosts the functions missing from spi.h such as begin, end, and transfer with options.
SpiMidi
- Houses all of the MIDI commands through SPI in order to simplify calling code
stdafx
- Houses all of the external includes for the project
- KeyMap.xml
- Xml that contains the mapping for a keyboard key to a MIDI note and the Light position
- Also contains mapping of keyboard keys to special functions like AutoPlay
- Song.xml
- The song to be auto-played
- Each note in the song is composed of the keyboard key to be "pressed" and the how long it should be pressed (duration)
- Since the key 'y' was not linked to a note, we used it here for a wait between notes
- You can edit the KeyMap.xml file to map any MIDI sounds to the keys on your keyboard