On Fri, Sep 7, 2012 at 9:42 AM, David Kastrup <d...@gnu.org> wrote: > Janek Warchoł <janek.lilyp...@gmail.com> writes: > >> On Thu, Sep 6, 2012 at 9:55 AM, David Kastrup <d...@gnu.org> wrote: >>> I don't see why you should not be able to do this using music functions. >> >> Hmm. You may be absolutely right. Maybe all we need is to write such >> functions and ship them with LilyPond! > > at = > #(define-music-function (parser location t e m) > (ly:duration? ly:event? ly:music?) > #{ << #m { \skip $t <>$e } >> #}) > > \new Voice { > \at 1*1/3 \p > \at 1*2/3 \< > \at 1\! > c'1 > }
Thanks! This shows how much i have to learn - didn't think it would be so easy. 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. (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?)) 2) similarly to using << >> construct manually, it breaks full-measure-extra-space - compare spacing of the whole notes: \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 { b8 b b b b b b b c'1 b8 b b b b\< b b b \at 2 \! c'1 } Now, full-measure-extra-space isn't that important, but we may expect that other similar context-specific things will appear and break because of spacer rests used in \at. > What we have under the umbrella of "syntax discussion" > contains three things: lexical units, grammar and vocabulary, mostly > implemented in lexer.ll, parser.yy, and *.ly respectively. In order to > keep syntax predictable, we want to be able to solve most problems just > by extending the vocabulary. That means that lexical units and grammar > should be as generic, powerful, and simple as possible. Agreed. > Specialized > lexical modes take power from the vocabulary. We want to avoid them as > much as possible given our historic constraints. ok. >>>> My rough idea would look something like this >>>> (this is just a musing, not a proposal for discussion yet): >>>> >>>> { b2 \<@0.5 a2 \!@0.5 } meaning { << b1 { s2 \< s2 \! } >> } >>> >>> Looks like a case of the cure being worse than the problem. Apart from >>> not being related in any obvious manner. >> >> I'm not sure i understand what you had in mind. > > I wanted to express that I'm not sure I understand what you had in > mind. I can't figure out how your proposed syntax is going to mean what > you state it would. Durations are different, there is a different > number of notes... ooops! That's embarassing! I've mixed two different examples from my vault. 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) cheers, Janek _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel