lilypond-user
[Top][All Lists]
Advanced

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

Re: Macro pre-processing?


From: Carrick Patterson
Subject: Re: Macro pre-processing?
Date: Thu, 06 Apr 2006 19:53:02 -0600
User-agent: Microsoft-Entourage/10.1.4.030702.0

I have read and re-read this part of the manual for weeks, and experimented around and I cannot get it to work unless it also contains a music _expression_. All the examples have the padding variable or whatever it is defined using define-music-function, which requires also passing a music _expression_ as a parameter. Example:

withPadding =
#(define-music-function (parser location padding music) (number? ly:music?)

I don't want to have to have a music _expression_ when I call my function. I'd like to do something like:

\myMark #3.0

This would put a rehearsal mark in and pad it three units.

It would be used like:

\score{ \relative c
{ c d e f g a b c \myMark #3.0 c b a g f e d c}
}

If this is possible and explained in the manual, the explanation as given there is greater than my weak brain can absorb.

Thanks for your indulgence and kind patience in trying to explain this.


From: Mats Bengtsson <address@hidden>
Date: Thu, 06 Apr 2006 22:40:25 +0200
To: Carrick Patterson <address@hidden>
Cc: Lilypond mailing list <address@hidden>
Subject: Re: Macro pre-processing?

That's exactly what you can do if you read those sections.
(Well, you will probably have to write \myPad #3.0 )

   /Mats

Carrick Patterson wrote:

> Yeah. Thanks.
>
> It still would be nice to be able to do something like \myPad 3.0.
>
> ------------------------------------------------------------------------
> *From: *Mats Bengtsson <address@hidden>
> *Date: *Thu, 06 Apr 2006 22:17:22 +0200
> *To: *Carrick Patterson <address@hidden>
> *Cc: *Geoff Horton <address@hidden>, Lilypond mailing list
> <address@hidden>
> *Subject: *Re: Macro pre-processing?
>
> Just read sections 11.1.3 and 11.1.6 in the manual.
>
>    /Mats
>
> Quoting Carrick Patterson <address@hidden>:
>
>> If somehow you find an answer to this and it doesn't make the list, I
> wish
>> you'd post it. I can think of a million uses for being able to pass a
>> variable to a function on the fly, and never have figured out how to
> do it
>> without having a second variable that is actual notes included and
> putting
>> the whole thing around curly brackets. Just to be able to pass a padding
>> parameter to a user-written function for spacing, say, rehearsal
> marks would
>> be a great timesaver.
>>
>>
>> From: "Geoff Horton" <address@hidden>
>> Date: Thu, 6 Apr 2006 11:57:44 -0400
>> To: "Lilypond mailing list" <address@hidden>
>> Subject: Macro pre-processing?
>>
>> I guess I should start by explaining what I want to do. I have a lot
>> of notes in chords whose noteheads need to be individually \tweak-ed
>> to be smaller. Always on the lookout to reduce typing (and thus
>> typos), I tried:
>>
>> organ = { \tweak "'font-size #-2 }
>>
>> But LilyPond wants an argument right then and there. I strongly
>> suspect I could do a Scheme macro if I knew enough about Scheme and
>> LilyPond internals, but that seems overkill when all I really want is
>> the equivalent of a C compilers macro expansion capability.
>>
>> I could write such a utility easily enough in Perl, and I suspect it's
>> simple enough that I could learn enough Python to write it without too
>> much trouble (thereby not introducing a fourth language into the mix),
>> but I'm wondering if there already exists a simple way to do text
>> substitutions that I don't know about. (I'd also like to use this for
>> a more general conditional interpretation facility than the tags
>> supply.)
>>
>> Geoff
>>
>>
>> _______________________________________________
>> lilypond-user mailing list
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>>
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>lilypond-user mailing list
>address@hidden
>http://lists.gnu.org/mailman/listinfo/lilypond-user
>  
>


--
=============================================
    Mats Bengtsson
    Signal Processing
    Signals, Sensors and Systems
    Royal Institute of Technology
    SE-100 44  STOCKHOLM
    Sweden
    Phone: (+46) 8 790 8463                
        Fax:   (+46) 8 790 7260
    Email: address@hidden
    WWW: http://www.s3.kth.se/~mabe
=============================================


reply via email to

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