lilypond-user
[Top][All Lists]
Advanced

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

Re: New hosting for Urs Liska's Scheme WIP book


From: Karlin High
Subject: Re: New hosting for Urs Liska's Scheme WIP book
Date: Thu, 3 Nov 2022 18:13:36 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 11/3/2022 5:39 PM, Jean Abou Samra wrote:
If you have thoughts on the best path towards making
it easy for people to learn Scheme, with these two resources
as a starting point, feel free to express them.

I am glad to see this effort, thank you for doing it.

Within the past week, I used define-music-function in a fashion other than cargo-cult for the first time.

It was in a SATB choral piece. There is temporary polyphony within a single part some places. I started out writing it as chords, then saw there was unison notes within the temporary polyphony. I want them to show stems up and down indicating unison has not ended.

Therefore I went,

<https://lilypond.org/doc/v2.23/Documentation/notation/multiple-voices>
"
A temporary polyphonic passage can be created with the following construct:

<< { \voiceOne … }
  \new Voice { \voiceTwo … }
>> \oneVoice
"

...but got tired of having all that code each time there was a unison note among the temporary-polyphony chords.

Could a music function or something be shorthand for that? Let's see...

<https://lilypond.org/doc/v2.23/Documentation/notation/substitution-function-syntax>

That page is pretty ideal. Here's the general form, what it contains, and how it can be used. I ended up with this:

%
\version "2.23.80"
uniTwo = #(define-music-function
           (uniNote)
           (ly:music?)
           #{
             << { \voiceOne #uniNote }
                \new Voice { \voiceTwo #uniNote }
             >> \oneVoice
           #})

{ c'4 \uniTwo e' g' }
%

I may end up replacing all the chords with the temporary-polyphony construct. And I may get told my \uniTwo function is very far from best practice. Regardless, Scheme code seems a bit more approachable now.
--
Karlin High
Missouri, USA



reply via email to

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