Page 1 of 1

Lilypond error: 'Expecting duration, found "4."'

Posted: Tue May 18, 2021 4:22 am
by leeward
I'm running Lilypond 2.22.0, and I have a section that goes from 4/4 to 12/8 but keeps the tempo the same. Here's some minimal example source:

Code: Select all

\version "2.22.0"
{
  \tempo 4 = 120
  \time 4/4
    c'4 c' c' c' |
  \time 12/8
  \tempo \markup {
    \concat {
      (
      \note #"4." #UP
      " = "
      \note #"4" #UP
      )
    }
  }
  c'4. c' c' c'
}
I got this from \note and metronome marks in the manual. However, when I run this through lilypond, I get the following error message:
test.ly:10:13: error: wrong type for argument 1. Expecting duration, found "4."
\note
#"4." #UP
/usr/share/lilypond/2.22.0/scm/lily.scm: 1036:21: In procedure reverse! in expression (ly:parse-file file-name):
/usr/share/lilypond/2.22.0/scm/lily.scm: 1036:21: Wrong type argument in position 1: (1 "4." . #f)
I'm very confused. Isn't "4." a duration? Is there some other setting I need to apply somewhere? It seems like the problem is just with \note, but I don't see what I could be messing up about it.

Re: Lilypond error: 'Expecting duration, found "4."'

Posted: Wed May 19, 2021 2:02 am
by leeward
Turns out it wanted {4} instead of #"4". Yay for bugs in documentation.

Re: Lilypond error: 'Expecting duration, found "4."'

Posted: Wed May 19, 2021 11:46 am
by raboof
leeward wrote: Wed May 19, 2021 2:02 am Turns out it wanted {4} instead of #"4". Yay for bugs in documentation.
It looks like you were using version 2.22 of lilypond, but version 2.20 of the docs. Maybe that's where the disconnect came from?

Re: Lilypond error: 'Expecting duration, found "4."'

Posted: Fri May 21, 2021 1:09 am
by leeward
raboof wrote: Wed May 19, 2021 11:46 am
leeward wrote: Wed May 19, 2021 2:02 am Turns out it wanted {4} instead of #"4". Yay for bugs in documentation.
It looks like you were using version 2.22 of lilypond, but version 2.20 of the docs. Maybe that's where the disconnect came from?
Hey, you're right. If I look at the right version of the docs, it tells me to do the right thing. Note for the future: Lilypond does not use semantic versions.