CFugue
Tempo.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: 2013-12-18 10:59:57 +0530 (Wed, 18 Dec 2013) $
9  $Rev: 197 $
10  $LastChangedBy: krishnapg $
11 */
12 
13 #ifndef _TEMPO_H___1A1E8E8A_DFBA_40c7_B45D_7B5EC45BEE4D__
14 #define _TEMPO_H___1A1E8E8A_DFBA_40c7_B45D_7B5EC45BEE4D__
15 
16 /** @file Tempo.h
17  * \brief Declares Tempo class used in Western music
18  */
19 #include "Dictionary.h"
20 
21 namespace CFugue
22 {
23  /// <Summary>
24  /// Represents Tempo for a song. This is independent of the individual tracks in a song.
25  /// Tempo can be changed during a song.
26  /// </Summary>
27  class Tempo
28  {
29  unsigned short m_nTempo; // Tempo in Beats Per Minute (BPM)
30  public:
31  inline Tempo(unsigned short nTempoInBPM) : m_nTempo(nTempoInBPM) { }
32 
33  /// Returns the current Tempo (in Beats Per Minute)
34  inline unsigned short GetTempo() const { return m_nTempo; }
35 
36  /// Populates the standard Tempo Macro defintions into Music String Dictionary
37  inline static void PopulateStandardDefinitions(DICTIONARY& stdDefns)
38  {
39  stdDefns[_T("GRAVE")] = _T("40");
40  stdDefns[_T("LARGO")] = _T("45");
41  stdDefns[_T("LARGHETTO")] = _T("50");
42  stdDefns[_T("LENTO")] = _T("55");
43  stdDefns[_T("ADAGIO")] = _T("60");
44  stdDefns[_T("ADAGIETTO")] = _T("65");
45 
46  stdDefns[_T("ANDANTE")] = _T("70");
47  stdDefns[_T("ANDANTINO")] = _T("80");
48  stdDefns[_T("MODERATO")] = _T("95");
49  stdDefns[_T("ALLEGRETTO")] = _T("110");
50 
51  stdDefns[_T("ALLEGRO")] = _T("120");
52  stdDefns[_T("VIVACE")] = _T("145");
53  stdDefns[_T("PRESTO")] = _T("180");
54  stdDefns[_T("PRETISSIMO")] = _T("220");
55  }
56 
57  };
58 
59 } // namespace CFugue
60 
61 #endif // _TEMPO_H___1A1E8E8A_DFBA_40c7_B45D_7B5EC45BEE4D__
static void PopulateStandardDefinitions(DICTIONARY &stdDefns)
Populates the standard Tempo Macro defintions into Music String Dictionary.
Definition: Tempo.h:37
unsigned short GetTempo() const
Returns the current Tempo (in Beats Per Minute)
Definition: Tempo.h:34
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