Warning: mysql_connect(): Can't connect to MySQL server on 'mysql.sourceforge.net' (111) in /home/groups/c/co/compo/htdocs/inc/variables.php on line 7

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/groups/c/co/compo/htdocs/inc/variables.php on line 8

Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/groups/c/co/compo/htdocs/inc/lib.stats.php on line 17

Warning: mysql_query(): A link to the server could not be established in /home/groups/c/co/compo/htdocs/inc/lib.stats.php on line 17

Warning: mysql_close(): no MySQL-Link resource supplied in /home/groups/c/co/compo/htdocs/inc/lib.stats.php on line 18

Home

Compo Online

Français

 

Presentation

compo and Open Music
Demos
FAQs
Download

Documentation

Tips

Contact
About us

SourceForge Logo

2001-11-28 - Representation of lyrics with compo

Consider this kind of morphing between the tune of a very popular musical, and some composition in the style of a motet from the Middle Ages, one voice singing the same text as the other but twice slower:

ear it

Any section of the form (lyrics ...) inside a compo script corresponds to a lyrics section to be printed on the score. Each syllabe or word is represented by an elementary note including some text as a string, just like for example :

(lyrics ("I'm")("sin-")("ging")("in")("the")("rain"))

But to have the text printed under a staff, one have to associate it to the corresponding voice, simply by setting properly the voice property at the lyrics note level :

(lyrics :treble ("I'm")("sin-")("ging")("in")("the")("rain"))

Note that though it figures here, :treble is the default value to the voice property and does not need to be specified.

Hence by synchronizing this expression with some other expression at the treble voice containing notes, you will have each part of text printed under each note at the same position. Two things are necessary for the synchronization. The lyrics section and the notes section should be placed inside a structure containing the :sync keyword, to indicate that both start at the same time :

(note :sync

(lyrics :tenor ("I'm")("sin-")("ging")("in")("the")("rain"))

(:tenor (:c)(:c5 :dur (+ :h :8th))(:a :8th)(:g :8th)(:f :8th)(:d :h.)))

and each piece of text should share the same duration properties than corresponding notes:

(note :sync

(lyrics :tenor ("I'm")("sin-" :dur (+ :h :8th))("ging" :8th)("in" :8th)("the" :8th)("rain" :h.))

(:tenor (:c)(:c5 :dur (+ :h :8th))(:a :8th)(:g :8th)(:f :8th)(:d :h.)))

Of course, if you already know compo, you have guessed that, in the score example above, the first half of the treble voice, and the bass voice can be represented by the same object:

(note :sync

  x=(:sync

    (lyrics (:rest :h.)("I'm")("sin-" :dur (+ :h :8th))("ging" :8th)("in" :8th)("the" :8th)("rain" :h.))

    ((:rest :h.)(:c)(:c5 :dur (+ :h :8th))(:a :8th)(:g :8th)(:f :8th)(:d :h.)))

  (x ...)

  (:bass :c3 :h x))

Hence, not only the musical notes can be shared, but equally the associated lyrics. Now suppose that this example was to be repeated twice, with the bass singing the second part of the text at the repetition. This is represented in score like this:

Since the second line under the bass staff is the same text than the second part of the treble staff, this text can also be abstracted in a variable in order to be shared:

y=(lyrics ("Just")("sin-" :dur (+ :h :8th))("ging" :8th)("in" :8th)("the" :8th)("rain" :h.))

Finally, here is the whole source of the example:

(note :sync

  x=(:sync

    (lyrics (:rest :h.)("I'm")("sin-" :dur (+ :h :8th))("ging" :8th)("in" :8th)("the" :8th)("rain" :h.))

    ((:rest :h.)(:c)(:c5 :dur (+ :h :8th))(:a :8th)(:g :8th)(:f :8th)(:d :h.)))

  y=(lyrics ("Just")("sin-" :dur (+ :h :8th))("ging" :8th)("in" :8th)("the" :8th)("rain" :h.))

  (x (:sync y (:c)(:f :dur (+ :h :8th))(:f :8th)(:g :8th)(:a :8th)(:c5 :h.))

  (:bass :c3 :h :sync x ((:rest :h.) (:bf y))))

Note the :bf height property to the last instance of y, which is the way to indicate that the corresponding text is to be placed on the second line.

2001-10-22 - Hierarchical representation of music