乐谱夹

存放一些各处收集来的谱子。

Alice

来源网络,用 LilyPond 重新打了。

\version "2.24.0"
\header {
  title = "Alice"
  composer = "古川本舖"
  arranger = "Osamuraisan"
  copyright = "SilverRainZ"
}

prelude = \repeat unfold 2 {
    e,4 c g d
    f, c g d
    g, c g d
    g,8(a,8\6) c4 g d \break
}

interlude = \repeat unfold 2 {
  <e, g>4 c' d' g'
  <f, g>4 c' d' g'
  <g, g>4 c' d' g'
  <f, g>4 c' d' g' \break
}

pieceA = {
  <a, c'>4 e' <e, g'> g
}

pieceAi = {
  <f, c'>4 g' <c g'> g
}

pieceB = {
  <c a'>4 g8 c'8 <f, c'>4 d
}

pieceBi = {
  <d g'>4 (c'') <a c''> g
}

pieceBii = {
  <c c'>4 d <g, d'> d'
}

pieceBiii = {
  <c c'>4 d <g, d'> f'
}

pieceC = {
  <c a>4 c' <g, e'> d
}

pieceCi = {
  <d c'>4 g <g, e'> g
}

pieceCii = {
  <c c'>4 d' <a, e'> g8 e'8
}

pieceCiii = {
  <d e'>4 c' <a, c'> g8 e'8
}

pieceCiv = {
  <c c'>4 d' <a, e'> g
}

pieceD = {
  <g, d'>4 c' <a, c'> g
}

pieceDi = {
  <g, d'>4 f' <a, e'> d
}

pieceDii = {
  <g, d'>4 d8 c'8 <a, c'>4 d8 e'8
}

pieceDiii = {
  <g, d'>4 c' <f, c'> g
}

pieceDiv = {
  <g, d'>4 d8 c'8 <a, c'>2
}

symbols =  {
  \time 4/4
  \tempo  "Allegro" 4 = 150

  % 1
  \prelude

  %9
  \pieceA
  \pieceB
  \pieceC
  \pieceD \break

  %13
  \pieceA
  \pieceB
  \pieceC
  \pieceDi \break

  %17
  \pieceA
  \pieceB
  \pieceC
  \pieceD \break

  %21
  \pieceA
  \pieceBi
  \pieceCi
  \pieceD \break

  %25
  \pieceA
  \pieceB
  <c a>4 c' <g, e'> <d f'>
  \pieceD \break

  %29
  \pieceA
  \pieceB
  \pieceC
  \pieceDi \break

  %33
  \pieceA
  \pieceB
  \pieceC
  \pieceD \break

  %37
  \pieceA
  \pieceBi
  \pieceCi
  \pieceDii \break

  \bar "||"

  %41
  \pieceDiii

  %42
  \pieceAi
  \pieceBii
  \pieceCii \break
  \pieceDiii

  %46
  \pieceAi
  \pieceBiii
  \pieceCiii \break
  \pieceDiii

  %50
  \pieceAi
  \pieceBiii
  \pieceCiv \break

  %53
  \pieceA
  \pieceBi
  \pieceCi
  \pieceDii \break

  \bar "||"

  %57
  \pieceA
  \pieceB
  \pieceC
  \pieceD \break

  %61
  \pieceA
  \pieceB
  \pieceC
  \pieceDi \break

  %65
  \pieceA
  \pieceB
  \pieceC
  \pieceD \break

  %69
  \pieceA
  \pieceBi
  \pieceCi
  \pieceDiv \break

  \bar "||"

  %73
  \prelude

  %81
  \interlude

  \bar "||"

  %89
  r1
  r1

  \bar "|."
}

\score {
  <<
    \new Staff \with {midiInstrument = "acoustic guitar (nylon)"} {
      \clef "G_8"
      \symbols
    }
    % \new TabStaff {
    %   \tabFullNotation
    %   \symbols
    % }
  >>

  \midi { }
  \layout { }
}

Witch Sprint I OP

自己扒的。

\version "2.24.0"
\header {
  title = "《魔女之泉 1》开场音乐"
  composer = "Kiwi Walks"
  arranger = "SilverRainZ"
}

