The elembuilder module

The `elembuilder` module
Пред. | Глава 4. Extending GNU Solfege | След.

## The `elembuilder` module

Here is a minimal lesson file:

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

    header {
        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`

  `label` can either be a plain string or one of the label functions.

`sort`

  If defined, the value of `sort` will be used to sort the elements when displaying the buttons. If not defined, the elements will be sorted by their name.

### 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 and music_displayer_stafflines.

### The question block

`elements`

  This variable defines which elements defines the question. It can be elements, as defined in the example above, or strings or labels defined by the label functions.

`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")

`name`

  The name is needed for storing statistics. A string or a label created by the label functions.

See also vmusic.

Пред. | Наверх | След.
The `dictation` module | Начало | The `harmonicinterval` module