adding chordmode chord modifiers

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

adding chordmode chord modifiers

智樂喬
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!

Regards,


Randy
Reply | Threaded
Open this post in threaded view
|

Re: adding chordmode chord modifiers

Aaron Hill
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

custom-chord-modifier.cropped.png (31K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: adding chordmode chord modifiers

Kieren MacMillan
Hi all,

> I am uncertain this is the right way to be going about things

What is the current state-of-the-art/code with respect to the big chord-naming push from last summer (or was it 2018?)?
The answer to that might inform the answer to your implicit question.  =)

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: adding chordmode chord modifiers

Thomas Morley-2
In reply to this post by 智樂喬
Am Mo., 7. Sept. 2020 um 18:32 Uhr schrieb Randy Josleyn
<[hidden email]>:

>
> 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!
>
> Regards,
>
>
> Randy

Speaking only for me I'd be fine with:

mus = \chordmode {
  \set additionalPitchPrefix = "add"
  c:3.5.9
}

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

But of course you can go for c:add9, see p.e. Aaron's reply.

My own take is a little different.
It's restricted to "add9", which will _remove_ a 7th pitch-step and no
need for chord-exceptions

%% c/p from chord-ignatzek-names.scm
#(define (pitch-step p)
  "Musicological notation for an interval.  Eg. C to D is 2."
  (+ 1 (ly:pitch-steps p)))

%% c/p from chord-ignatzek-names.scm
#(define (remove-step x ps)
  "Copy PS, but leave out the Xth step."
  (if (null? ps)
      '()
      (let* ((t (remove-step x (cdr ps))))
        (if (= (- x 1) (ly:pitch-steps (car ps)))
            t
            (cons (car ps) t)))))

%% proc to _remove_ 7
#(define (add9-modifier pitches)
  (remove-step (pitch-step (ly:make-pitch 0 6 0)) pitches))

%% let lily know about it
chordmodifiers = #(cons (cons 'add  add9-modifier) default-chord-modifier-list)

mus = \chordmode {
  \set additionalPitchPrefix = "add"
  c:3.5.9
  c:add9
}

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

Cheers,
  Harm

Reply | Threaded
Open this post in threaded view
|

Re: adding chordmode chord modifiers

Carl Sorensen-3
In reply to this post by Kieren MacMillan
Unfortunately, the state of the code is it never got worked out of all the regressions to get ready to push to master.

It is currently hanging around in a partially-fixed branch of mine that I haven't worked on for almost a year and a half.

See https://codereview.appspot.com/568650043/

With COVID raging, my University job takes about twice as much time, so I have very little time available for LilyPond.  I am sorry.

Carl


On 9/7/20, 1:08 PM, "lilypond-user on behalf of Kieren MacMillan" <lilypond-user-bounces+carl.d.sorensen=[hidden email] on behalf of [hidden email]> wrote:

Hi all,

> I am uncertain this is the right way to be going about things

What is the current state-of-the-art/code with respect to the big chord-naming push from last summer (or was it 2018?)?
The answer to that might inform the answer to your implicit question.  =)

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: adding chordmode chord modifiers

智樂喬
In reply to this post by 智樂喬
---------- Forwarded message ----------
From: Thomas Morley <[hidden email]>
To: Randy Josleyn <[hidden email]>
Cc: lilypond-user <[hidden email]>
Bcc: 
Date: Mon, 7 Sep 2020 21:47:55 +0200
Subject: Re: adding chordmode chord modifiers
Am Mo., 7. Sept. 2020 um 18:32 Uhr schrieb Randy Josleyn
<[hidden email]>:
>
> 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!
>
> Regards,
>
>
> Randy

Speaking only for me I'd be fine with:

mus = \chordmode {
  \set additionalPitchPrefix = "add"
  c:3.5.9
}

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

But of course you can go for c:add9, see p.e. Aaron's reply.

My own take is a little different.
It's restricted to "add9", which will _remove_ a 7th pitch-step and no
need for chord-exceptions

%% c/p from chord-ignatzek-names.scm
#(define (pitch-step p)
  "Musicological notation for an interval.  Eg. C to D is 2."
  (+ 1 (ly:pitch-steps p)))

%% c/p from chord-ignatzek-names.scm
#(define (remove-step x ps)
  "Copy PS, but leave out the Xth step."
  (if (null? ps)
      '()
      (let* ((t (remove-step x (cdr ps))))
        (if (= (- x 1) (ly:pitch-steps (car ps)))
            t
            (cons (car ps) t)))))

%% proc to _remove_ 7
#(define (add9-modifier pitches)
  (remove-step (pitch-step (ly:make-pitch 0 6 0)) pitches))

%% let lily know about it
chordmodifiers = #(cons (cons 'add  add9-modifier) default-chord-modifier-list)

mus = \chordmode {
  \set additionalPitchPrefix = "add"
  c:3.5.9
  c:add9
}

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

Cheers,
  Harm

Thank you so much Harm and Aaron for your code and suggestions. I'll give them a try and see how it goes. These code examples are informative to me — I do appreciate them!

(By the way, I switched to a daily digest for lilypond-user emails and I'm not sure about how replies work from them. I've made mistakes with how replies to a list work before, so I apologize if I've done it again.)

Randy
Reply | Threaded
Open this post in threaded view
|

Re: adding chordmode chord modifiers

Wols Lists
On 08/09/2020 03:21, Randy Josleyn wrote:
>
> (By the way, I switched to a daily digest for lilypond-user emails and
> I'm not sure about how replies work from them. I've made mistakes with
> how replies to a list work before, so I apologize if I've done it again.)

I don't know how it works, but I know one email client I used had the
ability to receive a digest and break it up into individual emails.

Or do what I do and just have rules that filter lists into their own
folder. You can then go in when you want to peruse them all one by one
(little hint - turn off email notification then you're less tempted
every time one comes in :-)

Cheers,
Wol

Reply | Threaded
Open this post in threaded view
|

Coping with digests, was Re: adding chordmode chord modifiers

David Wright
On Tue 08 Sep 2020 at 17:07:08 (+0100), antlists wrote:
> On 08/09/2020 03:21, Randy Josleyn wrote:
> >
> > (By the way, I switched to a daily digest for lilypond-user emails
> > and I'm not sure about how replies work from them. I've made
> > mistakes with how replies to a list work before, so I apologize if
> > I've done it again.)
>
> I don't know how it works, but I know one email client I used had the
> ability to receive a digest and break it up into individual emails.

They all should. AFAICT even Outlook should be able to recursively
open MIME attachments that are themselves emails, and reply to them in
the usual manner. (I can't speak for mobiles and suchlike.)

What's important, however, is that you subscribe to the MIME digest,
and not the Plain one because with the latter:
. you miss the attachments,
. you have to edit out all the surrounding emails when you reply, and
. you have to coerce the client into getting the threading fixed.

For some reason, the https://lists.gnu.org/mailman/listinfo/lilypond-user
page hides the MIME subscription option below a section that implies
you need to login as an administrator.

> Or do what I do and just have rules that filter lists into their own
> folder. You can then go in when you want to peruse them all one by one
> (little hint - turn off email notification then you're less tempted
> every time one comes in :-)

Cheers,
David.