lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incremental compiling


From: Urs Liska
Subject: Re: Incremental compiling
Date: Thu, 09 Aug 2012 10:05:26 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

 Another idea (based on sth so wrote earlier):

What I'm doing all of the time (when working on longer pieces) is messing around with \set Score.skipTypesetting
I set it
- to ##t at the beginning of the piece
- to  ##f a few measures before the point where I'm working on and
- to ##t again a few measures after the point (for this I usually just place a skip after the 'insert' point)

An editor could try to figure out the point where on just inserts music, do something similar to compile just a short section of the piece (maybe together with a -dpreview option) and show this snippet in a preview window.

Of course I'm aware of the fact that this isn't as trivial as it may sound:
If the editor shouldn't be required to parse the whole piece it has to rely on some user provided information in the source file (e.g. barNumberChecks, bar checks or special comments). It may be complex to determine the correct point if we are using variables and changing time signatures etc.
Maybe one could start with something as simple as:
- find the cursor
- go up in the source until you find m bar checks
- insert \set Score.skipTypesetting = ##f there
(this should be transparent to the user: either use some form of stream to pass to lilypond or write a temporary file)
- go back to the cursor and look downwards in the score
- if you find n bar checks then insert \set Score.skipTypesetting = ##t there (if you don't find them we assume we're already at the end of the music input)


Mmaybe it's something to think about.

Best
Urs

Am 09.08.2012 09:26, schrieb Vaughan McAlley:
Following one of the tangents from the “Sibelius Software UK office
shuts down thread”, here’s a potential algorithm for incremental
compiling. It’s only a suggestion: sorry if it’s flawed or you don’t
like it!

• when Lilypond is compiled, a temp file is created, containing the
source file, and page-layout structure of the music. For example:
Page 1 has two systems
   System 1 contains measures 1-4
   System 2 contains measures 5-7
etc...

Maybe also a database of which measure (if any) the beginning of each
line of source is part of.

• if Lilypond is invoked with the --incremental option, Lilypond
compares its cached copy of the source file with the source file
presented, and finds the first point of difference. Then it knows
which measure it wants to be on the first page it’s actually
publishing

• then, beginning at the appropriate page, it lays out one or two
pages worth of music, using simple Finale-like rules of page layout
(if a measure is too wide, it goes to the next page)

• if in doubt, do a full compile

With large scores, compile time would be reduced to slightly more than
a one- or two-page score. Watching a compile, the “interpreting music”
stage is very quick compared to “preprocessing graphic elements” and
layout optimization, and the extra work would incur little overhead
(and could be done after the PDF file is produced).

Vaughan

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

[Prev in Thread] Current Thread [Next in Thread]