Erlend Aasland | 1 Feb 2006 03:16
Picon

Re: Build fails because of No. hack

Hi

On 1/31/06, Han-Wen Nienhuys <hanwen <at> xs4all.nl> wrote:
Apparently, there are multiple versions of c0590xxx floating around.  We
should probably check whether afii61352 exists. Patch, anyone?

I've got two versions of the font installed on my computer, but none of them seems to contain afii61352. I added the following patch (also attached) as a temporary fix and now everything seems fine.

--- buildscripts/pfx2ttf.fontforge  2006-01-30 10:51:44.000000000 +0100
+++ buildscripts/pfx2ttf.fontforge  2006-02-01 01:42:18.000000000 +0100
<at> <at> -1,10 +1,16 <at> <at>
 #! <at> FONTFORGE <at>

 Open($1);
-MergeKern($2)
+MergeKern($2);

 # Remove the No. glyph - for want of better FF fix.
-Select("afii61352")
-Cut();
+err = SelectIf("afii61352");
+if ( err > 0 )
+   Cut();
+elseif ( err == 0 )
+   Print("Could not find \"numero\" glyph");
+elseif ( err < 0 )
+   Print("An error occurred while searching for the \"numero\" glyph");
+endif
 Generate($3 + $fontname + ".ttf");


Attachment (fontforge.patch): application/octet-stream, 634 bytes
_______________________________________________
lilypond-devel mailing list
lilypond-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Erik Sandberg | 1 Feb 2006 14:12
Picon
Picon
Favicon

Re: music function refactoring

On Wednesday 01 February 2006 13.43, Han-Wen Nienhuys wrote:
> Erik Sandberg wrote:
> > I have a feeling that \relative hacks is something very relevant (I
> > believe that shorthands such as the \interpolate{} thing can be very
> > valuable in the hands of an experienced lily user). The important thing
> > is that \relative should recurse into the parameters, not the return
> > value, of a function.
>
> the problem I have with this is that every other construct (eg. \times,
> \transpose) works directly. We can have "delayed" evaluation of music
> functions, but then every other construct needs to be done lazily too.
>
> Can you see a way to achieve that?

Yes, just represent those commands as music functions internally. E.g., 
\transpose creates a MusicFunction expression, with a list of two pitches and 
one Music as its 'elements (or 'arguments, I haven't decided yet), and 
'to-music-callback is set to ly:music-transpose (or rather, to a wrapper 
around that function).

--

-- 
Erik
Han-Wen Nienhuys | 1 Feb 2006 13:43
Picon
Picon
Favicon

Re: music function refactoring

Erik Sandberg wrote:
> I have a feeling that \relative hacks is something very relevant (I believe 
> that shorthands such as the \interpolate{} thing can be very valuable in the 
> hands of an experienced lily user). The important thing is that \relative 
> should recurse into the parameters, not the return value, of a function.

the problem I have with this is that every other construct (eg. \times, 
\transpose) works directly. We can have "delayed" evaluation of music 
functions, but then every other construct needs to be done lazily too.

Can you see a way to achieve that?

--

-- 
  Han-Wen Nienhuys - hanwen <at> xs4all.nl - http://www.xs4all.nl/~hanwen
Erik Sandberg | 1 Feb 2006 12:57
Picon
Picon
Favicon

Re: music function refactoring

On Monday 30 January 2006 01.01, Han-Wen Nienhuys wrote:
> Erik Sandberg wrote:
> > It could maybe be fixed by viewing variables as zero-parameter functions
> > somehow (but it would require "declaring" them globally before using
> > them).
>
> It's still a large change. I'm not yet convinced that getting cute
> \relative hacks is worth the breakage, and doing it from
> toplevel-music-functions does not seem very elegant to me.

I have a feeling that \relative hacks is something very relevant (I believe 
that shorthands such as the \interpolate{} thing can be very valuable in the 
hands of an experienced lily user). The important thing is that \relative 
should recurse into the parameters, not the return value, of a function.

