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

Do you typeset your scores on Linux? Share your thoughts, tips, and tricks here.

Moderators: khz, MattKingUSA

Post Reply
leeward
Established Member
Posts: 8
Joined: Fri May 07, 2021 4:30 am
Been thanked: 2 times

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

Post 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.
leeward
Established Member
Posts: 8
Joined: Fri May 07, 2021 4:30 am
Been thanked: 2 times

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

Post by leeward »

Turns out it wanted {4} instead of #"4". Yay for bugs in documentation.
User avatar
raboof
Established Member
Posts: 1796
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 13 times
Been thanked: 24 times
Contact:

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

Post 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?
leeward
Established Member
Posts: 8
Joined: Fri May 07, 2021 4:30 am
Been thanked: 2 times

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

Post 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.
Post Reply