lilypond-user
[Top][All Lists]
Advanced

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

Re: Change chord type input and chord name output


From: Volodymyr Prokopyuk
Subject: Re: Change chord type input and chord name output
Date: Sun, 20 Nov 2022 17:30:17 +0100

Outstanding! Thank you very much!

I'm impressed with the flexibility of LilyPond! However, less verbose scripting could be a huge plus to LilyPond.

Thank you,
Vlad

On Sun, Nov 20, 2022 at 2:46 PM Jean Abou Samra <jean@abou-samra.fr> wrote:
Hello,

Le 20/11/2022 à 10:27, Volodymyr Prokopyuk a écrit :
>
>   * How can I change the name for the c:aug7 from C7#5 to Co7 for all
>     augmented seventh chords, not only for specific pitches in the
>     chordNameExceptions list?
>   * Similarly, how can I change the name for the half-diminished
>     seventh c:m7.5- from Cøto Cø7for all half-diminished seventh chords?
>




You don't need to do anything special. The exceptions
defined with chordNameExceptions are given for one
"example" tonality, but they work for any transposition
of the chord.



>   * How can I define an alias for the c:m7.5- to be c:hdim7? I tried
>     with a variable, but it does not work
>
>



The syntax is not that straightforward and you need a bit
of Scheme code, but it can be done, see below.


\version "2.23.81"

myChordExceptions = {
   <c e gis bes>-\markup { \super "○7" }
   <c ees ges bes>-\markup { \super "ø7" }
}

\layout {
   \context {
     \ChordNames
     chordNameExceptions =
       #(append
         (sequential-music-to-chord-exceptions myChordExceptions #t)
         ignatzekExceptions)
   }
}

% adapted from chord-ignatzek-names.scm
#(define (replace-step repl pitches)
    (map (lambda (pitch)
           (if (eqv? (ly:pitch-steps pitch)
                     (ly:pitch-steps repl))
               repl
               pitch))
         pitches))

chordmodifiers.hdim =
   #(lambda (pitches)
      (replace-step #{ ees' #} (replace-step #{ ges' #} pitches)))

mus = \chordmode {
   c1:aug7 d:aug7
   c:m7.5- d:m7.5-
   c:hdim7 d:hdim7
}

<<
   \new Staff \mus
   \new ChordNames \mus
 >>



Best,
Jean


reply via email to

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