The `elembuilder` module
Prev | Chapter 4. Extending GNU Solfege | Next

## The `elembuilder` module

Here is a minimal lesson file:

    element progI { label = "I" }
    element progIV { label = "IV" }
    element progV { label = "V" }

    header {
        lesson_id = "3f3872c0-ef2e-4132-9fb1-97f75c7b28fd"
        module = elembuilder
        title = "progression test"
        elements = auto
        # uncomment if you want a music displayer.
        # have_music_displayer = yes
    }

    question {
     music = rvoice("<c' e g> <b d g> <c e g>")
     elements = progI, progV, progI
     name = "I-V-I"
    }
    question {
     music = rvoice("<c' e g> <c f a> <c e g>")
     elements = progI, progIV, progI
     name = "I-IV-I"
    }

### The element block

This block defines the elements the user can put together to answer the question. Each block is named by the string between `element` and `{`. The block defines one variable, `label` that is the label the button will get.

`label` can either be a plain string, or a `progressionlabel`. Progressionlabel strings are displayed a little larger than the default font, and a simple syntax let you get small subscript and superscript numbers. Try `I-(6,4)V(6,4)-I` or `I-IV(6)-V(6)-I` to get an idea how it works.

### The header block

`elements`

  This variable defines which elements to display. Set this to `auto` to display all elements that are needed to answer the questions in the lesson file. You can display more elements that needed to make it more difficult for the user. An example:

      elements = progI, progIV, progV, progIV, progV_6

`music_displayer_stafflines`

  Set this if you want the music displayer to show more than one empty staff line when the music displayer have no music to display.

See also at_question_start.

### The question block

`elements`

  This variable defines which elements defines the question.

`tonic`

  The exercise will have a "Play tonic" button if this variable is defined in a question in the lesson file. The variable should contain some music to play to the user so that he knows the tonic of the question. This can be useful in harmonic progressions that does not start on the tonic. This variable is optional. Example:

      tonic = chord("c e g")

Prev | Up | Next
The `nameinterval` module | Home | Midi instrument names