MuseScore  3.4
Music composition and notation
global.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
3  Copyright (C) 2008 Hans Fugal <hans@fugal.net> (OSX version)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 
20 
21 #ifndef __GLOBAL_H
22 #define __GLOBAL_H
23 
24 
25 #ifdef __APPLE__
26 #include <machine/endian.h>
27 #define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
28 #define __BIG_ENDIAN __DARWIN_BIG_ENDIAN
29 #define __PDP_ENDIAN __DARWIN_PDP_ENDIAN
30 #define __BYTE_ORDER __DARWIN_BYTE_ORDER
31 #else
32 #ifdef __MINGW32__
33 #define __BYTE_ORDER __LITTLE_ENDIAN
34 #else
35 #include <endian.h>
36 #endif
37 #endif
38 
39 #ifdef __BYTE_ORDER
40 #if (__BYTE_ORDER == __LITTLE_ENDIAN)
41 #define WR2(p,v) { (p)[0] = v; (p)[1] = v >> 8; }
42 #define WR4(p,v) { (p)[0] = v; (p)[1] = v >> 8; (p)[2] = v >> 16; (p)[3] = v >> 24; }
43 #define RD2(p) ((p)[0] + ((p)[1] << 8));
44 #define RD4(p) ((p)[0] + ((p)[1] << 8) + ((p)[2] << 16) + ((p)[3] << 24));
45 #elif (__BYTE_ORDER == __BIG_ENDIAN)
46 #define WR2(p,v) { (p)[1] = v; (p)[0] = v >> 8; }
47 #define WR4(p,v) { (p)[3] = v; (p)[2] = v >> 8; (p)[1] = v >> 16; (p)[0] = v >> 24; }
48 #define RD2(p) ((p)[1] + ((p)[0] << 8));
49 #define RD4(p) ((p)[3] + ((p)[2] << 8) + ((p)[1] << 16) + ((p)[0] << 24));
50 #else
51 #error Byte order is not supported !
52 #endif
53 #else
54 #error Byte order is undefined !
55 #endif
56 
57 enum // GLOBAL LIMITS
58 {
59  NASECT = 4,
60  NDIVIS = 8,
61  NKEYBD = 6,
62  NGROUP = 8,
63  NNOTES = 61,
64  NBANK = 32,
65  NPRES = 32
66 };
67 
68 
69 #define MIDICTL_SWELL 7
70 #define SWELL_MIN 0.0f
71 #define SWELL_MAX 1.0f
72 #define SWELL_DEF 1.0f
73 
74 #define MIDICTL_TFREQ 12
75 #define TFREQ_MIN 2.0f
76 #define TFREQ_MAX 8.0f
77 #define TFREQ_DEF 4.0f
78 
79 #define MIDICTL_TMODD 13
80 #define TMODD_MIN 0.0f
81 #define TMODD_MAX 0.6f
82 #define TMODD_DEF 0.3f
83 
84 #define MIDICTL_BANK 32
85 #define MIDICTL_HOLD 64
86 #define MIDICTL_IFELM 98
87 #define MIDICTL_ASOFF 120
88 #define MIDICTL_ANOFF 123
89 
90 #define KEYS_MASK 63
91 #define HOLD_MASK 64
92 #define ALL_MASK 127
93 
95 #include "synthesizer/midipatch.h"
96 #include "effects/effect.h"
97 #include "sparm.h"
98 
99 #endif
100 
Definition: global.h:62
Definition: global.h:64
Definition: global.h:59
Definition: global.h:61
Definition: global.h:60
Definition: global.h:65
Definition: global.h:63