Masahiko Hasebe / microbit_ymf825

Dependencies:   microbit

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers fmnote.h Source File

fmnote.h

00001 #ifndef FMNOTE_H
00002 #define FMNOTE_H
00003 #include "fmtone.h"
00004 #include "fmvoice.h"
00005 
00006 //  Note Class
00007 typedef struct _Note Note;
00008 struct _Note {
00009     unsigned char   _note;
00010     unsigned char   _velocity;
00011     bool            _inUse;
00012     bool            _keyon;
00013     bool            _hold;
00014 
00015     Note*           _prevPtr;
00016     Note*           _nextPtr;
00017     void*           _parent;
00018     Fmvoice*        _vc;
00019 };
00020 
00021 //  public
00022 extern void Note_init( Note* _this );
00023 extern bool Note_keyon( Note* _this, ToneData* newTone, unsigned char note, unsigned char velocity );
00024 extern void Note_keyoff( Note* _this );
00025 extern void Note_releaseVc( Note* _this, Fmvoice* rlsVc );
00026 extern void Note_release( Note* _this );
00027 extern void Note_damp( Note* _this );
00028 extern void Note_chgVibDpt( Note* _this );
00029 extern void Note_chgPit( Note* _this );
00030 
00031 //  setter
00032 extern void Note_setPrevPtr( Note* _this, Note* pn );
00033 extern void Note_setNextPtr( Note* _this, Note* nn );
00034 extern void Note_setPart( Note* _this, void* pt );
00035 extern void Note_setHold( Note* _this, bool hold );
00036 //  getter
00037 extern bool Note_isInUse( Note* _this );
00038 extern bool Note_isKeyOn( Note* _this );
00039 extern bool Note_isHeld( Note* _this );
00040 extern Note* Note_prevPtr( Note* _this );
00041 extern Note* Note_nextPtr( Note* _this );
00042 extern unsigned char Note_note(Note* _this);
00043 extern unsigned char Note_velocity(Note* _this);
00044 #endif