Original code base

This setup is complete with bluetooth, lcd and live streaming of commands from java
app.
**EDIT**
Most of the floppy drive/avr code is initially from
SammyIAm's "Moppy" project (https://github.com/SammyIAm/Moppy) but is later completely removed
and replaced with my on OOP version.
Added header file for a floppy drive class (going for a tidy programming approach)
Finished first implementation of Floppy class.

Yet to be tested properly or implemented into
main avr code.
Also added the timer library back for timing
funtionality in the main avr code.

TODO: maybe make a little funtion to set pin state?
it currently looks a little bit much and has large
scope for fucking up
Reworked the main avr code.

Most code is present except the main loop which changes the
floppy objects periods from the midi parser output.
More work is needed on java side (particularly format of output)
before work can be continued here.

Floppy class is still yet to be properly tested but at least it
compiles fine.
Now got the java app to output an array of condensed song data.

This is then copied into songData.h for the avr code (but this
could be automated later e.g. file creation and stuff).
The format of the data is a little confusing just to save memory:

It is a 4 byte, long-style variable
First byte is the period of the note in "ticks"
Next 22 bits are for the tick count (i.e. when the note should be played)
Final 2 bits are for the floppy/track number (0 -> 3)

Next to add the decoding and song control parts to avr code
Added some fixes to the logic of the updating functions
in Floppy class. Something still not right though so going
back to testing branch
Finalised the floppy drive class and checked functionality with multiple instances

Fixed some further little bugs in the floppy class
Removed all variables that were declared within the Floppy.cpp outside a function as they were
shared by all instances of the class (bad habit from  java coding this year) and were used over
the versions declared in the header.

Also added definitions for pin manipulation to avoid errors in single implementations of pin
settings...

NOTE: In updateFloppys() using a for loop to update each floppy object fucks shit up. So, yeah.
Take a better look at why that is (or leave it looking messy)
Got a working sketch to play a portion of a midi file.

The length of the song data array is a real issue. It currently resides in SRAM which is very restriced. A possible
fix for this is to move some of it into eeprom and swap them out in pages(?). that would only give space for 256 more
notes (+50%)...
The best outcome would be to somehow store it in the flash memory but I'm not sure if that is achieveable.

Looping through each floppy device have been fixed. the sizeof(array) doesn't return the number of elements in the
array, but the number of bytes it takes up in memory. So sizeof(_drives)/sizeof(Floppy) can be used to determine the
number of elements in the _drives array.

Next steps are to more efficiently store the song data and begin implementing the alarm clock functionality
Added "pgmspace.h" library for storing and retriving the song data from the flash memory (program space).

As the actual program is currently around 7 kB, there is then 23 kB left for song data. Each note is packed
into an unsigned long (4 bytes) so that is space for almost 6000 notes! (mm2 metalman only has 1400)

Because of this change, the length of the songData array can no longer be easily determined so a definition of
its length has been added in the songData.h header. The java app will need to be amended accordingly to output
this automatically, as well as the include for the pgmspace library.
Moved the floppy drive pins to work on  port register B (pins 8->13) to accomodate for the
external interrupt pins being 2 and 3 which are needed for user control.

Adapted the java midi parser to output the includes, definitions and such required for it to
compile with no editing. (main java file is called "main" not "arrayparser" but i wont
remove the undeeded file so git can be used to revert to an earlier version.

Next step is to add some user control for starting/stopping the song and then finally adding
in the alarm clock functionality.
1.0 "release" version of the alarm clock /
musical floppy drives project. Arduino chip
has been mounted along with all other
components to some perfboard and the project
is now fairly permanent. Well done to me.

Some songs with a large range of notes will
screw up with the compressed data structure
used but the metalman theme from MM2 works
like a charm.
Merge branch 'master' of github.com:cramsay/FlopperaClock