Code for the first mbed for the drum hero project

Dependencies:   4DGL SDFileSystem mbed

Fork of drums2 by Yusuf Kuris

Song/song.cpp

Committer:
ckabuloglu
Date:
2017-04-30
Revision:
3:54d4226a7d5e
Child:
5:02800d96625d

File content as of revision 3:54d4226a7d5e:

#include "mbed.h"
#include "song.h"

Song::Song(int id) {
    songId = id;

    static const int arr[192] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0,
                                1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0,
                                1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0,
                                1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0,
                                1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0,
                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};
                                  
    vector<int> vec (arr, arr + sizeof(arr) / sizeof(arr[0]) );
    length = vec.size();
    notes = vec;                            
    timing = 0.1; 
}