noteflakes / lydown

A language for music notation
http://ciconia.github.io/lydown
MIT License
24 stars 0 forks source link

Global music #37

Open noteflakes opened 9 years ago

noteflakes commented 9 years ago

In order to maximize the DRY principle, we could use work.ld or movement.ld files to provide a global music stream that includes the key and time signatures (with partial/pickup definitions), key and time signature changes in the middle of the piece, tempo changes, double bar lines, repetitions, etc.

In the rendered lilypond code, a global stream can be incorporated as follows:

ldGlobalMusic = {
  ...
}

\new Staff <<
  \ldGlobalMusic
  { \ldFluteMusic }
>>

The lydown code will look as follows, for example a movement.ld file:

- key: D
- time: 3/4
- pickup: 4
- tempo: Largo
S*20 // full bar silences (this also needs a separate issue)
\tempo: Allegro \time:4/4 ||

See also #38 for measure number indicators.

noteflakes commented 8 years ago

Working towards implementing this, we still have some issues:

So we should have an API as follows:

@context.current_signature() => {key: 'C', time: '4/4'}

Once a key/time signature is defined/redefined, it is stored in movements/mvt/signatures as an array in which each record is a hash with the following content:

{moment: MusicTime(...), key: 'C', time: '4/4'}