[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] A Good Idea
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] A Good Idea |
Date: |
Sun, 08 Nov 2009 12:13:50 +0000 |
Thinking about this, there is no mileage in separate re-fresh for
LilyPond and MIDI, so we can have a single refresh procedure for each
command, say D-<tag>. What we do need is an override that disables a
directive, since if the user has some text that has to be different in
different conditions we need to be able to store the un-used version; it
can live in a "hidden" directive. Whether/how the "hidden" directives
should display is moot.
Richard
On Sat, 2009-11-07 at 17:32 +0000, Richard Shann wrote:
> I realized that I don't need much to implement this. Here is a script
> which goes thru the current staff, running (L-<tag>) for any directives
> it finds. It doesn't even check if it should, but it correctly updates
> the Anacrusis if you have changed the duration of the upbeat.
>
> (d-GoToBeginning)
>
> (define (L-Anacrusis)
> (d-Anacrusis))
>
> (let loop ((tag #f))
> (set! tag (d-DirectiveGetTag-standalone))
> (if (string? tag)
> (eval-string (string-append "(L-" tag ")")))
> (if (d-NextStandaloneDirective)
> (loop tag)))
>
> My immediate interest is multi measure rests...
>
> Richard
>
>
> On Sat, 2009-11-07 at 10:21 +0000, Richard Shann wrote:
> > 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.
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Denemo-devel mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/denemo-devel
>
>
>
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel