Als je zelf lesbestanden wilt schrijven, kun je het beste kijken naar
de bestaande lesbestanden in lesson-files/
. Gebruik dit document
en het muziekformaat document als naslagwerk.
Een lesbestand bestaat uit een zogenaamd header-blok en een of meerdere question-blokken:
header { toekenning toekenning ... } question { toekenning ... }
Het headerblok kun je overal in het bestand opnemen. Het is echter gebruikelijk
om dit blok aan het begin van het bestand op te nemen. Als je meer dan een
headerblok opgeeft zal Solfege alleen de eerste gebruik en de overigen negeren.
Dit kan bijvoorbeeld voorkomen als je het include
commando gebruikt.
Definities die je kunt gebruiken in het headerblok:
title = tekst
description = tekst
content = lijst
chord
, dictation
, id-by-name
,
harmony
en sing-chord
Sommige lesbestanden kun je gebruiken voor meer dan een oefening. Een
lesbestand met akkoorden kun je bijvoorbeeld ook heel goed gebruiken bij
de Identificeer via naam oefening. Je moet hier in dit geval
content = chord, id-by-name
gebruiken.
musicformat = FORMAT
normal
: The default value
chord
: any music "MUSIC CODE" will be interpreted as:
\staff{ < MUSIC CODE > }or
\staff\transpose NOTENAME{ < MUSIC CODE > }
musicformat = chord
is necessary if lesson files
written for the chord exercise should be used by for example the
id-by-name exercise.
satb
: the music "c | bes g | e | G C"
will be interpreted as:
\staff{ \stemUp < c > } \addvoice{ \stemDown < bes g > } \staff{\clef bass; \stemUp < e > } \addvoice{ \stemDown < G C > }This is used by the sing-chord exercise.
random_transpose = yes | no
labelformat = normal | progression
filldir = horiz | vertic
fillnum = INTEGER
filldir
tell the direction the buttons are filled,
and fillnum
tell how many buttons there are in
each row or column.
name = "some short name"
music = "\staff{c'2 g' e4 e c1}"
question { tempo = 160/4 name = "Lisa gikk til skolen" music = "\staff\relative c'{c d e f g2 g2}" }
you can write:
question { tempo = 160/4 name = "Lisa gikk til skolen" "\staff\relative c'{c d e f g2 g2}" }
tempo = 130/4
In lesson files that is written to work with chord
exercise,
two more variables can used:
inversion
toptone
By default, the dictation exercise will show the first column of music, and then the user should write the rest. But if the first column is not good enough, if there for example are only rests on the first beat, these two variables can tell the program how much music to display:
clue_end = nn/dd
clue_end=1/4
will display all music in the first quarter note.
clue_music = MUSIC
Questions for this exercise need to have the key
variable set if the key signature is anything else than
c major (or a minor). Example:
question { "c''|e'|g|c" } question { "a'|e'|c'|a" } question { key="d \major" "a'|fis'|d'|d"} question { key="f \minor" "as'|f'|c'|f"}
Global variables can save you a few key strokes.
s = "\score\relative c'{ %s } question { # instead of music = "\score\relative c'{ c d e f g2 g2 } : music = s % "c d e f g2 g" }
The global variable tempo
will be the default tempo
for the questions following the definition. If not set, the
default value is 120 beats per minute. That equals the definition
tempo = 60/4
Everything after # on a line is ignored
Disclaimer: I don't know any of the standard ways of describing grammar, like BNF. So this is just an attemt to describe the file format to get people started writing lesson files.
Lessonfiles consists of assignment statements and blocks containing assignment statements.
_
description = _("This is a short description")
include
include(singchord-1)
string
"
character, like this: "this is a string"
.
The string can contain line breaks, so this is valid:
description = "<h1>Long desription</h1> This lessonfile need very much descriptions. bla bla bla"
If the string need to contain the "
character, you have
to use tripple quotes:
description = """Try <a href="solfege:practise/melodic-intervall">this </a> for a simpler intervall exercise."""
integer
tempotype (in lack of a better name)
bpm/beatlen
. An example:
tempo = 120/4
will set the tempo to 120 beats per minute, each beat being a quarter note.
The operators can only be used on strings
+
%
%s
. Examples:
"\staff\relative c'{%s}" % "c d e"evaluates to
"\staff\relative c'{c d e}"
To be put on the right side of assignments. The current parse does not complain if you redefines the identifiers, so don't do that!
chord, dictation, id-by-name, sing-chord
content
horiz, vertic
normal, progression
labelformat
values.
yes, no
Identifiers match the regular expression "[a-zA-Z]+[\w_-]*".
There are two block types, header
and question
blocktype { CONTENTS }