denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] A Good Idea


From: Richard Shann
Subject: [Denemo-devel] A Good Idea
Date: Sat, 07 Nov 2009 10:21:30 +0000

I have just posted these thoughts at
http://denemo.org/index.php/Dynamic_Denemo_Directives

Dynamic Denemo Directives


The current DenemoDirectives are created by commands invoked by the user
while creating the musical score. However there are many circumstances
where the directive needs to be modified for some condition that is
pertaining at print or play time. For example, when printing parts the
font size may need to be larger than when printing a score.

This design allows any directive to have a flag set in its override
field to indicate that a procedure (named from its tag) should be run
before printing or playing the score. Such a procedure could consult
conditions that have been given a value by the user and modify the
LilyPond or MIDI output to suit. It could also check, for example, if
the music had been edited since the directive was originally installed,
which may require the directive to be modified. Other tasks could
include installing the repeat open directive to match first and secont
time bars. Here is the detailed design:

When creating LilyPond output or MIDI output, we could invoke a
procedure (L-<tag>) or (M-tag) for all directives that have the <tag>
and the override flag DYNAMIC_LILYPOND or DYNAMIC_MIDI set. That is, if
you want a directive to run a script at print or play time you set the
override and, provided M/L-<tag> exists it will be run. If (defined?
`M/L-<tag>) is #f it would try to load the procedure from disk
(actions/lilyscripts/tag or actions/midiscripts/tag). 

The new infrastructure would be in exportmidi.c and exportlilypond.c, it would
     * store the cursor position (current movement, staff, measure and object 
as numerical positions, not pointers)
     * move the cursor through the whole score
     * examine all directives for the appropriate DYNAMIC_xxx override
     * if set, execute the script L-<tag> or M-<tag>, getting it from disk if 
not defined.
     * restore the cursor
     

Applications:

     * Anacrusis/upbeat/pickup the procedure L-Anacrusis just runs 
(d-Anacrusis) which will update the LilyPond to match the duration of the 
upbeat actually present
     * Multi-Measure rests, the script steps forward stopping when it 
encounters timesig changes, rehearsal marks, music etc. For each whole measure 
rest it encounters, it increments a counter and removes the LilyPond output for 
it, placing the cumulative multi-measure rest in the directive that is running 
the script.
     * Crescendo: the procedure M-Crescendo steps forward looking for the end 
crescendo. It takes start and end volumes from these two directives (or else 
some default) and computes a volume increase per second. Then it sets the midi 
volume on each chord according to its timing by setting a directive on the 
chords.
     

(1) The thing being that you cannot put the lily/midiscripts in
init.scm, since the command generating the directive will not have been
run in general during this invocation of Denemo.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]