This program generates sound by using FM tone generator YMF825 via SPI.
fmpart.h@0:c54d59d6fb78, 2018-01-05 (annotated)
- Committer:
- hasebems
- Date:
- Fri Jan 05 22:58:49 2018 +0000
- Revision:
- 0:c54d59d6fb78
???????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hasebems | 0:c54d59d6fb78 | 1 | #ifndef FMPART_H |
hasebems | 0:c54d59d6fb78 | 2 | #define FMPART_H |
hasebems | 0:c54d59d6fb78 | 3 | #include "fmnote.h" |
hasebems | 0:c54d59d6fb78 | 4 | #include "fmtone.h" |
hasebems | 0:c54d59d6fb78 | 5 | #include "fmasgn.h" |
hasebems | 0:c54d59d6fb78 | 6 | |
hasebems | 0:c54d59d6fb78 | 7 | #define MAX_NOTE_OBJECT 20 |
hasebems | 0:c54d59d6fb78 | 8 | |
hasebems | 0:c54d59d6fb78 | 9 | // Part Class |
hasebems | 0:c54d59d6fb78 | 10 | typedef struct _Part Part; |
hasebems | 0:c54d59d6fb78 | 11 | struct _Part{ |
hasebems | 0:c54d59d6fb78 | 12 | |
hasebems | 0:c54d59d6fb78 | 13 | ToneData _tone; |
hasebems | 0:c54d59d6fb78 | 14 | Note _note[MAX_NOTE_OBJECT]; |
hasebems | 0:c54d59d6fb78 | 15 | |
hasebems | 0:c54d59d6fb78 | 16 | Note* _topNt; // old |
hasebems | 0:c54d59d6fb78 | 17 | Note* _endNt; // latest |
hasebems | 0:c54d59d6fb78 | 18 | |
hasebems | 0:c54d59d6fb78 | 19 | unsigned char _cc1; |
hasebems | 0:c54d59d6fb78 | 20 | unsigned char _cc7; |
hasebems | 0:c54d59d6fb78 | 21 | unsigned char _cc64; |
hasebems | 0:c54d59d6fb78 | 22 | unsigned short _pbvalue; // 0 - 16383 |
hasebems | 0:c54d59d6fb78 | 23 | unsigned char _toneNumber; |
hasebems | 0:c54d59d6fb78 | 24 | }; |
hasebems | 0:c54d59d6fb78 | 25 | |
hasebems | 0:c54d59d6fb78 | 26 | // public |
hasebems | 0:c54d59d6fb78 | 27 | extern void Part_init( Part* _this ); |
hasebems | 0:c54d59d6fb78 | 28 | extern void Part_note( Part* _this, unsigned char note, unsigned char velocity ); |
hasebems | 0:c54d59d6fb78 | 29 | extern void Part_cc( Part* _this, unsigned char ccnum, unsigned char value ); |
hasebems | 0:c54d59d6fb78 | 30 | extern void Part_pbend( Part* _this, unsigned char lsb, unsigned char msb ); |
hasebems | 0:c54d59d6fb78 | 31 | extern void Part_pc( Part* _this, unsigned char num ); |
hasebems | 0:c54d59d6fb78 | 32 | extern void Part_releaseNote( Part* _this, Note* nt); |
hasebems | 0:c54d59d6fb78 | 33 | |
hasebems | 0:c54d59d6fb78 | 34 | // getter |
hasebems | 0:c54d59d6fb78 | 35 | extern unsigned char Part_cc1( Part* _this ); |
hasebems | 0:c54d59d6fb78 | 36 | extern unsigned char Part_cc7( Part* _this ); |
hasebems | 0:c54d59d6fb78 | 37 | extern unsigned short Part_pb( Part* _this ); |
hasebems | 0:c54d59d6fb78 | 38 | extern unsigned char Part_toneNumber( Part* _this ); |
hasebems | 0:c54d59d6fb78 | 39 | #endif |