lilypond-user
[Top][All Lists]
Advanced

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

Re: How to connect two note on diffrent stave with brace?


From: 睿达 陈
Subject: Re: How to connect two note on diffrent stave with brace?
Date: Sat, 12 Jun 2021 18:05:22 +0800

I have a BIG THANK to you! it make me confused a long time, have been tried this snippet https://lsr.di.unimi.it/LSR/Item?id=470, but i haven't study scheme to write this function.
above all, THANK YOU.


12.06.2021, 15:54, "Lukas-Fabian Moser" <lfm@gmx.de>:

Hi,

Am 12.06.21 um 07:40 schrieb Lukas-Fabian Moser:

 I'm very sorry for my english.
 I have tried \left-brace, it is useless. because although it can
 engrave between two stave but not connect any note.
 If need detail, attachment was given.

 Best Regards!

 One could abuse \arpeggio and make it appear as a brace. Here's a
 quick-and-dirty way:


Maybe better:

\version "2.22.1"

#(define (other-axis a)
    (remainder (+ a 1) 2))

#(define-markup-command (squash layout props axis arg) (ly:dir? markup?)
    (let* ((orig (interpret-markup layout props arg))
           (orig-extent (ly:stencil-extent orig (other-axis axis))))
      (ly:stencil-outline
       orig
       (make-filled-box-stencil
        (if (= axis X) empty-interval orig-extent)
        (if (= axis Y) empty-interval orig-extent)))))

braceArpeggio =
#(define-music-function (size) (number?)
    #{
      \set PianoStaff.connectArpeggios = ##t
      \override PianoStaff.Arpeggio.stencil = #ly:text-interface::print
      \override PianoStaff.Arpeggio.text = \markup
      \squash #Y
      \general-align #Y #UP
      \left-align
      \left-brace #size
    #})

\new PianoStaff <<
   \new Staff {
     \key d \major
     \once \braceArpeggio 50
     << a'2\arpeggio \\ a >>
   }
   \new Staff \with { \clef bass } {
     \key d \major
     <fis d>2.\arpeggio
   }
 >>

As of now, I couldn't get rid of the need to specify the size of the
brace manually. (The markup command \left-brace seems to expect a value
in points, and the relationship to staff-size arpeggio extents seems to
be above my current paygrade :-).)

Lukas





reply via email to

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