<commit_before>#Piano on Galileo

### Components
- Intel Galileo Board
- Windows Image on microSD card
- [MP3 Player Shield](https://www.sparkfun.com/products/10628)
- 16-Bit I/O Expander with Serial Interface [We used this one](http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en023500)
- 16 LEDS

### How The Code is Broken Up
- 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

### Configuration Files
- 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
    
### Hooking up Components
1. Place the MP3 Player Shield on top of your galileo board with the pins lined up
1. 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](http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf)
1. Hook up A0, A1, and A2 on the I/O Expander to GROUND on your Galileo.
1. Hook up RESET on the I/O Expander to 3.3V on your Galileo.
1. Hook up Vdd on the I/O Expander to 3.3V on your Galileo.
1. Hook up Vss on the I/O Expander to GROUND on your Galileo.
1. Hook up NC on the I/O Expander to GP10 on your Galileo.
1. Hook up SCL on the I/O Expander to GP13 on your Galileo.
1. Hook up SDA on the I/O Expander to GP11 on your Galileo.
![alt-text](pianoDiagram.png "Piano Diagram")
<commit_msg>Reorganization of README for better flow<commit_after>#Piano on Galileo

### Components
- Intel Galileo Board
- Windows Image on microSD card
- [MP3 Player Shield](https://www.sparkfun.com/products/10628)
- 16-Bit I/O Expander with Serial Interface [We used this one](http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en023500)
- 16 LEDS

### Hooking up Components
![alt-text](pianoDiagram.png "Piano Diagram")

1. Place the MP3 Player Shield on top of your galileo board with the pins lined up
1. 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](http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf)
1. Hook up A0, A1, and A2 on the I/O Expander to GROUND on your Galileo.
1. Hook up RESET on the I/O Expander to 3.3V on your Galileo.
1. Hook up Vdd on the I/O Expander to 3.3V on your Galileo.
1. Hook up Vss on the I/O Expander to GROUND on your Galileo.
1. Hook up NC on the I/O Expander to GP10 on your Galileo.
1. Hook up SCL on the I/O Expander to GP13 on your Galileo.
1. Hook up SDA on the I/O Expander to GP11 on your Galileo.

### How The Code is Broken Up
- 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

### Configuration Files
- 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

{'fraction_non_alphanumeric': 0.06814580031695722, 'fraction_numerical': 0.020998415213946117, 'mean_word_length': 3.6193961573650504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2509812', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1525, 'n_words': 785}