[Top][All Lists]

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

Re: [Bug?] Dotting notes by music function

From: Juergen Reuter
Subject: Re: [Bug?] Dotting notes by music function
Date: Fri, 13 Oct 2006 12:44:26 +0200 (CEST)

Ah, thanks, now I understand! But then, in the manual in Sect. 12.1.2 (Simple substitution functions), in the

custosNote = #(define-music-function (parser location note)

example, "note" should better be renamed into "event" or something similar to avoid misunderstandings, right?

By the way, do we have a generic substitution function that you can pass an event type and some replacement expression to? Maybe something like

  #(define-matching-expression (any-music-event-of-type 'NoteEvent))
    (original-match) (... <an expression in terms of original-match that
    is used as replacement for original-match> ...))),

where, in this example, the specified replace function is executed exactly once for each 'NoteEvent (i.e. the matching expression) in Music (with the note event passed as "original-match" argument to the replacement expression) in order to replace the original match by the result of the replacement expression?

(By the way, please note that I do not explicitly specify here the type of the matching expression, i.e. the return type of the any-msuic-event-of-type function. In the most general case, it could be an attributed music expression subgraph in order to implement a graph rewriting system. For now, I would be happy, if it would be just a music event type such as 'NoteEvent, in order to match all events of a given specific type.)

I guess, such a function would save lots of duplicated code used for navigating through music expressions, right? Or do we already have such a function?

Thanks & Greetings,

On Fri, 13 Oct 2006, Nicolas Sceaux wrote:

Juergen Reuter <address@hidden> writes:

Hi, all!

I would expect the following lily file:

\version "2.9.22"

dottedQuarter =
#(define-music-function (parser location note) (ly:music?)
    'duration (ly:make-duration 2 1)
    'pitch (ly:music-property note 'pitch)))

\new Voice \transpose c c' {
  f4 f \dottedQuarter f f f

to produce the notes:

f4 f4 f4. f4 f4

However, it produces:

f4 f4 c4. f4 f4

That is, the pitch changes from "f" to "c", although I am trying to
copy it from the original note.  Is this a bug or am I doing something

Are you sure that the note argument as a pitch property? Try:

\displayMusic f4


reply via email to

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