The rhythmtapping module
The rhythmtapping module
| ||
---|---|---|
Пред. | Глава 4. Extending GNU Solfege | След. |
Exercises using this module will play some music and then the user should tap the rhythm. The program will then say if the users rhythm is similar enough to the rhythm played by the computer.
Here is a minimal lesson file:
header { module = rhythmtapping version = "3.7.0" title = "Rhythm tapping test" } question { music = rhythm("c4 c8 c8") } question { music = music("\staff\relative c'{c4 d8 e f4}\addvoice\relative c'{c4 b8 c a4}") rhythm = rhythm("c4 c8 c c4") }
The first question in the example is very simple and self explaining. Solfege will play the rhythm defined in the music
variable, and the user should tap that rhythm.
The second question is a little more complicated. Here Solfege will play the music defined in the music
variable. And when the user taps the rhythm, Solfege will compare the users rhythm with the rhythm defined in the rhythm
variable. The reason for using two variables is that Solfege is not smart enough to figure out the rhythm if you enter polyphonic music. It make no difference if you set the rhythm
variable to be a rhythm
music object, or another single voice type like rvoice
. This might change in the future. You as a lesson file author must make sure the rhythms in the two variables are in fact the same.
See also at_question_start.