Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Education
Minuet
Commits
0dfbd891
Commit
0dfbd891
authored
Jun 27, 2016
by
Sandro Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor scale exercises to new architecture
parent
a24c38a4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
51 deletions
+61
-51
data/definitions/CMakeLists.txt
data/definitions/CMakeLists.txt
+1
-0
data/definitions/scales-major-and-its-modes-definitions.json
data/definitions/scales-major-and-its-modes-definitions.json
+39
-0
data/exercises/CMakeLists.txt
data/exercises/CMakeLists.txt
+1
-0
data/exercises/scales-major-and-its-modes-exercises.json
data/exercises/scales-major-and-its-modes-exercises.json
+16
-0
data/scales-major-and-its-modes.json
data/scales-major-and-its-modes.json
+0
-45
src/shell/exercisecontroller.cpp
src/shell/exercisecontroller.cpp
+4
-5
src/shell/exercisecontroller.h
src/shell/exercisecontroller.h
+0
-1
No files found.
data/definitions/CMakeLists.txt
View file @
0dfbd891
...
...
@@ -2,6 +2,7 @@ set(minuet_DEFINITIONS
intervals-ascending-melodic-definitions.json
intervals-descending-melodic-definitions.json
chords-root-position-definitions.json
scales-major-and-its-modes-definitions.json
)
install
(
FILES
${
minuet_DEFINITIONS
}
DESTINATION
${
KDE_INSTALL_DATADIR
}
/minuet/definitions
)
data/definitions/scales-major-and-its-modes-definitions.json
0 → 100644
View file @
0dfbd891
{
"definitions"
:
[
{
"tags"
:
[
"scale"
,
"ascending"
,
"major"
],
"name"
:
"Ionian"
,
"sequence"
:
"2 4 5 7 9 11 12"
},
{
"tags"
:
[
"scale"
,
"ascending"
,
"major"
],
"name"
:
"Dorian"
,
"sequence"
:
"2 3 5 7 9 10 12"
},
{
"tags"
:
[
"scale"
,
"ascending"
,
"major"
],
"name"
:
"Phrygian"
,
"sequence"
:
"1 3 5 7 8 10 12"
},
{
"tags"
:
[
"scale"
,
"ascending"
,
"major"
],
"name"
:
"Lydian"
,
"sequence"
:
"2 4 6 7 9 11 12"
},
{
"tags"
:
[
"scale"
,
"ascending"
,
"major"
],
"name"
:
"Mixolydian"
,
"sequence"
:
"2 4 5 7 9 10 12"
},
{
"tags"
:
[
"scale"
,
"ascending"
,
"major"
],
"name"
:
"Aeolian"
,
"sequence"
:
"2 3 5 7 8 10 12"
},
{
"tags"
:
[
"scale"
,
"ascending"
,
"major"
],
"name"
:
"Locrian"
,
"sequence"
:
"1 3 5 6 8 10 12"
}
]
}
data/exercises/CMakeLists.txt
View file @
0dfbd891
...
...
@@ -2,6 +2,7 @@ set(minuet_EXERCISES
intervals-ascending-melodic-exercises.json
intervals-descending-melodic-exercises.json
chords-root-position-exercises.json
scales-major-and-its-modes-exercises.json
)
install
(
FILES
${
minuet_EXERCISES
}
DESTINATION
${
KDE_INSTALL_DATADIR
}
/minuet/exercises
)
data/exercises/scales-major-and-its-modes-exercises.json
0 → 100644
View file @
0dfbd891
{
"exercises"
:
[
{
"name"
:
"Scales"
,
"root"
:
"21..104"
,
"playMode"
:
"scale"
,
"userMessage"
:
"the scale"
,
"children"
:
[
{
"name"
:
"Major Scale and its Modes"
,
"and-tags"
:
[
"scale"
,
"major"
]
}
]
}
]
}
data/scales-major-and-its-modes.json
deleted
100644 → 0
View file @
a24c38a4
{
"exercises"
:
[
{
"name"
:
"Scales"
,
"root"
:
"21..104"
,
"playMode"
:
"scale"
,
"userMessage"
:
"the scale"
,
"children"
:
[
{
"name"
:
"Major Scale and its Modes"
,
"options"
:
[
{
"name"
:
"Ionian"
,
"sequence"
:
"2 4 5 7 9 11 12"
},
{
"name"
:
"Dorian"
,
"sequence"
:
"2 3 5 7 9 10 12"
},
{
"name"
:
"Phrygian"
,
"sequence"
:
"1 3 5 7 8 10 12"
},
{
"name"
:
"Lydian"
,
"sequence"
:
"2 4 6 7 9 11 12"
},
{
"name"
:
"Mixolydian"
,
"sequence"
:
"2 4 5 7 9 10 12"
},
{
"name"
:
"Aeolian"
,
"sequence"
:
"2 3 5 7 8 10 12"
},
{
"name"
:
"Locrian"
,
"sequence"
:
"1 3 5 6 8 10 12"
}
]
}
]
}
]
}
src/shell/exercisecontroller.cpp
View file @
0dfbd891
...
...
@@ -44,8 +44,7 @@ ExerciseController::ExerciseController(MidiSequencer *midiSequencer) :
m_maxRootNote
(
0
),
m_playMode
(
ScalePlayMode
),
m_answerLength
(
1
),
m_chosenRootNote
(
0
),
m_chosenExercise
(
0
)
m_chosenRootNote
(
0
)
{
m_exercises
[
"exercises"
]
=
QJsonArray
();
m_exercises
[
"definitions"
]
=
QJsonArray
();
...
...
@@ -115,8 +114,8 @@ QStringList ExerciseController::randomlyChooseExercises()
}
for
(
unsigned
int
i
=
0
;
i
<
m_answerLength
;
++
i
)
{
m_
chosenExercise
=
qrand
()
%
m_exerciseOptions
.
size
();
QString
sequence
=
m_exerciseOptions
[
m_
chosenExercise
].
toObject
()[
QStringLiteral
(
"sequence"
)].
toString
();
unsigned
int
chosenExercise
=
qrand
()
%
m_exerciseOptions
.
size
();
QString
sequence
=
m_exerciseOptions
[
chosenExercise
].
toObject
()[
QStringLiteral
(
"sequence"
)].
toString
();
if
(
m_playMode
!=
RhythmPlayMode
)
{
int
minNote
=
INT_MAX
;
...
...
@@ -163,7 +162,7 @@ QStringList ExerciseController::randomlyChooseExercises()
}
}
chosenExercises
<<
m_exerciseOptions
[
m_
chosenExercise
].
toObject
()[
QStringLiteral
(
"name"
)].
toString
();
chosenExercises
<<
m_exerciseOptions
[
chosenExercise
].
toObject
()[
QStringLiteral
(
"name"
)].
toString
();
}
if
(
m_playMode
==
RhythmPlayMode
)
{
m_midiSequencer
->
appendEvent
(
m_midiSequencer
->
SMFNoteOn
(
9
,
80
,
120
),
barStart
);
...
...
src/shell/exercisecontroller.h
View file @
0dfbd891
...
...
@@ -84,7 +84,6 @@ private:
PlayMode
m_playMode
;
unsigned
int
m_answerLength
;
unsigned
int
m_chosenRootNote
;
unsigned
int
m_chosenExercise
;
QString
m_errorString
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment