lilypond-user
[Top][All Lists]
Advanced

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

Re: Define Music Function


From: ctesta
Subject: Re: Define Music Function
Date: Tue, 30 Aug 2011 18:21:08 -0400
User-agent: SquirrelMail/1.4.21

Thanks for the help everyone. I am getting closer. I have one other
question. How could I set the font-size of the first number to be bigger
that the numbers of the fraction?

This currently works, but I need the first number to be font-size = #6 and
the numerator and denominator to be font-size = #3 or so.

fractionRest = #(define-music-function (parser location string num denom)
(string-or-symbol? string-or-symbol? string-or-symbol?)
  #{
    \once \override Staff.Rest #'font-size = #3
    \once \override Staff.Rest #'stencil = #ly:text-interface::print
    \once \override Staff.Rest #'text = #(markup #:musicglyph $string
#:column (#:musicglyph $num #:musicglyph $denom))
    \once \override Dots #'transparent = ##t
    #}
)

This doesn't work.

fractionRest = #(define-music-function (parser location string num denom)
(string-or-symbol? string-or-symbol? string-or-symbol?)
  #{
    \once \override Staff.Rest #'font-size = #3
    \once \override Staff.Rest #'stencil = #ly:text-interface::print
    \once \override Staff.Rest #'text = #(markup #'font-size = #6
#:musicglyph $string #:column (#'font-size = #3 #:musicglyph $num
#:musicglyph $denom))
    \once \override Dots #'transparent = ##t
    #}
)

How would I do this?

Thanks so much,
Carl

> ------------------------------
>
> Message: 2
> Date: Tue, 30 Aug 2011 18:27:05 +0200
> From: Mike Solomon <address@hidden>
> To: address@hidden
> Cc: address@hidden
> Subject: Re: Define Music Function
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> On Aug 30, 2011, at 5:12 PM, address@hidden wrote:
>
>> Hello Everyone,
>>
>> I have been experimenting with music functions in Lilypond and defining
>> new grobs/glyphs etc. I am wondering if someone can help me with this
>> problem I am having. What I would like to create is a rest that looks
>> like
>> a big number that takes up the whole staff and then a fraction with a
>> diagonal line separating the numerator and denominator directly next to
>> it. So imagine a big "3 1/2" on the staff. Here is what I have for just
>> creating the single big number:
>>
>> numberRest = #(define-music-function (parser location string)
>> (string-or-symbol?)
>> #{
>>  \once \override Staff.Rest #'font-size = #6
>>  \once \override Staff.Rest #'Y-offset = #-2
>>  \once \override Staff.Rest #'stencil = #ly:text-interface::print
>>  \once \override Staff.Rest #'text = #(markup #:musicglyph $string)
>>  \once \override Dots #'transparent = ##t
>>  #}
>> )
>>
>> I can use that by doing the following code
>>
>> \numberRest #"three" r2.
>>
>> That works, and I am trying to adapt it for multiple variables and not
>> having much luck, any suggestions?
>>
>> fractionRest = #(define-music-function (parser location num denom)
>> (string-or-symbol? string-or-symbol?)
>> #{
>>  \once \override Staff.Rest #'font-size = #3
>>  \once \override Staff.Rest #'stencil = #ly:text-interface::print
>>  \once \override Staff.Rest #'text = #(markup #:musicglyph $num)
>>  \once \override Dots #'transparent = ##t
>>  \once \override Staff.Rest #'font-size = #3
>>  \once \override Staff.Rest #'stencil = #ly:text-interface::print
>>  \once \override Staff.Rest #'text = #(markup #:musicglyph $denom)
>>  \once \override Dots #'transparent = ##t
>>   #}
>> )
>>
>> Thanks,
>> Carl
>>
>
>
> Hopefully this'll be enough to get you on the track to fractional-rests
> galore!
>
> fractionRest = #(define-music-function (parser location num denom)
> (string-or-symbol? string-or-symbol?)
> #{
>  \once \override Staff.Rest #'stencil = #ly:text-interface::print
>  \once \override Staff.Rest #'text = #(markup #:fraction #:number $num
> #:number $denom)
>  \once \override Dots #'transparent = ##t
>   #})
> { \fractionRest #"4" #"3" r2. }
>
> Cheers,
> MS




reply via email to

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