Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2025 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 :
23 : #pragma once
24 :
25 : #include <QString>
26 : #include <unordered_map>
27 :
28 : #include "mpe/mpetypes.h"
29 :
30 : namespace muse::mpe {
31 : static const std::unordered_map<ArticulationFamily, QString> ARTICULATION_FAMILY_NAMES {
32 : { ArticulationFamily::Undefined, "Undefined" },
33 : { ArticulationFamily::Keyboards, "KeyboardsArticulation" },
34 : { ArticulationFamily::Strings, "StringsArticulation" },
35 : { ArticulationFamily::Winds, "WindsArticulation" },
36 : { ArticulationFamily::Percussions, "PercussionsArticulation" },
37 : { ArticulationFamily::Voices, "VoicesArticulation" },
38 : };
39 :
40 : static const std::unordered_map<ArticulationType, QString> ARTICULATION_TYPE_NAMES {
41 : { ArticulationType::Undefined, "Undefined" },
42 : { ArticulationType::Standard, "Standard" },
43 : { ArticulationType::Staccato, "Staccato" },
44 : { ArticulationType::Staccatissimo, "Staccatissimo" },
45 : { ArticulationType::Tenuto, "Tenuto" },
46 : { ArticulationType::Marcato, "Marcato" },
47 : { ArticulationType::Accent, "Accent" },
48 : { ArticulationType::SoftAccent, "SoftAccent" },
49 : { ArticulationType::LaissezVibrer, "LaissezVibrer" },
50 : { ArticulationType::Subito, "Subito" },
51 : { ArticulationType::FadeIn, "FadeIn" },
52 : { ArticulationType::FadeOut, "FadeOut" },
53 : { ArticulationType::Harmonic, "Harmonic" },
54 : { ArticulationType::JazzTone, "JazzTone" },
55 : { ArticulationType::PalmMute, "PalmMute" },
56 : { ArticulationType::Mute, "Mute" },
57 : { ArticulationType::Open, "Open" },
58 : { ArticulationType::Pizzicato, "Pizzicato" },
59 : { ArticulationType::SnapPizzicato, "SnapPizzicato" },
60 : { ArticulationType::RandomPizzicato, "RandomPizzicato" },
61 : { ArticulationType::UpBow, "UpBow" },
62 : { ArticulationType::DownBow, "DownBow" },
63 : { ArticulationType::Detache, "Detache" },
64 : { ArticulationType::Martele, "Martele" },
65 : { ArticulationType::Jete, "Jete" },
66 : { ArticulationType::ColLegno, "ColLegno" },
67 : { ArticulationType::SulPont, "SulPonticello" },
68 : { ArticulationType::SulTasto, "SulTasto" },
69 : { ArticulationType::GhostNote, "GhostNote" },
70 : { ArticulationType::CrossNote, "CrossNote" },
71 : { ArticulationType::CrossLargeNote, "CrossLargeNote" },
72 : { ArticulationType::CrossOrnateNote, "CrossOrnateNote" },
73 : { ArticulationType::CircleNote, "CircleNote" },
74 : { ArticulationType::CircleCrossNote, "CircleCrossNote" },
75 : { ArticulationType::CircleDotNote, "CircleDotNote" },
76 : { ArticulationType::TriangleLeftNote, "TriangleLeftNote" },
77 : { ArticulationType::TriangleRightNote, "TriangleRightNote" },
78 : { ArticulationType::TriangleUpNote, "TriangleUpNote" },
79 : { ArticulationType::TriangleDownNote, "TriangleDownNote" },
80 : { ArticulationType::TriangleRoundDownNote, "TriangleRoundDownNote" },
81 : { ArticulationType::DiamondNote, "DiamondNote" },
82 : { ArticulationType::MoonNote, "MoonNote" },
83 : { ArticulationType::PlusNote, "PlusNote" },
84 : { ArticulationType::SlashNote, "SlashNote" },
85 : { ArticulationType::SquareNote, "SquareNote" },
86 : { ArticulationType::SlashedBackwardsNote, "SlashedBackwardsNote" },
87 : { ArticulationType::SlashedForwardsNote, "SlashedForwardsNote" },
88 : { ArticulationType::Fall, "Fall" },
89 : { ArticulationType::QuickFall, "QuickFall" },
90 : { ArticulationType::Doit, "Doit" },
91 : { ArticulationType::Plop, "Plop" },
92 : { ArticulationType::Scoop, "Scoop" },
93 : { ArticulationType::BrassBend, "BrassBend" },
94 : { ArticulationType::Multibend, "Multibend" },
95 : { ArticulationType::SlideOutDown, "SlideOutDown" },
96 : { ArticulationType::SlideOutUp, "SlideOutUp" },
97 : { ArticulationType::SlideInAbove, "SlideInAbove" },
98 : { ArticulationType::SlideInBelow, "SlideInBelow" },
99 : { ArticulationType::Crescendo, "Crescendo" },
100 : { ArticulationType::Diminuendo, "Diminuendo" },
101 : { ArticulationType::DiscreteGlissando, "DiscreteGlissando" },
102 : { ArticulationType::ContinuousGlissando, "ContinuousGlissando" },
103 : { ArticulationType::Breath, "Breath" },
104 : { ArticulationType::Legato, "Legato" },
105 : { ArticulationType::Pedal, "Pedal" },
106 : { ArticulationType::Arpeggio, "Arpeggio" },
107 : { ArticulationType::ArpeggioUp, "ArpeggioUp" },
108 : { ArticulationType::ArpeggioDown, "ArpeggioDown" },
109 : { ArticulationType::ArpeggioStraightUp, "ArpeggioStraightUp" },
110 : { ArticulationType::ArpeggioStraightDown, "ArpeggioStraightDown" },
111 : { ArticulationType::Vibrato, "Vibrato" },
112 : { ArticulationType::WideVibrato, "WideVibrato" },
113 : { ArticulationType::MoltoVibrato, "MoltoVibrato" },
114 : { ArticulationType::SenzaVibrato, "SenzaVibrato" },
115 : { ArticulationType::Tremolo8th, "Tremolo8th" },
116 : { ArticulationType::Tremolo16th, "Tremolo16th" },
117 : { ArticulationType::Tremolo32nd, "Tremolo32nd" },
118 : { ArticulationType::Tremolo64th, "Tremolo64th" },
119 : { ArticulationType::TremoloBuzz, "TremoloBuzz" },
120 : { ArticulationType::UpperMordent, "ShortTrill" },
121 : { ArticulationType::Trill, "Trill" },
122 : { ArticulationType::TrillBaroque, "TrillBaroque" },
123 : { ArticulationType::LowerMordent, "Mordent" },
124 : { ArticulationType::PrallMordent, "PrallMordent" },
125 : { ArticulationType::UpperMordentBaroque, "UpperMordentBaroque" },
126 : { ArticulationType::LowerMordentBaroque, "LowerMordentBaroque" },
127 : { ArticulationType::MordentWithUpperPrefix, "MordentWithUpperPrefix" },
128 : { ArticulationType::UpMordent, "UpMordent" },
129 : { ArticulationType::DownMordent, "DownMordent" },
130 : { ArticulationType::Tremblement, "Tremblement" },
131 : { ArticulationType::UpPrall, "UpPrall" },
132 : { ArticulationType::PrallUp, "PrallUp" },
133 : { ArticulationType::PrallDown, "PrallDown" },
134 : { ArticulationType::LinePrall, "LinePrall" },
135 : { ArticulationType::Slide, "Slide" },
136 : { ArticulationType::Turn, "Turn" },
137 : { ArticulationType::InvertedTurn, "InvertedTurn" },
138 : { ArticulationType::PreAppoggiatura, "PreAppoggiatura" },
139 : { ArticulationType::PostAppoggiatura, "PostAppoggiatura" },
140 : { ArticulationType::Acciaccatura, "Acciaccatura" },
141 : { ArticulationType::TremoloBar, "TremoloBar" },
142 : { ArticulationType::Distortion, "Distortion" },
143 : { ArticulationType::Overdrive, "Overdrive" },
144 : { ArticulationType::Slap, "Slap" },
145 : { ArticulationType::Pop, "Pop" },
146 : { ArticulationType::LeftHandTapping, "LeftHandTapping" },
147 : { ArticulationType::RightHandTapping, "RightHandTapping" },
148 : { ArticulationType::MalletBellOnTable, "MalletBellOnTable" },
149 : { ArticulationType::MalletBellSuspended, "MalletBellSuspended" },
150 : { ArticulationType::MalletLift, "MalletLift" },
151 : { ArticulationType::Pluck, "Pluck" },
152 : { ArticulationType::PluckLift, "PluckLift" },
153 : { ArticulationType::Gyro, "Gyro" },
154 : { ArticulationType::Martellato, "Martellato" },
155 : { ArticulationType::MartellatoLift, "MartellatoLift" },
156 : { ArticulationType::HandMartellato, "HandMartellato" },
157 : { ArticulationType::MutedMartellato, "MutedMartellato" },
158 : { ArticulationType::ThumbDamp, "ThumbDamp" },
159 : { ArticulationType::BrushDamp, "BrushDamp" },
160 : { ArticulationType::Ring, "Ring" },
161 : { ArticulationType::RingTouch, "RingTouch" },
162 : { ArticulationType::SingingBell, "SingingBell" },
163 : { ArticulationType::SingingVibrate, "SingingVibrate" },
164 : { ArticulationType::Swing, "Swing" },
165 : { ArticulationType::Echo, "Echo" },
166 : };
167 :
168 0 : inline ArticulationFamily articulationFamilyFromString(const QString& str)
169 : {
170 0 : return muse::key(ARTICULATION_FAMILY_NAMES, str, ArticulationFamily::Undefined);
171 : }
172 :
173 0 : inline const QString articulationFamilyToString(const ArticulationFamily family)
174 : {
175 0 : return muse::value(ARTICULATION_FAMILY_NAMES, family);
176 : }
177 :
178 0 : inline ArticulationType articulationTypeFromString(const QString& str)
179 : {
180 0 : return muse::key(ARTICULATION_TYPE_NAMES, str, ArticulationType::Undefined);
181 : }
182 :
183 0 : inline const QString articulationTypeToString(const ArticulationType type)
184 : {
185 0 : return muse::value(ARTICULATION_TYPE_NAMES, type);
186 : }
187 : }
|