This program generates sound by using FM tone generator YMF825 via SPI.
fmnote.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 FMNOTE_H |
hasebems | 0:c54d59d6fb78 | 2 | #define FMNOTE_H |
hasebems | 0:c54d59d6fb78 | 3 | #include "fmtone.h" |
hasebems | 0:c54d59d6fb78 | 4 | #include "fmvoice.h" |
hasebems | 0:c54d59d6fb78 | 5 | |
hasebems | 0:c54d59d6fb78 | 6 | // Note Class |
hasebems | 0:c54d59d6fb78 | 7 | typedef struct _Note Note; |
hasebems | 0:c54d59d6fb78 | 8 | struct _Note { |
hasebems | 0:c54d59d6fb78 | 9 | unsigned char _note; |
hasebems | 0:c54d59d6fb78 | 10 | unsigned char _velocity; |
hasebems | 0:c54d59d6fb78 | 11 | bool _inUse; |
hasebems | 0:c54d59d6fb78 | 12 | bool _keyon; |
hasebems | 0:c54d59d6fb78 | 13 | bool _hold; |
hasebems | 0:c54d59d6fb78 | 14 | |
hasebems | 0:c54d59d6fb78 | 15 | Note* _prevPtr; |
hasebems | 0:c54d59d6fb78 | 16 | Note* _nextPtr; |
hasebems | 0:c54d59d6fb78 | 17 | void* _parent; |
hasebems | 0:c54d59d6fb78 | 18 | Fmvoice* _vc; |
hasebems | 0:c54d59d6fb78 | 19 | }; |
hasebems | 0:c54d59d6fb78 | 20 | |
hasebems | 0:c54d59d6fb78 | 21 | // public |
hasebems | 0:c54d59d6fb78 | 22 | extern void Note_init( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 23 | extern bool Note_keyon( Note* _this, ToneData* newTone, unsigned char note, unsigned char velocity ); |
hasebems | 0:c54d59d6fb78 | 24 | extern void Note_keyoff( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 25 | extern void Note_releaseVc( Note* _this, Fmvoice* rlsVc ); |
hasebems | 0:c54d59d6fb78 | 26 | extern void Note_release( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 27 | extern void Note_damp( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 28 | extern void Note_chgVibDpt( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 29 | extern void Note_chgPit( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 30 | |
hasebems | 0:c54d59d6fb78 | 31 | // setter |
hasebems | 0:c54d59d6fb78 | 32 | extern void Note_setPrevPtr( Note* _this, Note* pn ); |
hasebems | 0:c54d59d6fb78 | 33 | extern void Note_setNextPtr( Note* _this, Note* nn ); |
hasebems | 0:c54d59d6fb78 | 34 | extern void Note_setPart( Note* _this, void* pt ); |
hasebems | 0:c54d59d6fb78 | 35 | extern void Note_setHold( Note* _this, bool hold ); |
hasebems | 0:c54d59d6fb78 | 36 | // getter |
hasebems | 0:c54d59d6fb78 | 37 | extern bool Note_isInUse( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 38 | extern bool Note_isKeyOn( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 39 | extern bool Note_isHeld( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 40 | extern Note* Note_prevPtr( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 41 | extern Note* Note_nextPtr( Note* _this ); |
hasebems | 0:c54d59d6fb78 | 42 | extern unsigned char Note_note(Note* _this); |
hasebems | 0:c54d59d6fb78 | 43 | extern unsigned char Note_velocity(Note* _this); |
hasebems | 0:c54d59d6fb78 | 44 | #endif |