Gemphet8 ; 8-polyphonic synthesizer control application
Dependencies: MIDI REnc button mbed
MIDI_Proc/midi_proc.h@9:a86ad099f24d, 2014-08-11 (annotated)
- Committer:
- ChuckTimber
- Date:
- Mon Aug 11 23:16:06 2014 +0000
- Revision:
- 9:a86ad099f24d
- Parent:
- 5:7d7be4c72d21
- Child:
- 10:c3b797b62ddb
Function divided version - compile OK
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ChuckTimber | 5:7d7be4c72d21 | 1 | #ifndef __C_MIDI_PROC_H__ |
ChuckTimber | 5:7d7be4c72d21 | 2 | #define __C_MIDI_PROC_H__ 1 |
ChuckTimber | 5:7d7be4c72d21 | 3 | |
ChuckTimber | 5:7d7be4c72d21 | 4 | #include "mbed.h" |
ChuckTimber | 5:7d7be4c72d21 | 5 | #include "MIDI.h" |
ChuckTimber | 5:7d7be4c72d21 | 6 | |
ChuckTimber | 5:7d7be4c72d21 | 7 | #ifdef __cplusplus |
ChuckTimber | 9:a86ad099f24d | 8 | //extern "C" { |
ChuckTimber | 5:7d7be4c72d21 | 9 | #endif /* __cplusplus */ |
ChuckTimber | 5:7d7be4c72d21 | 10 | |
ChuckTimber | 5:7d7be4c72d21 | 11 | /** MIDI System message */ |
ChuckTimber | 5:7d7be4c72d21 | 12 | #define MIDI_ALL_NOTE_OFF 0x7B |
ChuckTimber | 5:7d7be4c72d21 | 13 | #define MIDI_RESET_ALL_CONTROLLERS 0x79 |
ChuckTimber | 5:7d7be4c72d21 | 14 | |
ChuckTimber | 5:7d7be4c72d21 | 15 | #define POLYPHONICE_NOTES 8 |
ChuckTimber | 5:7d7be4c72d21 | 16 | |
ChuckTimber | 5:7d7be4c72d21 | 17 | typedef unsigned char uint8_t; |
ChuckTimber | 5:7d7be4c72d21 | 18 | typedef unsigned short uint16_t; |
ChuckTimber | 5:7d7be4c72d21 | 19 | typedef uint8_t byte; |
ChuckTimber | 5:7d7be4c72d21 | 20 | typedef uint16_t word; |
ChuckTimber | 5:7d7be4c72d21 | 21 | |
ChuckTimber | 5:7d7be4c72d21 | 22 | /** @structure MIDI Note management structure |
ChuckTimber | 5:7d7be4c72d21 | 23 | * |
ChuckTimber | 5:7d7be4c72d21 | 24 | */ |
ChuckTimber | 5:7d7be4c72d21 | 25 | typedef struct _MidiNote { |
ChuckTimber | 5:7d7be4c72d21 | 26 | /// MIDI Note number |
ChuckTimber | 5:7d7be4c72d21 | 27 | uint8_t Note; |
ChuckTimber | 5:7d7be4c72d21 | 28 | /// MIDI Note velocity |
ChuckTimber | 5:7d7be4c72d21 | 29 | uint8_t Velocity; |
ChuckTimber | 5:7d7be4c72d21 | 30 | /// MIDI Note channel |
ChuckTimber | 5:7d7be4c72d21 | 31 | uint8_t Channel; |
ChuckTimber | 5:7d7be4c72d21 | 32 | /// pointer to the next _MidiNote object |
ChuckTimber | 5:7d7be4c72d21 | 33 | struct _MidiNote *next; |
ChuckTimber | 9:a86ad099f24d | 34 | } MN_t, *MN_p; |
ChuckTimber | 5:7d7be4c72d21 | 35 | |
ChuckTimber | 5:7d7be4c72d21 | 36 | extern MN_t NoteEnd; |
ChuckTimber | 5:7d7be4c72d21 | 37 | extern MN_t NoteStart; |
ChuckTimber | 5:7d7be4c72d21 | 38 | extern MN_t MidiNotes[]; |
ChuckTimber | 5:7d7be4c72d21 | 39 | extern uint16_t MidiNotesTag; |
ChuckTimber | 5:7d7be4c72d21 | 40 | extern uint8_t NumOfNotes; |
ChuckTimber | 5:7d7be4c72d21 | 41 | |
ChuckTimber | 5:7d7be4c72d21 | 42 | /** @brief Prototypes related to MIDI |
ChuckTimber | 5:7d7be4c72d21 | 43 | * |
ChuckTimber | 5:7d7be4c72d21 | 44 | */ |
ChuckTimber | 5:7d7be4c72d21 | 45 | extern void midi_init(void); |
ChuckTimber | 5:7d7be4c72d21 | 46 | extern MN_p allocN(void); |
ChuckTimber | 5:7d7be4c72d21 | 47 | extern void freeN(MN_p addr); |
ChuckTimber | 5:7d7be4c72d21 | 48 | extern void midi_allnoteoff(void); |
ChuckTimber | 5:7d7be4c72d21 | 49 | extern void midi_resetcontrol(void); |
ChuckTimber | 5:7d7be4c72d21 | 50 | extern void midi_sysreset(void); |
ChuckTimber | 5:7d7be4c72d21 | 51 | extern void midi_noteoff(byte channel, byte note, byte velocity); |
ChuckTimber | 5:7d7be4c72d21 | 52 | extern void midi_noteon(byte channel, byte note, byte velocity); |
ChuckTimber | 5:7d7be4c72d21 | 53 | extern void midi_cc(byte channel, byte number, byte value); |
ChuckTimber | 5:7d7be4c72d21 | 54 | extern void midi_pc(byte channel, byte number); |
ChuckTimber | 5:7d7be4c72d21 | 55 | extern void midi_pbend(byte channel, int bend); |
ChuckTimber | 5:7d7be4c72d21 | 56 | |
ChuckTimber | 5:7d7be4c72d21 | 57 | #ifdef __cplusplus |
ChuckTimber | 9:a86ad099f24d | 58 | //} |
ChuckTimber | 5:7d7be4c72d21 | 59 | #endif /* __cplusplus */ |
ChuckTimber | 5:7d7be4c72d21 | 60 | #endif /* __C_MIDI_PROC_H__ */ |