annotate src/midiutil.h @ 2:105513a2e3c9

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