lilypond-user
[Top][All Lists]
Advanced

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

Re: adding chordmode chord modifiers


From: Aaron Hill
Subject: Re: adding chordmode chord modifiers
Date: Mon, 07 Sep 2020 12:04:44 -0700
User-agent: Roundcube Webmail/1.4.2

On 2020-09-07 9:30 am, Randy Josleyn wrote:
Hi list,

Using my extremely limited general programming knowledge, I found in the scheme file chord-entry.scm that the chord modifiers m, maj, sus, and so on
are defined. Is it possible to add to this list? I want to write "add9"
chords like `c:add9`, which would be equivalent to writing `<c e g d'>` or `c:3.5.9` in chordmode (plus the chord exceptions snippet in the NM to add
the "add"). However, the latter methods are too verbose for me.

My use case is for printing chord symbols above the staff in a lead sheet.

I checked the snippets repository for "chord modifier", "chord*", and
"add9",  but I didn't see anything relevant.

Is there a way to create the "c:add9" syntax to get "Cadd9" to print as a
chord symbol? Any help would be appreciated!

Yes, although I am uncertain this is the right way to be going about things:

%%%%
\version "2.20.0"

#(define ((add-modifier minor?) pitches)
  (sort (list (ly:make-pitch 0 0 0)
              (ly:make-pitch 0 2 (if minor? FLAT 0))
              (ly:make-pitch 0 4 0)
              (last pitches))
        ly:pitch<?))

#(set! chordmodifiers (append chordmodifiers
  (list (cons 'add (add-modifier #f))
        (cons 'madd (add-modifier #t)))))

addExceptionsMusic = {
  <c d e g>1-\markup { \super "add2" }
  <c e f g>1-\markup { \super "add4" }
  <c e g d'>1-\markup { \super "add9" }
  <c e g fis'>1-\markup { \super { "add"
    #(alteration->text-accidental-markup SHARP) "11" } }
  <c d ees g>1-\markup { m \super "add2" }
  <c ees f g>1-\markup { m \super "add4" }
  <c ees g des'>1-\markup { m \super { "add"
    #(alteration->text-accidental-markup FLAT) "9" } }
  <c ees g d'>1-\markup { m \super "add9" }
}
addExceptions =
#(append
  (sequential-music-to-chord-exceptions addExceptionsMusic #t)
  ignatzekExceptions)

music = \chordmode {
  \set chordNameExceptions = #addExceptions
  c:add2 d:add4 e:add9 f:add11+
  c:madd2 d:madd4 e:madd9 f:madd9-
}
<< \new ChordNames \music \new Staff \music >>
%%%%


-- Aaron Hill

Attachment: custom-chord-modifier.cropped.png
Description: PNG image


reply via email to

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