[Top][All Lists]

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

Re: Issue a key change in Scheme syntax

From: David Kastrup
Subject: Re: Issue a key change in Scheme syntax
Date: Wed, 04 Apr 2018 17:08:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Am 04.04.2018 um 13:17 schrieb David Kastrup:


>>> Is it possible to write the Scheme function issuing the key change
>>> with the pitch and the generic mode as input?
>> (key-signature
>>       (key
>>         (get-meta-option base-path 'key-tonic)
>>         (get-meta-option base-path 'key-mode)))
>> Obviously I am missing something here.
> No.
>> Of course, you can also take a look at the definition of \key in
>> ly/ if you want to stick with 2.18 or something.
> I *still* get confused by so many basic things, for example the fact
> that \key, \time etc. are not (all) elements that are directly
> processed by the parser but may be implemented as functions and thus
> can *directly* be called through Scheme syntax.

Well, they _are_ still music functions.  Calling them "through Scheme
syntax" only made good sense once the "parser/location" arguments were
no longer needed.  "key" is _not_ a proper function.  It still is a
music function but it now has an "apply" method that typechecks all the
arguments, caters for optional arguments (if the type doesn't fit or
*unspecified* is given explicitly, the default is used instead) and then
extracts the music function internal function and calls it.

In short: this looks quite more simple and logical and "basic" than it
actually is under the hood.  It's confusing for experienced users but
not for beginners.

It's designed to work as expected, for completely unrealistic

> Arrgh.

You got that right.

David Kastrup

reply via email to

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