lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating a "swing rhythm" indication


From: Pierre Perol-Schneider
Subject: Re: Creating a "swing rhythm" indication
Date: Wed, 20 Nov 2019 16:43:41 +0100

Hi Romel
How about:

\version "2.18"

swingindic = \markup {
    \score {
      \new Staff \with {      
        \omit Clef
        \omit TimeSignature
        fontSize = #-4
        \override StaffSymbol.staff-space = #(magstep -4)
        \override StaffSymbol.line-count = #0
        \override VerticalAxisGroup.Y-extent = #'(0 . 0)
      }

      {
        \stemUp b8[ b]
        \tweak stencil #(lambda (grob)
                          (grob-interpret-markup grob
                            #{
                              \markup \fontsize #2 "="
                            #})) b\rest
        \tuplet 3/2 { b4 b8 }
      }
      \layout {
        indent = 0
      }
    }
  }

\swingindic

Cheers,
Pierre

Le mer. 20 nov. 2019 à 14:33, Romel Bismonte <address@hidden> a écrit :

Hello,

 

I was studying the LSR snippet that can insert an alternate rhythm indication (e.g., “swing”, “shuffle”, “maestoso”, etc.) as discussed in Item 204:

 

http://lsr.di.unimi.it/LSR/Item?id=204

 

Since I did not need the other options, I am attempting to boil down the snippet to just the thing I need. My attempt is as follows:

 

\version "2.18.2"

 

swingindic = \markup {

  \line \general-align #Y #DOWN {

    \score {

      \new Staff \with {         

        fontSize = #-4

        \override StaffSymbol.staff-space = #(magstep -4)

        \override StaffSymbol.line-count = #0

        \override VerticalAxisGroup.Y-extent = #'(0 . 0)

      }

      {

        \relative c' { \stemUp b8[ b] }

     

        s4.^\markup { \halign #0 "=" }

        \relative c' { \stemUp \tuplet 3/2 { b'4 b8 } }

      }

      \layout {

        ragged-right = ##t

        indent = 0

        \context {

          \Staff

          \remove "Clef_engraver"

          \remove "Time_signature_engraver"

        }       

      }

    }

  }

}

 

\swingindic

 

This works, but the first note cluster (the two eighth notes) are placed lower than the second note cluster (the triplet between the quarter and eighth note):

 

 

What can I do to align the note heads on the same line? Alternatively, what am I missing from the snippet implementation? At this point I am not opposed to using the whole snippet in my piece, but I ask here anyway as a learning opportunity to see how the markup works in this case. Thank you in advance for any assistance.

 

Romel Bismonte

 

P.S. I’ve been using Lilypond since Version 2.12, and I have to say it’s my most used program (together with Frescobaldi) as a choir director. Thank you for developing and helping to support such a great program.


reply via email to

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