drum

Dependencies:   4DGL SDFileSystem mbed-rtos mbed

Fork of drums by Can Kabuloglu

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers song.cpp Source File

song.cpp

00001 #include "mbed.h"
00002 #include "song.h"
00003 
00004 Song::Song(int id) {
00005     songId = id;
00006 
00007     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,
00008                                 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,
00009                                 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,
00010                                 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,
00011                                 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,
00012                                 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,};
00013                                   
00014     vector<int> vec (arr, arr + sizeof(arr) / sizeof(arr[0]) );
00015     length = vec.size();
00016     notes = vec;                            
00017     timing = 0.1; 
00018 }