[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: automatically left-aligning custom dynamics
From: |
james |
Subject: |
Re: automatically left-aligning custom dynamics |
Date: |
Sun, 9 Sep 2012 08:50:22 +0200 |
On Sep 7, 2012, at 1:48 AM, David Nalesnik wrote:
> Hi James,
>
> On Thu, Sep 6, 2012 at 5:00 PM, james <address@hidden> wrote:
>> I don't really understand it, but I can modify the examples of how to create
>> custom dynamics to get what I want.
>> I have a document with several examples like:
>> rinforzamf = #(
>> make-dynamic-script (
>> markup #:line (
>> #:left-align
>> #:normal-text
>> #:whiteout
>> #:italic "rinforza"
>> #:hspace 0
>> #:whiteout
>> #:dynamic "mf"
>> )
>> )
>> )
>> And a macro that left-aligns it:
>> leftalign = { \once \override Dynamics.DynamicText #'self-alignment-X = #-1 }
>>
>> Heretofore, I've just been manually adding the \leftalign before the
>> \rinforzamf (for example). Is there a way to get both of these in one
>> command?
>>
>
> With the following definitions, you can get what you want with a
> single command. Also, you can define other such combinations.
>
> (BTW, I commented out two lines in the markup definition which I don't
> think are needed.)
>
> HTH,
> David
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> \version "2.17.1"
>
> #(define (rinforza text)
> (let* ((text
> (markup
> #:line (
> ;#:left-align
> #:normal-text
> #:whiteout
> #:italic "rinforza"
> ;#:hspace 0
> #:whiteout
> #:dynamic text)))
> (my-dyn (make-music 'AbsoluteDynamicEvent
> 'text text)))
> (set! (ly:music-property my-dyn 'tweaks)
> (acons 'self-alignment-X -1
> (ly:music-property my-dyn 'tweaks)))
> my-dyn))
>
> rinforzamf = #(rinforza "mf")
> rinforzap = #(rinforza "p")
>
> \score {
> \new Staff <<
> { c'1 d' c' d' }
> \new Dynamics {
> s1*2\rinforzamf
> s1*2\rinforzap
> }
>>>
> }
Hello, I'm having some difficulty understanding how to integrate this into my
document. Is is possible to just add (acons 'self-alignment-X -1 into the
existing structure, and if so, where? Or does that not work?