My initial idea was to do a pure hack, where the partcombine function would 
insert a \relative c' around its arguments (guessing that the previous note 
was a c'), and then use a to-relative-callback which transposed the return 
value if the guess was incorrect. That hack is a lot dirtier, and it only 
works for functions that are 'linear' in transposition (i.e., functions f 
such that \transpose p1 p2 \f mus = \f \transpose p1 p2 mus).

An alternative is to hard-code \relative into the parser, always remembering 
the last entered pitch. That'd however be rather inelegant, and break 
backward compatibility.

I haven't figured out _anything_ except the new local variable assignment 
thing, that would break by postponing function calls to after parsing. (this 
is a good reason to make a final decision pretty soon, before 2.8)

With some minor chanes, the postponing of function calls would also make it 
possible to create recursive music expressions:

% music function written in quasi-code
func = #(lamda (m) (if (> (highest-pitch m) c'') (d''8) (\transpose c d \m)))
\forwardDeclare "foo"
foo = \relative { c8 \func \foo c8 }

=> foo = { c'8 d' e' fis' gis' ais' bis' cisis'' d'' cisis'' bis' ais' gis' 
fis' e' d' c' }

I'm not sure if this kind of feature would ever be useful, though.

It would also be possible to could construct a \for function with a rather 
clean syntax, something like:

\forwardDeclare "i"
\for "i" { c d e f} { e \i e e}
=> { { e c e e } { e d e e } {e e e e } {e f e e } }

A similar function can be written already, but it will have to work in a 
slightly different way, and the usefulness of the command is limited as long 
as \relative doesn't recurse into function parameters.

--

-- 
Erik
Graham Percival | 1 Feb 2006 21:13
Picon

Re: review new info on file layout


On 31-Jan-06, at 12:55 AM, Erik Sandberg wrote:

> BTW, is the meaning of the word 'indent' well-known among 
> non-programmers? In

Excellent point!  I think I'll reformat the whole chapter 4 with this 
distinction (programmers vs. non-programmers) in mind.

> - The outer braces should be << >> (using {} generates incorrect 
> output)

Thanks, fixed.

> - The following is a bit misleading:
>       \context Staff = singer <<
>         \context Voice = vocal { \melody }
>         \lyricsto vocal \new Lyrics { \text }
>>>
> The lyrics context is not part of the Staff context,

Really?  That's a pity; it would help to keep things simple.  Anyway, 
thanks!  I didn't know that.

> The correct way would be:
>
>       \context Staff = singer <<
>         \context Voice = vocal { \melody }
>>>
>       \new Lyrics \lyricsto vocal { \text }

Thanks, fixed in CVS.

> (I think there's a minor pedagogical point in saying \new Lyrics before
> \lyricsto, since the \new Lyrics really isn't a relevant argument of 
> the
> music function, and because all other contexts start with context 
> names)
>
> You could of course use \addlyrics instead.

I still haven't used lyrics -- what do you recommend?  We should 
probably use the same thing here as we do in the Example templates... 
what should those ones be?

Cheers,
- Graham
Han-Wen Nienhuys | 2 Feb 2006 02:35
Picon
Picon
Favicon

music macros?

Erik Sandberg wrote:
> Yes, just represent those commands as music functions internally. E.g., 
> \transpose creates a MusicFunction expression, with a list of two pitches and 
> one Music as its 'elements (or 'arguments, I haven't decided yet), and 
> 'to-music-callback is set to ly:music-transpose (or rather, to a wrapper 
> around that function).

OK, so we create all music expressions/events as "Music promises", which 
expand into Music objects via some function as soon as they are 
inspected, but have \relative deal with music-promises directly?

I think there should be a fool-proof (forced from the C++ side) way to 
make sure that all Music objects are instantiated in a 'delayed' way.

Nicolas, what do you think?   I think that, in a sense, \relative would 
be analogous to a Scheme macro, and the rest would be like function calls.

Hmm, maybe we should even take the distinction to the extreme: have both 
music functions and music macros. Nicolas?

Regarding the \parallelMusic: we should make sure that noone uses

  \parallelMusic #'(A B)

to define identifiers inside music expressions. We could just leave this 
aspect undocumented, or put a big warning sign that this will change in 
the near future.

--

