[Top][All Lists]

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

Re: New feature: automatically invert chords or drop/rise chord notes (i

From: dak
Subject: Re: New feature: automatically invert chords or drop/rise chord notes (issue 365840043 by address@hidden)
Date: Tue, 29 Jan 2019 08:51:23 -0800

On 2019/01/28 21:53:04, dak wrote:
On 2019/01/28 20:02:53, Valentin Villenave wrote:

> I can’t figure out how to make it work without resetting the
> elements list. How would you proceed?

Without any pointer to what you are having problems with, this is
"do it yourself".  Sigh.  I don't even understand what those
interfaces are
supposed to be good for so I at least changed the internals to stop
mixing directions and counts.  The user-level commands remain as
chaotic as I
find them to be.

Try this patched-up variant of code posted in the mailing list.


\version "2.21.0"

#(define-public (move-chord-note n octs)
    (_i "Transpose a note (numbered as @var{n}) by @var{octs} octaves.
@var{n} is zero-based and can be negative to count from the end.")
    (lambda (music)
      (define (proper-pitch note)
        (let* ((oct (ly:music-property note 'octavation))
              (pitch (ly:music-property note 'pitch)))
         (if (number? oct)
             (ly:pitch-transpose pitch (ly:make-pitch oct 0))

Well, considering the way invertChords is written, this should likely
just be
(define (proper-pitch note) (ly:music-property note 'pitch))
since "octavation" is only informational without affecting the pitch.
Thinko, sorry.

By the way, I find it somewhat strange that the code discussion on the
user list as well as the patch progress here completely ignore this
contribution.  After all, it was solicited.

reply via email to

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