APIs, hooks, servers and realtime integration

2012-02-28 Thread Steve Bennett
Hi all,
  I'm exploring possibilities for a web-based music creation and
manipulation tool, and considering LilyPond for rendering the music (is
there an alternative? :)). From what I can see in the documentation, it's
designed very much as a command line tool, intended to be driven directly
by users. Whereas I'm looking for a way to embed it in a web application,
and not pay the overhead of loading libraries, parsing and processing
entire scores when only small bits change, etc.

A search of the archives shows that this question comes up periodically in
various forms (a LilyPond server? an API? incremental rendering?), going
back to 2005 - but I haven't stumbled on anything much beyond proof of
concept. There's Wikitex, but MediaWiki isn't much help to me, and the
Wikitex repository and mailing lists (as linked from http://wikitex.org/) seem
to be offline.

The application will probably be based in Django, so Python hooks would be
especially useful. I'd be interested in ways of embedding LilyPond, or
running a server that can maintain a bit of state to provide quick response.

Any suggestions? Thoughts? Places to look? Other people to ask? :)

Thanks in advance,
Steve
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: APIs, hooks, servers and realtime integration

2012-02-28 Thread James
Steve,


On 28 February 2012 08:08, Steve Bennett stev...@gmail.com wrote:
 Hi all,
   I'm exploring possibilities for a web-based music creation and
 manipulation tool, and considering LilyPond for rendering the music (is
 there an alternative? :)). From what I can see in the documentation, it's
 designed very much as a command line tool, intended to be driven directly by
 users. Whereas I'm looking for a way to embed it in a web application, and
 not pay the overhead of loading libraries, parsing and processing entire
 scores when only small bits change, etc.

 A search of the archives shows that this question comes up periodically in
 various forms (a LilyPond server? an API? incremental rendering?), going
 back to 2005 - but I haven't stumbled on anything much beyond proof of
 concept. There's Wikitex, but MediaWiki isn't much help to me, and the
 Wikitex repository and mailing lists (as linked
 from http://wikitex.org/) seem to be offline.

 The application will probably be based in Django, so Python hooks would be
 especially useful. I'd be interested in ways of embedding LilyPond, or
 running a server that can maintain a bit of state to provide quick response.

 Any suggestions? Thoughts? Places to look? Other people to ask? :)

See thread.

http://lists.gnu.org/archive/html/lilypond-user/2012-02/msg2.html

Trevor Dixon has recently written a nice web-based app.


-- 
--

James

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Allow music with layout instructions in output definitions. (issue 5701049)

