It's getting better! yay! On Fri, Sep 7, 2012 at 11:10 AM, David Kastrup <d...@gnu.org> wrote: > > Janek Warchoł <janek.lilyp...@gmail.com> writes: >> However, i see two problems with this function, and i suppose they're >> not easy to fix within current framework: >> 1) it is "prefix". I'm pretty sure that users will get confused as to >> why sometimes you write \p after a note, and sometimes before it. > > The main reason is that it is _attached_ to the note, like accents are. > The attachment for dynamics is rather loose: basically it just plays at > the same time in the Voice. This attachment is no longer valid when > time-shifting. One could doubt the wisdom of turning commands like > dynamics into post events in the first place: things that make also > sense time-shifted might be conceptually better represented as > standalone events.
Maybe. > Coming back to your proposal: It would be possible to create an empty > post-event wrapper that can actually contain timed music, thus writing > something like > > \new Voice { > c'1 > \at 1*1/3 \p > \at 1*2/3 \< > \at 1\! > } > > and have \at as an event function. I doubt we would be doing people a > favor, though. It turns out that \at can actually time-shift arbitrary > music if you just replace the ly:event? tag with ly:music? You mean something like this? at = #(define-music-function (parser location t e m) (ly:duration? ly:music? ly:music?) #{ << #m { \skip $t <>$e } >> #}) << \new Staff { \at 2 { e'8 f' g' a' } c'1 } \new Staff { c'4 d' e' f' } >> Wow! it's cool! > This makes sense in a number of cases but would > really get strained if you had to do it in postevent syntax. In > particular if you don't want to attach it just to a single note but > rather a sequence, which would make sense for dynamics. Like this? \paper { ragged-right = ##f } at = #(define-music-function (parser location t e m) (ly:duration? ly:event? ly:music?) #{ << #m { \skip $t <>$e } >> #}) \new Voice { \at 4. \< \at 2 \! { c'4 d' e' } } (hey, that's really cool!) Frankly, i'd find it more natural to write it postfix: { c'4 d' e' } \at 4. \< \at 2 \! because if follows LilyPond spirit - "notes first, decorations later". (if that's what you're talking about). >> (of course if you understand what the function actually does, >> everything becomes clear - but i think it's important to have syntax >> that looks consistent and intuitive without reading function >> definitions (is the word "transparency" appropriate here?)) > > The problem is to avoid syntax that reads a bit more "intuitive" for > some use cases and gets totally intractable for others. agreed. >> I intended to write this: >> { b2 \<@0.5 a2 \!@0.5 } meaning { << { b2 a2 } { s4 s2 \< s4 \! } >> } >> (i don't insist on having decimal numbers. It's just that the idea >> was not to specify a delay duration, but a percent of the "parent" >> note duration, and decimal numbers look better for this) > > Decimal numbers are "inexact". With computers, you'll find that 0.5 and > 0.5 will likely add up to result in 1.0, but you'll be lucky if 0.4 and > 0.6 add up to 1.0. For music, the concept of simultaneousness is > sometimes important: if a dynamic change happens one microsecond after > the attack of a note, it is too late to affect the attack itself. This > will significantly change the MIDI and, if done judiciously, also the > print (where losing the direct attachment to a note may cause quite > different alignments). ok, scrap decimals then. _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel