Parenthesizing chord names

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Parenthesizing chord names

Tim McNamara
A common jazz lead sheet convention is to parenthesize optional  
chords written over the melody staff.  An example is a turnaround at  
the end of a song that is not played the last time through.  For  
example in "Easy Living" the turnaround over the last two bars of the  
second ending is (using the default language conventions):

f2 aes2:7
des2:maj7 c2:7

Rather than writing a separate ending, I'd like to just parenthesize  
the last three chords  over the final two bars so they would render:

F    (    Ab7    Dbmaj7    C7    )

This approach is commonly used in jazz lead sheets rather than  
writing multiple endings within multiple endings or adding codas.  
I've been plowing through the documentation and have searched the  
Web, which has extensive stuff about parenthesizing but nothing that  
I have found to suit the need I have.

Thanks!


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

James Bailey-4

El 01.03.2009, a las 01:12, Tim McNamara escribió:

> A common jazz lead sheet convention is to parenthesize optional  
> chords written over the melody staff.  An example is a turnaround  
> at the end of a song that is not played the last time through.  For  
> example in "Easy Living" the turnaround over the last two bars of  
> the second ending is (using the default language conventions):
>
> f2 aes2:7
> des2:maj7 c2:7
>
> Rather than writing a separate ending, I'd like to just  
> parenthesize the last three chords  over the final two bars so they  
> would render:
>
> F    (    Ab7    Dbmaj7    C7    )
>
> This approach is commonly used in jazz lead sheets rather than  
> writing multiple endings within multiple endings or adding codas.  
> I've been plowing through the documentation and have searched the  
> Web, which has extensive stuff about parenthesizing but nothing  
> that I have found to suit the need I have.
>

You could probably just add the Text_engraver to the ChordNames  
context, and include it as markup.

_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

M Watts
James E. Bailey wrote:

>
> El 01.03.2009, a las 01:12, Tim McNamara escribió:
>
>> A common jazz lead sheet convention is to parenthesize optional
>> chords written over the melody staff.  An example is a turnaround at
>> the end of a song that is not played the last time through.  For
>> example in "Easy Living" the turnaround over the last two bars of the
>> second ending is (using the default language conventions):
>>
>> f2 aes2:7
>> des2:maj7 c2:7
>>
>> Rather than writing a separate ending, I'd like to just parenthesize
>> the last three chords  over the final two bars so they would render:
>>
>> F    (    Ab7    Dbmaj7    C7    )
>>
>> This approach is commonly used in jazz lead sheets rather than
>> writing multiple endings within multiple endings or adding codas.  
>> I've been plowing through the documentation and have searched the
>> Web, which has extensive stuff about parenthesizing but nothing that
>> I have found to suit the need I have.
>>
>
> You could probably just add the Text_engraver to the ChordNames
> context, and include it as markup.


Yes, this works, but I found that the markups need to be attached to the
chornames with _ or ^, so you need to #'extra-offset them to get them on
the same line as the chordnames.

If you try to add Note_heads_engraver to the ChordNames context, so you
can attach markups to spacer notes, you get actual notes for your chords
above the staff as well!



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

James Bailey-4

El 01.03.2009, a las 12:47, M Watts escribió:

> James E. Bailey wrote:
>>
>> El 01.03.2009, a las 01:12, Tim McNamara escribió:
>>
>>> A common jazz lead sheet convention is to parenthesize optional  
>>> chords written over the melody staff.  An example is a turnaround  
>>> at the end of a song that is not played the last time through.  
>>> For example in "Easy Living" the turnaround over the last two  
>>> bars of the second ending is (using the default language  
>>> conventions):
>>>
>>> f2 aes2:7
>>> des2:maj7 c2:7
>>>
>>> Rather than writing a separate ending, I'd like to just  
>>> parenthesize the last three chords  over the final two bars so  
>>> they would render:
>>>
>>> F    (    Ab7    Dbmaj7    C7    )
>>>
>>> This approach is commonly used in jazz lead sheets rather than  
>>> writing multiple endings within multiple endings or adding  
>>> codas.  I've been plowing through the documentation and have  
>>> searched the Web, which has extensive stuff about parenthesizing  
>>> but nothing that I have found to suit the need I have.
>>>
>>
>> You could probably just add the Text_engraver to the ChordNames  
>> context, and include it as markup.
>
>
> Yes, this works, but I found that the markups need to be attached  
> to the chornames with _ or ^, so you need to #'extra-offset them to  
> get them on the same line as the chordnames.

Does using - not work?



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

Kieren MacMillan
In reply to this post by Tim McNamara
Hi Tim,

> Rather than writing a separate ending, I'd like to just  
> parenthesize the last three chords  over the final two bars so they  
> would render:
> F    (    Ab7    Dbmaj7    C7    )

Don't know how to (easily) parenthesize all the chords, but you can  
easily parenthesize each chord — see attached.

Hope this helps!
Kieren.

\version "2.12.2"

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

chordset = \chordmode
{
   c1:7 g1:7
   \set chordNameFunction = #parenthesis-ignatzek-chord-names
   a1:7 f1:7
   \unset chordNameFunction
   c1:7 g1:7
}

\score
{
   \new ChordNames \chordset
}

_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

Robin Bannister
Tim McNamara wrote:
> Rather than writing a separate ending, I'd like to just parenthesize  
> the last three chords  over the final two bars so they would render:
> F    (    Ab7    Dbmaj7    C7    )


ChordName outputs via text-interface, so the easiest way should be
  \once \override ChordNames.ChordName #'text = "("
 
But this has no effect. It probably acts too early,
i.e. before the Chord_name_engraver has written its result to #'text.

Trevor answered a similar question a year ago:
http://lists.gnu.org/archive/html/lilypond-user/2008-03/msg00275.html 

His solution modified the stencil, letting it overwrite #'text
just before printing.
As "addBrackets" it wrapped only a single chord, but you could
derive a left_only and a right_only version easily enough.

But if you want the bracket standing alone, how about setting up
a superfluous chord at the right place, and overwritung that?

See the snippet below; overwriteCN could also do things like "N.C."


Cheers,
Robin

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.12.1"

overwriteCN = #(define-music-function (parser location text) (string?)
  #{\once \set ChordNames.chordChanges = ##f
    \once \override ChordNames.ChordName #'stencil = #(lambda (grob)
      (ly:grob-set-property! grob 'text (markup $text))
      (ly:text-interface::print grob)
     )
  #})

harmoniesA = \transpose f f {\chordmode {
  f2:maj7 d2:m7 |
  g2:m7 c2:7.9- |
  f2 aes2:7 |
  des2:maj7 c2:7 |
}}

harmoniesB = \transpose f f {\chordmode {
  f2:maj7 d2:m7 |
  g2:m7 c2:7.9- |
  f4 \overwriteCN "(" f4 aes2:7 |
  des2:maj7 c4:7 \overwriteCN ")" c4:7 |
}}
 
melody = \transpose f f' { \key f \major \time 4/4
  \times 2/3 {a4 g'4 f'4} a4. e'8 |
  d'4 bes8[ d8] a4 a8[ f8] ~ |
  f1 ~ |
  f1 |
}

\score {<<
  \new ChordNames { \set chordChanges = ##t \harmoniesA }
  \new ChordNames { \set chordChanges = ##t \harmoniesB }
  \new Staff { \melody }
>>}
 
\layout {
  indent = 0
  ragged-right = ##f
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

M Watts
In reply to this post by James Bailey-4
James E. Bailey wrote:

>
> El 01.03.2009, a las 12:47, M Watts escribió:
>
>> James E. Bailey wrote:
>>>
>>> El 01.03.2009, a las 01:12, Tim McNamara escribió:
>>>
>>>> A common jazz lead sheet convention is to parenthesize optional
>>>> chords written over the melody staff.  An example is a turnaround
>>>> at the end of a song that is not played the last time through.  For
>>>> example in "Easy Living" the turnaround over the last two bars of
>>>> the second ending is (using the default language conventions):
>>>>
>>>> f2 aes2:7
>>>> des2:maj7 c2:7
>>>>
>>>> Rather than writing a separate ending, I'd like to just
>>>> parenthesize the last three chords  over the final two bars so they
>>>> would render:
>>>>
>>>> F    (    Ab7    Dbmaj7    C7    )
>>>>
>>>> This approach is commonly used in jazz lead sheets rather than
>>>> writing multiple endings within multiple endings or adding codas.  
>>>> I've been plowing through the documentation and have searched the
>>>> Web, which has extensive stuff about parenthesizing but nothing
>>>> that I have found to suit the need I have.
>>>>
>>>
>>> You could probably just add the Text_engraver to the ChordNames
>>> context, and include it as markup.
>>
>>
>> Yes, this works, but I found that the markups need to be attached to
>> the chornames with _ or ^, so you need to #'extra-offset them to get
>> them on the same line as the chordnames.
>
> Does using - not work?
>
>

Not for me, anyway:

newchord.ly:4:29: error: syntax error, unexpected \markup
test = \chordmode { f2 aes:7-
                             \markup "(" des:maj7 c:7-\markup ")" }




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

Kieren MacMillan
In reply to this post by Robin Bannister
Hi all,

This may be the easiest solution?

\version "2.12.2"

#(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) " )")))

LPC = { \set chordNameFunction = #left-parenthesis-ignatzek-chord-
names }
RPC = { \set chordNameFunction = #right-parenthesis-ignatzek-chord-
names }
NPC = { \unset chordNameFunction }

chordset = \chordmode
{
   c1:7 g1:7
   \LPC a1:7 \NPC f1:7
   c1:7 \RPC g1:7 \NPC
   c1:7 g1:7
}

\score
{
   \new ChordNames \chordset
}

Hope this helps!
Kieren.


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

jpeters
This works very well....
Kieren MacMillan wrote
Hi all,

This may be the easiest solution?

\version "2.12.2"

#(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) " )")))

LPC = { \set chordNameFunction = #left-parenthesis-ignatzek-chord-
names }
RPC = { \set chordNameFunction = #right-parenthesis-ignatzek-chord-
names }
NPC = { \unset chordNameFunction }

chordset = \chordmode
{
   c1:7 g1:7
   \LPC a1:7 \NPC f1:7
   c1:7 \RPC g1:7 \NPC
   c1:7 g1:7
}

\score
{
   \new ChordNames \chordset
}

Hope this helps!
Kieren.


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

lasconic
In reply to this post by Kieren MacMillan
That's great! Thanks a lot!

Just a question, do you think it's possible to have left/right as a param instead of defining a scheme function for each one ? For example, you might want to have more option like use [ instead of ( and then you need to create two others functions and new LBC/RBC and it seems easier to have something like this in chord mode.

\set chordNameFunction = #my-parenthesis-ignatzek-chord-names
\set bracket= "round"
\set bracket-dir = "left"

And a scheme function with some if /then/else statements. You see what I mean ?


Kieren MacMillan wrote
Hi all,

This may be the easiest solution?

\version "2.12.2"

#(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) " )")))

LPC = { \set chordNameFunction = #left-parenthesis-ignatzek-chord-
names }
RPC = { \set chordNameFunction = #right-parenthesis-ignatzek-chord-
names }
NPC = { \unset chordNameFunction }

chordset = \chordmode
{
   c1:7 g1:7
   \LPC a1:7 \NPC f1:7
   c1:7 \RPC g1:7 \NPC
   c1:7 g1:7
}

\score
{
   \new ChordNames \chordset
}

Hope this helps!
Kieren.


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesizing chord names

Robin Bannister
In reply to this post by Kieren MacMillan
Robin Bannister wrote:
> As "addBrackets" it wrapped only a single chord, but you could
> derive a left_only and a right_only version easily enough.

I wanted to see if I could make such a pair deliver something close
to what the OP illustrated, and managed this using \put-adjacent.
This itself requires a direction parameter (#LEFT / #RIGHT),
so I ended up with a onesided version. See below.

Features:
 - adjustable bracket separation
 - preserves chordname alignment
 - compatible with non-default chordNameFunction


Cheers,
Robin


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.12.1"

besideCN = #(define-music-function
    (parser location which-side added-text) (integer? string?)
  #{\once \override ChordNames.ChordName #'stencil = #(lambda (grob)
    (ly:grob-set-property! grob 'text  
      (markup #:put-adjacent 0 $which-side ; #LEFT or #RIGHT
        (ly:grob-property grob 'text) $added-text))
    (ly:text-interface::print grob))
  #})

harmoniesA = \transpose f f {\chordmode {
  f2:maj7 d2:m7 |
  g2:m7 c2:7.9- |
  f2 aes2:7 |
  des2:maj7 c2:7 |
}}

harmoniesB = \transpose f f {\chordmode {
  f2:maj7 d2:m7 |
  g2:m7 c2:7.9- |
  f2 \besideCN #LEFT "(    " aes2:7 |
  des2:maj7 \besideCN #RIGHT "   )" c2:7 |
}}
 
melody = \transpose f f' { \key f \major \time 4/4
  \times 2/3 {a4 g'4 f'4} a4. e'8 |
  d'4 bes8[ d8] a4 a8[ f8] ~ |
  f2 ~ f2 ~ |
  f2 ~ f2 |
}

\score {<<
  \new ChordNames { \set chordChanges = ##t \harmoniesA }
  \new ChordNames { \set chordChanges = ##t \harmoniesB }
  \new Staff { \melody }
>>}
 
\layout {
  indent = 0
  ragged-right = ##f
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user