Re: Yet another 2 patches for music streams
Hi, I've made the suggested modifications to the first patch. In order to proceed, I had to do some additional modifications: - Music_iterator::try_music now autodescends to a bottom context, and the method has been renamed to report_music. - Event_iterator has been introduced. Music events are iterated by event_iterator by default (was Simple_music_iterator before). I don't think Event_chord_iterator adds anything over Simultaneous_music_iterator (apart from speed, possibly), so it can probably be junked. - I have junked: - old-lyric-combine - output-property-iterator - try_music_in_children everywhere I'll probably be away from CVS access from Thursday to Monday or so, so it would be convenient for me to commit these changes tomorrow (more-or-less all remaining work depends on this megapatch). A new todo element popped up also: It should be fairly easy to create a Scheme_sequential_iterator, where the get_music_list method is customised from Scheme. This can be used to softcode Chord_tremolo_iterator, Percent_iterator, Sequential_music_iterator and Time_scaled_music_iterator. Known issue: \lyricsto is slightly broken (fails on morgenlied.ly), I haven't had the time to check it up but hope to fix it soon. > > - (tremolo-type ,integer? "") > > + (tremolo-type ,integer? "speed of tremolo, e.g. 16 for c4:16") > > hmm. That sucks, we should store the negative log (-4 for 16) rather > than 16. I also haven't made this change yet -- Erik ? lily/On ? lily/busy-playing-listener.cc ? lily/event-iterator.cc ? lily/foo.pdf ? lily/foo.ps ? lily/lilypond ? lily/lilypond.gdt ? lily/lilypond.gpr ? lily/out ? lily/out-scons ? lily/out-www ? lily/include/.sconsign ? lily/include/busy-playing-listener.hh ? lily/include/event-iterator.hh ? lily/include/out ? lily/include/out-www ? ly/out ? ly/out-www ? scm/out ? scm/out-www Index: lily/chord-tremolo-engraver.cc === RCS file: /sources/lilypond/lilypond/lily/chord-tremolo-engraver.cc,v retrieving revision 1.99 diff -u -r1.99 chord-tremolo-engraver.cc --- lily/chord-tremolo-engraver.cc 7 May 2006 19:51:11 - 1.99 +++ lily/chord-tremolo-engraver.cc 23 May 2006 06:36:58 - @@ -4,12 +4,12 @@ source file of the GNU LilyPond music typesetter (c) 2000--2006 Han-Wen Nienhuys <[EMAIL PROTECTED]> + Erik Sandberg <[EMAIL PROTECTED]> */ #include "math.h" // ceil #include "beam.hh" -#include "chord-tremolo-iterator.hh" #include "engraver-group.hh" #include "international.hh" #include "item.hh" @@ -39,92 +39,72 @@ */ class Chord_tremolo_engraver : public Engraver { - void typeset_beam (); TRANSLATOR_DECLARATIONS (Chord_tremolo_engraver); protected: Music *repeat_; - /// moment (global time) where beam started. - Moment start_mom_; - Moment stop_mom_; int flags_; - int total_duration_flags_; + // number of beams for short tremolos + int expected_beam_count_; + // current direction of beam (first RIGHT, then LEFT) + Direction beam_dir_; - /// location within measure where beam started. - Moment beam_start_location_; - - bool body_is_sequential_; Spanner *beam_; - Spanner *finished_beam_; - Item *stem_tremolo_; protected: virtual void finalize (); virtual bool try_music (Music *); - void stop_translation_timestep (); - void start_translation_timestep (); void process_music (); DECLARE_ACKNOWLEDGER (stem); }; Chord_tremolo_engraver::Chord_tremolo_engraver () { - beam_ = finished_beam_ = 0; + beam_ = 0; repeat_ = 0; flags_ = 0; - stem_tremolo_ = 0; - body_is_sequential_ = false; + expected_beam_count_ = 0; + beam_dir_ = CENTER; } bool Chord_tremolo_engraver::try_music (Music *m) { - if (m->is_mus_type ("repeated-music") - && m->get_property ("iterator-ctor") == Chord_tremolo_iterator::constructor_proc - && !repeat_) + if (m->is_mus_type ("tremolo-span-event")) { - Moment l = m->get_length (); - repeat_ = m; - start_mom_ = now_mom (); - stop_mom_ = start_mom_ + l; - - Music *body = Repeated_music::body (m); - body_is_sequential_ = body->is_mus_type ("sequential-music"); - - int elt_count = body_is_sequential_ ? scm_ilength (body->get_property ("elements")) : 1; - - if (body_is_sequential_ && elt_count != 2) - m->origin ()->warning (_f ("expect 2 elements for chord tremolo, found %d", elt_count)); - - if (elt_count <= 0) - elt_count = 1; - - Rational total_dur = l.main_part_; - Rational note_dur = total_dur / Rational (elt_count * Repeated_music::repeat_count (repeat_)); - - total_duration_flags_ = max (0, (intlog2 (total_dur.den ()) - 2)); - - flags_ = intlog2 (note_dur.den ()) -2; - + Direction span_dir = to_dir (m->get_property ("span-direction")); + if (span_dir == START) + { + repeat_ = m; + int type = scm_to_int (m->get_property ("tremolo-type")); + /* e.g. 1 for type 8, 2 for type 16 */ + flags_ = in
repeated texi2dvi runs
Is anybody here familiar with texinfo and texi2dvi? I'm flailing around relatively blindly... I can currently produce a pdf of the lilypond docs by running "make web" two or three times, deleting lilypond.dvi (and .pdf) in between. Sometimes it produces a lilypond.dvi without any table of contents or index entries; the second or third time everything works beautifully. In both cases, there are a whole bunch of error messages in the log file. I'm not certain if they're serious or not, but since the build process eventually produces a correct pdf, I'm doubly confused by them. Major changes (that I think are relevant) from last week: @cindex @code{\command} globally replaced with @funindex Added to macros.itexi: @macro funindex {WORD} @findex \WORD\ @kindex \WORD\ @end macro Added to stepmake/stepmake/texinfo-rules.make: texi2dvi -E ... (as a method of making a small text file work, proposed by Karl Berry) All these changes are in current CVS in the hopes that somebody else could look at them. If nobody can figure it out, I'll revert the whole mess. - Graham ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: pdf documentation broken
On 21-May-06, at 5:45 PM, Han-Wen Nienhuys wrote: Graham Percival schreef: I broken the creation of the pdf docs; I suspect it was the @cindex @code{} => @funindex macro (producing @findex and @kindex) change. I didn't notice it at the time (a few days ago) because it didn't complain for some reason. (enough pre- I have no clue. Can you refactor this into a bugreport for the texinfo mailing list? I'm in discussion with Karl; the cause of the problem wasn't immediately obvious to him, but he suggested using -E (expand macros). This avoids the original problem, but causes a few other problems. I'm tracking them down; if I can't fix it tonight, I'll revert CVS. Cheers, - Graham ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: [patch] lilypond -o other-dir/new-name
Han-Wen Nienhuys <[EMAIL PROTECTED]> writes: > Nicolas Sceaux schreef: >> Hi, >> Using LilyPond from CVS, when invoking lilypond with the -o option, >> specifying an output directory *and* a alternate basename, the alternate >> basename is disregarded. >> $ lilypond -o out/lwv05-letter lwv05.ly >> ==> produces files out/lwv05.* iso. out/lwv05-letter.* >> The following patch may fix this problem. > > Just a question: what do you think is the correct behavior for > >lilypond -o dir/base foo.ly bar.ly oh ok I see. I didn't thought about a single invocation on several files. In that case the base name should be disregarded. It does not make sense to specify one base name for several output files. dooh. ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Cautionary accidentals in Ambitus
Here's an ugly workaround: \score{ \relative c { \clef bass \once \override Staff.Clef #'stencil = ##f \once \override Staff.TimeSignature #'stencil = ##f \partial 4 s4 \bar "" \set Staff.forceClef = ##t \once \override Staff.Clef #'full-size-change = ##t \time 4/4 \clef bass \key des \major des aes des aes | } \layout{ \context { \Voice \consists Ambitus_engraver } } } /Mats Cameron Horsburgh wrote: Hi folks, I've recently written a timpani part for a score I'm writing, and I thought I'd add an ambitus to the beginning of the part to show the necessary tuning (I know, it's not standard!) The two notes I want the timps tuned to are aes and des, and the key is des major. However, because the key signature (which comes _after_ the ambitus) includes aes and des there are no flats on the ambitus. How do I add cautionary accidentals? I notice in the programme reference that Ambitus_engraver has a setting for cautionary accidentals, but it doesn't tell me how to turn them on or off. Here's a simple version of my code: \version "2.9.4" \score{ \relative c { \clef bass \key des \major des aes des aes | } \layout{ \context { \Voice \consists Ambitus_engraver } } } -- = Mats Bengtsson Signal Processing Signals, Sensors and Systems Royal Institute of Technology SE-100 44 STOCKHOLM Sweden Phone: (+46) 8 790 8463 Fax: (+46) 8 790 7260 Email: [EMAIL PROTECTED] WWW: http://www.s3.kth.se/~mabe = ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
Hi, On Mon, 22 May 2006, Erik Sandberg wrote: > On Monday 22 May 2006 17:43, Johannes Schindelin wrote: > > > You might want to experiment with some of the newer VC systems. Someone > > > on the list mirrors lilypond CVS with GIT. > > > > I do. > > > > If you are interested, I can make it public. > > > > At the moment, I track the CVS every morning (Greenwich time). > > That sounds great, if it's not too much work for you. Can one perform cvs > commits and GIT updates from the same source dir? The basic commands are very similar to CVS. IMHO the biggest three differences are: - no server needed ("git commit" commits to the .git directory) - no "cvs update", as there can be many servers, but "git fetch " - you can switch branches easily by "git checkout " So, typically I just update with git fetch origin which updates my origin branch to what was in CVS this morning. Then, I just create a throw-away branch to hack on lilypond: git checkout -b wonderfulNewWork origin This sets up a branch "wonderfulNewWork" starting at the HEAD of "origin". Now I hack on lilypond as much as I want. At the same mile-stones as with CVS, I commit with git commit -a -m "a short comment to remember what I did" The "-a" means "all changes". If I were to commit only the changes to a couple of files, it would do git commit -m "some other comment" GNUmakefile flower/random.cxx After a couple of days of work, I do the equivalent to "cvs update": git pull origin Note the "pull", not "fetch". It means to pull the "origin" branch, and merge it into the current branch. Then I get the patch with git diff origin > my.patch Actually, you can do more quite cool things with git. For example, you can look at the history with "git log". And if you want to see the patches right away, do "git log -p" to see the patch after each commit. To do that with the branch "origin" instead of the current one, do "git log -p origin". You can use the "pickaxe" to search when a function or variable or whatever was added: "git log -Sthefunction" will show you only the commits where the patch contains "thefunction". If you know which file contains it, you can make that even faster with "git log -Sthefunction that/file.c". Of course, there is at least one down-side, too. Since there is no central server, you actually have all the history in the .git folder. In packed format this means about 55 megabyte for lilypond. Ah, and the most important thing: you can clone the initial repository by git clone http://wbgn013.biozentrum.uni-wuerzburg.de/lilypond.git This downloads the 55meg and sets up a local clone in the folder "lilypond". Please be nice to the server... Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: release announcements?
Thomas Bushnell BSG schreef: Why do I never see release announcements on lilypond-devel? because they're posted on info-lilypond@gnu.org -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
lilypond 2.8, make fails, NCSB_SOURCE_FILES
$ ./configure; make ... make[1]: Entering directory `/home/karl/most/music/lilypond/2.8/mf' make[1]: *** No rule to make target [EMAIL PROTECTED]@', needed by `out/CenturySchL-Ital.otf'. Stop. make[1]: Leaving directory `/home/karl/most/music/lilypond/2.8/mf' make: *** [all] Error 2 $ Does not resolve symlinks when looking for gs fonts. Patch 'cvs diff -u -r lilypond_2_8 configure.in' attached. Regards /Karl Index: configure.in === RCS file: /sources/lilypond/lilypond/configure.in,v retrieving revision 1.184.2.2 diff -u -r1.184.2.2 configure.in --- configure.in9 May 2006 08:21:57 - 1.184.2.2 +++ configure.in22 May 2006 16:15:11 - @@ -75,6 +75,7 @@ NCSB_FILE=`$FCMATCH --verbose 'Century Schoolbook L:style=$style' | grep 'file:'` NCSB_FILE=`echo $NCSB_FILE | sed 's/^.*"\(.*\)".*$/\1/g'` + NCSB_FILE=`readlink -f $NCSB_FILE` NCSB_SOURCE_FILES="$NCSB_FILE $NCSB_SOURCE_FILES" done else ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
On Monday 22 May 2006 17:43, Johannes Schindelin wrote: > > You might want to experiment with some of the newer VC systems. Someone > > on the list mirrors lilypond CVS with GIT. > > I do. > > If you are interested, I can make it public. > > At the moment, I track the CVS every morning (Greenwich time). That sounds great, if it's not too much work for you. Can one perform cvs commits and GIT updates from the same source dir? (I had a quick look on the field of revision control systems; currently svn, darcs and git look like the best choices. I haven't decided which system to use yet.) -- Erik ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
release announcements?
Why do I never see release announcements on lilypond-devel? ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilypond 2.8 make fails
> Karl Hammar schreef: > > Patch in attachment. > > Building lilypond 2.8 (from todays cvs), make fails: > > > > > Index: mf/GNUmakefile > > === > > RCS file: /sources/lilypond/lilypond/mf/GNUmakefile,v > > retrieving revision 1.193.2.1 > > diff -u -r1.193.2.1 GNUmakefile > > --- mf/GNUmakefile 29 Mar 2006 16:19:38 - 1.193.2.1 > > +++ mf/GNUmakefile 22 May 2006 14:22:08 - > > @@ -138,7 +138,7 @@ > > ${MAKE} -C $(top-build-dir) link-mf-tree > > > > pfa_warning: > > -ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace) > > +ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//;1q'),mftrace) > > I don't have this in todays CVS of lilypond 2.8. ... Oops, wrong tag, sorry for the noise. Regards /Karl ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
Hi, On Mon, 22 May 2006, Han-Wen Nienhuys wrote: > Erik Sandberg schreef: > > > Also, in general, I think it should be possible to split patches up > > > further, eg. the tremolo stuff seems independent of the > > > partcombine/lyriccombine stuff. > > > > A problem is my limited internet access. I can cvs diff very seldom; I > > often work several days on lily between the diffs. This makes it > > difficult/troublesome to keep patches atomic. > > > > Currently I keep 3 copies of the lily tree, so I can maintain 2 > > independent diff branches + one unmodified version; this already leads > > to problems (the tremolo stuff was first supposed to go into branch 2, > > but was accidentally added to branch 1 instead). > > You might want to experiment with some of the newer VC systems. Someone > on the list mirrors lilypond CVS with GIT. I do. If you are interested, I can make it public. At the moment, I track the CVS every morning (Greenwich time). Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilypond 2.8 make fails
Karl Hammar schreef: Patch in attachment. Building lilypond 2.8 (from todays cvs), make fails: Index: mf/GNUmakefile === RCS file: /sources/lilypond/lilypond/mf/GNUmakefile,v retrieving revision 1.193.2.1 diff -u -r1.193.2.1 GNUmakefile --- mf/GNUmakefile 29 Mar 2006 16:19:38 - 1.193.2.1 +++ mf/GNUmakefile 22 May 2006 14:22:08 - @@ -138,7 +138,7 @@ ${MAKE} -C $(top-build-dir) link-mf-tree pfa_warning: -ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace) +ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//;1q'),mftrace) I don't have this in todays CVS of lilypond 2.8. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
lilypond 2.8 make fails
Patch in attachment. Building lilypond 2.8 (from todays cvs), make fails: $ ./configure checking build system type... i686-pc-linux-gnu checking Package... LILYPOND ... checking for mftrace... mftrace checking mftrace version... 1.2.4 ... $ make cd /home/karl/most/music/lilypond/2.8/out && rm -rf bin lib share mkdir -p ./out/bin ... make[1]: Entering directory `/home/karl/most/music/lilypond/2.8/mf' ERROR: mftrace not found For obtaining PFA/SVG fonts, either install mftrace (see http://www.xs4all.nl/~hanwen/mftrace/ ), or try one of the following commands in this directory: make get-fonts make get-rpm-fonts make get-deb-fonts These commands will try to download the files from internet. make[1]: Leaving directory `/home/karl/most/music/lilypond/2.8/mf' $ Error is in mf/GNUmakefile: $ grep -B1 -A3 '(MFTRACE)' mf/GNUmakefile pfa_warning: ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace) @echo "" @echo "ERROR: mftrace not found" @echo "" $ Running the shell line: $ mftrace --version | sed 's/ .*//' mftrace This License under information. Copyright $ It becomes "mftrace This License under information. Copyright " in make, which is not eq to "mftrace". It worked fine with older mftrace since they produced one line versions: $ /usr/bin/mftrace --version mftrace 1.1.17 $ Regards /Karl Index: mf/GNUmakefile === RCS file: /sources/lilypond/lilypond/mf/GNUmakefile,v retrieving revision 1.193.2.1 diff -u -r1.193.2.1 GNUmakefile --- mf/GNUmakefile 29 Mar 2006 16:19:38 - 1.193.2.1 +++ mf/GNUmakefile 22 May 2006 14:22:08 - @@ -138,7 +138,7 @@ ${MAKE} -C $(top-build-dir) link-mf-tree pfa_warning: -ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace) +ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//;1q'),mftrace) @echo "" @echo "ERROR: mftrace not found" @echo "" ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
Erik Sandberg schreef: > I think the proper way is to make it a music macro; is it OK to keep > it a music function until music macros exist? (also, the music > function code attempts to signal errors when \once is used in the > wrong place, so from a user's point of view, little changes) Why do you want to make it a macro? It removes a rule from the parser, and it makes it possible to reuse \once for future commands where it's relevant. Because \once is tied to property settings, \set #'foo=#bar translates into somethign like (property-operation 'set '() 'foo 'bar) and \once \set #'foo=#bar would naturally translates into something like (property-operation 'set '() 'foo 'bar #t) i.e., it's natural to view \once as operating on the syntax. (I realise now that I can achieve the same inside parser by shuffling around rules a bit, but I don't see any advantage) I don't see how you can apply to anything else besides property settings, and that's exactly why I want to keep it with property settings. Making it a macro, which is processed at a later stage sounds like a fragile solution to me. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
On 5/22/06, Han-Wen Nienhuys <[EMAIL PROTECTED]> wrote: Erik Sandberg schreef: > I think the proper way is to make it a music macro; is it OK to keep > it a music function until music macros exist? (also, the music > function code attempts to signal errors when \once is used in the > wrong place, so from a user's point of view, little changes) Why do you want to make it a macro? It removes a rule from the parser, and it makes it possible to reuse \once for future commands where it's relevant. Because \once is tied to property settings, \set #'foo=#bar translates into somethign like (property-operation 'set '() 'foo 'bar) and \once \set #'foo=#bar would naturally translates into something like (property-operation 'set '() 'foo 'bar #t) i.e., it's natural to view \once as operating on the syntax. (I realise now that I can achieve the same inside parser by shuffling around rules a bit, but I don't see any advantage) Erik ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: How to set text-direction
On Mon, May 22, 2006 at 02:16:40PM +0200, Han-Wen Nienhuys wrote: > Cameron Horsburgh schreef: > >%%% > >version "2.9.4" > > > > > > >gives me an error: > > > > > > 2.9.5 > > Still no difference. -- = Cameron Horsburgh /dev/random says: Dinner not ready: (A)bort (R)etry (P)izza http://web.netcall.com.au/horsburgh _ _ _ _ _ / ___| _ __ ___ (_) | ___| | | | \___ \| '_ ` _ \| | |/ _ \ | | | ___) | | | | | | | | __/_|_|_| |/|_| |_| |_|_|_|\___(_|_|_) = ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: How to set text-direction
Cameron Horsburgh schreef: %%% version "2.9.4" gives me an error: 2.9.5 -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: How to set text-direction
On Mon, May 22, 2006 at 02:02:11PM +0200, Han-Wen Nienhuys wrote: > Try this: > > \markup { > \override #(cons 'text-direction LEFT) \wordwrap { hello this will be > reversed } } > This code: %%% version "2.9.4" \relative{ a^\markup {\override #(cons 'text-direction LEFT) \wordwrap { hello this will be reversed } } } %%% gives me an error: Parsing... Interpreting music... [1] Preprocessing graphical objects... Calculating line breaks... [2] Drawing systems... ERROR: In procedure <: ERROR: Wrong type: #f -- = Cameron Horsburgh /dev/random says: Dinner not ready: (A)bort (R)etry (P)izza http://web.netcall.com.au/horsburgh _ _ _ _ _ / ___| _ __ ___ (_) | ___| | | | \___ \| '_ ` _ \| | |/ _ \ | | | ___) | | | | | | | | __/_|_|_| |/|_| |_| |_|_|_|\___(_|_|_) = ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
Erik Sandberg schreef: Also, in general, I think it should be possible to split patches up further, eg. the tremolo stuff seems independent of the partcombine/lyriccombine stuff. A problem is my limited internet access. I can cvs diff very seldom; I often work several days on lily between the diffs. This makes it difficult/troublesome to keep patches atomic. Currently I keep 3 copies of the lily tree, so I can maintain 2 independent diff branches + one unmodified version; this already leads to problems (the tremolo stuff was first supposed to go into branch 2, but was accidentally added to branch 1 instead). You might want to experiment with some of the newer VC systems. Someone on the list mirrors lilypond CVS with GIT. >+ dir_ = RIGHT; >+ } >+ if (dir == STOP) >+ { They don't represent the same thing. RIGHT means that the right beam-count is modified, STOP means that an event stops a spanner. I know they don't, that's why I suggest to use different names. > + SCM tremolo_symbol = ly_symbol2scm ("TremoloSpanEvent"); >+ SCM start_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (START)); >+ unsmob_music (start_event_scm)->set_spot (*origin); >+ SCM stop_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (STOP)); >+ >+ Music *start_event = unsmob_music (start_event_scm); >+ Music *stop_event = unsmob_music (stop_event_scm); I think you're leaking memory here, some unprotects are necessary. The Music objects are created by SCM code, I thought stuff returned from Scheme was unprotected in general? Yes, you're right. sorry. I don't understand. What is this for? I don't remember right now (I added those lines last summer). It might be related to problems with grace notes, or somethign like that. Should I remove hte lines if I can't find a more clear justification? Yes. > - (tremolo-type ,integer? "") > + (tremolo-type ,integer? "speed of tremolo, e.g. 16 for c4:16") hmm. That sucks, we should store the negative log (-4 for 16) rather than 16. why negative? negative log of the duration, log2(1/16) = -4 > +#define LOWLEVEL_MAKE_SYNTAX(proc, args) \ > + scm_apply_0 (proc, args) > +/* Syntactic Sugar. */ > #define MAKE_SYNTAX(name, location, ...) \ > - scm_apply_0 (ly_lily_module_constant (name), scm_list_n (make_input (location), __VA_ARGS__, SCM_UNDEFINED)); > + LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant (name), scm_list_n (make_input (location), __VA_ARGS__, SCM_UNDEFINED)); > I don't see the point of LOWLEVEL_MAKE_SYNTAX It was used for music functions first, then I found a different way to implement music functions. The macro can be used to use arbitrary function objects iso. symbols to represent functions. I think the proper way is to make it a music macro; is it OK to keep it a music function until music macros exist? (also, the music function code attempts to signal errors when \once is used in the wrong place, so from a user's point of view, little changes) Why do you want to make it a macro? > (define-ly-syntax-loc (repeat type num body alts) >(make-repeat type num body alts)) > + > +(define-ly-syntax-loc (context-specification type id mus ops create-new?) I believe that according to Scheme coding standards, the ? is only used on procedures, so this should just be create-new. ok. I recall seeing a ? in an existing non-procedure symbol in lily; I'll remove it the next time I see it. please do. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: How to set text-direction
Cameron Horsburgh schreef: On Mon, May 22, 2006 at 12:10:23PM +0200, Han-Wen Nienhuys wrote: Cameron Horsburgh schreef: Hi folks, I'm trying to write the documentation for the newish feature whereby the direction of text scripts can be changed. From the 2.8 NEWS: The order of words in \markup commands may now be reversed by setting the text-direction property. This is useful for Right-to-Left languages like Hebrew. Unfortunately I can't figure out how to do it. Any clues? see the regtest file for text-direction Nope--can't see it there. The onlything I can see in the regtest is markup-bidi-pango.ly, which seems to cheat a little bit! I've grepped through CVS and the only likely things I can find are in define-grob-properties.scm and define-markup-commands.scm. Unfortunately I'm not able to glean from those how it should be done. Try this: \markup { \override #(cons 'text-direction LEFT) \wordwrap { hello this will be reversed } } -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
On 5/22/06, Han-Wen Nienhuys <[EMAIL PROTECTED]> wrote: Also, in general, I think it should be possible to split patches up further, eg. the tremolo stuff seems independent of the partcombine/lyriccombine stuff. A problem is my limited internet access. I can cvs diff very seldom; I often work several days on lily between the diffs. This makes it difficult/troublesome to keep patches atomic. Currently I keep 3 copies of the lily tree, so I can maintain 2 independent diff branches + one unmodified version; this already leads to problems (the tremolo stuff was first supposed to go into branch 2, but was accidentally added to branch 1 instead). >+ dir_ = RIGHT; >+ } >+ if (dir == STOP) >+ { They don't represent the same thing. RIGHT means that the right beam-count is modified, STOP means that an event stops a spanner. > > + SCM tremolo_symbol = ly_symbol2scm ("TremoloSpanEvent"); >+ SCM start_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (START)); >+ unsmob_music (start_event_scm)->set_spot (*origin); >+ SCM stop_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (STOP)); >+ >+ Music *start_event = unsmob_music (start_event_scm); >+ Music *stop_event = unsmob_music (stop_event_scm); I think you're leaking memory here, some unprotects are necessary. The Music objects are created by SCM code, I thought stuff returned from Scheme was unprotected in general? >+ SCM start_chord = scm_call_1 (ly_lily_module_constant ("chordify-event"), start_event_scm); >+ SCM stop_chord = scm_call_1 (ly_lily_module_constant >("chordify-event"), stop_event_scm); >+ >+ child_list_ = scm_list_3 (start_chord, body->self_scm (), >stop_chord);+ I think it should be possible to do without the chord_event, and simply insert the events themselves. Possibly you will need to make an Event_iterator, which is similar to Event_chord_iterator. ok, I'll look into that. >+ child_list_ = scm_list_3 (start_chord, body->self_scm (), stop_chord);+ } >+ >+ Sequential_iterator::construct_children (); >+void >+Chord_tremolo_iterator::derived_mark () const > { >- return child_iter_->try_music (m); >+ scm_gc_mark (child_list_); It's better style to construct the child_list in get_music_list, and not store it all, as it's already stored in the base class in the cursor_ variable. Then you also don't need a derived_mark() member. I notice that you've done this with the other iterators too. Can you change this, also in time-scaled-music-iterator and percent-repeat-iterator? ok > + // Wait for a Create_context event, to catch implicitly created voices before it's too late. > + t->events_below ()->add_listener (GET_LISTENER (check_new_context), ly_symbol2scm ("CreateContext")); > + listening_ = true; > +} why does this happen in find_voice() ? Isn't it more natural to set the listener in construct_children? good idea (which btw seems to make a dirty workaround clean). > + // UGH. Only swallow the output property event in the context > + // it was intended for. This is inelegant but not inefficient. > + if (context ()->context_name_symbol () == m->get_property ("context-type")) > +{ > + props_.push_back (m); > + return true; > +} this doesn't work with \alias. Can you use context::is_alias() ? ok > + get_outlet ()->context_name_symbol ()); You're modifying the input; that's not allowed. Can you write a convert-ly rule to change \context Foo \applyOutput XXX -> \applyOutput #'Foo and change the \applyOutput to set context-type. ok > +/* > +* Processes a moment in an iterator, and returns whether any new music was reported. > +*/ > +bool > +Part_combine_iterator::try_process (Music_iterator *i, Moment m) > +{ > + Dispatcher *disp = i->get_outlet ()->event_source (); > + > + disp->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("MusicEvent")); > + busy_ = false; > + > + i->process (m); > + > + disp->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("MusicEvent")); > + return busy_; > +} I don't understand this. Why are you adding and removing listeners all the time? Why don't you signal the state of the Part_combine_iterator to set_busy through another boolean member? ie. Good idea, thanks (I just tried to emulate the previous behaviour as closely as possible) I don't understand. What is this for? I don't remember right now (I added those lines last summer). It might be related to problems with grace notes, or somethign like that. Should I remove hte lines if I can't find a more clear justification? > - (tremolo-type ,integer? "") > + (tremolo-type ,integer? "speed of tremolo, e.g. 16 for c4:16") hmm. That sucks, we should store the negative log (-4 for 16) rather
Re: Doc addition: Rehearsal Mark Alignment
On Mon, May 22, 2006 at 08:22:48PM +1000, Cameron Horsburgh wrote: Okay, here's an updated version of my suggested entry. ** The horizontal location of rehearsal marks can be adjusted by setting break-align-symbol: \relative { c1 \key cis \major \clef alto \override Score.RehearsalMark #'break-align-symbol = #'key-signature \mark "on-key" cis \key ces \major \override Score.RehearsalMark #'break-align-symbol = #'clef \clef treble \mark "on clef" ces } [Place music graphic here] Other values that can be taken by break-align-symbol include: ambitus, breathing-sign, clef, custos, staff-bar, left-edge, key-cancellation, key-signature, and time-signature. Of course, setting break-align-symbol will only have an effect if the symbol appears at that point in the music. ** -- = Cameron Horsburgh /dev/random says: Dinner not ready: (A)bort (R)etry (P)izza http://web.netcall.com.au/horsburgh _ _ _ _ _ / ___| _ __ ___ (_) | ___| | | | \___ \| '_ ` _ \| | |/ _ \ | | | ___) | | | | | | | | __/_|_|_| |/|_| |_| |_|_|_|\___(_|_|_) = ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: How to set text-direction
On Mon, May 22, 2006 at 12:10:23PM +0200, Han-Wen Nienhuys wrote: > Cameron Horsburgh schreef: > >Hi folks, > > > >I'm trying to write the documentation for the newish feature whereby the > >direction of text scripts can be changed. From the 2.8 NEWS: > > > >The order of words in \markup commands may now be reversed by setting the > >text-direction property. This is useful for Right-to-Left languages like > >Hebrew. > > > >Unfortunately I can't figure out how to do it. Any clues? > > see the regtest file for text-direction > > Nope--can't see it there. The onlything I can see in the regtest is markup-bidi-pango.ly, which seems to cheat a little bit! I've grepped through CVS and the only likely things I can find are in define-grob-properties.scm and define-markup-commands.scm. Unfortunately I'm not able to glean from those how it should be done. -- = Cameron Horsburgh /dev/random says: Dinner not ready: (A)bort (R)etry (P)izza http://web.netcall.com.au/horsburgh _ _ _ _ _ / ___| _ __ ___ (_) | ___| | | | \___ \| '_ ` _ \| | |/ _ \ | | | ___) | | | | | | | | __/_|_|_| |/|_| |_| |_|_|_|\___(_|_|_) = ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Getting the height of a system.
On Mon, 2006-05-22 at 10:57 +0200, Han-Wen Nienhuys wrote: > Joe Neeman schreef: > >> In that case, you could get the approximate height of one broken system > >> in logarithmic time. > >> > > Here's a first attempt at doing this. It isn't complete or well-tested > > yet. I add 4 grob properties > > > > Y-extent-safe > > Y-offset-safe > > default-Y-extent-is-safe > > default-Y-offset-is-safe > > > > where Y-extent-safe and Y-offset-safe are functions that take 3 > > arguments, a grob, and the starting and ending column ranks. > > default-Y-blah-is-safe just marks grobs where we don't need a > > Y-blah-safe because the default Y-blah doesn't introduce side effects. > > This is pretty much just there for NoteHead. > > Can't we just get away with assuming that functions that don't have > y-extent-safe have point dimensions? I think so, but we would still need to have a guess for Y-offset to make use of this. > BTW, naming would be > like > >safe-foo-bar > > "safe" might even be renamed "pure" or "readonly" which better reflects > the idea of the functionality. OK. > > > I've implemented Y-extent-safe for axis-group-interface, > > hara-kiri-group-interface and NoteHead. I think it might be useful to do > > side-position-interface also since that will take care of markups, > > rehearsal marks and some other things that tend to be positioned away > > from the staff. But that looks a bit harder so I haven't done it yet. > > > > Is this similar to what you had in mind? > > Actually, no. > > What I had in mind was only to detect when hara kiri staves are alive or > not, and use that to make an estimate of system height (with a fixed > system height setting). Your approach here will get more accurate > results, but I'm a little worried that the XXX_safe functions and > properties will spread throughout the code, which is a problem as > they're duplicating functionality. Yes, but I think 99% of the duplicated functionality is already in my patch. Everything else I can think of, could be refactored like I've done to Align_interface::align_elements_to_extents. Most of the side-effect-causing stuff in the vertical spacing code comes from calling extent and relative_position. Since I already have pure versions of those, it should just be a matter of adding (bool pure, int start, int end) to the paramaters of a few more functions and using Grob::safe_height instead of Grob::extent when pure is true. > > Does this patch already work for determining system heights, or is just > the beginning of the work? How much more must done? It works, but it currently only measures the height of StaffSymbol and NoteHead. I'd like to expand it to also count things that are typically above and below the staff. side-position-interface and self-alignment-interface would probably be the only things left to do. Maybe an estimate for Stem too, but that shouldn't be very important. I want to be a little more accurate than using a fixed position for each staff because the height of a staff can vary from piece to piece. For example, I have a string quartet in which the 1st violin part has systems about 20% taller than the 2nd violin because it tends to have higher notes. The consequence in the page-breaking algorithm for underestimating all the staff heights is that it will put too many systems on a page and the systems will run off the bottom of the page. OK, so the fix is easy for the user (just put system-height = something-bigger) but I think the probability of obvious mistakes in the default output should be _very_ low or else (1) it's inconvenient for the user and (2) we'll get millions of duplicate bug reports and Mats will have to patiently answer them all :) > > BTW, the idea of precomputing when parts of a VerticalAlignment are > hara-kiri'd can still be used to speed up the end result, I think. Yes, I'll do that. ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Doc addition: Rehearsal Mark Alignment
Cameron Horsburgh schreef: I've had a look at the note in the 2.8 News file about the new rehearsalMarkAlignSymbol. > It seems to say everything that's needed, but I'm wondering if we need > a list of possible values. The example shows key-signature and clef---where can I find the others? Check out the values for break-align-symbol in define-grobs.scm I've also noticed that the explanation calls the value rehearsalMarkAlignSymbol > whilst the snippet calls it break-align-symbol. What needs to be changed? this was changed during the 2.7 cycle. The snippet is correct. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Doc addition: Rehearsal Mark Alignment
I've had a look at the note in the 2.8 News file about the new rehearsalMarkAlignSymbol. It seems to say everything that's needed, but I'm wondering if we need a list of possible values. The example shows key-signature and clef---where can I find the others? I've also noticed that the explanation calls the value rehearsalMarkAlignSymbol whilst the snippet calls it break-align-symbol. What needs to be changed? In the graphic in the News file the 'On Clef' example seems to be on the bar line as opposed to the clef. Is this due to the Rehearsal mark alignment problem that cropped up in late 2.7? FWIW here's a suggested entry for 2.8.3 "Rehearsal Marks" as ripped off from the News: ** The horizontal location of rehearsal marks can be adjusted by setting the rehearsalMarkAlignSymbol property: \relative { c1 \key cis \major \clef alto \override Score.RehearsalMark #'break-align-symbol = #'key-signature \mark "on-key" cis \key ces \major \override Score.RehearsalMark #'break-align-symbol = #'clef \clef treble \mark "on clef" ces } [Place music graphic here] Other values that can be taken by break-align-symbol include: [list of possible values] ** -- = Cameron Horsburgh /dev/random says: Dinner not ready: (A)bort (R)etry (P)izza http://web.netcall.com.au/horsburgh _ _ _ _ _ / ___| _ __ ___ (_) | ___| | | | \___ \| '_ ` _ \| | |/ _ \ | | | ___) | | | | | | | | __/_|_|_| |/|_| |_| |_|_|_|\___(_|_|_) = ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: How to set text-direction
Cameron Horsburgh schreef: Hi folks, I'm trying to write the documentation for the newish feature whereby the direction of text scripts can be changed. From the 2.8 NEWS: The order of words in \markup commands may now be reversed by setting the text-direction property. This is useful for Right-to-Left languages like Hebrew. Unfortunately I can't figure out how to do it. Any clues? see the regtest file for text-direction -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
How to set text-direction
Hi folks, I'm trying to write the documentation for the newish feature whereby the direction of text scripts can be changed. From the 2.8 NEWS: The order of words in \markup commands may now be reversed by setting the text-direction property. This is useful for Right-to-Left languages like Hebrew. Unfortunately I can't figure out how to do it. Any clues? -- = Cameron Horsburgh /dev/random says: Dinner not ready: (A)bort (R)etry (P)izza http://web.netcall.com.au/horsburgh _ _ _ _ _ / ___| _ __ ___ (_) | ___| | | | \___ \| '_ ` _ \| | |/ _ \ | | | ___) | | | | | | | | __/_|_|_| |/|_| |_| |_|_|_|\___(_|_|_) = ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: pdf documentation broken
Han-Wen Nienhuys schreef: I have no clue. Can you refactor this into a bugreport for the texinfo mailing list? oh, and can you revert the patch as far as necessary to build the documentation of CVS HEAD? -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Yet another 2 patches for music streams
Erik Sandberg schreef: Hi, I've finished 2 more patches for music streams. One of them is considerably larger than the other, but the two should be independent. Some comments. Also, in general, I think it should be possible to split patches up further, eg. the tremolo stuff seems independent of the partcombine/lyriccombine stuff. + dir_ = RIGHT; + } + if (dir == STOP) + { This looks a bit confusing. Maybe we can rename things to more clear? >+ // number of beams for short tremolos >+ int expected_beaming_; please use expected_beam_count_ . In general, if you need these 1-line comments to explain what a member does, you have to rename that member. > + SCM tremolo_symbol = ly_symbol2scm ("TremoloSpanEvent"); + SCM start_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (START)); + unsmob_music (start_event_scm)->set_spot (*origin); + SCM stop_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (STOP)); + + Music *start_event = unsmob_music (start_event_scm); + Music *stop_event = unsmob_music (stop_event_scm); I think you're leaking memory here, some unprotects are necessary. >+ SCM start_chord = scm_call_1 (ly_lily_module_constant ("chordify-event"), start_event_scm); >+ SCM stop_chord = scm_call_1 (ly_lily_module_constant >("chordify-event"), stop_event_scm); >+ >+ child_list_ = scm_list_3 (start_chord, body->self_scm (), >stop_chord);+ I think it should be possible to do without the chord_event, and simply insert the events themselves. Possibly you will need to make an Event_iterator, which is similar to Event_chord_iterator. + child_list_ = scm_list_3 (start_chord, body->self_scm (), stop_chord);+ } + + Sequential_iterator::construct_children (); +void +Chord_tremolo_iterator::derived_mark () const { - return child_iter_->try_music (m); + scm_gc_mark (child_list_); It's better style to construct the child_list in get_music_list, and not store it all, as it's already stored in the base class in the cursor_ variable. Then you also don't need a derived_mark() member. I notice that you've done this with the other iterators too. Can you change this, also in time-scaled-music-iterator and percent-repeat-iterator? Questions: - It seems that the OutputPropertySetMusic music type is unused. Should I remove it? yes. - I have not yet done anything about old-lyric-combine-music-iterator. Should I spend time on making it work, or can we junk oldaddlyrics for the next release? (there's no regression test for oldaddlyrics, btw) let's junk it. - What's the Right Way to pass warnings and errors from Scheme code? I want some warning messages to make use of Input objects. (ly:message INPUT-SMOB "format string ~a" argument .. ) + // Wait for a Create_context event, to catch implicitly created voices before it's too late. + t->events_below ()->add_listener (GET_LISTENER (check_new_context), ly_symbol2scm ("CreateContext")); + listening_ = true; +} why does this happen in find_voice() ? Isn't it more natural to set the listener in construct_children? +#if 0 bool b = get_outlet ()->try_music ((Music *)m); // ugh Music_iterator *it = b ? (Music_iterator *) this : 0;// ugh if (!it) can you strip the #if 0 sections from patches? + // UGH. Only swallow the output property event in the context + // it was intended for. This is inelegant but not inefficient. + if (context ()->context_name_symbol () == m->get_property ("context-type")) +{ + props_.push_back (m); + return true; +} this doesn't work with \alias. Can you use context::is_alias() ? s_name ())); + // Send the event to a bottom context. The context-type property + // will later be used to apply the event in this context Minor nit: can you use /* */ for multiline comments, with indents like /* bla bla blah bla bla bla */ + get_music ()->set_property ("context-type", + get_outlet ()->context_name_symbol ()); You're modifying the input; that's not allowed. Can you write a convert-ly rule to change \context Foo \applyOutput XXX -> \applyOutput #'Foo and change the \applyOutput to set context-type. +IMPLEMENT_LISTENER (Part_combine_iterator, set_busy); +void +Part_combine_iterator::set_busy (SCM se) +{ + Stream_event *e = unsmob_stream_event (se); + SCM mus = e->get_property ("music"); + Music *m = unsmob_music (mus); + assert (m); + + if (m->is_mus_type ("note-event") || m->is_mus_type ("cluster-note-event")) +busy_ = true; +} + +/* +* Processes a moment in an iterator, and returns whether any new music was reported. +*/ +bool +Part_combine_iterator::try_process (Music_iterator *i, Moment m) +{ + Dispatcher *disp = i->get_outlet ()
Re: Getting the height of a system.
Joe Neeman schreef: In that case, you could get the approximate height of one broken system in logarithmic time. Here's a first attempt at doing this. It isn't complete or well-tested yet. I add 4 grob properties > Y-extent-safe Y-offset-safe default-Y-extent-is-safe default-Y-offset-is-safe where Y-extent-safe and Y-offset-safe are functions that take 3 arguments, a grob, and the starting and ending column ranks. default-Y-blah-is-safe just marks grobs where we don't need a Y-blah-safe because the default Y-blah doesn't introduce side effects. This is pretty much just there for NoteHead. Can't we just get away with assuming that functions that don't have y-extent-safe have point dimensions? BTW, naming would be like safe-foo-bar "safe" might even be renamed "pure" or "readonly" which better reflects the idea of the functionality. I've implemented Y-extent-safe for axis-group-interface, hara-kiri-group-interface and NoteHead. I think it might be useful to do side-position-interface also since that will take care of markups, rehearsal marks and some other things that tend to be positioned away from the staff. But that looks a bit harder so I haven't done it yet. Is this similar to what you had in mind? Actually, no. What I had in mind was only to detect when hara kiri staves are alive or not, and use that to make an estimate of system height (with a fixed system height setting). Your approach here will get more accurate results, but I'm a little worried that the XXX_safe functions and properties will spread throughout the code, which is a problem as they're duplicating functionality. Does this patch already work for determining system heights, or is just the beginning of the work? How much more must done? BTW, the idea of precomputing when parts of a VerticalAlignment are hara-kiri'd can still be used to speed up the end result, I think. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilypond ./ChangeLog lily/dynamic-engraver.cc l...
Erlend Aasland schreef: This change looks a bit weird to me. Should not this padding only be applied if the right part of the hairpin is attached to a barline (and not a note)? That is, something like this: --- lily/hairpin.cc 16 May 2006 19:00:39 - 1.66 +++ lily/hairpin.cc 18 May 2006 06:56:39 - @@ -162,7 +162,11 @@ Hairpin::print (SCM smob) x_points[d] = e.center () - d * padding / 3; } else - x_points[d] = e[d] - d * padding; + if (d == RIGHT && + !me->get_bound (RIGHT)->get_column ()->is_musical (me->get_bound (RIGHT)->get_column ())) + x_points[d] = e[d] - d * padding; + else + x_points[d] = e[d]; } } } yes, you're right. Thanks for the hint. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Getting the height of a system.
On Mon, 2006-05-15 at 12:20 +0200, Han-Wen Nienhuys wrote: > Perhaps you could even compute for each VerticalAxisGroup the range of > column ranks where it would disappear, and use that information add a > method to compute the approximate height of an alignment spanner, where > you explicitly call it with a (begin,end) pair of column ranks. > > In that case, you could get the approximate height of one broken system > in logarithmic time. > Here's a first attempt at doing this. It isn't complete or well-tested yet. I add 4 grob properties Y-extent-safe Y-offset-safe default-Y-extent-is-safe default-Y-offset-is-safe where Y-extent-safe and Y-offset-safe are functions that take 3 arguments, a grob, and the starting and ending column ranks. default-Y-blah-is-safe just marks grobs where we don't need a Y-blah-safe because the default Y-blah doesn't introduce side effects. This is pretty much just there for NoteHead. I've implemented Y-extent-safe for axis-group-interface, hara-kiri-group-interface and NoteHead. I think it might be useful to do side-position-interface also since that will take care of markups, rehearsal marks and some other things that tend to be positioned away from the staff. But that looks a bit harder so I haven't done it yet. Is this similar to what you had in mind? Index: lily/align-interface.cc === RCS file: /sources/lilypond/lilypond/lily/align-interface.cc,v retrieving revision 1.97 diff -u -r1.97 align-interface.cc --- lily/align-interface.cc 19 Feb 2006 00:14:59 - 1.97 +++ lily/align-interface.cc 22 May 2006 07:52:15 - @@ -145,8 +145,11 @@ align_to_fixed_distance (). */ -void -Align_interface::align_elements_to_extents (Grob *me, Axis a) +vector +Align_interface::get_extents_aligned_translates (Grob *me, + vector const &all_grobs, + Axis a, + bool safe, int start, int end) { Spanner *me_spanner = dynamic_cast (me); @@ -156,7 +159,7 @@ { line_break_details = me_spanner->get_bound (LEFT)->get_property ("line-break-system-details"); - if (!me->get_system ()) + if (!me->get_system () && !safe) me->warning (_ ("vertical alignment called before line-breaking.\n" "Only do cross-staff spanners with PianoStaff.")); @@ -171,10 +174,10 @@ vector dims; vector elems; - extract_grob_set (me, "elements", all_grobs); for (vsize i = 0; i < all_grobs.size (); i++) { - Interval y = all_grobs[i]->extent (me, a); + Interval y = (safe && a == Y_AXIS) ? all_grobs[i]->safe_height (me, start, end) + : all_grobs[i]->extent (me, a); if (!y.is_empty ()) { Grob *e = dynamic_cast (all_grobs[i]); @@ -245,24 +248,31 @@ if (translates.size ()) { Real w = translates[0]; + + if (scm_is_number (align)) + center_offset = total.linear_combination (scm_to_double (align)); + for (vsize i = 0, j = 0; j < all_grobs.size (); j++) { if (i < elems.size () && all_grobs[j] == elems[i]) w = translates[i++]; - all_translates.push_back (w); + all_translates.push_back (w - center_offset); } +} + return all_translates; +} - /* - FIXME: uncommenting freaks out the Y-alignment of - line-of-score. - */ - if (scm_is_number (align)) - center_offset = total.linear_combination (scm_to_double (align)); +void +Align_interface::align_elements_to_extents (Grob *me, Axis a) +{ + extract_grob_set (me, "elements", all_grobs); + vector translates = get_extents_aligned_translates (me, all_grobs, a, false, 0, 0); + if (translates.size ()) for (vsize j = 0; j < all_grobs.size (); j++) - all_grobs[j]->translate_axis (all_translates[j] - center_offset, a); -} + all_grobs[j]->translate_axis (translates[j], a); } + Axis Align_interface::axis (Grob *me) { Index: lily/axis-group-interface.cc === RCS file: /sources/lilypond/lilypond/lily/axis-group-interface.cc,v retrieving revision 1.76 diff -u -r1.76 axis-group-interface.cc --- lily/axis-group-interface.cc 16 Mar 2006 14:39:46 - 1.76 +++ lily/axis-group-interface.cc 22 May 2006 07:52:16 - @@ -8,10 +8,14 @@ #include "axis-group-interface.hh" +#include "align-interface.hh" #include "pointer-group-interface.hh" #include "grob.hh" #include "hara-kiri-group-spanner.hh" +#include "item.hh" +#include "paper-column.hh" #include "warn.hh" +#include "international.hh" void Axis_group_interface::add_element (Grob *me, Grob *e) @@ -61,6 +65,41 @@ return r; } +Interval +Axis_group_interface::relative_safe_height (Grob *me, + vector const &elts, + Grob *common, + int start, int end) +{ + Interval r; + vector translates; + + /* The children of an object with align-interface won't have their + offsets set properly because Y-offset is not safe for them. So + we do the translations here instead. + */ + + if (Align_interface::has_inte