lilypond-user
[Top][All Lists]
Advanced

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

Issue a key change in Scheme syntax


From: Urs Liska
Subject: Issue a key change in Scheme syntax
Date: Wed, 4 Apr 2018 12:26:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Hi,

in my infrastructure I have a function that binds

(key-signature
     #{
       \key
       #(get-meta-option base-path 'key-tonic)
       #(get-meta-option base-path 'key-mode)
     #})

but I would like to also change this to Scheme syntax (if it makes any sense after all).

The first call to get-meta-option retrieves a Pitch object, the second a list ((0 . 0) (1 . 0) (2 . 0) (3 . 0) (4 . 0) (5 . 0) (6 . 0)) which had been stored as \major.

Obviously \key expects a pitch and a mode, but \displayMusic { \key d \major } returns


(make-music

'SequentialMusic

'elements

(list (make-music

'KeyChangeEvent

'pitch-alist

(list (cons 1 0)

(cons 2 0)

(cons 3 1/2)

(cons 4 0)

(cons 5 0)

(cons 6 0)

(cons 0 1/2))

'tonic

(ly:make-pitch -1 1))))

where the steps of the scale obviously have already been "transposed" to reflect d major.

Is it possible to write the Scheme function issuing the key change with the pitch and the generic mode as input?

Should I store something else as input instead?

Or should I simply leave it alone and stick to the interspersed LilyPond syntax?

Thanks for any suggestions

Urs


reply via email to

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