lilypond-user
[Top][All Lists]
Advanced

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

Re: Optional chords


From: Klaus Blum
Subject: Re: Optional chords
Date: Fri, 28 Oct 2016 04:24:33 -0700 (MST)

Hi Herbert, 

several years ago, someone in the German lilypond forum posted a solution: 
http://www.lilypondforum.de/index.php?action=profile;area=showposts;u=54

This can easily be adjusted to draw parentheses only on the left or right
side: 

%
-------------------------------------------------------------------------------------
#(define (parenthesis-ignatzek-chord-names in-pitches bass inversion
context)
(markup #:line ( "(" (ignatzek-chord-names in-pitches bass inversion
context) ")" )))

#(define (left-parenthesis-ignatzek-chord-names in-pitches bass inversion
context)
(markup #:line ( "(" (ignatzek-chord-names in-pitches bass inversion
context) )))

#(define (right-parenthesis-ignatzek-chord-names in-pitches bass inversion
context)
(markup #:line ( (ignatzek-chord-names in-pitches bass inversion context)
")" )))

paren = #(define-music-function (parser location griffe) (ly:music?)
#{
        \set chordNameFunction = #parenthesis-ignatzek-chord-names
        $griffe
        \set chordNameFunction = #ignatzek-chord-names
#})

leftParen = #(define-music-function (parser location griffe) (ly:music?)
#{
        \set chordNameFunction = #left-parenthesis-ignatzek-chord-names
        $griffe
        \set chordNameFunction = #ignatzek-chord-names
#})

rightParen = #(define-music-function (parser location griffe) (ly:music?)
#{
        \set chordNameFunction = #right-parenthesis-ignatzek-chord-names
        $griffe
        \set chordNameFunction = #ignatzek-chord-names
#})

\new ChordNames \chordmode {
  \paren f1:maj7   \leftParen g2:m7  \rightParen c2:7
}
%
-------------------------------------------------------------------------------------

Cheers, 
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Optional-chords-tp195806p195817.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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