lilypond-user
[Top][All Lists]
Advanced

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

Re: How to create an extra-offset shortcut


From: Thomas Morley
Subject: Re: How to create an extra-offset shortcut
Date: Mon, 22 Jul 2013 19:56:41 +0200

2013/7/22 Rachael Thomas Carlson <address@hidden>:
> On Mon, 2013-07-22 at 18:18 +0200, David Kastrup wrote:
>> Rachael Thomas Carlson <address@hidden> writes:
>>
>> > Hello everyone:
>> >
>> > I am trying to figure out how I can create a nifty little shortcut to
>> > write a \once \override with the ability to manipulate the extra-offset
>> > of a grob using non-integer numbers.  What I have found works with
>> > integers only.  I need more control over this function: I need to be
>> > able to input decimals.
>> >
>> > Here is what I have (which works with integers but not decimals):
>> >
>> > \version "2.16.2"
>> >
>> > mkMove = #(define-music-function
>> >     (parser location x y)
>> >     ( number? number? )
>> >     #{ \once \override TextScript #'extra-offset = #(cons x y)
>> >     #})
>> >
>> > Any ideas?
>>
>> Should work just fine with decimals.  Decimal numbers don't really have
>> an input syntax in the LilyPond language proper (not while in music
>> entry mode), so you'll need to escape into Scheme for entering them:
>>
>> \mkMove #2.3 #-4.5
>>
> Hello:  Perfect!  I missed the pound signs fixed this.
>
> How would you do this using a tweak function for extra-offset?
>
> Thanks,
> Rachael

\version "2.16.2"

mkTweak =
#(define-event-function (parser location x y m) (number? number? ly:music?)
  #{  \tweak #'extra-offset #(cons x y) #m #})

{ c'1\mkTweak #4.4 #-3.3 ^"XY" }


-Harm



reply via email to

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