2012-02-28 Thread David Kastrup
Janek Warchoł janek.lilyp...@gmail.com writes:

 On Tue, Feb 28, 2012 at 2:36 AM,  d...@gnu.org wrote:
 \score {
   \new Staff { b b }
   \layout { \override NoteHead #'color = #red }
 }

 Totally elusive bug that also afflicted \settingsFrom.  Fixed

 i confirm that it works for me.  Thanks!

 I even hoped that something like this will be possible:
 \score { 
     \new Voice { b b }
     \new Voice = aa { b b }
   
   \layout { \override aa.NoteHead #'color = #red }
 }

 It is nonsense since aa is not the type but the id of a context and
 can't be meddled with in a layout definition.

 ok...
 Out of curiosity, would this be possible to add in a reasonable way or
 is it totally wrong?

Totally wrong.

 From a users' perspective, it would be great to have such overrides in
 \layout, because then i'd have 3 separate and independent areas of my
 file: - music in variables or \include files - style decisions in
 \layout block.  - score structure that doesn't contain any of the
 above and can be freely changed.

You can use context modifications for that.

 Try \new Voice = aa \with { \settingsFrom \override NoteHead #'color
 #red } { ...
 instead.

 It doesn't work:

 \score {
 \new Voice \with { \settingsFrom \override NoteHead #'color = #red } { b 
 b }
   }

 produces

 ../bah.ly:2:37: error: syntax error, unexpected \override
 \new Voice \with { \settingsFrom
  \override NoteHead #'color = #red } { b 
 b }

Ah yes.  Because \settingsFrom has an optional argument, and so the
music argument must be some delimited form if the optional argument is
left out.  At one point of time, this aggravation will go, but I will
need to boil down the grammar a bit more before I can manage that.

 If i add a pair of curly braces, i.e.
 \score {
   \new Voice \with { \settingsFrom { \override NoteHead #'color = #red
 } } { b b }
   }

 then it compiles, but the override isn't applied.

Well, I _did_ write Totally elusive bug that also afflicted
\settingsFrom.  Fixed.

So it is to be expected that you need to update to the very latest git
commit first.

Contextmodifications can be placed in variables, so you can write

aasettings = \with { ... }


and later use

\new Voice = aa \aasettings { ... }

or

\new Voice = aa \with \aasettings { ... }

-- 
David Kastrup

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Important: GSoC mentors

2012-02-28 Thread David Kastrup
Janek Warchoł janek.lilyp...@gmail.com writes:

 We have a nice Ideas List for Google Summer of Code.  Now, each
 project should have a mentor, who's job is to guide the student
 working on the code and evaluate his/her work.

 Mentors may or may not receive money, but they will surely win Eternal
 Glory (and maybe a Graham's Kiss, who knows?).  Please declare which
 project(s) you are willing to mentor (remember that not all projects
 will be launched):

I can't offer to mentor because my economic situation makes it rather
likely that I will have ceased all LilyPond activities by summer.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: APIs, hooks, servers and realtime integration

2012-02-28 Thread Steve Bennett
On 28 February 2012 19:24, James pkx1...@gmail.com wrote:

 See thread.

 http://lists.gnu.org/archive/html/lilypond-user/2012-02/msg2.html

 Trevor Dixon has recently written a nice web-based app.


Ah, sounds promising. But the site is down - bad gateway. Is the code
available anywhere?

Steve
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: ghostscript in gub

2012-02-28 Thread Graham Percival
On Sun, Feb 26, 2012 at 12:07:16AM -0800, Joe Neeman wrote:
 This patch allows me to build ghostscript in gub on Ubuntu 11.10. The
 problem is that ghostscript only looks for sys/types.h in /usr/include,
 whereas Ubuntu 11.10 has it in /usr/include/x86_64-linux-gnu.

Thanks, pushed.  I've checked that I can still compile ghostscript
with this patch attached.

- Graham

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Gets vertical skylines from grob stencils (issue 5626052)

2012-02-28 Thread m...@apollinemike.com
Hey all,

I have a new patch up that simplifies the old one a great deal and uses 
freetype to get outlines.

The only problem with it (that I know of) exists for some non-standard fonts.  
If you run input/regression/utf-8.ly through this, you'll see LilyPond get very 
angry about not being able to find the glyph in the font.  This is because I am 
stashing a font at creation time in pango-font.cc (check out the constructor - 
you'll see a new member font_ being set) instead of extracting the font from 
the glyphs.  In certain cases, this means that the FT_Face created in the 
pango_item_string_stencil of my patch is different from that created in current 
master.  I have no clue why this is the case - does anyone have any intuition 
about this?

Cheers,
MS
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Gets vertical skylines from grob stencils (issue 5626052)

2012-02-28 Thread m...@apollinemike.com
Hey all,

I've put up a new version that doesn't issue warnings.
The only problem I'm running into now is that the outlines aren't always 100% 
exact.  This causes really close kerning and sometimes even overlap (check out 
figured-bass-implicit.ly).  An easy (albeit kludgy) solution would be to add a 
bit of padding around all glyphs that come from a pango font.  Does this seem 
like a reasonable way of going about it?

Cheers,
MS
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Important: GSoC mentors

2012-02-28 Thread Janek Warchoł
On Tue, Feb 28, 2012 at 12:47 PM, David Kastrup d...@gnu.org wrote:
 Janek Warchoł janek.lilyp...@gmail.com writes:

 We have a nice Ideas List for Google Summer of Code.  Now, each
 project should have a mentor, who's job is to guide the student
 working on the code and evaluate his/her work.

 Mentors may or may not receive money, but they will surely win Eternal
 Glory (and maybe a Graham's Kiss, who knows?).  Please declare which
 project(s) you are willing to mentor (remember that not all projects
 will be launched):

 I can't offer to mentor because my economic situation makes it rather
 likely that I will have ceased all LilyPond activities by summer.

Damn.  I see that a Kickstarter project is really urgent.  Aargh, how
to do all this stuff!

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Cross-staff stem engraver (was: New frog in an empty pond?)

2012-02-28 Thread Pavel Roskin
Hello, Joe!

 In case it wasn't clear from what I said before, engravers in lilypond
 don't do the actual layout. Instead, they build the grobs and set up
 the connections between them. Most of the layout is done in callback
 functions.

Yes, I realize it now.  Your suggestion to create a new stem worked
fine.  I can get the relative coordinates of themes on different staves.

The attached file shows where I am now.  There are many minor issues,
and I hope I can solve most of them, but I'll certainly appreciate help.

I'm getting a message Weird stem, and I don't see how to avoid it.
Perhaps I should create a totally new grob with a unique name, such as
StemSpan.  Is that possible?  What would be needed?

How do I make the new stem start at the same point as the original
one.  I tried this:

(set! (ly:grob-property stem 'axes) (list X))

I don't understand how it works.  Not setting axes leads to:

programming error: axes should be nonempty

Maybe I should use some other parent for the new stem?

The new stems are offset horizontally on purpose to see where they
are.  But the vertical position is wrong and I don't see how to fix it.

I'll appreciate if you have a look at the code.

-- 
Regards,
Pavel Roskin
\version 2.14.2

#(define (grobParentByInterface grob intf axis)
   (if (memq intf (ly:grob-interfaces grob))
   grob
   (grobParentByInterface (ly:grob-parent grob axis) intf axis)))

#(define (extent-combine extents)
   (if (pair? (cdr extents))
   (interval-union (car extents) (extent-combine (cdr extents)))
   (car extents)))

#(define (crossStaffLength grob)
   (let* ((papercolumn (grobParentByInterface grob 'paper-column-interface X))
  (elementarray (ly:grob-object papercolumn 'elements))
  (yref (ly:grob-common-refpoint-of-array grob elementarray Y))
  (elements (ly:grob-object grob 'spanned-stems))
  (extents (map (lambda (x) (ly:grob-extent x yref Y)) elements))
  (foo (ly:message extents: ~a extents))
  (maxextent (extent-combine extents))
  (foo (ly:message maxextent: ~a maxextent))
  (length (- (car maxextent) (cdr maxextent
 length))

#(define (stemSpanStencil grob)
   (let* ((length (crossStaffLength grob)))
 (make-filled-box-stencil '(0.2 . 0.4) (cons 0 length

#(define (reparentStems ctx stems trans)
   (if (and (pair? stems) (pair? (cdr stems)))
   (let* ((stem (car stems))
  (parent (ly:grob-parent stem Y))
  (new-stem (ly:engraver-make-grob trans 'Stem '(
 (ly:message stems: ~a stems)
 (ly:message new-stem: ~a new-stem)
 (set! (ly:grob-property stem 'axes) (list X))
 (ly:axis-group-interface::add-element stem new-stem)
 (set! (ly:grob-object new-stem 'spanned-stems) stems)
 (set! (ly:grob-object new-stem 'Y-offset) 5)
 (set! (ly:grob-property new-stem 'stencil) stemSpanStencil)
 (set! (ly:grob-property new-stem 'length) crossStaffLength

#(define (Cross_staff_stem_engraver ctx)
  (let ((stems '()))

`((acknowledgers
   (stem-interface
. ,(lambda (trans grob source)
 (set! stems (cons grob stems)

  (process-acknowledged
   . ,(lambda (trans)
 (reparentStems ctx stems trans) (set! stems '()))

\layout {
  \context {
\PianoStaff
\consists #Cross_staff_stem_engraver
  }
}

\new PianoStaff 
  \new Staff { \stemUp g' a' b' c'' }
  \new Staff { \stemUp f' e' f' d' r }

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Cross-staff stem engraver (was: New frog in an empty pond?)

2012-02-28 Thread Joe Neeman
On Tue, Feb 28, 2012 at 2:56 PM, Pavel Roskin pro...@gnu.org wrote:

 Hello, Joe!

  In case it wasn't clear from what I said before, engravers in lilypond
  don't do the actual layout. Instead, they build the grobs and set up
  the connections between them. Most of the layout is done in callback
  functions.

 Yes, I realize it now.  Your suggestion to create a new stem worked
 fine.  I can get the relative coordinates of themes on different staves.

 The attached file shows where I am now.  There are many minor issues,
 and I hope I can solve most of them, but I'll certainly appreciate help.

 I'm getting a message Weird stem, and I don't see how to avoid it.
 Perhaps I should create a totally new grob with a unique name, such as
 StemSpan.  Is that possible?  What would be needed?


It would be nice to do this eventually, because having a different grob
name would make it easier for the users to tweak it. I think it would
involve editing scm/define-grobs.scm, but there may be a way to do it from
an .ly file also


 How do I make the new stem start at the same point as the original
 one.  I tried this:

 (set! (ly:grob-property stem 'axes) (list X))

 I don't understand how it works.  Not setting axes leads to:

 programming error: axes should be nonempty


Don't use ly:axis-group-interface::add-element, because stems don't
implement the axis-group-interface. (Removing this will also remove the
axes warning.) Instead, use ly:grob-set-parent!. You'll probably want to
set both the X parent and the Y parent. Then the X and Y offsets of
new-stem will be measured relative to stem (instead of relative to the
whole system, which is the default).

Cheers,
Joe
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Savannah credential problems?

2012-02-28 Thread David Kastrup

Hi,

anybody else getting those?

git fetch
Permission denied (publickey).
fatal: The remote end hung up unexpectedly


-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Savannah credential problems?

2012-02-28 Thread Thomas Morley
2012/2/29 David Kastrup d...@gnu.org:

 Hi,

 anybody else getting those?

 git fetch
 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly


 --
 David Kastrup

Couldn't reach Savannah for some hours.

The following error was encountered while trying to retrieve the URL:
http://git.savannah.gnu.org/gitweb/?
Connection to 140.186.70.72 failed.
The system returned: (110) Connection timed out

But now it works.


Cheers,
  Harm

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Savannah credential problems?

2012-02-28 Thread David Kastrup
Thomas Morley thomasmorle...@googlemail.com writes:

 2012/2/29 David Kastrup d...@gnu.org:

 Hi,

 anybody else getting those?

 git fetch
 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly

 Couldn't reach Savannah for some hours.

 The following error was encountered while trying to retrieve the URL:
 http://git.savannah.gnu.org/gitweb/?
 Connection to 140.186.70.72 failed.
 The system returned: (110) Connection timed out

 But now it works.

Well, that would be an anonymous (readonly) connection not requiring
authentication.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Savannah credential problems?

2012-02-28 Thread Phil Holmes
- Original Message - 
From: David Kastrup d...@gnu.org

To: lilypond-devel@gnu.org
Sent: Tuesday, February 28, 2012 11:37 PM
Subject: Re: Savannah credential problems?



Thomas Morley thomasmorle...@googlemail.com writes:


2012/2/29 David Kastrup d...@gnu.org:


Hi,

anybody else getting those?

git fetch
Permission denied (publickey).
fatal: The remote end hung up unexpectedly


Couldn't reach Savannah for some hours.

The following error was encountered while trying to retrieve the URL:
http://git.savannah.gnu.org/gitweb/?
Connection to 140.186.70.72 failed.
The system returned: (110) Connection timed out

But now it works.


Well, that would be an anonymous (readonly) connection not requiring
authentication.

--
David Kastrup



Seemed to me that savannah was down full stop. Now up again, but not tried a 
push.


--
Phil Holmes



___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Gets vertical skylines from grob stencils (issue 5626052)

2012-02-28 Thread Joe Neeman
On Tue, Feb 28, 2012 at 1:32 PM, m...@apollinemike.com 
m...@apollinemike.com wrote:

 Hey all,

 I've put up a new version that doesn't issue warnings.


Any change of getting an updated git branch, too?
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


PATCH: Countdown to 20120301

2012-02-28 Thread Colin Campbell

For 20:00 MST Thursday March 1

Critical:
Issue 2338 
http://code.google.com/p/lilypond/issues/detail?id=2338: OS X LilyPad 
not working - R 5694092 http://codereview.appspot.com/5694092/


Documentation:
Issue 2306 
http://code.google.com/p/lilypond/issues/detail?id=2306: add info 
about Articulations on EventChords to CG - R 5696080 
http://codereview.appspot.com/5696080/
Issue 2320 
http://code.google.com/p/lilypond/issues/detail?id=2320: Patch: CG: 
add information about Regtest Checking Project - R 5669047 
http://codereview.appspot.com/5669047/


Enhancement:
Issue 2349 
http://code.google.com/p/lilypond/issues/detail?id=2349: Patch: 
Removes transparents in TabVoice and replaces with false stencil - R 
5694066 http://codereview.appspot.com/5694066/
Issue 2357 
http://code.google.com/p/lilypond/issues/detail?id=2357: Patch: web: 
rephrase bugreports section - R 5698070 
http://codereview.appspot.com/5698070/
 Issue 2358 
http://code.google.com/p/lilypond/issues/detail?id=2358: Patch: Allow 
music with layout instructions in output definitions. - R 5701049 
http://codereview.appspot.com/5701049/
Issue 2364 
http://code.google.com/p/lilypond/issues/detail?id=2364: Patch: Don't 
use Bottom overrides (default when unspecified) in \tabFullNotation - R 
5701058 http://codereview.appspot.com/5701058/


Scripts:
Issue 2360 
http://code.google.com/p/lilypond/issues/detail?id=2360: Scheme 
sandbox fails to load readline module - R 5698074 
http://codereview.appspot.com/5698074/



Cheers,
Colin



--
I've learned that you shouldn't go through life with a catcher's mitt on both 
hands.
You need to be able to throw something back.
-Maya Angelou, poet (1928- )

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Cross-staff stem engraver (was: New frog in an empty pond?)

2012-02-28 Thread Pavel Roskin

Quoting Joe Neeman joenee...@gmail.com:


I'm getting a message Weird stem, and I don't see how to avoid it.
Perhaps I should create a totally new grob with a unique name, such as
StemSpan.  Is that possible?  What would be needed?



It would be nice to do this eventually, because having a different grob
name would make it easier for the users to tweak it. I think it would
involve editing scm/define-grobs.scm, but there may be a way to do it from
an .ly file also


It turn out the message comes from ly:stem::offset-callback and can be  
suppressed by redefining X-offset.



Don't use ly:axis-group-interface::add-element, because stems don't
implement the axis-group-interface. (Removing this will also remove the
axes warning.) Instead, use ly:grob-set-parent!. You'll probably want to
set both the X parent and the Y parent. Then the X and Y offsets of
new-stem will be measured relative to stem (instead of relative to the
whole system, which is the default).


That was it!  I have a working solution now!  It will need to be  
improved to ignore rests and other invisible stems, check the  
cross-staff property, avoid connecting incompatible stems and so on.   
The old stems should be made transparent.  But all that should be  
simple.  Once I have something easy to use, I plan to submit it to the  
LSR.


Actually, it looks like System is a better Y-parent for the new stem.   
Perhaps I'll try to use the common reference of the stems to be  
connected.


Here's what I have now (attached).

Thank you for your help!

--
Regards,
Pavel Roskin

\version 2.14.2

#(define (extent-combine extents)
   (if (pair? (cdr extents))
   (interval-union (car extents) (extent-combine (cdr extents)))
   (car extents)))

#(define (stemSpanExtent grob)
   (let* ((yref (ly:grob-parent grob Y))
  (stems (ly:grob-object grob 'spanned-stems))
  (extents (map (lambda (x) (ly:grob-extent x yref Y)) stems))
  (maxextent (extent-combine extents)))
 maxextent))

#(define (stemSpanStencil grob)
   (let* ((stem (car (ly:grob-object grob 'spanned-stems)))
  (xextent (ly:grob-extent stem stem X))
  (yextent (stemSpanExtent grob)))
 (make-filled-box-stencil xextent yextent)))

#(define (reparentStems ctx stems trans)
   (if (and (pair? stems)
(pair? (cdr stems)))
   (let* ((stem (car stems))
  (new-stem (ly:engraver-make-grob trans 'Stem '(
 (ly:grob-set-parent! new-stem X stem)
 (set! (ly:grob-object new-stem 'spanned-stems) stems)
 (set! (ly:grob-property new-stem 'X-offset) 0)
 (set! (ly:grob-property new-stem 'stencil) stemSpanStencil

#(define (Cross_staff_stem_engraver ctx)
  (let ((stems '()))

`((acknowledgers
   (stem-interface
. ,(lambda (trans grob source)
 (set! stems (cons grob stems)

  (process-acknowledged
   . ,(lambda (trans)
 (reparentStems ctx stems trans) (set! stems '()))

\layout {
  \context {
\PianoStaff
\consists #Cross_staff_stem_engraver
  }
}

\new PianoStaff 
  \new Staff { \stemUp g'4 a' b' g' \stemDown c' }
  \new Staff { \stemUp f'4 e' f' d' \stemDown c''' }

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Checking whether Savannah is down

2012-02-28 Thread Werner LEMBERG

Folks,


to check the Savannah status, look here:

  http://identi.ca/group/fsfstatus


  Werner

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Savannah credential problems?

2012-02-28 Thread David Kastrup
Phil Holmes m...@philholmes.net writes:

 Seemed to me that savannah was down full stop. Now up again, but not
 tried a push.

By now straight git fetch works again for my developer repository, so
it would appear that the authentication thing has been fixed.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Checking whether Savannah is down

2012-02-28 Thread David Kastrup
Werner LEMBERG w...@gnu.org writes:

 Folks,


 to check the Savannah status, look here:

   http://identi.ca/group/fsfstatus

It did not report problems with authentication.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Allow music with layout instructions in output definitions. (issue 5701049)

2012-02-28 Thread Janek Warchoł
On Tue, Feb 28, 2012 at 9:27 AM, David Kastrup d...@gnu.org wrote:
 Janek Warchoł janek.lilyp...@gmail.com writes:
 I even hoped that something like this will be possible:
 \score { 
     \new Voice { b b }
     \new Voice = aa { b b }
   
   \layout { \override aa.NoteHead #'color = #red }
 }

 It is nonsense since aa is not the type but the id of a context and
 can't be meddled with in a layout definition.

 ok...
 Out of curiosity, would this be possible to add in a reasonable way or
 is it totally wrong?

 Totally wrong.

Pity.  It would be very useful.

 From a users' perspective, it would be great to have such overrides in
 \layout, because then i'd have 3 separate and independent areas of my
 file: - music in variables or \include files - style decisions in
 \layout block.  - score structure that doesn't contain any of the
 above and can be freely changed.

 You can use context modifications for that.

Hmm?  If i try

\score { 
\new Voice { b b }
\new Voice = aa { b b }
  
  \layout {
\context {
   \Voice = aa
   \override NoteHead #'color = #red
 }
   }
}

i get a syntax error.
Maybe i misunderstood you.

 \score {
     \new Voice \with { \settingsFrom \override NoteHead #'color = #red } { b 
 b }
   }

 produces

 ../bah.ly:2:37: error: syntax error, unexpected \override
     \new Voice \with { \settingsFrom
                                      \override NoteHead #'color = #red } { b 
 b }

 Ah yes.  Because \settingsFrom has an optional argument, and so the
 music argument must be some delimited form if the optional argument is
 left out.  At one point of time, this aggravation will go, but I will
 need to boil down the grammar a bit more before I can manage that.

ok

 Well, I _did_ write Totally elusive bug that also afflicted
 \settingsFrom.  Fixed.

 So it is to be expected that you need to update to the very latest git
 commit first.

Aah, fixed in git.  I thought it was fixed in the new patchset.

 Contextmodifications can be placed in variables, so you can write

 aasettings = \with { ... }

 and later use

 \new Voice = aa \aasettings { ... }

 or

 \new Voice = aa \with \aasettings { ... }

sure, i can do this.  Nevertheless, writing these in \layout {} would
be more elegant and in my opinion easier to maintain: \layout must be
placed at the end of \score block, while variables containing context
modifications must be defined before they are used, i.e. before \score
block.  Thus, style decisions are spread over two places.

still, your work is great!
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel