Gemphet8 ; 8-polyphonic synthesizer control application
Dependencies: MIDI REnc button mbed
MIDI_Proc/midi_proc.h@10:c3b797b62ddb, 2014-08-12 (annotated)
- Committer:
- ChuckTimber
- Date:
- Tue Aug 12 00:00:28 2014 +0000
- Revision:
- 10:c3b797b62ddb
- Parent:
- 9:a86ad099f24d
function divided working copy - 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 | 10:c3b797b62ddb | 7 | extern MIDI midi; |
ChuckTimber | 10:c3b797b62ddb | 8 | |
ChuckTimber | 5:7d7be4c72d21 | 9 | #ifdef __cplusplus |
ChuckTimber | 9:a86ad099f24d | 10 | //extern "C" { |
ChuckTimber | 5:7d7be4c72d21 | 11 | #endif /* __cplusplus */ |
ChuckTimber | 5:7d7be4c72d21 | 12 | |
ChuckTimber | 5:7d7be4c72d21 | 13 | /** MIDI System message */ |
ChuckTimber | 5:7d7be4c72d21 | 14 | #define MIDI_ALL_NOTE_OFF 0x7B |
ChuckTimber | 5:7d7be4c72d21 | 15 | #define MIDI_RESET_ALL_CONTROLLERS 0x79 |
ChuckTimber | 5:7d7be4c72d21 | 16 | |
ChuckTimber | 5:7d7be4c72d21 | 17 | #define POLYPHONICE_NOTES 8 |
ChuckTimber | 5:7d7be4c72d21 | 18 | |
ChuckTimber | 5:7d7be4c72d21 | 19 | /** @structure MIDI Note management structure |
ChuckTimber | 5:7d7be4c72d21 | 20 | * |
ChuckTimber | 5:7d7be4c72d21 | 21 | */ |
ChuckTimber | 5:7d7be4c72d21 | 22 | typedef struct _MidiNote { |
ChuckTimber | 5:7d7be4c72d21 | 23 | /// MIDI Note number |
ChuckTimber | 5:7d7be4c72d21 | 24 | uint8_t Note; |
ChuckTimber | 5:7d7be4c72d21 | 25 | /// MIDI Note velocity |
ChuckTimber | 5:7d7be4c72d21 | 26 | uint8_t Velocity; |
ChuckTimber | 5:7d7be4c72d21 | 27 | /// MIDI Note channel |
ChuckTimber | 5:7d7be4c72d21 | 28 | uint8_t Channel; |
ChuckTimber | 5:7d7be4c72d21 | 29 | /// pointer to the next _MidiNote object |
ChuckTimber | 5:7d7be4c72d21 | 30 | struct _MidiNote *next; |
ChuckTimber | 9:a86ad099f24d | 31 | } MN_t, *MN_p; |
ChuckTimber | 5:7d7be4c72d21 | 32 | |
ChuckTimber | 5:7d7be4c72d21 | 33 | extern MN_t NoteEnd; |
ChuckTimber | 5:7d7be4c72d21 | 34 | extern MN_t NoteStart; |
ChuckTimber | 5:7d7be4c72d21 | 35 | extern MN_t MidiNotes[]; |
ChuckTimber | 5:7d7be4c72d21 | 36 | extern uint16_t MidiNotesTag; |
ChuckTimber | 5:7d7be4c72d21 | 37 | extern uint8_t NumOfNotes; |
ChuckTimber | 5:7d7be4c72d21 | 38 | |
ChuckTimber | 5:7d7be4c72d21 | 39 | /** @brief Prototypes related to MIDI |
ChuckTimber | 5:7d7be4c72d21 | 40 | * |
ChuckTimber | 5:7d7be4c72d21 | 41 | */ |
ChuckTimber | 5:7d7be4c72d21 | 42 | extern void midi_init(void); |
ChuckTimber | 5:7d7be4c72d21 | 43 | extern MN_p allocN(void); |
ChuckTimber | 5:7d7be4c72d21 | 44 | extern void freeN(MN_p addr); |
ChuckTimber | 5:7d7be4c72d21 | 45 | extern void midi_allnoteoff(void); |
ChuckTimber | 5:7d7be4c72d21 | 46 | extern void midi_resetcontrol(void); |
ChuckTimber | 5:7d7be4c72d21 | 47 | extern void midi_sysreset(void); |
ChuckTimber | 5:7d7be4c72d21 | 48 | extern void midi_noteoff(byte channel, byte note, byte velocity); |
ChuckTimber | 5:7d7be4c72d21 | 49 | extern void midi_noteon(byte channel, byte note, byte velocity); |
ChuckTimber | 5:7d7be4c72d21 | 50 | extern void midi_cc(byte channel, byte number, byte value); |
ChuckTimber | 5:7d7be4c72d21 | 51 | extern void midi_pc(byte channel, byte number); |
ChuckTimber | 5:7d7be4c72d21 | 52 | extern void midi_pbend(byte channel, int bend); |
ChuckTimber | 5:7d7be4c72d21 | 53 | |
ChuckTimber | 5:7d7be4c72d21 | 54 | #ifdef __cplusplus |
ChuckTimber | 9:a86ad099f24d | 55 | //} |
ChuckTimber | 5:7d7be4c72d21 | 56 | #endif /* __cplusplus */ |
ChuckTimber | 5:7d7be4c72d21 | 57 | #endif /* __C_MIDI_PROC_H__ */ |