mbedでmidi(Format 0)を再生
midi.h@1:250e7251f8fc, 2014-08-09 (annotated)
- Committer:
- Naoto_111
- Date:
- Sat Aug 09 09:29:31 2014 +0000
- Revision:
- 1:250e7251f8fc
- Parent:
- 0:7c17c3b3a8d7
play_realtime???; ???????1????????????4
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Naoto_111 | 0:7c17c3b3a8d7 | 1 | #ifndef MBED_MIDI |
Naoto_111 | 0:7c17c3b3a8d7 | 2 | #define MBED_MIDI |
Naoto_111 | 0:7c17c3b3a8d7 | 3 | |
Naoto_111 | 0:7c17c3b3a8d7 | 4 | #include "mbed.h" |
Naoto_111 | 0:7c17c3b3a8d7 | 5 | #include <list> |
Naoto_111 | 0:7c17c3b3a8d7 | 6 | |
Naoto_111 | 0:7c17c3b3a8d7 | 7 | class midi { |
Naoto_111 | 0:7c17c3b3a8d7 | 8 | public: |
Naoto_111 | 0:7c17c3b3a8d7 | 9 | midi(PinName _bzr); |
Naoto_111 | 0:7c17c3b3a8d7 | 10 | //~midi(); |
Naoto_111 | 0:7c17c3b3a8d7 | 11 | void read(const char *path); |
Naoto_111 | 1:250e7251f8fc | 12 | void play(/*int repeat*/); |
Naoto_111 | 1:250e7251f8fc | 13 | void play_realtime(const char *path/*, int repeat*/); |
Naoto_111 | 0:7c17c3b3a8d7 | 14 | |
Naoto_111 | 0:7c17c3b3a8d7 | 15 | private: |
Naoto_111 | 1:250e7251f8fc | 16 | list<int> tm;//tempo |
Naoto_111 | 0:7c17c3b3a8d7 | 17 | //list<int> ev; |
Naoto_111 | 1:250e7251f8fc | 18 | list<char> ca;//channel |
Naoto_111 | 1:250e7251f8fc | 19 | list<float> fq;//frequency |
Naoto_111 | 0:7c17c3b3a8d7 | 20 | //list<float> vo; |
Naoto_111 | 1:250e7251f8fc | 21 | list<int> no;//note |
Naoto_111 | 0:7c17c3b3a8d7 | 22 | list<char>::iterator pch; |
Naoto_111 | 0:7c17c3b3a8d7 | 23 | list<int>::iterator pi; |
Naoto_111 | 0:7c17c3b3a8d7 | 24 | list<float>::iterator pf; |
Naoto_111 | 1:250e7251f8fc | 25 | list<int>::iterator pn; |
Naoto_111 | 0:7c17c3b3a8d7 | 26 | Timer t; |
Naoto_111 | 0:7c17c3b3a8d7 | 27 | PinName bzr; |
Naoto_111 | 0:7c17c3b3a8d7 | 28 | int chmax; |
Naoto_111 | 0:7c17c3b3a8d7 | 29 | char *path_c; |
Naoto_111 | 0:7c17c3b3a8d7 | 30 | unsigned short int tracks; |
Naoto_111 | 0:7c17c3b3a8d7 | 31 | unsigned short int crochet; |
Naoto_111 | 0:7c17c3b3a8d7 | 32 | long int tempo; |
Naoto_111 | 1:250e7251f8fc | 33 | double freq[12]; |
Naoto_111 | 1:250e7251f8fc | 34 | double *table; |
Naoto_111 | 0:7c17c3b3a8d7 | 35 | template<class X> |
Naoto_111 | 0:7c17c3b3a8d7 | 36 | void change_endian(X *raw,int byte); |
Naoto_111 | 1:250e7251f8fc | 37 | int powi(int a); |
Naoto_111 | 0:7c17c3b3a8d7 | 38 | }; |
Naoto_111 | 0:7c17c3b3a8d7 | 39 | #endif |