CFugue
ControllerEvent.h
Go to the documentation of this file.
1 /*
2  This is part of CFugue, a C++ Runtime for MIDI Score Programming
3  Copyright (C) 2009 Gopalakrishna Palem
4 
5  For links to further information, or to contact the author,
6  see <http://cfugue.sourceforge.net/>.
7 
8  $LastChangedDate: 2014-05-10 11:18:40 +0530 (Sat, 10 May 2014) $
9  $Rev: 205 $
10  $LastChangedBy: krishnapg $
11 */
12 
13 #ifndef __CONTROLLEREVENT_H_501C77B7_6423_4E41_A53D_1516C031BF77
14 #define __CONTROLLEREVENT_H_501C77B7_6423_4E41_A53D_1516C031BF77
15 
16 /** @file ControllerEvent.h
17  * \brief Declares MIDI Controller Events used in MusicStrings
18  */
19 #include "Dictionary.h"
20 
21 namespace CFugue
22 {
23  /// Takes care of defining the MIDI Controller Events used in MusicStrings
25  {
26  unsigned char uControl;
27  unsigned char uValue;
28  public:
29  ControllerEvent(unsigned char argControl, unsigned char argValue)
30  : uControl(argControl), uValue(argValue)
31  {
32  }
33  /// Returns the current control index
34  inline unsigned char GetControl() const { return uControl; }
35  /// Returns the current control value
36  inline unsigned char GetValue() const { return uValue; }
37  /// Populates the standard Tempo Macro defintions into Music String Dictionary
38  inline static void PopulateStandardDefinitions(DICTIONARY& stdDefns)
39  {
40  //
41  // Controller names
42  //
43  stdDefns[_T("BANK_SELECT_COARSE" )] = _T("0");
44  stdDefns[_T("MOD_WHEEL_COARSE" )] = _T("1");
45  stdDefns[_T("BREATH_COARSE" )] = _T("2");
46  stdDefns[_T("FOOT_PEDAL_COARSE" )] = _T("4");
47  stdDefns[_T("PORTAMENTO_TIME_COARSE" )] = _T("5");
48  stdDefns[_T("DATA_ENTRY_COARSE" )] = _T("6");
49  stdDefns[_T("VOLUME_COARSE" )] = _T("7");
50  stdDefns[_T("BALANCE_COARSE" )] = _T("8");
51  stdDefns[_T("PAN_POSITION_COARSE" )] = _T("10");
52  stdDefns[_T("EXPRESSION_COARSE" )] = _T("11");
53  stdDefns[_T("EFFECT_CONTROL_1_COARSE" )] = _T("12");
54  stdDefns[_T("EFFECT_CONTROL_2_COARSE" )] = _T("13");
55 
56  stdDefns[_T("SLIDER_1" )] = _T("16");
57  stdDefns[_T("SLIDER_2" )] = _T("17");
58  stdDefns[_T("SLIDER_3" )] = _T("18");
59  stdDefns[_T("SLIDER_4" )] = _T("19");
60 
61  stdDefns[_T("BANK_SELECT_FINE" )] = _T("32");
62  stdDefns[_T("MOD_WHEEL_FINE" )] = _T("33");
63  stdDefns[_T("BREATH_FINE" )] = _T("34");
64  stdDefns[_T("FOOT_PEDAL_FINE" )] = _T("36");
65  stdDefns[_T("PORTAMENTO_TIME_FINE" )] = _T("37");
66  stdDefns[_T("DATA_ENTRY_FINE" )] = _T("38");
67  stdDefns[_T("VOLUME_FINE" )] = _T("39");
68  stdDefns[_T("BALANCE_FINE" )] = _T("40");
69  stdDefns[_T("PAN_POSITION_FINE" )] = _T("42");
70  stdDefns[_T("EXPRESSION_FINE" )] = _T("43");
71  stdDefns[_T("EFFECT_CONTROL_1_FINE" )] = _T("44");
72  stdDefns[_T("EFFECT_CONTROL_2_FINE" )] = _T("45");
73 
74  stdDefns[_T("HOLD_PEDAL" )] = _T("64");
75  stdDefns[_T("HOLD" )] = _T("64");
76  stdDefns[_T("PORTAMENTO" )] = _T("65");
77  stdDefns[_T("SUSTENUTO_PEDAL" )] = _T("66");
78  stdDefns[_T("SUSTENUTO" )] = _T("66");
79  stdDefns[_T("SOFT_PEDAL" )] = _T("67");
80  stdDefns[_T("SOFT" )] = _T("67");
81  stdDefns[_T("LEGATO_PEDAL" )] = _T("68");
82  stdDefns[_T("LEGATO" )] = _T("68");
83  stdDefns[_T("HOLD_2_PEDAL" )] = _T("69");
84  stdDefns[_T("HOLD_2" )] = _T("69");
85 
86  stdDefns[_T("SOUND_VARIATION" )] = _T("70");
87  stdDefns[_T("VARIATION" )] = _T("70");
88  stdDefns[_T("SOUND_TIMBRE" )] = _T("71");
89  stdDefns[_T("TIMBRE" )] = _T("71");
90  stdDefns[_T("SOUND_RELEASE_TIME" )] = _T("72");
91  stdDefns[_T("RELEASE_TIME" )] = _T("72");
92  stdDefns[_T("SOUND_ATTACK_TIME" )] = _T("73");
93  stdDefns[_T("ATTACK_TIME" )] = _T("73");
94  stdDefns[_T("SOUND_BRIGHTNESS" )] = _T("74");
95  stdDefns[_T("BRIGHTNESS" )] = _T("74");
96  stdDefns[_T("SOUND_CONTROL_6" )] = _T("75");
97  stdDefns[_T("CONTROL_6" )] = _T("75");
98  stdDefns[_T("SOUND_CONTROL_7" )] = _T("76");
99  stdDefns[_T("CONTROL_7" )] = _T("76");
100  stdDefns[_T("SOUND_CONTROL_8" )] = _T("77");
101  stdDefns[_T("CONTROL_8" )] = _T("77");
102  stdDefns[_T("SOUND_CONTROL_9" )] = _T("78");
103  stdDefns[_T("CONTROL_9" )] = _T("78");
104  stdDefns[_T("SOUND_CONTROL_10" )] = _T("79");
105  stdDefns[_T("CONTROL_10" )] = _T("79");
106 
107  stdDefns[_T("GENERAL_PURPOSE_BUTTON_1" )] = _T("80");
108  stdDefns[_T("GENERAL_BUTTON_1" )] = _T("80");
109  stdDefns[_T("BUTTON_1" )] = _T("80");
110  stdDefns[_T("GENERAL_PURPOSE_BUTTON_2" )] = _T("81");
111  stdDefns[_T("GENERAL_BUTTON_2" )] = _T("81");
112  stdDefns[_T("BUTTON_2" )] = _T("81");
113  stdDefns[_T("GENERAL_PURPOSE_BUTTON_3" )] = _T("82");
114  stdDefns[_T("GENERAL_BUTTON_3" )] = _T("82");
115  stdDefns[_T("BUTTON_3" )] = _T("82");
116  stdDefns[_T("GENERAL_PURPOSE_BUTTON_4" )] = _T("83");
117  stdDefns[_T("GENERAL_BUTTON_4" )] = _T("83");
118  stdDefns[_T("BUTTON_4" )] = _T("83");
119 
120  stdDefns[_T("EFFECTS_LEVEL" )] = _T("91");
121  stdDefns[_T("EFFECTS" )] = _T("91");
122  stdDefns[_T("TREMULO_LEVEL" )] = _T("92");
123  stdDefns[_T("TREMULO" )] = _T("92");
124  stdDefns[_T("CHORUS_LEVEL" )] = _T("93");
125  stdDefns[_T("CHORUS" )] = _T("93");
126  stdDefns[_T("CELESTE_LEVEL" )] = _T("94");
127  stdDefns[_T("CELESTE" )] = _T("94");
128  stdDefns[_T("PHASER_LEVEL" )] = _T("95");
129  stdDefns[_T("PHASER" )] = _T("95");
130 
131  stdDefns[_T("DATA_BUTTON_INCREMENT" )] = _T("96");
132  stdDefns[_T("DATA_BUTTON_INC" )] = _T("96");
133  stdDefns[_T("BUTTON_INC" )] = _T("96");
134  stdDefns[_T("BUTTON_INCREMENT" )] = _T("96");
135  stdDefns[_T("DATA_BUTTON_DECREMENT" )] = _T("97");
136  stdDefns[_T("DATA_BUTTON_DEC" )] = _T("97");
137  stdDefns[_T("BUTTON_DEC" )] = _T("97");
138  stdDefns[_T("BUTTON_DECREMENT" )] = _T("97");
139 
140  stdDefns[_T("NON_REGISTERED_COARSE" )] = _T("98");
141  stdDefns[_T("NON_REGISTERED_FINE" )] = _T("99");
142  stdDefns[_T("REGISTERED_COARSE" )] = _T("100");
143  stdDefns[_T("REGISTERED_FINE" )] = _T("101");
144 
145  stdDefns[_T("ALL_SOUND_OFF" )] = _T("120");
146  stdDefns[_T("ALL_CONTROLLERS_OFF" )] = _T("121");
147  stdDefns[_T("LOCAL_KEYBOARD" )] = _T("122");
148  stdDefns[_T("ALL_NOTES_OFF" )] = _T("123");
149  stdDefns[_T("OMNI_MODE_OFF" )] = _T("124");
150  stdDefns[_T("OMNI_OFF" )] = _T("124");
151  stdDefns[_T("OMNI_MODE_ON" )] = _T("125");
152  stdDefns[_T("OMNI_ON" )] = _T("125");
153  stdDefns[_T("MONO_OPERATION" )] = _T("126");
154  stdDefns[_T("MONO" )] = _T("126");
155  stdDefns[_T("POLY_OPERATION" )] = _T("127");
156  stdDefns[_T("POLY" )] = _T("127");
157 
158  //
159  // Combined Controller names
160  // (index = coarse_controller_index + 128 * fine_controller_index)
161  //
162  // User can either use
163  // X[Foot_Pedal_Coarse]=10
164  // X[Foot_Pedal_Fine]=65
165  // or alternately use the combined form
166  // X[Foot_Pedal]=1345
167  //
168  stdDefns[_T("BANK_SELECT" )] = _T("4096"); // 0 + 128 * 32
169  stdDefns[_T("MOD_WHEEL" )] = _T("4225"); // 1 + 128 * 33
170  stdDefns[_T("BREATH" )] = _T("4354"); // 2 + 128 * 34
171  stdDefns[_T("FOOT_PEDAL" )] = _T("4612"); // 4 + 128 * 36
172  stdDefns[_T("PORTAMENTO_TIME" )] = _T("4741"); // 5 + 128 * 37
173  stdDefns[_T("DATA_ENTRY" )] = _T("4870"); // 6 + 128 * 38
174  stdDefns[_T("VOLUME" )] = _T("4999"); // 7 + 128 * 39
175  stdDefns[_T("BALANCE" )] = _T("5128"); // 8 + 128 * 40
176  stdDefns[_T("PAN_POSITION" )] = _T("5386"); // 10 + 128 * 42
177  stdDefns[_T("EXPRESSION" )] = _T("5515"); // 11 + 128 * 43
178  stdDefns[_T("EFFECT_CONTROL_1" )] = _T("5644"); // 12 + 128 * 44
179  stdDefns[_T("EFFECT_CONTROL_2" )] = _T("5773"); // 13 + 128 * 45
180  stdDefns[_T("NON_REGISTERED" )] = _T("12770");// 98 + 128 * 99
181  stdDefns[_T("REGISTERED" )] = _T("13028");//100 + 128 * 101
182 
183  //
184  // On/Off values for controllers
185  //
186  stdDefns[_T("ON" )] = _T("127");
187  stdDefns[_T("OFF" )] = _T("0");
188  stdDefns[_T("DEFAULT" )] = _T("64");
189  }
190  };
191 
192 } // namespace CFugue
193 
194 #endif // __CONTROLLEREVENT_H_501C77B7_6423_4E41_A53D_1516C031BF77
Takes care of defining the MIDI Controller Events used in MusicStrings.
unsigned char GetValue() const
Returns the current control value.
static void PopulateStandardDefinitions(DICTIONARY &stdDefns)
Populates the standard Tempo Macro defintions into Music String Dictionary.
unsigned char GetControl() const
Returns the current control index.
std::map< MString, MString, StringLess< const TCHAR * > > DICTIONARY
Definition: Dictionary.h:37
Declares Dictionary type used by the Parsers.

CFugue, the C++ Music Programming Library © Copyright 2009 Cenacle Research India Private Limited Gopalakrishna Palem