1
//---------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2012 LenMus project
5
// This program is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation,
7
// either version 3 of the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along with this
14
// program. If not, see <http://www.gnu.org/licenses/>.
16
// For any comment, suggestion or feature request, please contact the manager of
17
// the project at cecilios@users.sourceforge.net
19
//---------------------------------------------------------------------------------------
21
#ifndef __LENMUS_SCALE_H__ //to avoid nested includes
22
#define __LENMUS_SCALE_H__
25
#include "lenmus_standard_header.h"
28
#include <wx/wxprec.h>
32
#include <lomse_pitch.h>
33
using namespace lomse;
39
//---------------------------------------------------------------------------------------
40
// enum to classify scales
43
// --------------------- ----
50
// --------------------- ----
56
// Medievals modes Mode Gregorian modes
57
// --------------------- ---- --------------------------
58
// Protus aut�ntico I Dorico Dorian (Re)
59
// plagal II Hipod�rico
60
// Deuterus aut�ntico III Frigio Phrygian (Mi)
61
// plagal IV Hipofrigio
62
// Tritus aut�ntico V Lidio Lydian (Fa)
63
// plagal VI Hipolidio
64
// Tetrardus aut�ntico VII Mixolidio Mixolydian (Sol)
65
// plagal VIII Hipomixolidio
67
// Modes introduced in 1547:
69
// aut�ntico IX Eolio Aeolian (La = minor natural)
71
// aut�ntico XI J�nico Ionian (Do = major natural)
72
// plagal XII Hipoj�nico
74
// Later introduced modes (rarely used):
76
// XIII Locrio Locrian (Si)
86
est_LastMajor = est_MajorTypeIV,
93
est_LastMinor = est_MinorMelodic,
95
// From here, scales without mode
96
est_EndOfModalScales = est_LastMinor,
106
est_LastGreek = est_GreekLocrian,
112
//Start of non-tonal scales
114
est_WholeTones = est_StartNonTonal,
116
est_LastOther = est_Chromatic,
118
//last element, to signal End Of Table
123
//---------------------------------------------------------------------------------------
124
//a scale is a sequence of up 13 notes (12 chromatic notes plus repetition of first one).
126
#define k_notes_in_scale 13 //Change this for more notes in a scale
132
EKeySignature m_nKey;
133
FPitch m_fpNote[k_notes_in_scale]; //the scale
136
//build a scale from root note and type
137
Scale(FPitch fpRootNote, EScaleType nScaleType, EKeySignature nKey = k_key_C);
140
inline EScaleType get_scale_type() { return m_nType; }
141
inline wxString get_name() { return type_to_name( m_nType ); }
143
string rel_ldp_name_for_note(int i);
144
string abs_ldp_name_for_note(int i);
145
inline FPitch get_note(int i) { return m_fpNote[i]; }
148
static wxString type_to_name(EScaleType nType);
149
static bool is_major(EScaleType nType);
150
static bool is_minor(EScaleType nType);
151
static bool is_gregorian(EScaleType nType);
152
static bool is_tonal(EScaleType nScaleType) { return nScaleType < est_StartNonTonal; }
153
static EScaleType short_name_to_type(const wxString& sName);
160
#endif // __LENMUS_SCALE_H__