[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making two functions into one
From: |
David Kastrup |
Subject: |
Re: Making two functions into one |
Date: |
Mon, 16 Jan 2023 15:52:34 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
| || | | <aalderson@caramail.com> writes:
> I would like to make a function which will be responsible for two things:
>
> 1. Change time signature
>
> 2. Fill empty bar with 's8'
>
> I made this one, but there is a problem with point'n'click function,
> so I can't click on time signature to go to correspondent place in
> code:
>
> \version "2.24.0"
>
> nd = #(define-music-function (number) (integer?)
> (list (make-music
> 'SequentialMusic
> 'elements
> (list (make-music
> 'TimeSignatureMusic
> 'numerator
> number
> 'denominator
> 8
> 'beat-structure
> '())))
[...]
> So I thought about delete one nested (list) and try it:
> Honestly, I don't understand why it's like that, because when I run
> displayScheme{}, it display it properly without (list) and
> SquentialMusic for this two events. I suspect it could be something
> wrong with my definition.
You need to look closer at the difference of your displayScheme results.
Your above definition is missing the element
'origin (*location*)
in the make-music function arguments. A music function automatically
tacks them onto the top music expression but not on everything below.
Without origin information, point-and-click has no way to know where to
go. I am not sure what magic you imagine to be doing that job for
you...
--
David Kastrup
Re: Making two functions into one,
David Kastrup <=
Re: Making two functions into one, Jean Abou Samra, 2023/01/16