lilypond-user
[Top][All Lists]
Advanced

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

Re:substitution for numerator


From: Stefan Thomas
Subject: Re:substitution for numerator
Date: Mon, 19 Sep 2011 20:42:21 +0200

Dear Jan-Peter,
I would like to create a music function which allows You to build a slur lasting some eigth-triplet and some sixtheenth-quintuplet notes.
I dream of something like:

music = \relative c' {
 \times 2/3 {c8 d e } \times 4/5 {c16 a g f e }
}
slurs = {
 \tripletquintupletslur #2 #5 % the slur lasts 2 triplet and 5 quintuplet notes
}
\new Staff { \context Voice << { \music} {\slurs }>>}
 %%%%%%%%%%

Hello Stefan,

you probably have to code the scaled note in scheme:
--snip--
numerator = #(define-music-function (parser location x) (integer?)
  (make-music 'EventChord
    'elements
    (list
      (make-music 'NoteEvent
        'duration (ly:make-duration 0 0 3 x)
        'pitch (ly:make-pitch 0 0 0))
)))

\displayMusic \relative c' {
  \numerator #4 c4
}
--snip--

But you will get the same result, if you use the times-command:\times
2/3 { c1 }
This will set the numerator and denominator in the duration. And if you
want to hide the tuplet bracket and number, you can do so with:
  \once \override TupletBracket #'stencil = ##f
  \once \override TupletNumber #'stencil = ##f

But this is probably not the source of your question. What is your goal?

Cheers,
Jan-Peter


Am 18.09.2011 11:01, schrieb Stefan Thomas:
> numerator = #(define-music-function (parser location x) (number?)
>   #{ % in der folgenden Zeile Lilypondcode eingeben
>     c1*$x/3
> #})
> themusic = {
>   \numerator #4
> }



reply via email to

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