0
|
1 /*
|
|
2 * midiutil.h - Header for auxiliary MIDI functionality.
|
|
3 * Version 1.4
|
|
4 *
|
|
5 * AUTHOR: Steven Goodwin (StevenGoodwin@gmail.com)
|
|
6 * Copyright 2010, Steven Goodwin.
|
|
7 *
|
|
8 * This program is free software; you can redistribute it and/or
|
|
9 * modify it under the terms of the GNU General Public License as
|
|
10 * published by the Free Software Foundation; either version 2 of
|
|
11 * the License,or (at your option) any later version.
|
|
12 *
|
|
13 * This program is distributed in the hope that it will be useful,
|
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 * GNU General Public License for more details.
|
|
17 *
|
|
18 * You should have received a copy of the GNU General Public License
|
|
19 * along with this program; if not, write to the Free Software
|
|
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
21 */
|
|
22
|
|
23 #include "midiinfo.h"
|
|
24
|
|
25
|
|
26 #ifndef _MIDIUTIL_H
|
|
27 #define _MIDIUTIL_H
|
|
28
|
|
29
|
|
30 #define CHORD_ROOT_MASK 0x000000ff
|
|
31 #define CHORD_TYPE_MASK 0x0000ff00
|
|
32 #define CHORD_BASS_MASK 0x00ff0000
|
|
33 #define CHORD_ADDITION_MASK 0xff000000
|
|
34
|
|
35 #define CHORD_TYPE_MAJOR 0x00000100
|
|
36 #define CHORD_TYPE_MINOR 0x00000200
|
|
37 #define CHORD_TYPE_AUG 0x00000300
|
|
38 #define CHORD_TYPE_DIM 0x00000400
|
|
39
|
|
40 #define CHORD_ADD_7TH 0x01000000
|
|
41 #define CHORD_ADD_9TH 0x02000000
|
|
42 #define CHORD_ADD_MAJ7TH 0x04000000
|
|
43
|
|
44
|
|
45 /*
|
|
46 ** Name resolving prototypes
|
|
47 */
|
|
48 BOOL muGetInstrumentName(char *pName, int iInstr);
|
|
49 BOOL muGetDrumName(char *pName, int iInstr);
|
|
50 BOOL muGetMIDIMsgName(char *pName, tMIDI_MSG iMsg);
|
|
51 BOOL muGetControlName(char *pName, tMIDI_CC iCC);
|
|
52 BOOL muGetKeySigName(char *pName, tMIDI_KEYSIG iKey);
|
|
53 BOOL muGetTextName(char *pName, tMIDI_TEXT iEvent);
|
|
54 BOOL muGetMetaName(char *pName, tMIDI_META iEvent);
|
|
55
|
|
56 /*
|
|
57 ** Conversion prototypes
|
|
58 */
|
|
59 int muGetNoteFromName(const char *pName);
|
|
60 char *muGetNameFromNote(char *pStr, int iNote);
|
|
61 float muGetFreqFromNote(int iNote);
|
|
62 int muGetNoteFromFreq(float fFreq);
|
|
63
|
|
64 int muGuessChord(const int *pNoteStatus, const int channel, const int lowRange, const int highRange);
|
|
65 char *muGetChordName(char *str, int chord);
|
|
66
|
|
67 #endif /* _MIDIUTIL_H*/
|