LM 2.4.1: errors in variable definitions

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

LM 2.4.1: errors in variable definitions

Federico Bruni-2
I found a bug in the Learning Manual:
http://lilypond.org/doc/v2.19/Documentation/learning/organizing-pieces-with-variables.html

The example suggested at the end of that page doesn't work:

1. paperheight should be renamed to paper-height

2. name variable should be renamed to something else (myName), as it
triggers this error:
warning: identifier name is a keyword: `name'

3. width variable triggers this error:
error: unknown escaped string: `\cm'

I don't know how to fix this,

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\version "2.19.45"

%width = 4.5\cm
%name = "Wendy"
aFivePaper = \paper { paper-height = 21.0 \cm }

\paper {
  \aFivePaper
  %line-width = \width
}

{
  c4%^\name
}




_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LM 2.4.1: errors in variable definitions

Malte Meyn-3


Am 17.07.2016 um 09:16 schrieb Federico Bruni:
>
> 3. width variable triggers this error:
> error: unknown escaped string: `\cm'
>
> I don't know how to fix this,

Put the definition of width into an \paper block. cm seems to be unknown
outside.

\paper {
   width = 4.5\cm
}

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LM 2.4.1: errors in variable definitions

Federico Bruni-2
Il giorno dom 17 lug 2016 alle 10:45, Malte Meyn
<[hidden email]> ha scritto:

>
>
> Am 17.07.2016 um 09:16 schrieb Federico Bruni:
>>
>> 3. width variable triggers this error:
>> error: unknown escaped string: `\cm'
>>
>> I don't know how to fix this,
>
> Put the definition of width into an \paper block. cm seems to be
> unknown outside.
>
> \paper {
>   width = 4.5\cm
> }

Of course, but this is the standard \paper property and the whole point
of the example in the documentation is defining variables.

We may omit the unit and use the default one (millimeters). But I
wonder if this is a bug or there's a better way to define such a
variable.




_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LM 2.4.1: errors in variable definitions

dak
Federico Bruni <[hidden email]> writes:

> Il giorno dom 17 lug 2016 alle 10:45, Malte Meyn
> <[hidden email]> ha scritto:
>>
>>
>> Am 17.07.2016 um 09:16 schrieb Federico Bruni:
>>>
>>> 3. width variable triggers this error:
>>> error: unknown escaped string: `\cm'
>>>
>>> I don't know how to fix this,
>>
>> Put the definition of width into an \paper block. cm seems to be
>> unknown outside.
>>
>> \paper {
>>   width = 4.5\cm
>> }
>
> Of course, but this is the standard \paper property and the whole
> point of the example in the documentation is defining variables.
>
> We may omit the unit and use the default one (millimeters). But I
> wonder if this is a bug or there's a better way to define such a
> variable.

I thought the default unit was staff spaces?  Don't quote me on that but
I thought that the main mess was that the definition of \cm changed when
one changed the default staff size.

--
David Kastrup

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LM 2.4.1: errors in variable definitions

Malte Meyn-3


Am 17.07.2016 um 11:44 schrieb David Kastrup:
> I thought the default unit was staff spaces?

Not in the paper block. See paper-defaults-init.ly, lines 30ff.

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LM 2.4.1: errors in variable definitions

Federico Bruni-2
In reply to this post by dak
Il giorno dom 17 lug 2016 alle 11:44, David Kastrup <[hidden email]> ha
scritto:

>>  Of course, but this is the standard \paper property and the whole
>>  point of the example in the documentation is defining variables.
>>
>>  We may omit the unit and use the default one (millimeters). But I
>>  wonder if this is a bug or there's a better way to define such a
>>  variable.
>
> I thought the default unit was staff spaces?  Don't quote me on that
> but
> I thought that the main mess was that the definition of \cm changed
> when
> one changed the default staff size.

Perhaps the default unit of \paper properties is millimeters? That
would make sense. While staff spaces make sense for elements of the
notation.

I just made a test. A 208 line-width spans almost all the 210x210
document:

\version "2.19.45"

width = 208
stringName = "Wendy"
aFivePaper = \paper { paper-height = 210 }

\paper {
  \aFivePaper
  line-width = \width
  ragged-last = ##f
  indent = 0
}

{
  c4^\stringName
}




_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LM 2.4.1: errors in variable definitions

dak
Federico Bruni <[hidden email]> writes:

> Il giorno dom 17 lug 2016 alle 11:44, David Kastrup <[hidden email]> ha
> scritto:
>>>  Of course, but this is the standard \paper property and the whole
>>>  point of the example in the documentation is defining variables.
>>>
>>>  We may omit the unit and use the default one (millimeters). But I
>>>  wonder if this is a bug or there's a better way to define such a
>>>  variable.
>>
>> I thought the default unit was staff spaces?  Don't quote me on that
>> but
>> I thought that the main mess was that the definition of \cm changed
>> when
>> one changed the default staff size.
>
> Perhaps the default unit of \paper properties is millimeters? That
> would make sense. While staff spaces make sense for elements of the
> notation.
>
> I just made a test. A 208 line-width spans almost all the 210x210
> document:
>
> \version "2.19.45"
>
> width = 208
> stringName = "Wendy"
> aFivePaper = \paper { paper-height = 210 }
>
> \paper {
>  \aFivePaper
>  line-width = \width
>  ragged-last = ##f
>  indent = 0
> }
>
> {
>  c4^\stringName
> }

Well, I have no actual idea here.  I just know that stuff gets scaled
around in paper and/or layout blocks and I had a hard time figuring out
how or why.  Maybe it's different in \paper and \layout (and I think at
the very least in the \layout block of a \score markup), and maybe I
just haven't got the hang of it at all.

--
David Kastrup

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LM 2.4.1: errors in variable definitions

Federico Bruni-2
Eventually I've added an issue in the tracker:
https://sourceforge.net/p/testlilyissues/issues/5132/


Il giorno dom 17 lug 2016 alle 12:18, David Kastrup <[hidden email]> ha
scritto:

> Federico Bruni <[hidden email]> writes:
>
>>  Il giorno dom 17 lug 2016 alle 11:44, David Kastrup <[hidden email]> ha
>>  scritto:
>>>>   Of course, but this is the standard \paper property and the whole
>>>>   point of the example in the documentation is defining variables.
>>>>
>>>>   We may omit the unit and use the default one (millimeters). But I
>>>>   wonder if this is a bug or there's a better way to define such a
>>>>   variable.
>>>
>>>  I thought the default unit was staff spaces?  Don't quote me on
>>> that
>>>  but
>>>  I thought that the main mess was that the definition of \cm changed
>>>  when
>>>  one changed the default staff size.
>>
>>  Perhaps the default unit of \paper properties is millimeters? That
>>  would make sense. While staff spaces make sense for elements of the
>>  notation.
>>
>>  I just made a test. A 208 line-width spans almost all the 210x210
>>  document:
>>
>>  \version "2.19.45"
>>
>>  width = 208
>>  stringName = "Wendy"
>>  aFivePaper = \paper { paper-height = 210 }
>>
>>  \paper {
>>   \aFivePaper
>>   line-width = \width
>>   ragged-last = ##f
>>   indent = 0
>>  }
>>
>>  {
>>   c4^\stringName
>>  }
>
> Well, I have no actual idea here.  I just know that stuff gets scaled
> around in paper and/or layout blocks and I had a hard time figuring
> out
> how or why.  Maybe it's different in \paper and \layout (and I think
> at
> the very least in the \layout block of a \score markup), and maybe I
> just haven't got the hang of it at all.
>
> --
> David Kastrup


_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Loading...