symbols =  {
  \time 4/4
  \tempo  "Allegretto" 4 = 110

  % 1
  c'4 c' c' c'8 b8
  c'4 g' c' c'8 b8
  c'4 g' (ais') c''8 b'8
  c''2 r2 \break

  %14
  e'4 g c'2
  a8 c'8 c'8 d'8 c'2

  e'4 g' c'2
  c'4 d'8 e'8 c'4 g \break

  e'4 g c'2
  a8 c'8 c'8 d'8 e'4 c'

  g4 f e f8 g8

  \bar "|."
}

\score {
  <<
    \new Staff \with {midiInstrument = "acoustic guitar (nylon)"} {
      \clef "G_8"
      \symbols
    }
    % \new TabStaff {
    %   \tabFullNotation
    %   \symbols
    % }
  >>

  \midi { }
  \layout { }
}

girlfriend

待处理

还只有旋律,等我耳朵更好一点再来吧。

\version "2.24.0"
\header {
  title = "girlfriend"
  composer = "古川本舖"
  arranger = "SilverRainZ"
  copyright = "SilverRainZ"
}

symbols =  {
  \time 4/4
  \tempo 4 = 70

  % 1-4
  c8 d e e      e4 d8 e8~
  e4 d8 e       a,4 d8 e
  d4 c8 c4      c4 d8 e4 
  g4. e8 d c d4
  \break

  % 5-8
  d8 c c d4. e8
  c4 b,8 c2 e8
  f g4 d d f4
  e e8 d c d4 e8
  \break

  c4 b,8 c2

  \bar "|."
}

\score {
  <<
    \new Staff \with {midiInstrument = "acoustic guitar (nylon)"} {
      \clef "G_8"
      \symbols
    }
    % \new TabStaff {
    %   \tabFullNotation
    %   \symbols
    % }
  >>

  \midi { }
  \layout { }
}

Alice 间奏

之前武士桑的谱里没有的部分,是用口琴吹的。扒出来的节奏好像有问题:

\version "2.24.0"

symbols =  {
  \time 4/4
  \tempo  "Allegro" 4 = 150

  e8 d4 c4 c4.
  c4 g g2
  c2 d4 d
  c4 d e2
  \break

  e8 d4 c4 c4.
  c4 g g2
  c2 d4 f
  e4 c c2
  \break

  e8 d4 c4 c4.
  c4 g g2
  c2 d4 d
  c4 d e2
  \break

  c4 e g2
  g4 c' c'2
  c2 e
  d2 c

  \bar "|."
}

\score {
  <<
    \new Staff \with {midiInstrument = "acoustic guitar (nylon)"} {
      \clef "G_8"
      \symbols
    }
    % \new TabStaff {
    %   \tabFullNotation
    %   \symbols
    % }
  >>

  \midi { }
  \layout { }
}

送别 简谱

CAGED 系统 用。

\version "2.20.0"
#(set-global-staff-size 20)

% un-comment the next line to remove Lilypond tagline:
% \header { tagline="" }

% comment out the next line if you're debugging jianpu-ly
% (but best leave it un-commented in production, since
% the point-and-click locations won't go to the user input)
\pointAndClickOff

\paper {
  print-all-headers = ##t %% allow per-score headers

  % un-comment the next line for A5:
  % #(set-default-paper-size "a5" )

  % un-comment the next line for no page numbers:
  % print-page-number = ##f

  % un-comment the next 3 lines for a binding edge:
  % two-sided = ##t
  % inner-margin = 20\mm
  % outer-margin = 10\mm

  % un-comment the next line for a more space-saving header layout:
  % scoreTitleMarkup = \markup { \center-column { \fill-line { \magnify #1.5 { \bold { \fromproperty #'header:dedication } } \magnify #1.5 { \bold { \fromproperty #'header:title } } \fromproperty #'header:composer } \fill-line { \fromproperty #'header:instrument \fromproperty #'header:subtitle \smaller{\fromproperty #'header:subsubtitle } } } }
}

%% 2-dot and 3-dot articulations
#(append! default-script-alist
   (list
    `(two-dots
       . (
           (stencil . ,ly:text-interface::print)
           (text . ,#{ \markup \override #'(font-encoding . latin1) \center-align \bold ":" #})
           (padding . 0.20)
           (avoid-slur . inside)
           (direction . ,UP)))))
#(append! default-script-alist
   (list
    `(three-dots
       . (
           (stencil . ,ly:text-interface::print)
           (text . ,#{ \markup \override #'(font-encoding . latin1) \center-align \bold "⋮" #})
           (padding . 0.30)
           (avoid-slur . inside)
           (direction . ,UP)))))
"two-dots" =
#(make-articulation 'two-dots)

"three-dots" =
#(make-articulation 'three-dots)

\layout {
  \context {
    \Score
    scriptDefinitions = #default-script-alist
  }
}

note-mod =
#(define-music-function
     (text note)
     (markup? ly:music?)
   #{
     \tweak NoteHead.stencil #ly:text-interface::print
     \tweak NoteHead.text
        \markup \lower #0.5 \sans \bold #text
     \tweak Rest.stencil #ly:text-interface::print
     \tweak Rest.text
        \markup \lower #0.5 \sans \bold #text
     #note
   #})
#(define (flip-beams grob)
   (ly:grob-set-property!
    grob 'stencil
    (ly:stencil-translate
     (let* ((stl (ly:grob-property grob 'stencil))
            (centered-stl (ly:stencil-aligned-to stl Y DOWN)))
       (ly:stencil-translate-axis
        (ly:stencil-scale centered-stl 1 -1)
        (* (- (car (ly:stencil-extent stl Y)) (car (ly:stencil-extent centered-stl Y))) 0) Y))
     (cons 0 -0.8))))

%=======================================================
#(define-event-class 'jianpu-grace-curve-event 'span-event)

#(define (add-grob-definition grob-name grob-entry)
   (set! all-grob-descriptions
         (cons ((@@ (lily) completize-grob-entry)
                (cons grob-name grob-entry))
               all-grob-descriptions)))

#(define (jianpu-grace-curve-stencil grob)
   (let* ((elts (ly:grob-object grob 'elements))
          (refp-X (ly:grob-common-refpoint-of-array grob elts X))
          (X-ext (ly:relative-group-extent elts refp-X X))
          (refp-Y (ly:grob-common-refpoint-of-array grob elts Y))
          (Y-ext (ly:relative-group-extent elts refp-Y Y))
          (direction (ly:grob-property grob 'direction RIGHT))
          (x-start (* 0.5 (+ (car X-ext) (cdr X-ext))))
          (y-start (+ (car Y-ext) 0.32))
          (x-start2 (if (eq? direction RIGHT)(+ x-start 0.5)(- x-start 0.5)))
          (x-end (if (eq? direction RIGHT)(+ (cdr X-ext) 0.2)(- (car X-ext) 0.2)))
          (y-end (- y-start 0.5))
          (stil (ly:make-stencil `(path 0.1
                                        (moveto ,x-start ,y-start
                                         curveto ,x-start ,y-end ,x-start ,y-end ,x-start2 ,y-end
                                         lineto ,x-end ,y-end))
                                  X-ext
                                  Y-ext))
          (offset (ly:grob-relative-coordinate grob refp-X X)))
     (ly:stencil-translate-axis stil (- offset) X)))

#(add-grob-definition
  'JianpuGraceCurve
  `(
     (stencil . ,jianpu-grace-curve-stencil)
     (meta . ((class . Spanner)
              (interfaces . ())))))

#(define jianpu-grace-curve-types
   '(
      (JianpuGraceCurveEvent
       . ((description . "Used to signal where curve encompassing music start and stop.")
          (types . (general-music jianpu-grace-curve-event span-event event))
          ))
      ))

#(set!
  jianpu-grace-curve-types
  (map (lambda (x)
         (set-object-property! (car x)
           'music-description
           (cdr (assq 'description (cdr x))))
         (let ((lst (cdr x)))
           (set! lst (assoc-set! lst 'name (car x)))
           (set! lst (assq-remove! lst 'description))
           (hashq-set! music-name-to-property-table (car x) lst)
           (cons (car x) lst)))
    jianpu-grace-curve-types))

#(set! music-descriptions
       (append jianpu-grace-curve-types music-descriptions))

#(set! music-descriptions
       (sort music-descriptions alist<?))


#(define (add-bound-item spanner item)
   (if (null? (ly:spanner-bound spanner LEFT))
       (ly:spanner-set-bound! spanner LEFT item)
       (ly:spanner-set-bound! spanner RIGHT item)))

jianpuGraceCurveEngraver =
#(lambda (context)
   (let ((span '())
         (finished '())
         (current-event '())
         (event-start '())
         (event-stop '()))
     `(
       (listeners
        (jianpu-grace-curve-event .
          ,(lambda (engraver event)
             (if (= START (ly:event-property event 'span-direction))
                 (set! event-start event)
                 (set! event-stop event)))))

       (acknowledgers
        (note-column-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)
                  (add-bound-item span grob)))
             (if (ly:spanner? finished)
                 (begin
                  (ly:pointer-group-interface::add-grob finished 'elements grob)
                  (add-bound-item finished grob)))))
        (inline-accidental-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)))
             (if (ly:spanner? finished)
                 (ly:pointer-group-interface::add-grob finished 'elements grob))))
        (script-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)))
             (if (ly:spanner? finished)
                 (ly:pointer-group-interface::add-grob finished 'elements grob)))))
       
       (process-music .
         ,(lambda (trans)
            (if (ly:stream-event? event-stop)
                (if (null? span)
                    (ly:warning "No start to this curve.")
                    (begin
                     (set! finished span)
                     (ly:engraver-announce-end-grob trans finished event-start)
                     (set! span '())
                     (set! event-stop '()))))
            (if (ly:stream-event? event-start)
                (begin
                 (set! span (ly:engraver-make-grob trans 'JianpuGraceCurve event-start))
                 (set! event-start '())))))
       
       (stop-translation-timestep .
         ,(lambda (trans)
            (if (and (ly:spanner? span)
                     (null? (ly:spanner-bound span LEFT)))
                (ly:spanner-set-bound! span LEFT
                  (ly:context-property context 'currentMusicalColumn)))
            (if (ly:spanner? finished)
                (begin
                 (if (null? (ly:spanner-bound finished RIGHT))
                     (ly:spanner-set-bound! finished RIGHT
                       (ly:context-property context 'currentMusicalColumn)))
                 (set! finished '())
                 (set! event-start '())
                 (set! event-stop '())))))
       
       (finalize
        (lambda (trans)
          (if (ly:spanner? finished)
              (begin
               (if (null? (ly:spanner-bound finished RIGHT))
                   (set! (ly:spanner-bound finished RIGHT)
                         (ly:context-property context 'currentMusicalColumn)))
               (set! finished '())))))
       )))

jianpuGraceCurveStart =
#(make-span-event 'JianpuGraceCurveEvent START)

jianpuGraceCurveEnd =
#(make-span-event 'JianpuGraceCurveEvent STOP)
%===========================================================

%{ The jianpu-ly input was:
% http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html

NoBarNums % break heigth of chore names

title=送别
4=80
1=A
4/4

chords= a1 d2 a2 a1 e:7 a1 d2 a2 a1 e:7 d1 e:7 a2 d2 a2 e:7 a1 d2 a2 e:7 a1

5 q3 q5 1' -
6  q1' q6 5 -
5 q1 q2 3 q2 q1 
2  - - 0
\break

5 q3 q5 1'. q7
6 1' 5 -
5 q2 q3 4. q7,
1 - . 0
\break

6 ^"低八度" 1' 1' 0
7 q6 q7 1' ^"I" 0
q6 q7 q1' q6 q6 q5 q3 q1
2 - . 0
\break

5 q3 q5 1'. q7
6 1' 5 -
5 q2 q3 4. q7,
1 - . 0
%}


\score {
<< \override Score.BarNumber.break-visibility = #center-visible
\override Score.BarNumber.Y-offset = -1
\set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
\new ChordNames { \set chordChanges = ##t 
\chordmode { a1 d2 a2 a1 e:7 a1 d2 a2 a1 e:7 d1 e:7 a2 d2 a2 e:7 a1 d2 a2 e:7 a1 } }

%% === BEGIN JIANPU STAFF ===
    \new RhythmicStaff \with {
    \consists "Accidental_engraver" 
    \consists \jianpuGraceCurveEngraver
    % Get rid of the stave but not the barlines:
    \override StaffSymbol.line-count = #0 % tested in 2.15.40, 2.16.2, 2.18.0, 2.18.2, 2.20.0 and 2.22.2
    \override BarLine.bar-extent = #'(-2 . 2) % LilyPond 2.18: please make barlines as high as the time signature even though we're on a RhythmicStaff (2.16 and 2.15 don't need this although its presence doesn't hurt; Issue 3685 seems to indicate they'll fix it post-2.18)
    $(add-grace-property 'Voice 'Stem 'direction DOWN)
    $(add-grace-property 'Voice 'Slur 'direction UP)
    $(add-grace-property 'Voice 'Stem 'length-fraction 0.5)
    $(add-grace-property 'Voice 'Beam 'beam-thickness 0.1)
    $(add-grace-property 'Voice 'Beam 'length-fraction 0.3)
    $(add-grace-property 'Voice 'Beam 'after-line-breaking flip-beams)
    $(add-grace-property 'Voice 'Beam 'Y-offset 2.5)
    $(add-grace-property 'Voice 'NoteHead 'Y-offset 2.5)
    }
    { \new Voice="W" {
    \override Beam.transparent = ##f
    \override Stem.direction = #DOWN
    \override Tie.staff-position = #2.5
    \tupletUp
    \tieUp
    \override Stem.length-fraction = #0
    \override Beam.beam-thickness = #0.1
    \override Beam.length-fraction = #0.5
    \override Beam.after-line-breaking = #flip-beams
    \override Voice.Rest.style = #'neomensural % this size tends to line up better (we'll override the appearance anyway)
    \override Accidental.font-size = #-4
    \override TupletBracket.bracket-visibility = ##t

    \override Staff.TimeSignature.style = #'numbered
    \override Staff.Stem.transparent = ##t
     \tempo 4=80 \mark \markup{1=A} \time 4/4  \note-mod "5" g4 \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "1" c4^.
 ~  \note-mod "–" c4 | %{ bar 2: %}
 \note-mod "6" a4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "5" g4
 ~  \note-mod "–" g4 | %{ bar 3: %}
 \note-mod "5" g4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "2" d8]
 \note-mod "3" e4 \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 4: %}
 \note-mod "2" d4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" d4
 ~  \note-mod "–" d4  \note-mod "0" r4 \break | %{ bar 5: %}
 \note-mod "5" g4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8]
 \note-mod "1" c4.^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[]
| %{ bar 6: %}
 \note-mod "6" a4
 \note-mod "1" c4^. \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "5" g4
 ~  \note-mod "–" g4 | %{ bar 7: %}
 \note-mod "5" g4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "3" e8]
 \note-mod "4" f4. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8-\tweak #'X-offset #0.6 _. []
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 8: %}
 \note-mod "1" c4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~  \note-mod "–" c4  \note-mod "0" r4 \break | %{ bar 9: %}
 \note-mod "6" a4
^"低八度"  \note-mod "1" c4^.  \note-mod "1" c4^.  \note-mod "0" r4 | %{ bar 10: %}
 \note-mod "7" b4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
 \note-mod "1" c4^. ^"I"  \note-mod "0" r4 | %{ bar 11: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 12: %}
 \note-mod "2" d4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" d4
 ~  \note-mod "–" d4  \note-mod "0" r4 \break | %{ bar 13: %}
 \note-mod "5" g4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8]
 \note-mod "1" c4.^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[]
| %{ bar 14: %}
 \note-mod "6" a4
 \note-mod "1" c4^. \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "5" g4
 ~  \note-mod "–" g4 | %{ bar 15: %}
 \note-mod "5" g4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "3" e8]
 \note-mod "4" f4. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8-\tweak #'X-offset #0.6 _. []
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 16: %}
 \note-mod "1" c4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~  \note-mod "–" c4  \note-mod "0" r4 \bar "|." } }
% === END JIANPU STAFF ===

>>
\header{
title="送别"
}
\layout{ \context { \Score \remove "Bar_number_engraver" } 
  \context {
    \Global
    \grobdescriptions #all-grob-descriptions
  }
} }
\score {
\unfoldRepeats
<< 
\new ChordNames { \set chordChanges = ##t 
\chordmode { a1 d2 a2 a1 e:7 a1 d2 a2 a1 e:7 d1 e:7 a2 d2 a2 e:7 a1 d2 a2 e:7 a1 } }

% === BEGIN MIDI STAFF ===
    \new Staff { \new Voice="X" { \tempo 4=80 \transpose c a, { \key c \major  \time 4/4 g'4 e'8 g'8 c''2 | %{ bar 2: %} a'4 c''8 a'8 g'2 | %{ bar 3: %} g'4 c'8 d'8 e'4 d'8 c'8 | %{ bar 4: %} d'2. r4 \break | %{ bar 5: %} g'4 e'8 g'8 c''4. b'8 | %{ bar 6: %} a'4 c''4 g'2 | %{ bar 7: %} g'4 d'8 e'8 f'4. b8 | %{ bar 8: %} c'2. r4 \break | %{ bar 9: %} a'4 ^"低八度" c''4 c''4 r4 | %{ bar 10: %} b'4 a'8 b'8 c''4 ^"I" r4 | %{ bar 11: %} a'8 b'8 c''8 a'8 a'8 g'8 e'8 c'8 | %{ bar 12: %} d'2. r4 \break | %{ bar 13: %} g'4 e'8 g'8 c''4. b'8 | %{ bar 14: %} a'4 c''4 g'2 | %{ bar 15: %} g'4 d'8 e'8 f'4. b8 | %{ bar 16: %} c'2. r4 } } }
% === END MIDI STAFF ===

>>
\header{
title="送别"
}
\midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 84 4)}} }

自新大陆 第二乐章 节选 简谱

\version "2.20.0"
#(set-global-staff-size 20)

% un-comment the next line to remove Lilypond tagline:
% \header { tagline="" }

% comment out the next line if you're debugging jianpu-ly
% (but best leave it un-commented in production, since
% the point-and-click locations won't go to the user input)
\pointAndClickOff

\paper {
  print-all-headers = ##t %% allow per-score headers

  % un-comment the next line for A5:
  % #(set-default-paper-size "a5" )

  % un-comment the next line for no page numbers:
  % print-page-number = ##f

  % un-comment the next 3 lines for a binding edge:
  % two-sided = ##t
  % inner-margin = 20\mm
  % outer-margin = 10\mm

  % un-comment the next line for a more space-saving header layout:
  % scoreTitleMarkup = \markup { \center-column { \fill-line { \magnify #1.5 { \bold { \fromproperty #'header:dedication } } \magnify #1.5 { \bold { \fromproperty #'header:title } } \fromproperty #'header:composer } \fill-line { \fromproperty #'header:instrument \fromproperty #'header:subtitle \smaller{\fromproperty #'header:subsubtitle } } } }
}

%% 2-dot and 3-dot articulations
#(append! default-script-alist
   (list
    `(two-dots
       . (
           (stencil . ,ly:text-interface::print)
           (text . ,#{ \markup \override #'(font-encoding . latin1) \center-align \bold ":" #})
           (padding . 0.20)
           (avoid-slur . inside)
           (direction . ,UP)))))
#(append! default-script-alist
   (list
    `(three-dots
       . (
           (stencil . ,ly:text-interface::print)
           (text . ,#{ \markup \override #'(font-encoding . latin1) \center-align \bold "⋮" #})
           (padding . 0.30)
           (avoid-slur . inside)
           (direction . ,UP)))))
"two-dots" =
#(make-articulation 'two-dots)

"three-dots" =
#(make-articulation 'three-dots)

\layout {
  \context {
    \Score
    scriptDefinitions = #default-script-alist
  }
}

note-mod =
#(define-music-function
     (text note)
     (markup? ly:music?)
   #{
     \tweak NoteHead.stencil #ly:text-interface::print
     \tweak NoteHead.text
        \markup \lower #0.5 \sans \bold #text
     \tweak Rest.stencil #ly:text-interface::print
     \tweak Rest.text
        \markup \lower #0.5 \sans \bold #text
     #note
   #})
#(define (flip-beams grob)
   (ly:grob-set-property!
    grob 'stencil
    (ly:stencil-translate
     (let* ((stl (ly:grob-property grob 'stencil))
            (centered-stl (ly:stencil-aligned-to stl Y DOWN)))
       (ly:stencil-translate-axis
        (ly:stencil-scale centered-stl 1 -1)
        (* (- (car (ly:stencil-extent stl Y)) (car (ly:stencil-extent centered-stl Y))) 0) Y))
     (cons 0 -0.8))))

%=======================================================
#(define-event-class 'jianpu-grace-curve-event 'span-event)

#(define (add-grob-definition grob-name grob-entry)
   (set! all-grob-descriptions
         (cons ((@@ (lily) completize-grob-entry)
                (cons grob-name grob-entry))
               all-grob-descriptions)))

#(define (jianpu-grace-curve-stencil grob)
   (let* ((elts (ly:grob-object grob 'elements))
          (refp-X (ly:grob-common-refpoint-of-array grob elts X))
          (X-ext (ly:relative-group-extent elts refp-X X))
          (refp-Y (ly:grob-common-refpoint-of-array grob elts Y))
          (Y-ext (ly:relative-group-extent elts refp-Y Y))
          (direction (ly:grob-property grob 'direction RIGHT))
          (x-start (* 0.5 (+ (car X-ext) (cdr X-ext))))
          (y-start (+ (car Y-ext) 0.32))
          (x-start2 (if (eq? direction RIGHT)(+ x-start 0.5)(- x-start 0.5)))
          (x-end (if (eq? direction RIGHT)(+ (cdr X-ext) 0.2)(- (car X-ext) 0.2)))
          (y-end (- y-start 0.5))
          (stil (ly:make-stencil `(path 0.1
                                        (moveto ,x-start ,y-start
                                         curveto ,x-start ,y-end ,x-start ,y-end ,x-start2 ,y-end
                                         lineto ,x-end ,y-end))
                                  X-ext
                                  Y-ext))
          (offset (ly:grob-relative-coordinate grob refp-X X)))
     (ly:stencil-translate-axis stil (- offset) X)))

#(add-grob-definition
  'JianpuGraceCurve
  `(
     (stencil . ,jianpu-grace-curve-stencil)
     (meta . ((class . Spanner)
              (interfaces . ())))))

#(define jianpu-grace-curve-types
   '(
      (JianpuGraceCurveEvent
       . ((description . "Used to signal where curve encompassing music start and stop.")
          (types . (general-music jianpu-grace-curve-event span-event event))
          ))
      ))

#(set!
  jianpu-grace-curve-types
  (map (lambda (x)
         (set-object-property! (car x)
           'music-description
           (cdr (assq 'description (cdr x))))
         (let ((lst (cdr x)))
           (set! lst (assoc-set! lst 'name (car x)))
           (set! lst (assq-remove! lst 'description))
           (hashq-set! music-name-to-property-table (car x) lst)
           (cons (car x) lst)))
    jianpu-grace-curve-types))

#(set! music-descriptions
       (append jianpu-grace-curve-types music-descriptions))

#(set! music-descriptions
       (sort music-descriptions alist<?))


#(define (add-bound-item spanner item)
   (if (null? (ly:spanner-bound spanner LEFT))
       (ly:spanner-set-bound! spanner LEFT item)
       (ly:spanner-set-bound! spanner RIGHT item)))

jianpuGraceCurveEngraver =
#(lambda (context)
   (let ((span '())
         (finished '())
         (current-event '())
         (event-start '())
         (event-stop '()))
     `(
       (listeners
        (jianpu-grace-curve-event .
          ,(lambda (engraver event)
             (if (= START (ly:event-property event 'span-direction))
                 (set! event-start event)
                 (set! event-stop event)))))

       (acknowledgers
        (note-column-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)
                  (add-bound-item span grob)))
             (if (ly:spanner? finished)
                 (begin
                  (ly:pointer-group-interface::add-grob finished 'elements grob)
                  (add-bound-item finished grob)))))
        (inline-accidental-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)))
             (if (ly:spanner? finished)
                 (ly:pointer-group-interface::add-grob finished 'elements grob))))
        (script-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)))
             (if (ly:spanner? finished)
                 (ly:pointer-group-interface::add-grob finished 'elements grob)))))
       
       (process-music .
         ,(lambda (trans)
            (if (ly:stream-event? event-stop)
                (if (null? span)
                    (ly:warning "No start to this curve.")
                    (begin
                     (set! finished span)
                     (ly:engraver-announce-end-grob trans finished event-start)
                     (set! span '())
                     (set! event-stop '()))))
            (if (ly:stream-event? event-start)
                (begin
                 (set! span (ly:engraver-make-grob trans 'JianpuGraceCurve event-start))
                 (set! event-start '())))))
       
       (stop-translation-timestep .
         ,(lambda (trans)
            (if (and (ly:spanner? span)
                     (null? (ly:spanner-bound span LEFT)))
                (ly:spanner-set-bound! span LEFT
                  (ly:context-property context 'currentMusicalColumn)))
            (if (ly:spanner? finished)
                (begin
                 (if (null? (ly:spanner-bound finished RIGHT))
                     (ly:spanner-set-bound! finished RIGHT
                       (ly:context-property context 'currentMusicalColumn)))
                 (set! finished '())
                 (set! event-start '())
                 (set! event-stop '())))))
       
       (finalize
        (lambda (trans)
          (if (ly:spanner? finished)
              (begin
               (if (null? (ly:spanner-bound finished RIGHT))
                   (set! (ly:spanner-bound finished RIGHT)
                         (ly:context-property context 'currentMusicalColumn)))
               (set! finished '())))))
       )))

jianpuGraceCurveStart =
#(make-span-event 'JianpuGraceCurveEvent START)

jianpuGraceCurveEnd =
#(make-span-event 'JianpuGraceCurveEvent STOP)
%===========================================================

%{ The jianpu-ly input was:
% 要成为特别的人 TODO: trumpet

title=E 小调第 9 号交响曲《自新大陆》第二乐章 节选
4=60
1=Db
4/4


3. q5 5 -
3. q2 1 -
2. q3 5. q3
2 - - -

3. q5 5 -
3. q2 1 -
2. q3 2. q1
1 - - -

6. q1' 1' -
7 5 6 -
6 1' 7 5
6 - - -

3. q5 5 -
3. q2 1 -
2. q3 5. q3
2 - - -

3. q5 5 -
1' 2' 3' -
2' 1' 2' 6
1' - - -
%}


\score {
<< \override Score.BarNumber.break-visibility = #center-visible
\override Score.BarNumber.Y-offset = -1
\set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)

%% === BEGIN JIANPU STAFF ===
    \new RhythmicStaff \with {
    \consists "Accidental_engraver" 
    \consists \jianpuGraceCurveEngraver
    % Get rid of the stave but not the barlines:
    \override StaffSymbol.line-count = #0 % tested in 2.15.40, 2.16.2, 2.18.0, 2.18.2, 2.20.0 and 2.22.2
    \override BarLine.bar-extent = #'(-2 . 2) % LilyPond 2.18: please make barlines as high as the time signature even though we're on a RhythmicStaff (2.16 and 2.15 don't need this although its presence doesn't hurt; Issue 3685 seems to indicate they'll fix it post-2.18)
    $(add-grace-property 'Voice 'Stem 'direction DOWN)
    $(add-grace-property 'Voice 'Slur 'direction UP)
    $(add-grace-property 'Voice 'Stem 'length-fraction 0.5)
    $(add-grace-property 'Voice 'Beam 'beam-thickness 0.1)
    $(add-grace-property 'Voice 'Beam 'length-fraction 0.3)
    $(add-grace-property 'Voice 'Beam 'after-line-breaking flip-beams)
    $(add-grace-property 'Voice 'Beam 'Y-offset 2.5)
    $(add-grace-property 'Voice 'NoteHead 'Y-offset 2.5)
    }
    { \new Voice="W" {
    \override Beam.transparent = ##f
    \override Stem.direction = #DOWN
    \override Tie.staff-position = #2.5
    \tupletUp
    \tieUp
    \override Stem.length-fraction = #0
    \override Beam.beam-thickness = #0.1
    \override Beam.length-fraction = #0.5
    \override Beam.after-line-breaking = #flip-beams
    \override Voice.Rest.style = #'neomensural % this size tends to line up better (we'll override the appearance anyway)
    \override Accidental.font-size = #-4
    \override TupletBracket.bracket-visibility = ##t

    \override Staff.TimeSignature.style = #'numbered
    \override Staff.Stem.transparent = ##t
     \tempo 4=60 \mark \markup{1=D\flat} \time 4/4  \note-mod "3" e4. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "5" g4
 ~  \note-mod "–" g4 | %{ bar 2: %}
 \note-mod "3" e4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "1" c4
 ~  \note-mod "–" c4 | %{ bar 3: %}
 \note-mod "2" d4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[]
 \note-mod "5" g4. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 4: %}
 \note-mod "2" d4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" d4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" d4
 ~  \note-mod "–" d4 | %{ bar 5: %}
 \note-mod "3" e4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "5" g4
 ~  \note-mod "–" g4 | %{ bar 6: %}
 \note-mod "3" e4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "1" c4
 ~  \note-mod "–" c4 | %{ bar 7: %}
 \note-mod "2" d4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[]
 \note-mod "2" d4. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 8: %}
 \note-mod "1" c4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~  \note-mod "–" c4 | %{ bar 9: %}
 \note-mod "6" a4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "1" c4^.
 ~  \note-mod "–" c4 | %{ bar 10: %}
 \note-mod "7" b4
 \note-mod "5" g4 \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "6" a4
 ~  \note-mod "–" a4 | %{ bar 11: %}
 \note-mod "6" a4
 \note-mod "1" c4^.  \note-mod "7" b4  \note-mod "5" g4 \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 12: %}
 \note-mod "6" a4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" a4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" a4
 ~  \note-mod "–" a4 | %{ bar 13: %}
 \note-mod "3" e4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "5" g4
 ~  \note-mod "–" g4 | %{ bar 14: %}
 \note-mod "3" e4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "1" c4
 ~  \note-mod "–" c4 | %{ bar 15: %}
 \note-mod "2" d4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[]
 \note-mod "5" g4. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 16: %}
 \note-mod "2" d4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" d4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" d4
 ~  \note-mod "–" d4 | %{ bar 17: %}
 \note-mod "3" e4.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "5" g4
 ~  \note-mod "–" g4 | %{ bar 18: %}
 \note-mod "1" c4^.
 \note-mod "2" d4^. \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "3" e4^.
 ~  \note-mod "–" e4 | %{ bar 19: %}
 \note-mod "2" d4^.
 \note-mod "1" c4^.  \note-mod "2" d4^.  \note-mod "6" a4 \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 20: %}
 \note-mod "1" c4^.
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~  \note-mod "–" c4 \bar "|." } }
% === END JIANPU STAFF ===

>>
\header{
title="E 小调第 9 号交响曲《自新大陆》第二乐章 节选"
}
\layout{
  \context {
    \Global
    \grobdescriptions #all-grob-descriptions
  }
} }
\score {
\unfoldRepeats
<< 

% === BEGIN MIDI STAFF ===
    \new Staff { \new Voice="X" { \tempo 4=60 \transpose c des { \key c \major  \time 4/4 e'4. g'8 g'2 | %{ bar 2: %} e'4. d'8 c'2 | %{ bar 3: %} d'4. e'8 g'4. e'8 | %{ bar 4: %} d'1 | %{ bar 5: %} e'4. g'8 g'2 | %{ bar 6: %} e'4. d'8 c'2 | %{ bar 7: %} d'4. e'8 d'4. c'8 | %{ bar 8: %} c'1 | %{ bar 9: %} a'4. c''8 c''2 | %{ bar 10: %} b'4 g'4 a'2 | %{ bar 11: %} a'4 c''4 b'4 g'4 | %{ bar 12: %} a'1 | %{ bar 13: %} e'4. g'8 g'2 | %{ bar 14: %} e'4. d'8 c'2 | %{ bar 15: %} d'4. e'8 g'4. e'8 | %{ bar 16: %} d'1 | %{ bar 17: %} e'4. g'8 g'2 | %{ bar 18: %} c''4 d''4 e''2 | %{ bar 19: %} d''4 c''4 d''4 a'4 | %{ bar 20: %} c''1 } } }
% === END MIDI STAFF ===

>>
\header{
title="E 小调第 9 号交响曲《自新大陆》第二乐章 节选"
}
\midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 84 4)}} }

Canon in D Major 节选 简谱

\version "2.20.0"
#(set-global-staff-size 20)

% un-comment the next line to remove Lilypond tagline:
% \header { tagline="" }

% comment out the next line if you're debugging jianpu-ly
% (but best leave it un-commented in production, since
% the point-and-click locations won't go to the user input)
\pointAndClickOff

\paper {
  print-all-headers = ##t %% allow per-score headers

  % un-comment the next line for A5:
  % #(set-default-paper-size "a5" )

  % un-comment the next line for no page numbers:
  % print-page-number = ##f

  % un-comment the next 3 lines for a binding edge:
  % two-sided = ##t
  % inner-margin = 20\mm
  % outer-margin = 10\mm

  % un-comment the next line for a more space-saving header layout:
  % scoreTitleMarkup = \markup { \center-column { \fill-line { \magnify #1.5 { \bold { \fromproperty #'header:dedication } } \magnify #1.5 { \bold { \fromproperty #'header:title } } \fromproperty #'header:composer } \fill-line { \fromproperty #'header:instrument \fromproperty #'header:subtitle \smaller{\fromproperty #'header:subsubtitle } } } }
}

%% 2-dot and 3-dot articulations
#(append! default-script-alist
   (list
    `(two-dots
       . (
           (stencil . ,ly:text-interface::print)
           (text . ,#{ \markup \override #'(font-encoding . latin1) \center-align \bold ":" #})
           (padding . 0.20)
           (avoid-slur . inside)
           (direction . ,UP)))))
#(append! default-script-alist
   (list
    `(three-dots
       . (
           (stencil . ,ly:text-interface::print)
           (text . ,#{ \markup \override #'(font-encoding . latin1) \center-align \bold "⋮" #})
           (padding . 0.30)
           (avoid-slur . inside)
           (direction . ,UP)))))
"two-dots" =
#(make-articulation 'two-dots)

"three-dots" =
#(make-articulation 'three-dots)

\layout {
  \context {
    \Score
    scriptDefinitions = #default-script-alist
  }
}

note-mod =
#(define-music-function
     (text note)
     (markup? ly:music?)
   #{
     \tweak NoteHead.stencil #ly:text-interface::print
     \tweak NoteHead.text
        \markup \lower #0.5 \sans \bold #text
     \tweak Rest.stencil #ly:text-interface::print
     \tweak Rest.text
        \markup \lower #0.5 \sans \bold #text
     #note
   #})
#(define (flip-beams grob)
   (ly:grob-set-property!
    grob 'stencil
    (ly:stencil-translate
     (let* ((stl (ly:grob-property grob 'stencil))
            (centered-stl (ly:stencil-aligned-to stl Y DOWN)))
       (ly:stencil-translate-axis
        (ly:stencil-scale centered-stl 1 -1)
        (* (- (car (ly:stencil-extent stl Y)) (car (ly:stencil-extent centered-stl Y))) 0) Y))
     (cons 0 -0.8))))

%=======================================================
#(define-event-class 'jianpu-grace-curve-event 'span-event)

#(define (add-grob-definition grob-name grob-entry)
   (set! all-grob-descriptions
         (cons ((@@ (lily) completize-grob-entry)
                (cons grob-name grob-entry))
               all-grob-descriptions)))

#(define (jianpu-grace-curve-stencil grob)
   (let* ((elts (ly:grob-object grob 'elements))
          (refp-X (ly:grob-common-refpoint-of-array grob elts X))
          (X-ext (ly:relative-group-extent elts refp-X X))
          (refp-Y (ly:grob-common-refpoint-of-array grob elts Y))
          (Y-ext (ly:relative-group-extent elts refp-Y Y))
          (direction (ly:grob-property grob 'direction RIGHT))
          (x-start (* 0.5 (+ (car X-ext) (cdr X-ext))))
          (y-start (+ (car Y-ext) 0.32))
          (x-start2 (if (eq? direction RIGHT)(+ x-start 0.5)(- x-start 0.5)))
          (x-end (if (eq? direction RIGHT)(+ (cdr X-ext) 0.2)(- (car X-ext) 0.2)))
          (y-end (- y-start 0.5))
          (stil (ly:make-stencil `(path 0.1
                                        (moveto ,x-start ,y-start
                                         curveto ,x-start ,y-end ,x-start ,y-end ,x-start2 ,y-end
                                         lineto ,x-end ,y-end))
                                  X-ext
                                  Y-ext))
          (offset (ly:grob-relative-coordinate grob refp-X X)))
     (ly:stencil-translate-axis stil (- offset) X)))

#(add-grob-definition
  'JianpuGraceCurve
  `(
     (stencil . ,jianpu-grace-curve-stencil)
     (meta . ((class . Spanner)
              (interfaces . ())))))

#(define jianpu-grace-curve-types
   '(
      (JianpuGraceCurveEvent
       . ((description . "Used to signal where curve encompassing music start and stop.")
          (types . (general-music jianpu-grace-curve-event span-event event))
          ))
      ))

#(set!
  jianpu-grace-curve-types
  (map (lambda (x)
         (set-object-property! (car x)
           'music-description
           (cdr (assq 'description (cdr x))))
         (let ((lst (cdr x)))
           (set! lst (assoc-set! lst 'name (car x)))
           (set! lst (assq-remove! lst 'description))
           (hashq-set! music-name-to-property-table (car x) lst)
           (cons (car x) lst)))
    jianpu-grace-curve-types))

#(set! music-descriptions
       (append jianpu-grace-curve-types music-descriptions))

#(set! music-descriptions
       (sort music-descriptions alist<?))


#(define (add-bound-item spanner item)
   (if (null? (ly:spanner-bound spanner LEFT))
       (ly:spanner-set-bound! spanner LEFT item)
       (ly:spanner-set-bound! spanner RIGHT item)))

jianpuGraceCurveEngraver =
#(lambda (context)
   (let ((span '())
         (finished '())
         (current-event '())
         (event-start '())
         (event-stop '()))
     `(
       (listeners
        (jianpu-grace-curve-event .
          ,(lambda (engraver event)
             (if (= START (ly:event-property event 'span-direction))
                 (set! event-start event)
                 (set! event-stop event)))))

       (acknowledgers
        (note-column-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)
                  (add-bound-item span grob)))
             (if (ly:spanner? finished)
                 (begin
                  (ly:pointer-group-interface::add-grob finished 'elements grob)
                  (add-bound-item finished grob)))))
        (inline-accidental-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)))
             (if (ly:spanner? finished)
                 (ly:pointer-group-interface::add-grob finished 'elements grob))))
        (script-interface .
          ,(lambda (engraver grob source-engraver)
             (if (ly:spanner? span)
                 (begin
                  (ly:pointer-group-interface::add-grob span 'elements grob)))
             (if (ly:spanner? finished)
                 (ly:pointer-group-interface::add-grob finished 'elements grob)))))
       
       (process-music .
         ,(lambda (trans)
            (if (ly:stream-event? event-stop)
                (if (null? span)
                    (ly:warning "No start to this curve.")
                    (begin
                     (set! finished span)
                     (ly:engraver-announce-end-grob trans finished event-start)
                     (set! span '())
                     (set! event-stop '()))))
            (if (ly:stream-event? event-start)
                (begin
                 (set! span (ly:engraver-make-grob trans 'JianpuGraceCurve event-start))
                 (set! event-start '())))))
       
       (stop-translation-timestep .
         ,(lambda (trans)
            (if (and (ly:spanner? span)
                     (null? (ly:spanner-bound span LEFT)))
                (ly:spanner-set-bound! span LEFT
                  (ly:context-property context 'currentMusicalColumn)))
            (if (ly:spanner? finished)
                (begin
                 (if (null? (ly:spanner-bound finished RIGHT))
                     (ly:spanner-set-bound! finished RIGHT
                       (ly:context-property context 'currentMusicalColumn)))
                 (set! finished '())
                 (set! event-start '())
                 (set! event-stop '())))))
       
       (finalize
        (lambda (trans)
          (if (ly:spanner? finished)
              (begin
               (if (null? (ly:spanner-bound finished RIGHT))
                   (set! (ly:spanner-bound finished RIGHT)
                         (ly:context-property context 'currentMusicalColumn)))
               (set! finished '())))))
       )))

jianpuGraceCurveStart =
#(make-span-event 'JianpuGraceCurveEvent START)

jianpuGraceCurveEnd =
#(make-span-event 'JianpuGraceCurveEvent STOP)
%===========================================================

%{ The jianpu-ly input was:
% TODO: repeat
% https://www.bilibili.com/video/BV1CM4y1Y7S9

title=Canon in D Major 节选
4=130
1=D
4/4

WithStaff

5' q3' q4' 5' q3' q4'
q5' q5 q6 q7  q1' q2' q3' q4'
3' q1' q2' 3' q3 q4
q5 q6 q5 q4  q5 q1' q7 q1'
6 q1' q7 6 q5 q4
q5 q4 q3 q4  q5 q6 q7 q1'

6 q1' q7 1' q7 q6
q7 q1' q2' q1' q7 q1' q6 q7

%/
5' q3' q4' 5' q3' q4'
q5' q5 q6 q7  q1' q2' q3' q4'
3' q1' q2' 3' q3 q4
q5 q6 q5 q4  q5 q1' q7 q1'
6 q1' q7 6 q5 q4
q5 q4 q3 q4  q5 q6 q7 q1'
%\

6 q1' q7 1' q7 q1'
q7 q6 q7 q1' q2' q3' q4' q5'

%/
5' q3' q4' 5' q3' q4'
q5' q5 q6 q7  q1' q2' q3' q4'
3' q1' q2' 3' q3 q4
q5 q6 q5 q4  q5 q1' q7 q1'
6 q1' q7 6 q5 q4
q5 q4 q3 q4  q5 q6 q7 q1'
%\

%//
6 q1' q7 1' q7 q6
q7 q1' q2' q1' q7 q1' q6 q7
%\\

1' - - -
%}


\score {
<< \override Score.BarNumber.break-visibility = #center-visible
\override Score.BarNumber.Y-offset = -1
\set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)

%% === BEGIN JIANPU STAFF ===
    \new RhythmicStaff \with {
    \consists "Accidental_engraver" 
    \consists \jianpuGraceCurveEngraver
   %% Limit space between Jianpu and corresponding-Western staff
   \override VerticalAxisGroup.staff-staff-spacing = #'((minimum-distance . 7) (basic-distance . 7) (stretchability . 0))

    % Get rid of the stave but not the barlines:
    \override StaffSymbol.line-count = #0 % tested in 2.15.40, 2.16.2, 2.18.0, 2.18.2, 2.20.0 and 2.22.2
    \override BarLine.bar-extent = #'(-2 . 2) % LilyPond 2.18: please make barlines as high as the time signature even though we're on a RhythmicStaff (2.16 and 2.15 don't need this although its presence doesn't hurt; Issue 3685 seems to indicate they'll fix it post-2.18)
    $(add-grace-property 'Voice 'Stem 'direction DOWN)
    $(add-grace-property 'Voice 'Slur 'direction UP)
    $(add-grace-property 'Voice 'Stem 'length-fraction 0.5)
    $(add-grace-property 'Voice 'Beam 'beam-thickness 0.1)
    $(add-grace-property 'Voice 'Beam 'length-fraction 0.3)
    $(add-grace-property 'Voice 'Beam 'after-line-breaking flip-beams)
    $(add-grace-property 'Voice 'Beam 'Y-offset 2.5)
    $(add-grace-property 'Voice 'NoteHead 'Y-offset 2.5)
    }
    { \new Voice="W" {
    \override Beam.transparent = ##f
    \override Stem.direction = #DOWN
    \override Tie.staff-position = #2.5
    \tupletUp
    \tieUp
    \override Stem.length-fraction = #0
    \override Beam.beam-thickness = #0.1
    \override Beam.length-fraction = #0.5
    \override Beam.after-line-breaking = #flip-beams
    \override Voice.Rest.style = #'neomensural % this size tends to line up better (we'll override the appearance anyway)
    \override Accidental.font-size = #-4
    \override TupletBracket.bracket-visibility = ##t

    \override Staff.TimeSignature.style = #'numbered
    \override Staff.Stem.transparent = ##t
     \tempo 4=130 \mark \markup{1=D} \time 4/4  \note-mod "5" g4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
 \note-mod "5" g4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
| %{ bar 2: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "2" d8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
| %{ bar 3: %}
 \note-mod "3" e4^.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "2" d8^.]
 \note-mod "3" e4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
| %{ bar 4: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
| %{ bar 5: %}
 \note-mod "6" a4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
 \note-mod "6" a4 \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
| %{ bar 6: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
| %{ bar 7: %}
 \note-mod "6" a4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
 \note-mod "1" c4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
| %{ bar 8: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
| %{ bar 9: %}
 \note-mod "5" g4^.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
 \note-mod "5" g4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
| %{ bar 10: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "2" d8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
| %{ bar 11: %}
 \note-mod "3" e4^.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "2" d8^.]
 \note-mod "3" e4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
| %{ bar 12: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
| %{ bar 13: %}
 \note-mod "6" a4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
 \note-mod "6" a4 \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
| %{ bar 14: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
| %{ bar 15: %}
 \note-mod "6" a4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
 \note-mod "1" c4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
| %{ bar 16: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "3" e8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "4" f8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8^.]
| %{ bar 17: %}
 \note-mod "5" g4^.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
 \note-mod "5" g4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
| %{ bar 18: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "5" g8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "2" d8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8^.]
| %{ bar 19: %}
 \note-mod "3" e4^.
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "2" d8^.]
 \note-mod "3" e4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
| %{ bar 20: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
| %{ bar 21: %}
 \note-mod "6" a4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
 \note-mod "6" a4 \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
| %{ bar 22: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "3" e8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "4" f8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "5" g8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
| %{ bar 23: %}
 \note-mod "6" a4
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "1" c8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
 \note-mod "1" c4^. \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "6" a8]
| %{ bar 24: %} \set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "2" d8^.[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "7" b8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "1" c8^.]
\set stemLeftBeamCount = #0
\set stemRightBeamCount = #1
 \note-mod "6" a8[
\set stemLeftBeamCount = #1
\set stemRightBeamCount = #1
 \note-mod "7" b8]
\once \override Tie.transparent = ##t \once \override Tie.staff-position = #0 | %{ bar 25: %}
 \note-mod "1" c4^.
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~ \once \override Tie.transparent = ##t \once \override Tie.staff-position = #0  \note-mod "–" c4
 ~  \note-mod "–" c4 \bar "|." } }
% === END JIANPU STAFF ===


%% === BEGIN 5-LINE STAFF ===
    \new Staff {
    \override Score.SystemStartBar.collapse-height = #11 % (needed on 2.22)
    \new Voice="X" {
    #(set-accidental-style 'modern-cautionary)
    \override Staff.TimeSignature.style = #'numbered
 \tempo 4=130 \transpose c d { \key c \major  \time 4/4 g''4 e''8 f''8 g''4 e''8 f''8 | %{ bar 2: %} g''8 g'8 a'8 b'8 c''8 d''8 e''8 f''8 | %{ bar 3: %} e''4 c''8 d''8 e''4 e'8 f'8 | %{ bar 4: %} g'8 a'8 g'8 f'8 g'8 c''8 b'8 c''8 | %{ bar 5: %} a'4 c''8 b'8 a'4 g'8 f'8 | %{ bar 6: %} g'8 f'8 e'8 f'8 g'8 a'8 b'8 c''8 | %{ bar 7: %} a'4 c''8 b'8 c''4 b'8 a'8 | %{ bar 8: %} b'8 c''8 d''8 c''8 b'8 c''8 a'8 b'8 | %{ bar 9: %} g''4 e''8 f''8 g''4 e''8 f''8 | %{ bar 10: %} g''8 g'8 a'8 b'8 c''8 d''8 e''8 f''8 | %{ bar 11: %} e''4 c''8 d''8 e''4 e'8 f'8 | %{ bar 12: %} g'8 a'8 g'8 f'8 g'8 c''8 b'8 c''8 | %{ bar 13: %} a'4 c''8 b'8 a'4 g'8 f'8 | %{ bar 14: %} g'8 f'8 e'8 f'8 g'8 a'8 b'8 c''8 | %{ bar 15: %} a'4 c''8 b'8 c''4 b'8 c''8 | %{ bar 16: %} b'8 a'8 b'8 c''8 d''8 e''8 f''8 g''8 | %{ bar 17: %} g''4 e''8 f''8 g''4 e''8 f''8 | %{ bar 18: %} g''8 g'8 a'8 b'8 c''8 d''8 e''8 f''8 | %{ bar 19: %} e''4 c''8 d''8 e''4 e'8 f'8 | %{ bar 20: %} g'8 a'8 g'8 f'8 g'8 c''8 b'8 c''8 | %{ bar 21: %} a'4 c''8 b'8 a'4 g'8 f'8 | %{ bar 22: %} g'8 f'8 e'8 f'8 g'8 a'8 b'8 c''8 | %{ bar 23: %} a'4 c''8 b'8 c''4 b'8 a'8 | %{ bar 24: %} b'8 c''8 d''8 c''8 b'8 c''8 a'8 b'8 | %{ bar 25: %} c''1 } } }
% === END 5-LINE STAFF ===

>>
\header{
title="Canon in D Major 节选"
}
\layout{
  \context {
    \Global
    \grobdescriptions #all-grob-descriptions
  }
} }
\score {
\unfoldRepeats
<< 

% === BEGIN MIDI STAFF ===
    \new Staff { \new Voice="Y" { \tempo 4=130 \transpose c d { \key c \major  \time 4/4 g''4 e''8 f''8 g''4 e''8 f''8 | %{ bar 2: %} g''8 g'8 a'8 b'8 c''8 d''8 e''8 f''8 | %{ bar 3: %} e''4 c''8 d''8 e''4 e'8 f'8 | %{ bar 4: %} g'8 a'8 g'8 f'8 g'8 c''8 b'8 c''8 | %{ bar 5: %} a'4 c''8 b'8 a'4 g'8 f'8 | %{ bar 6: %} g'8 f'8 e'8 f'8 g'8 a'8 b'8 c''8 | %{ bar 7: %} a'4 c''8 b'8 c''4 b'8 a'8 | %{ bar 8: %} b'8 c''8 d''8 c''8 b'8 c''8 a'8 b'8 | %{ bar 9: %} g''4 e''8 f''8 g''4 e''8 f''8 | %{ bar 10: %} g''8 g'8 a'8 b'8 c''8 d''8 e''8 f''8 | %{ bar 11: %} e''4 c''8 d''8 e''4 e'8 f'8 | %{ bar 12: %} g'8 a'8 g'8 f'8 g'8 c''8 b'8 c''8 | %{ bar 13: %} a'4 c''8 b'8 a'4 g'8 f'8 | %{ bar 14: %} g'8 f'8 e'8 f'8 g'8 a'8 b'8 c''8 | %{ bar 15: %} a'4 c''8 b'8 c''4 b'8 c''8 | %{ bar 16: %} b'8 a'8 b'8 c''8 d''8 e''8 f''8 g''8 | %{ bar 17: %} g''4 e''8 f''8 g''4 e''8 f''8 | %{ bar 18: %} g''8 g'8 a'8 b'8 c''8 d''8 e''8 f''8 | %{ bar 19: %} e''4 c''8 d''8 e''4 e'8 f'8 | %{ bar 20: %} g'8 a'8 g'8 f'8 g'8 c''8 b'8 c''8 | %{ bar 21: %} a'4 c''8 b'8 a'4 g'8 f'8 | %{ bar 22: %} g'8 f'8 e'8 f'8 g'8 a'8 b'8 c''8 | %{ bar 23: %} a'4 c''8 b'8 c''4 b'8 a'8 | %{ bar 24: %} b'8 c''8 d''8 c''8 b'8 c''8 a'8 b'8 | %{ bar 25: %} c''1 } } }
% === END MIDI STAFF ===

>>
\header{
title="Canon in D Major 节选"
}
\midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 84 4)}} }

歌 - 罗大佑 - 两声部五线谱 - Claude 生成

%%%% 罗大佑《歌》 两声部(旋律 + 和声)
%%%% 来源乐谱:音伴·吉他课堂(简谱 1=D, 4/4, 78bpm)
%%%% 作词:徐志摩  作曲:罗大佑
%%%%
%%%% 记谱说明:
%%%%   - 内部旋律/和声以首调 C 书写,外层用 \transpose c d 移到实际调号 D 大调。
%%%%   - 和声声部使用 \chordmode,配合 roman-numerals.ly 将和弦符号显示为级数。

\version "2.24.0"

\include "roman-numerals.ly"

common = {
  \key c \major
  \time 4/4
  \tempo 4=78
}

%% 前奏 / 间奏 / 尾奏 共用旋律(简谱 4 5 4 3 2 1 7. 6 …)
interlude = \fixed c' {
  f8 g f e d c \acciaccatura{b, c} b,8 a,8
  \acciaccatura{g,} b,8 g \acciaccatura{b,} a, f \acciaccatura{a,} g, e f, d
  c2 r4
}

melody = \fixed c' {
  \common
  \set melismaBusyProperties = #'()

  %1 前奏(简谱 1. 2 3 5 | 4 5 4 3 2 1 7. 6 | 7 5. 6 4 5. 3 4 2 | 1 - 0)
  c4. d8 e4 g4
  \interlude
  r8 g,

  %5 我死去的时候亲爱你别为我唱悲伤的歌
  \acciaccatura{d} e8 e e e e4 g
  f8. (g16 f8 e) d4 r8 g,
  \acciaccatura{c} d8 d d d d4 c8. d16
  e2 r4 r8 g,

  %9 坟上不必安插蔷薇也无需浓荫的柏树让
  \acciaccatura{d} e8 e e e e4 g
  f8. (g16 f8 e) d4 r8 g,
  \acciaccatura{c} d4 d8. r16 c8 b, a,16 b,8.
  c2 r4 r8 c8

  %13
  \repeat volta 2 {
    \acciaccatura{g} a4 (a8) g8 f4 a8 r8
    g8 (a) g (f) e4 g8 r
    f8. (g16 f8) e8 d4 b,8 (b,)
    c8 c d4 e r8 c

    %17
    \acciaccatura{g} a4 (a8) g8 f4 a8 r8
    g8 (a) g (f) e4 (g8 r16 g)
    fis8 (e) fis g a4 d8 r8
    \acciaccatura{a} b4 (b8.) a16 g4 (f)

    %21
    \time 2/4
    r4 r8 e
    \time 4/4
    e4 e8 e e4 g8 g
    f8. (g16 f8) e8 d4 r8 g,
    \acciaccatura{c} d8 d d d d d c (d)

    %25
    e2 r4 r8 g,
    \acciaccatura{d} e4 e8. r16 r8 e e \acciaccatura{f} g
    f8 (g) f e d4 r8 g,
    \acciaccatura{c} d4 d8. r16 c8 b, a, (b,)

    \alternative {
      \volta 1 {
        %29
        c4. d8 e4 g4
        \interlude
        r8 c,
      }

      \volta 2 {
        %33
        c2 r4 r8 g,
        \acciaccatura{d} e4 e8. r16 r8 e e \acciaccatura{f} g
        f8 (g) f e d4 r8 g,
        \acciaccatura{c} d4 d8. r16 c8 b, a, (b,)

        %37
        c2 r4 r8 g,
        \acciaccatura{d} e4 e8. r16 r8 e e \acciaccatura{f} g
        f8 (g) f e d4 r8 g,
        \acciaccatura{c} d4 d8. r16 c8 b, a, (b,)

        %41
        c4. d8 e4 g4
        \interlude
        r4
      }
    }
  }
}

%% 和弦 → 级数映射(1=D 大调):
%%   D=I(c)  G=IV(f)  Em=ii(d:m)  A=V(g)
%%   #Fm=iii(e:m)  Bm=vi(a:m)  E=II(d)  A7=V7(g:7)  D7=I7(c:7)
harmony = \chordmode {
  \common

  %1
  c1
  f2 d:m
  g1
  c1

  %5
  c2 e:m
  d2:m g
  d2:m g
  c1

  %9
  c2 e:m
  d2:m g
  d2:m g
  c2 c:7

  %13
  \repeat volta 2 {
    f1
    e2:m a:m
    d2:m g
    c2 c:7

    %17
    f1
    e2:m a:m
    d1
    g1:7

    %21
    \time 2/4
    r2
    \time 4/4
    c2 e:m
    d2:m g
    d2:m g

    %25
    c1
    c2 e:m
    d2:m g
    d2:m g

    \alternative {
      \volta 1 {
        %29
        c2 f
        d1:m
        g1
        c2 c:7
      }

      \volta 2 {
        %33
        c1
        c2 e:m
        d2:m g
        d2:m g

        %37
        c1
        e1:m
        d2:m g
        g1

        %41
        c2 f
        d1:m
        g1
        c1
      }
    }
  }
}

%% 歌词(逐音符对位;_ 表示该音符为上一字的延音)
lyricIntro = \lyricmode {
  %% 跳过前奏 m1-4 的器乐音符(4 + 16 = 20 个非装饰音)
  \repeat unfold 20 { \skip 1 }
  当
  我 死 去 的 时 候
  亲 _ _ 爱 你 别
  为 我 唱 悲 伤 的 歌
  _ 我
  坟 上 不 必 安 插
  蔷 _ _ 薇 也 无
  需 _ 浓 荫 的 柏
  树 让
}

lyricVerseOne = \lyricmode {
  盖 _ 着 我 的
  青 _ 青 的 草 _
  淋 _ 着 雨 也
  沾 着 露 珠 假
  如 _ 你 愿 意
  请 记 着 我 _ _
  要 是 你 甘 心 _
  忘 _ 了 我 _
  在
  悠 久 的 坟 墓 中
  迷 _ 惘 _ _ 阳
  光 不 升 起 也 不 消 _
  翳 我
  我 也 许 也 许
  还 记 得 你 _ 我
  也 许 把 你 忘 _
}

lyricVerseTwo = \lyricmode {
  再 _ 见 不 到
  地 _ 面 的 青 荫
  觉 _ 不 到 雨
  露 的 甜 蜜 我
  再 _ 听 不 到
  夜 莺 的 歌 喉 在
  黑 _ _ 夜 里 _
  倾 诉 悲 啼 _
  在
  悠 久 的 坟 墓 中
  迷 _ 惘 _ _ 阳
  光 不 升 起 也 不 消 _
  翳 我
  我 也 许 也 许
  还 记 得 你 _ 我
  也 许 把 你 忘 _
  记 我
  我 也 许 也 许
  还 记 得 你 _ 我
  也 许 把 你 忘 _
  记 我
  我 也 许 也 许
  还 记 得 你 _ 我
  也 许 把 你 忘 _
}

\score {
  \transpose c d <<
    \new ChordNames {
      \set chordChanges = ##t
      \harmony
    }
    \new Staff {
      \new Voice = "mel" { \melody }
    }
    \new Lyrics \lyricsto "mel" {
      \lyricIntro
      <<
        { \lyricVerseOne }
        \new Lyrics {
          \set associatedVoice = "mel"
          \lyricVerseTwo
        }
      >>
    }
  >>
  \layout {}
  \midi {}
}