-- 
  Han-Wen Nienhuys - hanwen <at> xs4all.nl - http://www.xs4all.nl/~hanwen
Han-Wen Nienhuys | 2 Feb 2006 02:40
Picon
Picon
Favicon

Re: music function refactoring

Erik Sandberg wrote:
> Yes, just represent those commands as music functions internally. E.g., 
> \transpose creates a MusicFunction expression, with a list of two pitches and 
> one Music as its 'elements (or 'arguments, I haven't decided yet), and 
> 'to-music-callback is set to ly:music-transpose (or rather, to a wrapper 
> around that function).
> 

just for the record, I think that this will be post 2.8 stuff. I have 
some plans for reorganizing the input format, and this would also fit 
nicely for the 3.0 release.

--

-- 
  Han-Wen Nienhuys - hanwen <at> xs4all.nl - http://www.xs4all.nl/~hanwen
Werner LEMBERG | 2 Feb 2006 07:20
Picon

bad images in NEWS.html


The first thing I see in NEWS.html are bad images: All lilypond music
examples are cropped incorrectly at the left side!  This is really bad
advertisement, especially for newcomers.  Any chance that this gets
fixed?

    Werner
Werner LEMBERG | 2 Feb 2006 07:21
Picon

Re: bad images in NEWS.html

From: Werner LEMBERG <wl <at> gnu.org>
Subject: bad images in NEWS.html
Date: Thu, 02 Feb 2006 07:20:19 +0100 (CET)

> The first thing I see in NEWS.html are bad images:

To be more specific, I mean this file:

  http://lilypond.org/doc/v2.7/Documentation/topdocs/NEWS.html

     Werner
Erik Sandberg | 2 Feb 2006 13:10
Picon
Picon
Favicon

Re: music macros?

Citerar Han-Wen Nienhuys <hanwen <at> xs4all.nl>:

> Erik Sandberg wrote:
> > Yes, just represent those commands as music functions internally. E.g., 
> > \transpose creates a MusicFunction expression, with a list of two pitches
> and 
> > one Music as its 'elements (or 'arguments, I haven't decided yet), and 
> > 'to-music-callback is set to ly:music-transpose (or rather, to a wrapper 
> > around that function).
> 
> OK, so we create all music expressions/events as "Music promises", which 
> expand into Music objects via some function as soon as they are 
> inspected, but have \relative deal with music-promises directly?

The way I view it, only functions and variables would need to be "promises".

> I think there should be a fool-proof (forced from the C++ side) way to 
> make sure that all Music objects are instantiated in a 'delayed' way.

Interesting idea, but I don't understand it fully (how would \relative
instantiate music, if the C++ code prohibits that?).

> Nicolas, what do you think?   I think that, in a sense, \relative would 
> be analogous to a Scheme macro, and the rest would be like function calls.
> 
> Hmm, maybe we should even take the distinction to the extreme: have both 
> music functions and music macros. Nicolas?

Sounds like a sound idea. Apart from \relative, it would be nice to also have
\score, \include, \header etc. as macros.

In this case, IWBN if a ly file always was a single music expression in a
sense,
so one would in principle be allowed to place braces around the top-level ly
file, like:

{ foo = { c d e }
\score {
  \foo
  \header {...}
}
}

I this kind of syntax would make it possible to improve the language in the
future; I'm thinking of making a \lambda music function (not macro) possible.

There's the question of whether function parameters should have some kind of
parentheses around them. It _might_ be possible to introduce \lambda without
requiring this, there is however a risk of dirt in the grammar.

> Regarding the \parallelMusic: we should make sure that noone uses
> 
>   \parallelMusic #'(A B)
> 
> to define identifiers inside music expressions. We could just leave this 
> aspect undocumented, or put a big warning sign that this will change in 
> the near future.

Well, we could just even hard-code the command into the parser for now
(prohibiting people from using it).

It would be nice if we could have a discussion on post-3.0 syntax before
releasing 2.8: This would increase the possibilities to do some wise
intermediate syntax changes for 2.8, similar to the 1.6->1.8->2.0 chord syntax
changes. (seems that you already have done this with \score syntax, but we
might need more, depending on the plans for 3.0)

Erik

Gmane