From 8002fa018c81f70585c25232247c6dcba7f5cba0 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 18 Oct 1999 14:45:06 +0200 Subject: [PATCH] release: 1.2.15 --- AUTHORS.txt | 67 ------ CHANGES | 14 ++ Documentation/BLURB.in | 3 - Documentation/COPYRIGHT | 88 ------- Documentation/GNUmakefile | 15 +- Documentation/MANIFESTO.texi | 114 --------- Documentation/index.texi | 24 +- Documentation/metadoc/regression-test.tely | 14 +- AIMS => Documentation/misc/AIMS | 0 .../misc/ANNOUNCE-0.1 | 0 .../misc/ANNOUNCE-1.0 | 0 .../misc/ANNOUNCE-1.2 | 0 NEWS-0.0 => Documentation/misc/CHANGES-0.0 | 0 NEWS-0.1 => Documentation/misc/CHANGES-0.1 | 0 NEWS-1.0 => Documentation/misc/CHANGES-1.0 | 0 NEWS-1.1 => Documentation/misc/CHANGES-1.1 | 0 Documentation/misc/GNUmakefile | 21 ++ Documentation/misc/NEWS-1.2 | 25 ++ Documentation/misc/NEWS-1.2~ | 25 ++ Documentation/misc/index.texi | 23 ++ Documentation/misc/interview | 108 +++++++++ Documentation/user/properties.itely | 2 +- Documentation/user/refman.itely | 9 +- Documentation/user/tutorial.itely | 12 +- NEWS | 25 -- TODO | 30 +-- VERSION | 4 +- buildscripts/lilypond-login.sh | 9 +- buildscripts/lilypond-profile.sh | 6 +- debian/GNUmakefile | 2 - debian/control | 8 +- debian/control.in | 5 +- debian/out/control | 8 +- flower/include/parray.hh | 19 ++ input/bugs/core.ly | 3 - input/star-spangled-banner.ly | 7 +- input/test/break.ly | 12 + input/test/lyrics-bar.ly | 30 +++ .../{repeat-semifold.ly => repeat-volta.ly} | 7 +- lily/GNUmakefile | 1 - lily/auto-beam-engraver.cc | 1 - lily/bar-engraver.cc | 56 +---- lily/bar-req-collect-engraver.cc | 11 + lily/bar.cc | 2 +- lily/beam-engraver.cc | 2 +- lily/beam.cc | 94 +++----- lily/bezier.cc | 3 +- lily/break-algorithm.cc | 21 +- lily/break-align-item.cc | 2 - lily/collision.cc | 2 +- lily/column-x-positions.cc | 7 - lily/command-request.cc | 1 - lily/crescendo.cc | 2 +- lily/cross-staff.cc | 44 ++++ lily/encompass-info.cc | 92 -------- lily/engraver.cc | 1 + lily/extender-spanner.cc | 4 +- lily/gourlay-breaking.cc | 70 +++--- lily/hyphen-spanner.cc | 4 +- lily/include/bar-engraver.hh | 4 +- lily/include/bar-req-collector-engraver.hh | 26 +++ lily/include/beam.hh | 2 +- lily/include/break-algorithm.hh | 2 +- lily/include/column-x-positions.hh | 3 +- lily/include/command-request.hh | 3 +- lily/include/cross-staff.hh | 17 ++ lily/include/encompass-info.hh | 27 --- lily/include/ly-symbols.hh | 1 + lily/include/music-iterator.hh | 8 +- lily/include/paper-def.hh | 29 +-- lily/include/paper-score.hh | 9 +- lily/include/score-column.hh | 5 - lily/include/score-element.hh | 17 +- lily/include/score-engraver.hh | 1 - lily/include/slur.hh | 4 +- lily/include/timing-engraver.hh | 5 + lily/include/unfolded-repeat-iterator.hh | 3 + lily/lily-guile.cc | 3 + lily/lookup.cc | 6 +- lily/main.cc | 6 +- lily/midi-def.cc | 4 +- lily/music-iterator.cc | 10 +- lily/paper-def.cc | 42 +--- lily/paper-score.cc | 54 +---- lily/parser.yy | 20 +- lily/score-column.cc | 4 - lily/score-element.cc | 77 ++++++ lily/score-engraver.cc | 47 ++-- lily/score.cc | 4 +- lily/separating-group-spanner.cc | 1 - lily/simultaneous-music-iterator.cc | 2 +- lily/single-malt-grouping-item.cc | 1 - lily/slur.cc | 220 +++++++++++------- lily/spacing-spanner.cc | 1 - lily/staff-sym.cc | 2 +- lily/stem-info.cc | 63 +---- lily/stem-tremolo.cc | 2 +- lily/stem.cc | 3 +- lily/timing-engraver.cc | 47 ++++ lily/unfolded-repeat-iterator.cc | 12 +- ly/declarations.ly | 4 +- ly/engraver.ly | 14 +- ly/midi.ly | 1 + ly/params.ly | 41 ++-- ly/property.ly | 14 +- make/lilypond.spec.in | 2 +- make/out/lilypond.lsm | 11 +- make/out/lilypond.spec | 17 +- make/toplevel.make.in | 7 +- mutopia/N.W.Gade/README | 7 +- mutopia/N.W.Gade/brass.ly | 12 +- mutopia/N.W.Gade/parts.ly | 14 +- mutopia/N.W.Gade/score.ly | 3 +- mutopia/N.W.Gade/strings.ly | 2 +- mutopia/N.W.Gade/wood.ly | 12 +- scm/lily.scm | 5 +- test/GNUmakefile | 17 -- test/bow.cc | 165 ------------- test/hash.cc | 39 ---- test/int.cc | 51 ---- tex/lily-ps-defs.tex | 10 +- 121 files changed, 1018 insertions(+), 1386 deletions(-) delete mode 100644 AUTHORS.txt delete mode 100644 Documentation/BLURB.in delete mode 100644 Documentation/COPYRIGHT delete mode 100644 Documentation/MANIFESTO.texi rename AIMS => Documentation/misc/AIMS (100%) rename ANNOUNCE-0.1 => Documentation/misc/ANNOUNCE-0.1 (100%) rename ANNOUNCE-1.0 => Documentation/misc/ANNOUNCE-1.0 (100%) rename ANNOUNCE-1.2 => Documentation/misc/ANNOUNCE-1.2 (100%) rename NEWS-0.0 => Documentation/misc/CHANGES-0.0 (100%) rename NEWS-0.1 => Documentation/misc/CHANGES-0.1 (100%) rename NEWS-1.0 => Documentation/misc/CHANGES-1.0 (100%) rename NEWS-1.1 => Documentation/misc/CHANGES-1.1 (100%) create mode 100644 Documentation/misc/GNUmakefile create mode 100644 Documentation/misc/NEWS-1.2 create mode 100644 Documentation/misc/NEWS-1.2~ create mode 100644 Documentation/misc/index.texi create mode 100644 Documentation/misc/interview create mode 100644 input/test/break.ly create mode 100644 input/test/lyrics-bar.ly rename input/test/{repeat-semifold.ly => repeat-volta.ly} (91%) create mode 100644 lily/bar-req-collect-engraver.cc create mode 100644 lily/cross-staff.cc delete mode 100644 lily/encompass-info.cc create mode 100644 lily/include/bar-req-collector-engraver.hh create mode 100644 lily/include/cross-staff.hh delete mode 100644 lily/include/encompass-info.hh delete mode 100644 test/GNUmakefile delete mode 100644 test/bow.cc delete mode 100644 test/hash.cc delete mode 100644 test/int.cc diff --git a/AUTHORS.txt b/AUTHORS.txt deleted file mode 100644 index b58b34bf2f..0000000000 --- a/AUTHORS.txt +++ /dev/null @@ -1,67 +0,0 @@ - - -AUTHORS - who did what on GNU LilyPond? -*************************************** - - This file lists authors of GNU LilyPond, and what they wrote. This -list is alphabetically ordered. - - * Tom Cato Amundsen , cembalo-partita in - mudela, accordion symbols, some mudela-book.py - - * Mats Bengtsson , - `http://www.s3.kth.se/~matsb/' lots of testing, fixes, general - comments and contributions. - - * Eric Bullinger , accidental transposition. - - * Laura Conrad (lconrad@world.std.com) fixes to abc2ly - - * Jan Arne Fagertun , TeX - titling and lytodvi.sh - - * Anthony Fok , debian package: debian/* - - * Bjoern Jacke german glossary stuff. - - * Neil Jerram . parts of - Documentation/Vocab* - - * Donald Ervin Knuth, `http://www-cs-staff.stanford.edu/~knuth/' - mf/ital-*.mf (these were taken from the CM fonts) - - * Michael Krause , breathing signs - - * Werner Lemberg , misc bugfixes, some Beam and Stem - code. - - * David R. Linn , Mailing list - maintenance. - - * Adrian Mariano <> Reference manual, tutorial fixes, glossary. - - * Han-Wen Nienhuys , - `http://www.cs.uu.nl/~hanwen/' Main author (initials: HWN). - - * Jan Nieuwenhuizen , - `http://www.xs4all.nl/~jantien/' Main author (initials: JCN). - - * Alexandre Oliva , - `http://sunsite.unicamp.br/~oliva/' testing - - * Franc ois Pinard, parts of - Documentation/Vocab*, started internationalization stuff - - * Glen Prideaux , minor bug fix to - script used to generate doc++ documentation - - * Roy R. Rankin , major extension, - fixes to abc2ly, lilypond bug fixes - - * Jeffrey B. Reed , Windows-NT support. - - * Shay Rojanski Some mudela source. - - Your name could be here! If you want to fix something, do it, and -send us a patch! - diff --git a/CHANGES b/CHANGES index 3c07949e2c..604f59c4aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,22 @@ +pl 15 (Oct 18) + 14.jcn1 + - Kludge for accented chars (thanks, Mats) - bf: don't fail on error in doco package - doco package: noarch - bf: standchen: mutopia prep +14.hwn1 + - move some misc stuff into Documentation/misc/ + - cleanups: slur & beam. + - junked Encompass_info + - Smobs -- simplifies sc_elt memory management + - Timing_engraver collects bar reqs + - unfold all if doing MIDI. + - bfs: do something sensible if it doesn't fit. + - penalties for break stuff supported. + +******* 13.jcn2,3 - mutopia/J.S.Bach/Petites-Preludes: bf's and mutopia preraration - separate documentation package diff --git a/Documentation/BLURB.in b/Documentation/BLURB.in deleted file mode 100644 index 52e0ef5c75..0000000000 --- a/Documentation/BLURB.in +++ /dev/null @@ -1,3 +0,0 @@ -LilyPond is a music typesetter. It produces beautiful sheet music -using a high level description file as input. LilyPond is part of -the GNU Project. diff --git a/Documentation/COPYRIGHT b/Documentation/COPYRIGHT deleted file mode 100644 index 1628105c98..0000000000 --- a/Documentation/COPYRIGHT +++ /dev/null @@ -1,88 +0,0 @@ -[Note to uninitiated readers. This is a Q&A document that explains -what to watch out for when submitting scores for the Mutopia project. -The Mutopia project is an effort to accumulate an archive of sheet -music that is in the public domain. The project should be similar to -the Gutenberg project. - -We will be using music typesetting software to produce the software. -The project will only accept music for composers that have passed into -the PD. The sole remaining problem is caused by the editorial -changes. A recent edition may contain editorial amendments that are -not in the PD, so we cannot simply copy the music from recent -editions.] - - - -What is copyright? - -Copyright is a legal system that protects the expressions of ideas. -It was originally conceived to foster development of art and -knowledge. - -Copyright law gives "owners" of the expressions the right to restrict -reproductions of these expressions and collect fees. In this way they -can earn a living. For example, a poet may restrict xeroxing and -public performances of his poems, and demand a fee for print for -prints and performances. - -After some time ---for most forms of expression, this is 70 years -after the author died--- the work goes into the public domain, which -means that all restrictions are lifted. You can print, perform and -modify the works as much as you like. - -Copyright law is internationalised. In most countries the conditions -from the Berne convention have been adopted. - - - - -How does copyright work for music scores? - -Let's analyze how a printed score is produced: - -1. The composer composes music. - -2. An editor edits the music, based on the composer's manuscript and -on other editions. - -3. An engraver lays out the editor's product. - -As you can see, there are three individuals, whose expressions are -protected by copyright law. Since we are interested in the scores -that are in the PD. - -The copyright on the music itself passes into the PD 70 years after -the death of the composer. (Or XXXX years after publication if the -work is published posthumously.) - -The copyright on the editorial changes pass in to the PD 70 years -after death of the editor, or XXX years after publication. Depending on YYY - -The copyright of the engraver is of no interest to us, since we will -not reproduce any of the layout. - - - -What are editorial changes? - - - - - - -How do I find out what changes might be copyrighted? - -You cannot copyright something you did not create yourself. So if you -find the same editorial changes across different editions it is -unlikely that it is copyrighted. - - - - -Urtexts? - - - -Scores that are not marked with dates? - - diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index d900ff88fc..1d6e86f54e 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -1,25 +1,16 @@ -# Documentation/Makefile - depth = .. NAME = documentation -SUBDIRS= user metadoc bibliography pictures topdocs ntweb +SUBDIRS= user metadoc bibliography pictures topdocs ntweb misc STEPMAKE_TEMPLATES=documentation texinfo -README_TOP_FILES=NEWS DEDICATION TODO AIMS CHANGES -INFO_FILES = $(wildcard $(outdir)/$(package).info*) -EXTRA_DIST_FILES = COPYRIGHT - - - -BLURBS=BLURB +README_TOP_FILES=NEWS DEDICATION CHANGES +EXTRA_DIST_FILES = include $(depth)/make/stepmake.make default: do-doc -info: $(outdir)/$(package).info - local-WWW: copy-for-me copy-for-me: diff --git a/Documentation/MANIFESTO.texi b/Documentation/MANIFESTO.texi deleted file mode 100644 index 4900adb78f..0000000000 --- a/Documentation/MANIFESTO.texi +++ /dev/null @@ -1,114 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@setfilename MANIFESTO.info -@settitle MANIFESTO - Rationale behind the GNU LilyPond project - -@node Top, , Goals for mudela, (dir) -@top -@menu -* MANIFESTO - Rationale behind the GNU LilyPond project::MANIFESTO - Rationale behind the GNU LilyPond project -@end menu - - - -@node MANIFESTO - Rationale behind the GNU LilyPond project, Goals for LilyPond, , Top -@menu -* Goals for LilyPond:: Goals for LilyPond -* Development constraints:: Development constraints -* Goals for mudela:: Goals for mudela -@end menu -@chapter MANIFESTO -- Rationale behind the GNU LilyPond project - - -@node Goals for LilyPond, Development constraints, MANIFESTO - Rationale behind the GNU LilyPond project, MANIFESTO - Rationale behind the GNU LilyPond project -@section Goals for LilyPond - -GNU LilyPond was written with some considerations in mind: - -@itemize @bullet -@item Describing a well-defined language for defining music. We call - this language (rather arrogantly) The Musical Definition Language - (mudela for short). GNU LilyPond reads a mudela sourcefile and outputs a - TeX file. -@item Providing an easy-to-use interface for typesetting music in - its broadest sense. This interface should be intuitive from a musical - point of view. By broadest sense we mean: it is designed for music - printed left to right in staffs, using notes to designate rythm and - pitch. -@item Generating high-quality output. Ideally it should be of a professional - quality. We'd like to render Herbert Chlapiks words, "Fine music - setting is not possible without a knowledgeable printer," untrue. -@item Making a system which is fully tweakable. It should be possible to - typeset a book on how not to typeset music. -@end itemize - -@node Development constraints, Goals for mudela, Goals for LilyPond, MANIFESTO - Rationale behind the GNU LilyPond project -@section Development constraints - -Further considerations while doing the programming - -@itemize @bullet -@item GNU LilyPond uses TeX for its output. This is not a key issue: in a - future version, GNU LilyPond might bypass TeX, but at the moment TeX - is convenient for producing output. -@item GNU LilyPond does not display notes directly, nor will it be rehacked - to be used interactively. GNU LilyPond writes output to a file. It - will not be extended to play music, or to recognize music. -@item GNU LilyPond is intended to run on Unix platforms, but it should - be portable to any platform which can run TeX and the GNU tools -@item GNU LilyPond is free. Commercial windows packages for setting music are - abundant. Free musicprinting software is scarce. For more thoughts on - this, please consult the @file{gnu-music} documentation. -@item GNU LilyPond is written in GNU C++. It will not be downgraded/ported to fit - broken systems. -@end itemize - -@node Goals for mudela, Top, Development constraints, MANIFESTO - Rationale behind the GNU LilyPond project -@section Goals for mudela - -The design of Mudela has been (perfect past tense, hopefully) an -ongoing process, the most important criteria being: - -@itemize @bullet -@item define the (musical) message of the composer as unambiguously as possible. - This means that, given a piece Mudela, it should be possible for a - program to play a reasonable interpretation of the piece. - - It also means that, given a piece of Mudela, it should be possible for a - program to print a score of the piece. -@item be intuitive, and easily readable (compared to, say, Musi*TeX input, - or MIDI :-), -@item be easily writable in ASCII with a simple texteditor -@end itemize - -Other considerations were (and will be): - -@itemize @bullet -@item be able to edit the layout without danger of changing the original - music (Urtext), -@item allow for adding different interpretations, again, - without danger of changing the original, -@item easy to create a conductor's score, - as well as the scores for all individual instruments, -@item provide simple musical manipulations, such as @emph{i} extracting a - slice of music from a previously defined piece, @emph{ii} extracting - only the rhythm from a piece of music, @emph{iii} transposing, etc., -@item easy to comprehend to both programmers and others. -@end itemize - -One of the things that (might) be here would be: feasible to use in a -graphic editor. We don't have experience with these beasts, so we -don't know how to do this. Comments appreciated. - -Musical pieces could be - -@itemize @bullet -@item Orchestral scores, (eg Mahler) -@item piano pieces (eg. Schubert, Rachmaninov), -@item pop songs (lyrics and chords), -@item Gregorian chants, -@item Bach multivoice organ pieces, -@item Short excerpts to be used in musicological publications. -@end itemize - - -@bye diff --git a/Documentation/index.texi b/Documentation/index.texi index f308cfe45b..31afd58918 100644 --- a/Documentation/index.texi +++ b/Documentation/index.texi @@ -8,33 +8,29 @@ @unnumberedsubsec Introduction @itemize -@item @uref{../topdocs/out-www/README.html, README} -@item @uref{../topdocs/out-www/INSTALL.html, Installation Instructions} -@item @uref{../topdocs/out-www/AUTHORS.html,The Authors} +@item @uref{DEDICATION.txt,Dedication} +@item @uref{../topdocs/out-www/AUTHORS.html, Authors} +@item @uref{../topdocs/out-www/README.html, Readme file} +@item @uref{../topdocs/out-www/INSTALL.html, Installation instructions} @end itemize - - @unnumberedsubsec Documentation @itemize @bullet -@item @uref{faq.html,FAQs} +@item @uref{faq.html,Frequently asked questions}, with answers @item @uref{programs.html,`Manual pages'} @item @uref{../user/out-www/index.html,User documentation} @item @uref{../metadoc/out-www/index.html,Hacker documentation} @item @uref{../bibliography/out-www/,Bibliography} +@item @uref{../misc/out-www/index.html,Miscellaneous texts} @end itemize -@unnumberedsubsec Miscellaneous blurbs - - -@itemize @bullet -@item @uref{TODO.txt, TODO list} -@item @uref{CHANGES.txt,Change log} -@item @uref{DEDICATION.html,DEDICATION} -@item @uref{AIMS.txt,Why?} +@unnumberedsubsec{Status} +@itemize +@item @uref{TODO.txt, Thing to do} +@item @uref{CHANGES.txt, Things recently done} @end itemize diff --git a/Documentation/metadoc/regression-test.tely b/Documentation/metadoc/regression-test.tely index f945a54105..24e4d58902 100644 --- a/Documentation/metadoc/regression-test.tely +++ b/Documentation/metadoc/regression-test.tely @@ -162,10 +162,10 @@ Unfolded behavior: @mudelafile{repeat-unfold.ly} -Semi (un)folded behavior. Voltas can start on non-barline moments. +Volta (Semi folded) behavior. Voltas can start on non-barline moments. If they don't barlines should still be shown. -@mudelafile{repeat-semifold.ly} +@mudelafile{repeat-volta.ly} Folded. This doesn't make sense without alternatives, but it works. @@ -237,9 +237,19 @@ Loose: @mudelafile{spacing-loose.ly} +Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that +lyrics don't collide with barlines. + +@mudelafile{lyrics-bar.ly} @section Global stuff +Breaks can be encouraged and discouraged using @code{\break} and +@code{\nobreak}. They are abbrevs for @code{\penalty} commands. + +@mudelafile{break.ly} + + Markings that are attached to (invisible) barlines are delicate: the are attached to the rest of the score without the score knowing it. Consequently, they fall over often. diff --git a/AIMS b/Documentation/misc/AIMS similarity index 100% rename from AIMS rename to Documentation/misc/AIMS diff --git a/ANNOUNCE-0.1 b/Documentation/misc/ANNOUNCE-0.1 similarity index 100% rename from ANNOUNCE-0.1 rename to Documentation/misc/ANNOUNCE-0.1 diff --git a/ANNOUNCE-1.0 b/Documentation/misc/ANNOUNCE-1.0 similarity index 100% rename from ANNOUNCE-1.0 rename to Documentation/misc/ANNOUNCE-1.0 diff --git a/ANNOUNCE-1.2 b/Documentation/misc/ANNOUNCE-1.2 similarity index 100% rename from ANNOUNCE-1.2 rename to Documentation/misc/ANNOUNCE-1.2 diff --git a/NEWS-0.0 b/Documentation/misc/CHANGES-0.0 similarity index 100% rename from NEWS-0.0 rename to Documentation/misc/CHANGES-0.0 diff --git a/NEWS-0.1 b/Documentation/misc/CHANGES-0.1 similarity index 100% rename from NEWS-0.1 rename to Documentation/misc/CHANGES-0.1 diff --git a/NEWS-1.0 b/Documentation/misc/CHANGES-1.0 similarity index 100% rename from NEWS-1.0 rename to Documentation/misc/CHANGES-1.0 diff --git a/NEWS-1.1 b/Documentation/misc/CHANGES-1.1 similarity index 100% rename from NEWS-1.1 rename to Documentation/misc/CHANGES-1.1 diff --git a/Documentation/misc/GNUmakefile b/Documentation/misc/GNUmakefile new file mode 100644 index 0000000000..55a1efe7ed --- /dev/null +++ b/Documentation/misc/GNUmakefile @@ -0,0 +1,21 @@ +depth = ../.. + +NAME = documentation + +STEPMAKE_TEMPLATES=documentation texinfo + +TEXTS =AIMS $(wildcard CHANGES-*) $(wildcard ANNOUNCE-*) $(wildcard NEWS-*) interview +EXTRA_DIST_FILES = $(TEXTS) + + +include $(depth)/make/stepmake.make + +default: do-doc + +local-WWW: $(addprefix $(outdir)/, $(addsuffix .txt, $(TEXTS))) + +copy-for-me: + $(foreach a, $(README_TOP_FILES),cp ../$(a) $(outdir)/$(a).txt && ) true + +$(outdir)/%.txt: % + cp $< $@ diff --git a/Documentation/misc/NEWS-1.2 b/Documentation/misc/NEWS-1.2 new file mode 100644 index 0000000000..d3499b3490 --- /dev/null +++ b/Documentation/misc/NEWS-1.2 @@ -0,0 +1,25 @@ +WHAT'S NEW SINCE 1.0.17 + +* Large cleanups, enhanced design and GUILE integration for smaller + memory footprint and more flexible code. + +* Direct output to PostScript (optional), PDFTeX or as GUILE script + (default output still to plain TeX). + +* Convertors for ABC and MUP formats. + +* Font: now available as scalable PostScript. New glyphs: time + signature, more note heads. + +* Enhanced input: semi-automatic beaming, (nested) tuplets, (nested) + repeats, chordnames, automatic Lyrics durations. + +* Grace notes, volta brackets, multiple styles for note heads and + time signatures, breathing signs, lyric extenders, cross staff + beaming and slurring. + +* --safe option for the paranoid. + +* More elegant spacing. Text is spaced exactly. + +* Lots of bugfixes. diff --git a/Documentation/misc/NEWS-1.2~ b/Documentation/misc/NEWS-1.2~ new file mode 100644 index 0000000000..d3499b3490 --- /dev/null +++ b/Documentation/misc/NEWS-1.2~ @@ -0,0 +1,25 @@ +WHAT'S NEW SINCE 1.0.17 + +* Large cleanups, enhanced design and GUILE integration for smaller + memory footprint and more flexible code. + +* Direct output to PostScript (optional), PDFTeX or as GUILE script + (default output still to plain TeX). + +* Convertors for ABC and MUP formats. + +* Font: now available as scalable PostScript. New glyphs: time + signature, more note heads. + +* Enhanced input: semi-automatic beaming, (nested) tuplets, (nested) + repeats, chordnames, automatic Lyrics durations. + +* Grace notes, volta brackets, multiple styles for note heads and + time signatures, breathing signs, lyric extenders, cross staff + beaming and slurring. + +* --safe option for the paranoid. + +* More elegant spacing. Text is spaced exactly. + +* Lots of bugfixes. diff --git a/Documentation/misc/index.texi b/Documentation/misc/index.texi new file mode 100644 index 0000000000..8a84edbeb8 --- /dev/null +++ b/Documentation/misc/index.texi @@ -0,0 +1,23 @@ +\input texinfo @c -*-texinfo-*- +@setfilename index.info +@settitle index + +@node Top, , , (dir) +@top + +Miscellaneous texts +@itemize +@item @uref{CHANGES-0.0.txt, Change logs from 0.0 till 0.1 } +@item @uref{CHANGES-0.1.txt, Change logs from 0.1 till 1.0 } +@item @uref{CHANGES-1.0.txt, Change logs from 1.0 till 1.1 } +@item @uref{CHANGES-1.1.txt, Change logs from 1.1 till 1.2 } +@item @uref{NEWS-1.2.txt, summary of changes from 1.1 till 1.2 } +@item @uref{ANNOUNCE-0.1.txt, Announcement of 0.1 (includes summary of +changes)} +@item @uref{ANNOUNCE-1.0.txt, Announcement of 1.0 (includes summary of +changes)} +@item @uref{ANNOUNCE-1.2.txt, Announcement of 1.2 (includes summary of changes)} + +@item @uref{AIMS.txt} +@end itemize + diff --git a/Documentation/misc/interview b/Documentation/misc/interview new file mode 100644 index 0000000000..4526280199 --- /dev/null +++ b/Documentation/misc/interview @@ -0,0 +1,108 @@ +(Oct / 99) + +* What is it? + +In short, LilyPond does for sheet music what (La)TeX does for printed +text: the input describes the music you want printed, the program +processes the input like a compiler, and the output file contains +printed music. + +* Who would use it? + +People who want beautifully printed music, but don't have time to +learn intricacies of music notation. + + * Why would they use it instead of similar projects? + +Within the free software movement, LilyPond is unique: free music +notation software is very scarce, and is either difficult to use, +clumsy or does not give pretty results. + + * Special features/strengths? + +Just like LaTeX, the input format is very abstract, and the output is +very elegant. Additionally, most aspects of the formatting can be +adjusted to taste. + +LilyPond also allows very easy integration with TeX: you can write a +paper that mixes fragments of notation with LaTeX. + +* Special problems? + +Music notation is very complicated. It is much more difficult than +typesetting mathematics which is TeX's forte. Almost everything in +music notation is a "Special problem". + +Generally, the more modern the music is, the more problems it +contains: classical and baroque music like Mozart and Bach should pose +no problems for LilyPond. Romantic music like Brahms and Schumann will +get printed but with some formatting errors. Twentieth century music +like Schoenberg and Bartok can be very difficult to typeset. + +Luckily for most, Pop-music is relatively uncomplicated: it should not +be a problem to print that kind of music. + +* Who is working on it? + +Jan Nieuwenhuizen and me (Han-Wen Nienhuys) have written most of the +core of the program, but the most elaborate example in the +distribution (a 40 page orchestral score) was contributed by one of +our long-time users. He is a member of a small band of developers +that contribute small patches. + + * Plans for the close and distant future? + +The most concrete development plan for now is to use GUILE much more +pervasively: LilyPond started out as a C++ program, with lots of +formatting rules that were hard-wired into the system. We want to +express those rules in Scheme, so that they can be changed at +run-time. + +A much more interesting development is The Mutopia Project: it is a +website where you can download sheet music that has passed into the +public domain. Just think of Project Gutenberg, but then for sheet +music. We hope that in the future you can just point your browser to +Mutopia if you need classical music. + +The Mutopia website has not gone live yet, but you can preview some +scores at http://sca.uwaterloo.ca/Mutopia/. What we need now is lots +of help with entering sheet music. If you like classical music, come +out and help us! + + + + * Interesting/fun stories that might juice up the story? + +Jan Nieuwenhuizen and me have been best friends for a some four years +now. LilyPond development catalyses our friendship, and our friendship +catalyses LilyPond development. We call each other a few times a week +to discuss development, and the most revolutionary improvements in +Lily have often been the result of a long nights of discussions on +software design over glasses of Whisky + +Another question that pops up in outsiders is: ``what do aquatic +flowers have to do with music typography? Why the weird name?'' + +I started Lily (our affectionate name for LilyPond) three years +ago. Back then, I was in an amateur symphonic orchestra together with +Jan. I had a crush on this magnificent girl in the orchestra: her +name was Suzanne, she played both the flute and the cello, and (of +course) I thought she was very pretty. + +At the time, Jan was dating Roos (Dutch for `Rose' -- she also played +the cello). I also knew about about a package Rosegarden (a GUI MIDI +sequencer and notation editor). When I found out that `Susan' is +Hebrew for `lily', I decided that calling the package `LilyPond' would +match make the nomenclature of the rest of my life perfectly. + +Some things don't last---the two girls, the cellos and the orchestra, +all have disappeared from our lives. LilyPond however has survived +over time. It is a big, mature program with a healthy user-base and +good prospects. Best of all is, that we still have a good time +hacking on it + + +* License?! + +GPL, of course. + diff --git a/Documentation/user/properties.itely b/Documentation/user/properties.itely index c750b3af9c..f5ead31c6c 100644 --- a/Documentation/user/properties.itely +++ b/Documentation/user/properties.itely @@ -1,4 +1,4 @@ -@node Properties, , , Top +@node Properties, , , Reference Manual @cindex properties!Lyrics diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 1ba86f3112..bea07dc13d 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1295,17 +1295,16 @@ chords can be expressed in two different ways: @mudela[fragment,verbatim,center] \notes \context Staff { \cadenza 1; - - <{a b c'}{c' d' e'}> + + < { a b c' } { c' d' e' } > } @end mudela @cindex context selection -@keyindex{context} +@c @keyindex{context} @example - \context - @var{contexttype} [= @var{contextname}] @var{musicexpr} + \context @var{contexttype} [= @var{contextname}] @var{musicexpr} @end example Interpret @var{musicexpr} within a context of type @var{contexttype}. diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 35b5dc0cae..5029f7fa34 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -383,6 +383,7 @@ may differ, since the titling in this document is not generated by \include "paper16.ly" melody = \notes \relative c' { \partial 8; + \key c \minor; g8 | c4 c8 d [es () d] c4 | f4 f8 g [es() d] c g | c4 c8 d [es () d] c4 | d4 es8 d c4. @@ -452,12 +453,17 @@ give names to the different parts of music, and use the names to construct the music within the score block. @example - \partial 8; - @end example -The piece starts with an anacrusis of one eighth. @example +The piece starts with an anacrusis of one eighth. +@example + \key c \minor +@end example +The key is C minor: we have three flats. + + +@example c4 c8 d [es () d] c4 | f4 f8 g [es() d] c g | c4 c8 d [es () d] c4 | d4 es8 d c4. diff --git a/NEWS b/NEWS index 66e89bcf1c..5d740e231d 100644 --- a/NEWS +++ b/NEWS @@ -8,28 +8,3 @@ WHAT'S NEW SINCE 1.2.0 * Documentation now all is in texinfo. -WHAT'S NEW SINCE 1.0.17 - -* Large cleanups, enhanced design and GUILE integration for smaller - memory footprint and more flexible code. - -* Direct output to PostScript (optional), PDFTeX or as GUILE script - (default output still to plain TeX). - -* Convertors for ABC and MUP formats. - -* Font: now available as scalable PostScript. New glyphs: time - signature, more note heads. - -* Enhanced input: semi-automatic beaming, (nested) tuplets, (nested) - repeats, chordnames, automatic Lyrics durations. - -* Grace notes, volta brackets, multiple styles for note heads and - time signatures, breathing signs, lyric extenders, cross staff - beaming and slurring. - -* --safe option for the paranoid. - -* More elegant spacing. Text is spaced exactly. - -* Lots of bugfixes. diff --git a/TODO b/TODO index f2df107e6c..dc34df7475 100644 --- a/TODO +++ b/TODO @@ -11,6 +11,8 @@ Grep -i for TODO, FIXME and ugh/ugr/urg. .* TODO . * use Rhythmic_head::position_i () for all Staff_referenced . * .po -> .pot. +. * why need to run -C mf twice? +. * junk BLURB files. . * setting indent to 0 with \shape fails . * ly2dvi : don't repeat opus if same. . * breaks before mmrests are favored. @@ -20,11 +22,9 @@ Grep -i for TODO, FIXME and ugh/ugr/urg. . * rerun profile . * fix or replace feta-accordion.mf . * fix configure with CFLAGS or LDFLAGS, try: -+ CFLAGS=-g LDFLAGS='-Wl,--warn-common' ./configure -+ configure will use them while testing the compiler, but they don't -+ appear in config.make - -. * Break_req handling is silly (break_forbid () + \break fucks up.) + CFLAGS=-g LDFLAGS='-Wl,--warn-common' ./configure +configure will use them while testing the compiler, but they don't +appear in config.make . * script engraver . * Chords: . * Bass/inversion pitch when not part of Chord @@ -490,19 +490,7 @@ hesitate to ask. . * SGML input . * Documentation -. * remove links to non-free SW. . * internal documentation -. * a general paper. -. * \properties -. * left/rightbeamcount -. * various other new properties. -. * introduction? -. * info? -. * LaTeX? -. * more manpages? -. * Doc (C) stuff of sheet music -. * a better format? SGML? TeX? Info? -. * a better tutorial . * more spanners (smallish) . * Glissando @@ -515,7 +503,6 @@ hesitate to ask. . * lines: . * Ledger lines, should be separate item: Ledger_lines -. * set different line sizes / thicknesses . * beam stem showthrough, inter beam sizes (french vs german style) . * Collisions @@ -524,7 +511,7 @@ hesitate to ask. . * Keys: . * merge key{item} & localkey{item}? -. * spacing, national styles? +. * spacing . * Support for TAB . * redo Notehead to allow digits as heads @@ -533,7 +520,6 @@ hesitate to ask. . * should adjust stemlength for flag number. . * breaking: -. * caching breakpoints . * saving them . * specify number of lines @@ -543,10 +529,8 @@ hesitate to ask. . * \translator -> ? . * fix \partial . * \bla {} vs \bla ; -. * mix engraver hacking with music ? . * \once\property KEY = VAL . * input property -. * abstract grammar. . * Figure out semicolons. . * 4 ? . * Viola mode? @@ -564,8 +548,6 @@ hesitate to ask. .* SMALLISH PROJECTS -. * fix confusing naming in Engraver vs Engraver_group_engraver (context) - . * A range for context errors (eg. mark both { and }. ) . * lyric in staff (sharpsharp in staff, text below) diff --git a/VERSION b/VERSION index 273303e4f0..a29c25c1b1 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=2 -PATCH_LEVEL=14 -MY_PATCH_LEVEL=jcn1 +PATCH_LEVEL=15 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/lilypond-login.sh b/buildscripts/lilypond-login.sh index d7e8e972d8..ca9d6c5c9f 100755 --- a/buildscripts/lilypond-login.sh +++ b/buildscripts/lilypond-login.sh @@ -1,10 +1,10 @@ #!/bin/csh # env. vars for the C-shell. - # set environment for LilyPond. To be installed in /etc/profile.d/ -setenv GS_LIB "@datadir@/ps" + setenv GS_FONTPATH "@datadir@/afm" + # bit silly. for ly2dvi, overrules compiled-in datadir... setenv LILYPONDPREFIX "@datadir@" @@ -19,10 +19,5 @@ if ($?TEXINPUTS) then else setenv TEXINPUTS "/usr/share/lilypond/tex::" endif -if ($?GUILE_LOAD_PATH) then - setenv GUILE_LOAD_PATH "/usr/share/lilypond/scm:${GUILE_LOAD_PATH}" -else - setenv GUILE_LOAD_PATH "/usr/share/lilypond/scm" -endif diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index 6aebf7b701..f2083862de 100755 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -2,7 +2,6 @@ # set environment for LilyPond. To be installed in /etc/profile.d/ -GS_LIB="@datadir@/ps" GS_FONTPATH="@datadir@/afm:@datadir@/pfa" # bit silly. for ly2dvi, overrules compiled-in datadir... @@ -12,11 +11,8 @@ LILYPONDPREFIX="@datadir@" MFINPUTS="@datadir@/mf:"${MFINPUTS:=":"} TEXINPUTS="@datadir@/tex:@datadir@/ps:"${TEXINPUTS:=":"} -GUILE_LOAD_PATH="@datadir@/scm:$GUILE_LOAD_PATH" - -export GUILE_LOAD_PATH LILYINCLUDE LILYPONDPREFIX MFINPUTS TEXINPUTS GS_LIB GS_FONTPATH +export LILYINCLUDE LILYPONDPREFIX MFINPUTS TEXINPUTS GS_LIB GS_FONTPATH -# echo $LILYINCLUDE $MFINPUTS $TEXINPUTS $GS_LIB $GS_FONTPATH diff --git a/debian/GNUmakefile b/debian/GNUmakefile index 740dafc961..929f049b15 100644 --- a/debian/GNUmakefile +++ b/debian/GNUmakefile @@ -3,8 +3,6 @@ depth = .. NAME = debian -BLURBS = BLURB -AT_FILES = $(BLURBS) # at-dir = $(outdir)/ at-ext = diff --git a/debian/control b/debian/control index 07d913fd21..0b48d3e3e1 100644 --- a/debian/control +++ b/debian/control @@ -9,10 +9,10 @@ Architecture: any Depends: ${shlibs:Depends}, tetex-bin (>= 0.9.990310-1) Recommends: python-base (>= 1.5.2-4), tetex-base (>= 0.9.990311-1), tetex-extra (>= 0.9.990311-1) Conflicts: musixtex-fonts, tetex-base (<< 0.9) -Description: A program for printing sheet music. - LilyPond is a music typesetter. It produces beautiful sheet music - using a high level description file as input. LilyPond is part of - the GNU Project. +Description: A program for printing sheet music. LilyPond is a music typesetter. It produces beautiful sheet music +using a high level description file as input. LilyPond is part of +the GNU Project. + . URLs: http://www.cs.uu.nl/~hanwen/lilypond/ http://www.xs4all.nl/~jantien/lilypond/ diff --git a/debian/control.in b/debian/control.in index 47e33d963d..0b48d3e3e1 100644 --- a/debian/control.in +++ b/debian/control.in @@ -9,7 +9,10 @@ Architecture: any Depends: ${shlibs:Depends}, tetex-bin (>= 0.9.990310-1) Recommends: python-base (>= 1.5.2-4), tetex-base (>= 0.9.990311-1), tetex-extra (>= 0.9.990311-1) Conflicts: musixtex-fonts, tetex-base (<< 0.9) -Description: A program for printing sheet music.@BLURB@ +Description: A program for printing sheet music. LilyPond is a music typesetter. It produces beautiful sheet music +using a high level description file as input. LilyPond is part of +the GNU Project. + . URLs: http://www.cs.uu.nl/~hanwen/lilypond/ http://www.xs4all.nl/~jantien/lilypond/ diff --git a/debian/out/control b/debian/out/control index 07d913fd21..0b48d3e3e1 100644 --- a/debian/out/control +++ b/debian/out/control @@ -9,10 +9,10 @@ Architecture: any Depends: ${shlibs:Depends}, tetex-bin (>= 0.9.990310-1) Recommends: python-base (>= 1.5.2-4), tetex-base (>= 0.9.990311-1), tetex-extra (>= 0.9.990311-1) Conflicts: musixtex-fonts, tetex-base (<< 0.9) -Description: A program for printing sheet music. - LilyPond is a music typesetter. It produces beautiful sheet music - using a high level description file as input. LilyPond is part of - the GNU Project. +Description: A program for printing sheet music. LilyPond is a music typesetter. It produces beautiful sheet music +using a high level description file as input. LilyPond is part of +the GNU Project. + . URLs: http://www.cs.uu.nl/~hanwen/lilypond/ http://www.xs4all.nl/~jantien/lilypond/ diff --git a/flower/include/parray.hh b/flower/include/parray.hh index 8a2efcb6fd..a9baeab836 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -129,6 +129,25 @@ public: Array::empty; Array::reverse; Array::tighten_maxsize; + + T *& boundary (int d, int i) + { + assert (d); + if (d == 1) + return top (i); + else + return elem_ref (i); + } + T * boundary (int d, int i)const + { + assert (d); + if (d == 1) + return top (i); + else + return elem_ref (i); + } + + T ** access_array () const { return (T**) Array::access_array(); diff --git a/input/bugs/core.ly b/input/bugs/core.ly index 5564617f77..2ad2caf191 100644 --- a/input/bugs/core.ly +++ b/input/bugs/core.ly @@ -15,9 +15,6 @@ global = \notes { \paper { \translator{ \StaffContext - - % other core dump when this is removed? - \remove "Time_signature_engraver"; } } } diff --git a/input/star-spangled-banner.ly b/input/star-spangled-banner.ly index e4bbe8d76e..d16dadc5e6 100644 --- a/input/star-spangled-banner.ly +++ b/input/star-spangled-banner.ly @@ -164,10 +164,13 @@ handLyrics = \notes \context GrandStaff < \GrandStaffContext \accepts "Lyrics"; } -% castingalgorithm = \Wordwrap; + \translator { + \LyricsContext + \consists "Bar_engraver"; + } } \midi {} } -\version "1.2.0"; +\version "1.2.14"; diff --git a/input/test/break.ly b/input/test/break.ly new file mode 100644 index 0000000000..ce65bb178b --- /dev/null +++ b/input/test/break.ly @@ -0,0 +1,12 @@ + + + +\score{ + \notes\context Voice{ + \emptyText + c1 c1^"no break after 2nd note" \nobreak c1 c1 + + c1^"break after this" \break c1 c1 + } + \paper { linewidth = 4.0\cm;} +} diff --git a/input/test/lyrics-bar.ly b/input/test/lyrics-bar.ly new file mode 100644 index 0000000000..0e714c34f6 --- /dev/null +++ b/input/test/lyrics-bar.ly @@ -0,0 +1,30 @@ + +\score { + + \context StaffGroup < + \notes \context Staff { b1 b1 \bar "|."; } + \lyrics\context Lyrics < + \context BarLV { thisContextHasBarEngraver1 added } + \context LyricVoice { this4 one has no barEngraverAddedToContext1 } + > + \notes \context Staff = SB { b1 b1 } + + > + + \paper { + linewidth = -1.0\cm; + \translator { + \LyricsContext + \consists "Bar_engraver"; + \accepts "BarLV"; + } + \translator { + \LyricsVoiceContext + \consists "Bar_engraver"; + \name "BarLV"; + } + \translator { + \LyricsVoiceContext + } + } +} diff --git a/input/test/repeat-semifold.ly b/input/test/repeat-volta.ly similarity index 91% rename from input/test/repeat-semifold.ly rename to input/test/repeat-volta.ly index d05959555b..46cea92205 100644 --- a/input/test/repeat-semifold.ly +++ b/input/test/repeat-volta.ly @@ -8,5 +8,10 @@ % more alts than body \repeat volta 2 { c^"2$\\times$ 3alt" d } \alternative { e f g } -}} +} + + \midi{} + \paper{} + +} diff --git a/lily/GNUmakefile b/lily/GNUmakefile index 638a618ace..29df520062 100644 --- a/lily/GNUmakefile +++ b/lily/GNUmakefile @@ -20,7 +20,6 @@ $(outdir)/my-lily-parser.o: $(outdir)/parser.hh $(outdir)/my-lily-lexer.o: $(outdir)/parser.hh $(outdir)/lexer.o: $(outdir)/parser.hh $(outdir)/lily-version.o: $(outdir)/version.hh -$(outdir)/main.o: $(outdir)/BLURB.hh diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 28fc85fa65..69b9a4f6ed 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -194,7 +194,6 @@ Auto_beam_engraver::create_beam_p () */ if ((*stem_l_arr_p_)[i]->beam_l_) { - delete beam_p; return 0; } beam_p->add_stem ((*stem_l_arr_p_)[i]); diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 84ada321e8..2aa4904054 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -6,13 +6,14 @@ (c) 1997, 1998, 1999 Han-Wen Nienhuys Jan Nieuwenhuizen */ + #include "score-engraver.hh" #include "bar-engraver.hh" #include "staff-bar.hh" #include "musical-request.hh" #include "multi-measure-rest.hh" #include "command-request.hh" -#include "time-description.hh" +#include "timing-engraver.hh" #include "engraver-group-engraver.hh" #include "warn.hh" @@ -22,20 +23,6 @@ Bar_engraver::Bar_engraver() do_post_move_processing(); } -bool -Bar_engraver::do_try_music (Music*r_l) -{ - if (Bar_req * b= dynamic_cast (r_l)) - { - if (bar_req_l_ && bar_req_l_->equal_b (b)) // huh? - return false; - - bar_req_l_ = b; - return true; - } - - return false; -} @@ -68,7 +55,7 @@ Bar_engraver::create_bar () bar_p_->set_elt_property (bar_size_scm_sym, gh_double2scm (Real(prop))); } - announce_element (Score_element_info (bar_p_, bar_req_l_)); + announce_element (Score_element_info (bar_p_, 0)); } } @@ -103,8 +90,6 @@ Bar_engraver::request_bar (String requested_type) void Bar_engraver::do_creation_processing () { - create_bar (); - bar_p_->type_str_ = ""; } void @@ -120,26 +105,15 @@ Bar_engraver::do_removal_processing () void Bar_engraver::do_process_requests() { - Time_description const *time = get_staff_info().time_C_; - if (bar_req_l_) - { - create_bar (); - bar_p_->type_str_ = bar_req_l_->type_str_; - } - else if (!now_mom ()) - { - create_bar (); - bar_p_->type_str_ = "|"; - } - else + Translator * t = daddy_grav_l ()->get_simple_translator ("Timing_engraver"); + + Timing_engraver * te = dynamic_cast(t); + String which = (te) ? te->which_bar () : ""; + + if (which.length_i ()) { - Scalar nonauto = get_property ("barNonAuto", 0); - if (!nonauto.to_bool ()) - { - Scalar always = get_property ("barAlways", 0); - if ((time && !time->whole_in_measure_) || always.to_bool ()) - create_bar (); - } + create_bar(); + bar_p_->type_str_ = which; } if (!bar_p_) @@ -169,14 +143,6 @@ Bar_engraver::do_pre_move_processing() } } -void -Bar_engraver::do_post_move_processing() -{ - bar_req_l_ = 0; -} - - - ADD_THIS_TRANSLATOR(Bar_engraver); diff --git a/lily/bar-req-collect-engraver.cc b/lily/bar-req-collect-engraver.cc new file mode 100644 index 0000000000..2eafaed254 --- /dev/null +++ b/lily/bar-req-collect-engraver.cc @@ -0,0 +1,11 @@ +/* + bar-req-collect-engraver.cc -- implement Bar_req_collect_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#include "command-request.hh" + diff --git a/lily/bar.cc b/lily/bar.cc index 95ffc72519..f21d68fbac 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -76,7 +76,7 @@ Bar::do_pre_processing () break; } } - if (remove_elt_property (at_line_start_scm_sym)!= SCM_BOOL_F + if (remove_elt_property (at_line_start_scm_sym) != SCM_BOOL_F // UGR. && (break_status_dir () == RIGHT) && (type_str_ == "")) { type_str_ = "|"; diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index b34d329d94..5ba4ed9306 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -110,7 +110,7 @@ Beam_engraver::do_process_requests () prop = get_property ("autoInterstaffKneeGap", 0); if (prop.isnum_b ()) beam_p_->set_elt_property (auto_interstaff_knee_gap_scm_sym, gh_int2scm( prop)); - + prop = get_property ("beamquantisation", 0); if (prop.isnum_b ()) beam_p_->quantisation_ = (Beam::Quantisation)(int)prop; diff --git a/lily/beam.cc b/lily/beam.cc index 92a92050a2..83d83260ae 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -273,13 +273,12 @@ Beam::get_default_dir () const [Ross] states that the majority of the notes dictates the direction (and not the mean of "center distance") - But is that because it really looks better, or because he - wants to provide some real simple hands-on rules. + But is that because it really looks better, or because he wants + to provide some real simple hands-on rules? We have our doubts, so we simply provide all sensible alternatives. - If dir is not determined: up (see stem::get_default_dir ()) - */ + If dir is not determined: up (see stem::get_default_dir ()) */ Direction beam_dir; Direction neutral_dir = (Direction)(int)paper_l ()->get_var ("stem_default_neutral_direction"); @@ -338,7 +337,6 @@ void Beam::solve_slope () { assert (sinfo_.size () > 1); - DEBUG_OUT << "Beam::solve_slope: \n"; Least_squares l; for (int i=0; i < sinfo_.size (); i++) @@ -357,8 +355,8 @@ Beam::check_stemlengths_f (bool set_b) { Real interbeam_f = paper_l ()->interbeam_f (multiple_i_); - Real beam_f = paper_l ()->beam_thickness_f (); - Real staffline_f = paper_l ()->rule_thickness (); + Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);; + Real staffline_f = paper_l ()-> get_var ("stafflinethickness"); Real epsilon_f = staffline_f / 8; Real dy_f = 0.0; for (int i=0; i < sinfo_.size (); i++) @@ -524,8 +522,8 @@ Beam::quantise_dy () Real interline_f = stems_[0]->staff_line_leading_f (); Real internote_f = interline_f / 2; - Real staffline_f = paper_l ()->rule_thickness (); - Real beam_f = paper_l ()->beam_thickness_f (); + Real staffline_f = paper_l ()->get_var ("stafflinethickness"); + Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);; Real dx_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f (); @@ -550,9 +548,6 @@ Beam::quantise_dy () slope_f_ = (quanty_f / dx_f) / internote_f * sign (slope_f_); } -static int test_pos = 0; - - /* Prevent interference from stafflines and beams. See Documentation/tex/fonts.doc @@ -566,7 +561,7 @@ Beam::quantise_left_y (bool extend_b) if extend_b then stems must *not* get shorter */ - if (quantisation_ <= NONE) + if (quantisation_ == NONE) return; /* @@ -582,8 +577,8 @@ Beam::quantise_left_y (bool extend_b) Real space = stems_[0]->staff_line_leading_f (); Real internote_f = space /2; - Real staffline_f = paper_l ()->rule_thickness (); - Real beam_f = paper_l ()->beam_thickness_f (); + Real staffline_f = paper_l ()->get_var ("stafflinethickness"); + Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);; /* [TODO] @@ -593,7 +588,6 @@ Beam::quantise_left_y (bool extend_b) Real straddle = 0; Real sit = beam_f / 2 - staffline_f / 2; - Real inter = space / 2; Real hang = space - beam_f / 2 + staffline_f / 2; /* @@ -604,7 +598,8 @@ Beam::quantise_left_y (bool extend_b) For simplicity, we'll assume dir = UP and correct if dir = DOWN afterwards. */ - + // isn't this asymmetric ? --hwn + // dim(left_y_) = internote Real dy_f = dir_ * left_y_ * internote_f; @@ -612,51 +607,26 @@ Beam::quantise_left_y (bool extend_b) Real beamdy_f = beamdx_f * slope_f_ * internote_f; Array allowed_position; - if (quantisation_ != TEST) + if (quantisation_ <= NORMAL) { - if (quantisation_ <= NORMAL) - { - if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2)) - allowed_position.push (straddle); - if ((multiple_i_ <= 1) || (abs (beamdy_f) >= staffline_f / 2)) - allowed_position.push (sit); - allowed_position.push (hang); - } - else - // TODO: check and fix TRADITIONAL - { - if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2)) - allowed_position.push (straddle); - if ((multiple_i_ <= 1) && (beamdy_f <= staffline_f / 2)) - allowed_position.push (sit); - if (beamdy_f >= -staffline_f / 2) - allowed_position.push (hang); - } + if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2)) + allowed_position.push (straddle); + if ((multiple_i_ <= 1) || (abs (beamdy_f) >= staffline_f / 2)) + allowed_position.push (sit); + allowed_position.push (hang); } else + // TODO: check and fix TRADITIONAL { - if (test_pos == 0) - { - allowed_position.push (hang); - cout << "hang" << hang << "\n"; - } - else if (test_pos==1) - { + if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2)) allowed_position.push (straddle); - cout << "straddle" << straddle << endl; - } - else if (test_pos==2) - { + if ((multiple_i_ <= 1) && (beamdy_f <= staffline_f / 2)) allowed_position.push (sit); - cout << "sit" << sit << endl; - } - else if (test_pos==3) - { - allowed_position.push (inter); - cout << "inter" << inter << endl; - } + if (beamdy_f >= -staffline_f / 2) + allowed_position.push (hang); } + Interval iv = quantise_iv (allowed_position, space, dy_f); Real quanty_f = dy_f - iv[SMALLER] <= iv[BIGGER] - dy_f ? iv[SMALLER] : iv[BIGGER]; @@ -670,14 +640,14 @@ Beam::quantise_left_y (bool extend_b) void Beam::set_stemlens () { - Real staffline_f = paper_l ()->rule_thickness (); + Real staffline_f = paper_l ()->get_var ("stafflinethickness"); // enge floots Real epsilon_f = staffline_f / 8; // je bent zelf eng --hwn. Real dy_f = check_stemlengths_f (false); - for (int i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) // 2 ? { left_y_ += dy_f * dir_; quantise_left_y (dy_f); @@ -687,9 +657,6 @@ Beam::set_stemlens () break; } } - - test_pos++; - test_pos %= 4; } void @@ -730,6 +697,8 @@ Beam::do_add_processing () /* beams to go with one stem. + + clean me up. */ Molecule Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const @@ -738,16 +707,15 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const (prev && !(prev->hpos_f () < here->hpos_f ()))) programming_error ("Beams are not left-to-right"); - Real staffline_f = paper_l ()->rule_thickness (); + Real staffline_f = paper_l ()->get_var ("stafflinethickness"); Real interbeam_f = paper_l ()->interbeam_f (multiple_i_); Real internote_f = here->staff_line_leading_f ()/2; - Real beam_f = paper_l ()->beam_thickness_f (); + Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);; Real dy = interbeam_f; Real stemdx = staffline_f; Real sl = slope_f_* internote_f; - lookup_l ()->beam (sl, 20 PT, 1 PT); Molecule leftbeams; Molecule rightbeams; @@ -759,7 +727,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const else if (here->type_i ()== 1) nw_f = paper_l ()->get_var ("wholewidth"); else if (here->type_i () == 2) - nw_f = paper_l ()->note_width () * 0.8; + nw_f = paper_l ()->get_var ("notewidth") * 0.8; else nw_f = paper_l ()->get_var ("quartwidth"); diff --git a/lily/bezier.cc b/lily/bezier.cc index 7a7a1f6833..9acb9004e9 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -33,7 +33,7 @@ /* - UGH. Clean up debugging junk. + UGH. Remove debugging junk. */ @@ -232,7 +232,6 @@ Bezier_bow::calc_f (Real height) { transform (); calc_default (height); - calc_bezier (); Real dy = check_fit_f (); diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index fd5955fc38..40d7b84e97 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -31,7 +31,7 @@ Break_algorithm::find_break_indices () const if (all[i]->breakable_b ()) retval.push (i); - if (linelength <=0) + if (linewidth_f_ <=0) while (retval.size () >2) retval.del (1); @@ -49,7 +49,7 @@ Break_algorithm::find_breaks () const if (all[i]->breakable_b ()) retval.push (all[i]); - if (linelength <=0) + if (linewidth_f_ <=0) while (retval.size () >2) retval.del (1); @@ -86,31 +86,18 @@ Break_algorithm::generate_spacing_problem (Line_of_cols curline, Interval line) Break_algorithm::Break_algorithm () { pscore_l_ = 0; - linelength = 0; + linewidth_f_ = 0; } void Break_algorithm::set_pscore (Paper_score*s) { pscore_l_ = s; - linelength = s->paper_l_->linewidth_f (); + linewidth_f_ = s->paper_l_->get_var("linewidth"); do_set_pscore (); } -bool -Break_algorithm::feasible (Line_of_cols curline) const -{ - if (linelength <= 0) - return true; - for (int i=0; i < curline.size (); i++) - { - if (i && i < curline.size () -1 - && ((dynamic_cast(curline[i]))->break_penalty_i () >= Break_req::FORCE)) - return false; - } - return true; -} void Break_algorithm::problem_OK () const diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index a391411db9..32e573a68c 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -139,8 +139,6 @@ Break_align_item::do_pre_processing() } - - Break_align_item::Break_align_item () { stacking_dir_ = RIGHT; diff --git a/lily/collision.cc b/lily/collision.cc index c5424710cd..c8e97cc998 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -33,7 +33,7 @@ Collision::do_pre_processing() Array hand (forced_shift ()); Link_array done; - Real wid = paper_l ()->note_width (); + Real wid = paper_l ()->get_var ("collision_note_width"); for (int i=0; i < hand.size (); i++) { hand[i].e1_->translate_axis (hand[i].e2_ *wid, X_AXIS); diff --git a/lily/column-x-positions.cc b/lily/column-x-positions.cc index 91c616fcb0..eb4c983701 100644 --- a/lily/column-x-positions.cc +++ b/lily/column-x-positions.cc @@ -7,7 +7,6 @@ */ #include "column-x-positions.hh" -#include "simple-spacer.hh" // ugh #include "real.hh" #include "debug.hh" @@ -15,7 +14,6 @@ Column_x_positions::Column_x_positions() { energy_f_ = infinity_f; satisfies_constraints_b_ = false; - spacer_l_ =0; } Column_x_positions::~Column_x_positions() @@ -23,11 +21,6 @@ Column_x_positions::~Column_x_positions() } -void -Column_x_positions::add_paper_column (Paper_column*c) -{ - cols_.push (c); -} void Column_x_positions::print() const diff --git a/lily/command-request.cc b/lily/command-request.cc index ce13bab7fe..35f0cdac4c 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -157,7 +157,6 @@ Key_change_req::Key_change_req () Break_req::Break_req () { - penalty_i_ = 0; } Mark_req::Mark_req (String s) diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 8257150872..01f2ba5a77 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -52,7 +52,7 @@ Crescendo::get_symbol () const bool continued = broken[Direction (-grow_dir_)]; - Real height = paper_l()->staffheight_f () / 6; + Real height = paper_l()->get_var ("crescendo_height"); Real thick = paper_l ()->get_var ("crescendo_thickness"); return Molecule (lookup_l ()->hairpin (w_dim, height, thick, grow_dir_ < 0, continued)); diff --git a/lily/cross-staff.cc b/lily/cross-staff.cc new file mode 100644 index 0000000000..47300e660d --- /dev/null +++ b/lily/cross-staff.cc @@ -0,0 +1,44 @@ +#include "cross-staff.hh" +#include "item.hh" +#include "align-element.hh" +#include "spanner.hh" +#include "warn.hh" + +Real +calc_interstaff_dist (Item const *item, Spanner const *span) +{ + Real interstaff = 0.0; + Graphical_element *common = item->common_refpoint (span, Y_AXIS); + Align_element * align = dynamic_cast (common); + if (align && align->axis() == Y_AXIS) + { + if (align->threshold_interval_[MIN] != + align->threshold_interval_[MAX]) + warning (_ ("minVerticalAlign != maxVerticalAlign: cross staff spanners may be broken")); + + interstaff = align->threshold_interval_[MIN]; + + Graphical_element const * span_refpoint = span; + while (span_refpoint->parent_l (Y_AXIS) != common) + span_refpoint = span_refpoint->parent_l (Y_AXIS); + + Graphical_element const * note_refpoint = item; + while (note_refpoint->parent_l (Y_AXIS) != common) + note_refpoint = note_refpoint->parent_l (Y_AXIS); + + int span_prio = + align->get_priority ((Score_element*) dynamic_cast (span_refpoint)); + int item_prio = + align->get_priority ((Score_element*) dynamic_cast (note_refpoint)); + + /* + our staff is lower -> interstaff *= -1 + */ + + if (span_prio < item_prio) + interstaff *= -1; + return interstaff; + } + else return 0.0; +} + diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc deleted file mode 100644 index aebad06539..0000000000 --- a/lily/encompass-info.cc +++ /dev/null @@ -1,92 +0,0 @@ -/* - encompass-info.cc -- implement Encompass_info - - source file of the GNU LilyPond music typesetter - - (c) 1998--1999 Jan Nieuwenhuizen - -*/ -#include "dimension-cache.hh" -#include "proto.hh" -#include "stem.hh" -#include "note-column.hh" -#include "paper-def.hh" -#include "encompass-info.hh" -#include "slur.hh" -#include "staff-symbol.hh" -#include "note-head.hh" -#include "debug.hh" -#include "align-element.hh" - -Encompass_info::Encompass_info () -{ -} - -Encompass_info::Encompass_info (Note_column const* note_column, Direction dir, Slur const* slur_l) -{ - interstaff_f_ = 0; - - Stem* stem_l = note_column->stem_l_; - if (!stem_l) - { - warning (_ ("Slur over rest?")); - o_[X_AXIS] = note_column->hpos_f (); - o_[Y_AXIS] = note_column->extent (Y_AXIS)[dir]; - return; - } - - o_[X_AXIS] = stem_l->hpos_f (); - - /* - Simply set x to middle of notehead - */ - - o_[X_AXIS] -= 0.5 * stem_l->dir_ * note_column->extent (X_AXIS).length (); - - if ((stem_l->dir_ == dir) - && !stem_l->extent (Y_AXIS).empty_b ()) - { - o_[Y_AXIS] = stem_l->extent (Y_AXIS)[dir]; - } - else - { - o_[Y_AXIS] = note_column->extent (Y_AXIS)[dir]; - } - - /* - leave a gap: slur mustn't touch head/stem - */ - o_[Y_AXIS] += dir * slur_l->paper_l ()->get_var ("slur_y_free"); - - Graphical_element *common = stem_l->common_refpoint (slur_l, Y_AXIS); - Align_element * align = dynamic_cast (common); - if (align && align->axis() == Y_AXIS) - { - if (align->threshold_interval_[MIN] != - align->threshold_interval_[MAX]) - warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff beams/slurs may be broken")); - - interstaff_f_ = align->threshold_interval_[MIN]; - - Graphical_element const * slur_refpoint = slur_l; - while (slur_refpoint->parent_l (Y_AXIS) != common) - slur_refpoint = slur_refpoint->parent_l (Y_AXIS); - - Graphical_element const * note_refpoint = note_column; - while (note_refpoint->parent_l (Y_AXIS) != common) - note_refpoint = note_refpoint->parent_l (Y_AXIS); - - int slur_prio = - align->get_priority ((Score_element*) dynamic_cast (slur_refpoint)); - int stem_prio = - align->get_priority ((Score_element*) dynamic_cast (note_refpoint)); - - /* - our staff is lower -> interstaff_f_ *= -1 - */ - - if (slur_prio < stem_prio) - interstaff_f_ *= -1; - o_[Y_AXIS] += interstaff_f_; - } -} diff --git a/lily/engraver.cc b/lily/engraver.cc index f8ed5e5d6a..6121e82eb1 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -12,6 +12,7 @@ #include "engraver-group-engraver.hh" #include "debug.hh" #include "paper-def.hh" +#include "score-element.hh" void Engraver::fill_staff_info (Staff_info&) diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index dc7f4c22aa..2cedcea834 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -61,7 +61,7 @@ void Extender_spanner::do_post_processing () { // UGH - Real nw_f = paper_l ()->note_width () * 0.8; + Real gap = paper_l ()->get_realvar (interline_scm_sym); Direction d = LEFT; do @@ -71,7 +71,7 @@ Extender_spanner::do_post_processing () if (d == LEFT) dx_f_drul_[d] += t->extent (X_AXIS).length (); else - dx_f_drul_[d] -= d * nw_f / 2; + dx_f_drul_[d] -= d * gap / 2; } while (flip(&d) != LEFT); } diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 533092aeee..63a6adc624 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -72,29 +72,17 @@ Gourlay_breaking::do_solve () const */ int minimal_start_idx = -1; Column_x_positions minimal_sol; + Column_x_positions backup_sol; + Real minimal_demerits = infinity_f; for (int start_idx = break_idx; start_idx--;) { -#if 0 - if (break_idx - start_idx > max_measures_i_) - break; -#endif - - if (optimal_paths[start_idx].prev_break_i_ < 0 - && optimal_paths[start_idx].line_config_.energy_f_) - continue; - - - Line_of_cols line = all.slice (breaks[start_idx], breaks[break_idx]+1); line[0] = dynamic_cast(line[0]->find_broken_piece (RIGHT)); line.top () = dynamic_cast(line.top ()->find_broken_piece (LEFT)); - if (!feasible (line)) - break; - Column_x_positions cp; cp.cols_ = line; @@ -103,13 +91,19 @@ Gourlay_breaking::do_solve () const Simple_spacer * sp = generate_spacing_problem (line, line_dims); sp->solve (&cp); delete sp; - + + if (start_idx == break_idx - 1) + backup_sol = cp; // in case everything fucks up if (!cp.satisfies_constraints_b_) break; - Real this_demerits - = combine_demerits (optimal_paths[start_idx].line_config_, cp) - + optimal_paths[start_idx].demerits_f_; + + Real this_demerits; + if (optimal_paths[start_idx].demerits_f_ >= infinity_f) + this_demerits = infinity_f; + else + this_demerits = combine_demerits (optimal_paths[start_idx].line_config_, cp) + + optimal_paths[start_idx].demerits_f_; if (this_demerits < minimal_demerits) { @@ -119,19 +113,20 @@ Gourlay_breaking::do_solve () const } } + int prev =break_idx - 1; if (minimal_start_idx < 0) { - optimal_paths[break_idx].prev_break_i_ = -1; - optimal_paths[break_idx].line_config_.energy_f_ = infinity_f; + optimal_paths[break_idx].demerits_f_ = infinity_f; + optimal_paths[break_idx].line_config_ = backup_sol; } else { - optimal_paths[break_idx].prev_break_i_ = minimal_start_idx; + prev = minimal_start_idx; optimal_paths[break_idx].line_config_ = minimal_sol; optimal_paths[break_idx].demerits_f_ = minimal_demerits; - optimal_paths[break_idx].line_i_ = - optimal_paths[minimal_start_idx].line_i_ + 1; } + optimal_paths[break_idx].prev_break_i_ = prev; + optimal_paths[break_idx].line_i_ = optimal_paths[prev].line_i_ + 1; if (! (break_idx % HAPPY_DOTS_I)) *mlog << "[" << break_idx << "]" << flush; @@ -150,17 +145,14 @@ Gourlay_breaking::do_solve () const for (int i = optimal_paths.size ()-1; i> 0;) { final_breaks.push (i); - assert (i > optimal_paths[i].prev_break_i_); - - // there was no "feasible path" - if (!optimal_paths[i].line_config_.config_.size ()) { - final_breaks.set_size (0); - break; - } - i = optimal_paths[i].prev_break_i_; + int prev = optimal_paths[i].prev_break_i_; + assert (i > prev); + i = prev; } - + if (optimal_paths.top ().demerits_f_ >= infinity_f) + warning (_ ("No feasible line breaking found")); + for (int i= final_breaks.size (); i--;) lines.push (optimal_paths[final_breaks[i]].line_config_); @@ -188,5 +180,17 @@ Real Gourlay_breaking::combine_demerits (Column_x_positions const &prev, Column_x_positions const &this_one) const { - return abs (this_one.force_f_) + abs (prev.force_f_ - this_one.force_f_); + Real break_penalties = 0.0; + Paper_column * pc = this_one.cols_.top (); + if (pc->original_l_) + { + SCM pen = pc->get_elt_property (penalty_scm_sym); + if (pen != SCM_BOOL_F) + { + break_penalties += gh_scm2double (SCM_CDR(pen)); + } + } + + return abs (this_one.force_f_) + abs (prev.force_f_ - this_one.force_f_) + + break_penalties; } diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index 990c24884b..86c840e7eb 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -71,7 +71,7 @@ void Hyphen_spanner::do_post_processing () { // UGH - Real nw_f = paper_l ()->note_width () * 0.8; + Real gap = paper_l ()->get_realvar (interline_scm_sym); Direction d = LEFT; do @@ -81,7 +81,7 @@ Hyphen_spanner::do_post_processing () if (d == LEFT) dx_f_drul_[d] += t->extent (X_AXIS).length (); else - dx_f_drul_[d] -= d * nw_f / 2; + dx_f_drul_[d] -= d * gap / 2; } while (flip(&d) != LEFT); } diff --git a/lily/include/bar-engraver.hh b/lily/include/bar-engraver.hh index bbb26c7c70..64f0063470 100644 --- a/lily/include/bar-engraver.hh +++ b/lily/include/bar-engraver.hh @@ -26,15 +26,13 @@ public: protected: virtual void do_creation_processing (); virtual void do_removal_processing (); - virtual bool do_try_music (Music *req_l); virtual void do_process_requests(); virtual void do_pre_move_processing(); - virtual void do_post_move_processing(); + private: void create_bar (); - Bar_req * bar_req_l_; Bar * bar_p_; }; diff --git a/lily/include/bar-req-collector-engraver.hh b/lily/include/bar-req-collector-engraver.hh new file mode 100644 index 0000000000..126d2e0404 --- /dev/null +++ b/lily/include/bar-req-collector-engraver.hh @@ -0,0 +1,26 @@ +/* + bar-req-collect-engraver.hh -- declare + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef BAR_REQ_COLLECT_ENGRAVER_HH +#define BAR_REQ_COLLECT_ENGRAVER_HH + +#include "engraver.hh" +class Bar_req_collect_engraver : public Engraver +{ + Bar_req* bar_req_l_; +public: + VIRTUAL_COPY_CONS(Translator); + void do_post_move_processing (); + bool do_try_music (Music *); +}; + + + +#endif /* Bar_Req_COLLECT_ENGRAVER_HH */ + diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 145bbddce0..9e1cbb8346 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -31,7 +31,7 @@ public: The beams should be prevented to conflict with the stafflines, especially at small slopes. */ - enum Quantisation { NONE, NORMAL, TRADITIONAL, TEST }; + enum Quantisation { NONE, NORMAL, TRADITIONAL }; enum Dir_algorithm { /* DOWN=-1, UP=1, */ MAJORITY=2, MEAN, MEDIAN }; Link_array stems_; diff --git a/lily/include/break-algorithm.hh b/lily/include/break-algorithm.hh index e0548adf9e..8a25d7b554 100644 --- a/lily/include/break-algorithm.hh +++ b/lily/include/break-algorithm.hh @@ -25,7 +25,7 @@ class Break_algorithm { protected: Paper_score *pscore_l_; - Real linelength; + Real linewidth_f_; /// search all pcols which are breakable. Line_of_cols find_breaks() const; diff --git a/lily/include/column-x-positions.hh b/lily/include/column-x-positions.hh index 1048751401..d124535153 100644 --- a/lily/include/column-x-positions.hh +++ b/lily/include/column-x-positions.hh @@ -13,7 +13,7 @@ typedef Link_array Line_of_cols; struct Column_x_positions { - Simple_spacer * spacer_l_; + Line_of_cols cols_; Array config_; @@ -23,7 +23,6 @@ struct Column_x_positions { ~Column_x_positions(); Column_x_positions(); - void add_paper_column (Paper_column*c); void print() const; }; diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index b7a29e0f11..ee64d1fe27 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -18,8 +18,7 @@ class Break_req : public Request { public: - enum { DISALLOW = -10000, FORCE = 10000 }; - int penalty_i_; + Real penalty_f_; Break_req (); protected: VIRTUAL_COPY_CONS(Music); diff --git a/lily/include/cross-staff.hh b/lily/include/cross-staff.hh new file mode 100644 index 0000000000..9fdfb97f84 --- /dev/null +++ b/lily/include/cross-staff.hh @@ -0,0 +1,17 @@ +/* + cross-staff.hh -- declare cross staff calc funcs. + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef CROSS_STAFF_HH +#define CROSS_STAFF_HH +#include "lily-proto.hh" +Real +calc_interstaff_dist (Item const *item, Spanner const *span); + +#endif /* CROSS_STAFF_HH */ + diff --git a/lily/include/encompass-info.hh b/lily/include/encompass-info.hh deleted file mode 100644 index 04caf77102..0000000000 --- a/lily/include/encompass-info.hh +++ /dev/null @@ -1,27 +0,0 @@ -/* - encompass-info.hh -- declare Encompass_info - - source file of the GNU LilyPond music typesetter - - (c) 1998--1999 Jan Nieuwenhuizen - -*/ - -#ifndef ENCOMPASS_INFO_HH -#define ENCOMPASS_INFO_HH - -#include "lily-proto.hh" -#include "direction.hh" -#include "offset.hh" - -struct Encompass_info -{ - Encompass_info (); - Encompass_info (Note_column const*, Direction, Slur const *); - - Offset o_; - // junkme - Real interstaff_f_; -}; - -#endif // ENCOMPASS_INFO_HH diff --git a/lily/include/ly-symbols.hh b/lily/include/ly-symbols.hh index 521fa3d06e..f0f3dd098d 100644 --- a/lily/include/ly-symbols.hh +++ b/lily/include/ly-symbols.hh @@ -64,6 +64,7 @@ DECLARE_LY_SYMBOL(octave_dir); DECLARE_LY_SYMBOL(origin); DECLARE_LY_SYMBOL(output); DECLARE_LY_SYMBOL(padding); +DECLARE_LY_SYMBOL(penalty); DECLARE_LY_SYMBOL(pianobrace); DECLARE_LY_SYMBOL(placebox); DECLARE_LY_SYMBOL(rulesym); diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index f7d9c061e3..d5ca0e0560 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -28,6 +28,8 @@ class Music_iterator { Interpretation_context_handle handle_; protected: + bool playback_b_; // Should use SCMs + Music const * music_l_; /// ugh. JUNKME @@ -73,9 +75,9 @@ public: void set_translator (Translator_group*); /** Get an iterator matching the type of MUS, and use TRANS to find - an accompanying translation unit - */ - static Music_iterator* static_get_iterator_p (Music const* mus); + an accompanying translation unit. Repeated music can be fully + unfolded by setting PLAYING */ + static Music_iterator* static_get_iterator_p (Music const* mus, bool playing); void init_translator (Music const *, Translator_group *); Music_iterator(); diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 77942e8027..8615d9cf86 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -30,20 +30,18 @@ add support for multiple fontsizes - + remove all utility funcs add support for other len->wid conversions. - Input_engraver should be in here. - Interesting variables: /// The distance between lines interline - */ +*/ class Paper_def : public Music_output_def { Hash_table *lookup_p_tab_p_; @@ -54,7 +52,6 @@ protected: public: virtual ~Paper_def (); - Array shape_int_a_; Real get_realvar (SCM symbol) const; @@ -67,26 +64,13 @@ public: void set_lookup (int, Lookup*); Paper_def (Paper_def const&); - /// The distance between beams of multiplicity_i + /** The distance between beams of multiplicity_i + JUNKME + */ Real interbeam_f (int multiplicity_i) const; - /// The thickness of a beam - Real beam_thickness_f () const; - - /// thickness of the standard line - Real rule_thickness () const; - - /// thickness of the staff line - Real staffline_f () const; - Interval line_dimensions_int (int) const; - Real linewidth_f () const; - - /// height of the staff - Real staffheight_f () const; - /// width of a crotchet ball - Real note_width () const; void print () const; Lookup const * lookup_l (int sz) const; // TODO naming @@ -95,9 +79,10 @@ public: influence using the geometric_ and paratime_signatures. */ Real length_mom_to_dist (Moment, Real) const; - Real geometric_spacing (Moment) const; + Real arithmetic_constant (Moment minimal_mom) const; Real arithmetic_spacing (Moment mom,Real constant) const; + virtual int get_next_default_count () const; static void reset_default_count(); diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index c17afddfee..7fad9b8b32 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -23,14 +23,7 @@ class Paper_score : public Music_output { - /// crescs etc; no particular order - Link_array span_p_arr_; - - /// other elements - Link_array elem_p_arr_; - Link_array break_helpers_arr_; - - SCM protected_scms_; + SCM element_smob_list_; public: Paper_def *paper_l_; diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index 9c2097367e..eff9441bf3 100644 --- a/lily/include/score-column.hh +++ b/lily/include/score-column.hh @@ -26,16 +26,11 @@ */ class Score_column : public Paper_column { - friend class Score; - friend class Score_engraver; - - int break_penalty_i_; Moment when_; public: Moment shortest_playing_mom_; Moment shortest_starter_mom_; - int break_penalty_i () { return break_penalty_i_; } VIRTUAL_COPY_CONS(Score_element); diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index af9b484faa..25a30532ff 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -35,8 +35,6 @@ Boolean (true iff defined) */ class Score_element : public virtual Graphical_element { - - friend class Paper_score; /** properties specific for this element. Destructor will not call scm_unprotect, so as to allow more flexible GC arrangements. The @@ -82,7 +80,6 @@ public: Paper_def *paper_l () const; Lookup const *lookup_l () const; - virtual ~Score_element (); void add_processing (); void substitute_dependency (Score_element*,Score_element*); @@ -108,6 +105,12 @@ public: virtual Score_element *find_broken_piece (Line_of_score*) const; protected: + + /** + Junk score element. This is protected because this is supposed to + be handled by GUILE gc. */ + virtual ~Score_element (); + Score_element* dependency (int) const; int dependency_size () const; @@ -144,6 +147,14 @@ protected: virtual Link_array get_extra_dependencies () const; static Interval dim_cache_callback (Dimension_cache*); +public: + SCM smobify_self (); + static SCM mark_smob (SCM); + static scm_sizet free_smob (SCM s); + static int print_smob (SCM s, SCM p, scm_print_state*); + static long smob_tag; + static void init_smobs(); + SCM self_scm_; }; diff --git a/lily/include/score-engraver.hh b/lily/include/score-engraver.hh index e98e002681..2851980e05 100644 --- a/lily/include/score-engraver.hh +++ b/lily/include/score-engraver.hh @@ -20,7 +20,6 @@ class Score_engraver : public Engraver_group_engraver, public Global_translator { Line_of_score * scoreline_l_; - int break_penalty_i_; int breaks_i_; Link_array elem_p_arr_; diff --git a/lily/include/slur.hh b/lily/include/slur.hh index bf61df4b86..2fb4b5ede4 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -15,12 +15,14 @@ */ class Slur : public Bow { + int cross_staff_count () const; + Offset encompass_offset (Note_column const* )const; public: Slur (); VIRTUAL_COPY_CONS(Score_element); void add_column (Note_column*); - + Link_array encompass_arr_; protected: diff --git a/lily/include/timing-engraver.hh b/lily/include/timing-engraver.hh index 00d55c5a46..99621579ec 100644 --- a/lily/include/timing-engraver.hh +++ b/lily/include/timing-engraver.hh @@ -18,9 +18,14 @@ */ class Timing_engraver : public Timing_translator, public Engraver { + + Bar_req * bar_req_l_; protected: virtual void fill_staff_info (Staff_info&); + virtual bool do_try_music (Music * ); + virtual void do_post_move_processing (); public: + String which_bar (); VIRTUAL_COPY_CONS(Translator); }; diff --git a/lily/include/unfolded-repeat-iterator.hh b/lily/include/unfolded-repeat-iterator.hh index 22888cf29a..71adef6598 100644 --- a/lily/include/unfolded-repeat-iterator.hh +++ b/lily/include/unfolded-repeat-iterator.hh @@ -24,6 +24,9 @@ public: */ int done_count_; + + /// unfold everything, or do volta? + bool full_unfold_b_; /// are we busy doing the body? bool do_main_b_; diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index b2017c27af..311397cdd8 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -169,10 +169,13 @@ init_functions () } extern void init_symbols (); +extern void init_smobs (); // guh -> .hh + void init_lily_guile () { init_symbols(); init_functions (); + init_smobs (); } diff --git a/lily/lookup.cc b/lily/lookup.cc index 0e76c6849d..1000f37ab6 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -424,8 +424,12 @@ Lookup::text (String style, String text, Paper_def *paper_l) const brace_count ++; else if (text[i] == '}') brace_count --; - Character_metric *c = (Character_metric*)afm_l->get_char ((unsigned char)text[i],false); + Character_metric *c = (Character_metric*)afm_l-> + get_char ((unsigned char)text[i],false); + // Ugh, use the width of 'x' for unknown characters + if (c->dimensions()[X_AXIS].length () == 0) + c = (Character_metric*)afm_l->get_char ((unsigned char)'x',false); w += c->dimensions()[X_AXIS].length (); ydims.unite (c->dimensions()[Y_AXIS]); } diff --git a/lily/main.cc b/lily/main.cc index f4ad427ab9..c4062cb1a4 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -94,7 +94,11 @@ usage () cout << _ ("Typeset music and or play MIDI from FILE"); cout << "\n\n"; cout << -#include "BLURB.hh" +_( +"LilyPond is a music typesetter. It produces beautiful sheet music\n" +"using a high level description file as input. LilyPond is part of \n" +"the GNU Project.\n" +); cout << '\n'; cout << _ ("Options:"); diff --git a/lily/midi-def.cc b/lily/midi-def.cc index 5bda659f5d..47899ae066 100644 --- a/lily/midi-def.cc +++ b/lily/midi-def.cc @@ -59,10 +59,10 @@ void Midi_def::print() const { #ifndef NPRINT + DEBUG_OUT << "MIDI {\n"; Music_output_def::print (); - DEBUG_OUT << "Midi {"; DEBUG_OUT << "4/min: " << Moment (60) / (whole_in_seconds_mom_ * Moment (4)); - DEBUG_OUT << "}\n"; + DEBUG_OUT << "}\n"; #endif } diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 9de2bb6af7..e5774c9f32 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -114,7 +114,7 @@ Music_iterator::ok() const } Music_iterator* -Music_iterator::static_get_iterator_p (Music const *m) +Music_iterator::static_get_iterator_p (Music const *m, bool playing) { Music_iterator * p =0; @@ -142,14 +142,15 @@ Music_iterator::static_get_iterator_p (Music const *m) p = new Music_wrapper_iterator; else if (Repeated_music const * n = dynamic_cast (m)) { - if (n->fold_b_) + if (n->fold_b_ && !playing) p = new Folded_repeat_iterator; else p = new Unfolded_repeat_iterator; } else assert (0); - + + p->playback_b_ = playing; p->music_l_ = m; return p; @@ -176,7 +177,7 @@ Music_iterator::init_translator (Music const *m, Translator_group *report_l) Music_iterator* Music_iterator::get_iterator_p (Music const*m) const { - Music_iterator*p = static_get_iterator_p (m); + Music_iterator*p = static_get_iterator_p (m, playback_b_); p->init_translator (m, report_to_l()); p->construct_children(); @@ -185,6 +186,7 @@ Music_iterator::get_iterator_p (Music const*m) const Music_iterator::Music_iterator() { + playback_b_ = false; first_b_ = true; } diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 620bbb660f..dc99d4d87b 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -108,10 +108,10 @@ Paper_def::line_dimensions_int (int n) const { if (!shape_int_a_.size ()) { - if (n) - return Interval (0, linewidth_f ()); - else - return Interval (get_var ("indent"), linewidth_f ()); + Real lw = get_realvar (linewidth_scm_sym); + Real ind = n? 0.0:get_var ("indent"); + + return Interval (ind, lw); } if (n >= shape_int_a_.size ()) @@ -120,17 +120,6 @@ Paper_def::line_dimensions_int (int n) const return shape_int_a_[n]; } -Real -Paper_def::beam_thickness_f () const -{ - return get_realvar (beam_thickness_scm_sym); -} - -Real -Paper_def::linewidth_f () const -{ - return get_realvar (linewidth_scm_sym); -} Real Paper_def::length_mom_to_dist (Moment d,Real k) const @@ -171,24 +160,6 @@ Paper_def::set_lookup (int i, Lookup*l) } -Real -Paper_def::rule_thickness () const -{ - return get_realvar (rulethickness_scm_sym); -} - -Real -Paper_def::staffline_f () const -{ - return get_realvar (rulethickness_scm_sym); - } - -Real -Paper_def::staffheight_f () const -{ - return get_realvar (staffheight_scm_sym); - } - Real Paper_def::interbeam_f (int multiplicity_i) const { @@ -198,11 +169,6 @@ Paper_def::interbeam_f (int multiplicity_i) const return get_realvar (interbeam4_scm_sym); } -Real -Paper_def::note_width () const -{ - return get_realvar (notewidth_scm_sym); -} void Paper_def::print () const diff --git a/lily/paper-score.cc b/lily/paper-score.cc index 0d7cbfdddf..ef983e8053 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -24,12 +24,11 @@ Paper_score::Paper_score () { - protected_scms_ = scm_protect_object (gh_cons (SCM_BOOL_T, SCM_EOL)); paper_l_ =0; outputter_l_ =0; Line_of_score * line_p = new Line_of_score; - typeset_unbroken_spanner (line_p); - + line_p->pscore_l_ = this; + element_smob_list_ = scm_protect_object (gh_cons (line_p->self_scm_, SCM_EOL)); line_l_ = line_p; } @@ -41,40 +40,17 @@ Paper_score::Paper_score (Paper_score const &s) Paper_score::~Paper_score () { - for (int i=span_p_arr_.size (); --i >=0 ; ) - delete span_p_arr_[i]; - for (int i=elem_p_arr_.size (); --i >=0 ; ) - delete elem_p_arr_[i]; - - scm_unprotect_object (protected_scms_); + scm_unprotect_object (element_smob_list_); } void Paper_score::typeset_element (Score_element * elem_p) { - elem_p_arr_.push (elem_p); elem_p->pscore_l_ = this; - // take over protection. - SCM_CDR(protected_scms_) = gh_cons (elem_p->element_property_alist_, - SCM_CDR (protected_scms_)); - scm_unprotect_object (elem_p->element_property_alist_); - - SCM p = elem_p->remove_elt_property (break_helper_only_scm_sym); - if (p != SCM_BOOL_F) - break_helpers_arr_.push (elem_p); -} - - -void -Paper_score::typeset_unbroken_spanner (Spanner*span_p) -{ - span_p_arr_.push (span_p); - span_p->pscore_l_=this; - - SCM p = span_p->remove_elt_property (break_helper_only_scm_sym); - if (p != SCM_BOOL_F) - break_helpers_arr_.push (span_p); + SCM_CDR(element_smob_list_) = gh_cons (elem_p->self_scm_, + SCM_CDR (element_smob_list_)); + scm_unprotect_object (elem_p->self_scm_); } void @@ -85,21 +61,20 @@ Paper_score::add_column (Paper_column *p) typeset_element(p); } - - void Paper_score::print () const { #ifndef NPRINT if (!flower_dstream) return ; + DEBUG_OUT << "Paper_score { "; DEBUG_OUT << "\n elements: "; - for (int i=0; i < span_p_arr_.size (); i++) - span_p_arr_[i]->print (); - for (int i=0; i < elem_p_arr_.size (); i++) - elem_p_arr_[i]->print(); - + + for (SCM p = SCM_CDR (element_smob_list_); + p != SCM_EOL; + p = SCM_CDR(p)) + gh_display (SCM_CAR(p)); DEBUG_OUT << "}\n"; #endif } @@ -159,8 +134,6 @@ Paper_score::process () typeset_element (line_l); } - if (experimental_features_global_b) - *mlog << _f ("%s elements", elem_p_arr_.size () + span_p_arr_.size ()); *mlog << "\n"; *mlog << _ ("Line ... "); @@ -174,9 +147,6 @@ Paper_score::process () line_l->post_processing (); *mlog << i << flush; line_l->output_all (i + 1 == lines.size()); - if (experimental_features_global_b) - *mlog << '(' << elem_p_arr_.size () + span_p_arr_.size () << ')'; - *mlog << ']' << flush; } diff --git a/lily/parser.yy b/lily/parser.yy index feb3ae516e..4d84041f38 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -652,15 +652,21 @@ real_array: */ midi_block: MIDI - - '{' midi_body '}' { $$ = $3; } + '{' midi_body '}' { + $$ = $3; + THIS-> lexer_p_-> scope_l_arr_.pop(); + } ; midi_body: /* empty */ { - $$ = THIS->default_midi_p (); + Midi_def * p =THIS->default_midi_p (); + $$ = p; + THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); } | MIDI_IDENTIFIER { - $$ = $1-> access_content_Midi_def (true); + Midi_def * p =$1-> access_content_Midi_def (true); + $$ = p; + THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); } | midi_body assignment semicolon { @@ -1002,10 +1008,10 @@ verbose_command_req: m->one_beat_i_=$4; $$ = m; } - | PENALTY int { + | PENALTY int { Break_req * b = new Break_req; - b->penalty_i_ = $2; - b-> set_spot (THIS->here_input ()); + b->penalty_f_ = $2 / 100.0; + b->set_spot (THIS->here_input ()); $$ = b; } | SKIP duration_length { diff --git a/lily/score-column.cc b/lily/score-column.cc index 6c5209a435..334a35d4ba 100644 --- a/lily/score-column.cc +++ b/lily/score-column.cc @@ -13,7 +13,6 @@ Score_column::Score_column (Moment w) { - break_penalty_i_ = 0; when_ = w; } @@ -22,9 +21,6 @@ Score_column::do_print() const { #ifndef NPRINT DEBUG_OUT << " at " << when_ << '\n'; - if (break_penalty_i_ >= Break_req::FORCE) - DEBUG_OUT << "Break forced"; - DEBUG_OUT << "Shortest playing: " << shortest_playing_mom_ << " shortest starter: " << shortest_starter_mom_; Paper_column::do_print(); #endif diff --git a/lily/score-element.cc b/lily/score-element.cc index bdb4f4bd30..9282bfc010 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -44,13 +44,18 @@ Score_element::Score_element() pscore_l_=0; lookup_l_ =0; status_i_ = 0; + self_scm_ = SCM_EOL; original_l_ = 0; element_property_alist_ = scm_protect_object (gh_cons (gh_cons (void_scm_sym, SCM_BOOL_T) , SCM_EOL)); + + smobify_self (); } Score_element::Score_element (Score_element const&s) : Graphical_element (s) { + + self_scm_ = SCM_EOL; used_b_ = true; original_l_ =(Score_element*) &s; element_property_alist_ = scm_protect_object (scm_list_copy (s.element_property_alist_)); @@ -59,6 +64,8 @@ Score_element::Score_element (Score_element const&s) status_i_ = s.status_i_; lookup_l_ = s.lookup_l_; pscore_l_ = s.pscore_l_; + + smobify_self (); } Score_element::~Score_element() @@ -223,6 +230,9 @@ Score_element::output_processing () pscore_l_->outputter_l_->output_molecule (output_p_, o, classname(this)); + + delete output_p_; + output_p_ =0; } /* @@ -424,3 +434,70 @@ Score_element::find_broken_piece (Line_of_score*) const { return 0; } + +static scm_smobfuns score_elt_funs = { + Score_element::mark_smob, Score_element::free_smob, + Score_element::print_smob, 0, +}; + + +SCM +Score_element::smobify_self () +{ + if (self_scm_ != SCM_EOL) + return self_scm_; + + SCM s; + SCM_NEWCELL(s); + SCM_SETCAR(s,smob_tag); + void * me_p = this; + SCM_SETCDR(s,me_p); + scm_protect_object (s); + self_scm_ = s; + + scm_unprotect_object (element_property_alist_); // ugh + return s; +} + +SCM +Score_element::mark_smob (SCM ses) +{ + void * mp = (void*) SCM_CDR(ses); + Score_element * s = (Score_element*) mp; + + assert (s->self_scm_ == ses); + return s->element_property_alist_; +} + +scm_sizet +Score_element::free_smob (SCM ses) +{ + Score_element * s = (Score_element*) SCM_CDR(ses); + delete s; + return 0; +} + +int +Score_element::print_smob (SCM s, SCM port, scm_print_state *) +{ + Score_element *sc = (Score_element *) SCM_CDR (s); + + scm_puts ("#name (), port); + scm_puts (" >", port); + return 1; +} + +long Score_element::smob_tag; + +void +Score_element::init_smobs () +{ + smob_tag = scm_newsmob (&score_elt_funs); +} + +void +init_smobs() +{ + Score_element::init_smobs (); +} diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 1c1d39205c..76580cbb38 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -20,7 +20,6 @@ Score_engraver::Score_engraver() { - break_penalty_i_ = 0; scoreline_l_ =0; command_column_l_ =0; musical_column_l_ =0; @@ -33,8 +32,8 @@ Score_engraver::prepare (Moment w) { Global_translator::prepare (w); set_columns (new Score_column (w), new Score_column (w)); - - break_penalty_i_ = 0; + + command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); post_move_processing(); } @@ -89,11 +88,7 @@ Score_engraver::announce_element (Score_element_info info) { announce_info_arr_.push (info); info.origin_trans_l_arr_.push (this); - - if (Spanner *s = dynamic_cast (info.elem_l_)) - pscore_p_->typeset_unbroken_spanner (s); - else if (Item *i = dynamic_cast (info.elem_l_)) - pscore_p_->typeset_element (i); + pscore_p_->typeset_element (info.elem_l_); } /* All elements are propagated to the top upon announcement. If @@ -174,9 +169,8 @@ Score_engraver::typeset_all() void Score_engraver::do_pre_move_processing() { - if (break_penalty_i_ > Break_req::DISALLOW) + if (command_column_l_->get_elt_property (breakable_scm_sym) != SCM_BOOL_F) { - command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); breaks_i_ ++; if (! (breaks_i_%8)) *mlog << "[" << breaks_i_ << "]" << flush; @@ -197,10 +191,8 @@ Score_engraver::set_columns (Score_column *new_command_l, scoreline_l_->add_column (command_column_l_); } else - { - delete command_column_l_ ; - command_column_l_ =0; - } + command_column_l_ =0; + if (new_command_l) command_column_l_ = new_command_l; @@ -210,10 +202,7 @@ Score_engraver::set_columns (Score_column *new_command_l, scoreline_l_->add_column (musical_column_l_); } else - { - delete musical_column_l_; - musical_column_l_ = 0; - } + musical_column_l_ = 0; if (new_musical_l) { @@ -249,16 +238,22 @@ Score_engraver::do_try_music (Music*r) if (!gotcha) { - /* - UGH! THIS IS NOT SYMMETRIC. CLEAN ME UP! - */ if (Break_req* b = dynamic_cast (r)) { gotcha = true; - if (b->penalty_i_ <= Break_req::DISALLOW) - break_penalty_i_ = b->penalty_i_; - else if (b->penalty_i_ >= Break_req::FORCE) - command_column_l_->break_penalty_i_ = b->penalty_i_; + + + SCM pen = command_column_l_->get_elt_property (penalty_scm_sym); + Real total_penalty = (pen == SCM_BOOL_F) + ? 0.0 + : gh_scm2double (SCM_CDR(pen)); // ugh. Should typecheck. + + total_penalty += b->penalty_f_; + if (b->penalty_f_ > 10000.0) // ugh. arbitrary. + forbid_breaks (); + + command_column_l_->set_elt_property (penalty_scm_sym, + gh_double2scm (total_penalty)); } } return gotcha; @@ -267,7 +262,7 @@ Score_engraver::do_try_music (Music*r) void Score_engraver::forbid_breaks () { - break_penalty_i_ = Break_req::DISALLOW; + SCM junk = command_column_l_->remove_elt_property (breakable_scm_sym); } ADD_THIS_TRANSLATOR(Score_engraver); diff --git a/lily/score.cc b/lily/score.cc index 0c56c31bbe..5f9a2b65c5 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -59,7 +59,9 @@ Score::run_translator (Music_output_def *odef_l) *mlog << '\n' << _("Interpreting music...") << flush; trans_p->last_mom_ = music_p_->length_mom (); - Music_iterator * iter = Music_iterator::static_get_iterator_p (music_p_); + + bool playing = odef_l->scope_p_->elem_b ("unfold_all"); + Music_iterator * iter = Music_iterator::static_get_iterator_p (music_p_, playing); iter->init_translator(music_p_, trans_p); iter->construct_children(); diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 590a10c78b..a07381b615 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -90,6 +90,5 @@ Separating_group_spanner::do_substitute_element_pointer (Score_element*o, Separating_group_spanner::Separating_group_spanner() { - set_elt_property (break_helper_only_scm_sym, SCM_BOOL_T); padding_f_ =0.0; } diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 1faaa67c13..7f1ff97560 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -31,7 +31,7 @@ Simultaneous_music_iterator::construct_children() Cons *i = (sim->music_p_list_p_) ? sim->music_p_list_p_->head_ : 0; for (; i; i = i->next_, j++) { - Music_iterator * mi = static_get_iterator_p (i->car_); + Music_iterator * mi = static_get_iterator_p (i->car_, playback_b_); /* if separate_contexts_b_ is set, create a new context with the number number as name */ diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index c3804bf2b3..90227b09b2 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -13,7 +13,6 @@ Single_malt_grouping_item ::Single_malt_grouping_item() { - set_elt_property (break_helper_only_scm_sym, SCM_BOOL_T); set_elt_property (transparent_scm_sym, SCM_BOOL_T); // this is weird! , but needed! diff --git a/lily/slur.cc b/lily/slur.cc index 0aa11a6ab4..c8582e8abb 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -24,8 +24,8 @@ #include "debug.hh" #include "box.hh" #include "bezier.hh" -#include "encompass-info.hh" #include "main.hh" +#include "cross-staff.hh" Slur::Slur () { @@ -91,6 +91,51 @@ Note_column_compare (Note_column *const&n1 , Note_column* const&n2) return Item::left_right_compare (n1, n2); } + +Offset +Slur::encompass_offset (Note_column const* col) const +{ + Offset o; + Stem* stem_l = col->stem_l_; + if (!stem_l) + { + warning (_ ("Slur over rest?")); + o[X_AXIS] = col->hpos_f (); + o[Y_AXIS] = col->extent (Y_AXIS)[dir_]; + return o; + } + + o[X_AXIS] = stem_l->hpos_f (); + + /* + Simply set x to middle of notehead + */ + + o[X_AXIS] -= 0.5 * stem_l->dir_ * col->extent (X_AXIS).length (); + + if ((stem_l->dir_ == dir_) + && !stem_l->extent (Y_AXIS).empty_b ()) + { + o[Y_AXIS] = stem_l->extent (Y_AXIS)[dir_]; + } + else + { + o[Y_AXIS] = col->extent (Y_AXIS)[dir_]; + } + + /* + leave a gap: slur mustn't touch head/stem + */ + o[Y_AXIS] += dir_ * paper_l ()->get_var ("slur_y_free"); + o[Y_AXIS] += calc_interstaff_dist (stem_l, this); + return o; +} + +/* + ARGRARGRARGRARGAR! + + Fixme + */ void Slur::do_post_processing () { @@ -198,36 +243,34 @@ Slur::do_post_processing () } while (flip (&d) != LEFT); - int interstaff_i = 0; - for (int i = 0; i < encompass_arr_.size (); i++) + bool cross_count = cross_staff_count (); + bool interstaff_b = (0 < cross_count) && (cross_count < encompass_arr_.size ()); + + Drul_array info_drul; + Interval interstaff_interval; + + do { - Encompass_info info (encompass_arr_[i], dir_, this); - if (info.interstaff_f_) - { - interstaff_i++; - } + info_drul[d] = encompass_offset (encompass_arr_.boundary (d, 0)); + interstaff_interval[d] = calc_interstaff_dist (encompass_arr_.boundary (d,0), + this); } - bool interstaff_b = interstaff_i && (interstaff_i < encompass_arr_.size ()); - - Drul_array info_drul; - info_drul[LEFT] = Encompass_info (encompass_arr_[0], dir_, this); - info_drul[RIGHT] = Encompass_info (encompass_arr_.top (), dir_, this); - Real interstaff_f = info_drul[RIGHT].interstaff_f_ - - info_drul[LEFT].interstaff_f_; + while (flip (&d) != LEFT); + + Real interstaff_f = interstaff_interval.length (); if (fix_broken_b) { Direction d = (encompass_arr_.top () != spanned_drul_[RIGHT]) ? RIGHT : LEFT; - dy_f_drul_[d] = info_drul[d].o_[Y_AXIS]; + dy_f_drul_[d] = info_drul[d][Y_AXIS]; if (!interstaff_b) { - dy_f_drul_[d] -= info_drul[d].interstaff_f_; - - if (interstaff_i) + dy_f_drul_[d] -= interstaff_interval[d]; + if (cross_count) // interstaff_i ? { - dy_f_drul_[LEFT] += info_drul[d].interstaff_f_; - dy_f_drul_[RIGHT] += info_drul[d].interstaff_f_; + dy_f_drul_[LEFT] += interstaff_interval[d]; + dy_f_drul_[RIGHT] += interstaff_interval[d]; } } } @@ -238,25 +281,13 @@ Slur::do_post_processing () Catch and correct some ugly cases */ - Real height_damp_f; - Real slope_damp_f; - Real snap_f; - Real snap_max_dy_f; + - if (!interstaff_b) - { - height_damp_f = paper_l ()->get_var ("slur_height_damping"); - slope_damp_f = paper_l ()->get_var ("slur_slope_damping"); - snap_f = paper_l ()->get_var ("slur_snap_to_stem"); - snap_max_dy_f = paper_l ()->get_var ("slur_snap_max_slope_change"); - } - else - { - height_damp_f = paper_l ()->get_var ("slur_interstaff_height_damping"); - slope_damp_f = paper_l ()->get_var ("slur_interstaff_slope_damping"); - snap_f = paper_l ()->get_var ("slur_interstaff_snap_to_stem"); - snap_max_dy_f = paper_l ()->get_var ("slur_interstaff_snap_max_slope_change"); - } + String infix = interstaff_b ? "interstaff_" : ""; + Real height_damp_f = paper_l ()->get_var ("slur_"+infix +"height_damping"); + Real slope_damp_f = paper_l ()->get_var ("slur_"+infix +"slope_damping"); + Real snap_f = paper_l ()->get_var ("slur_"+infix +"snap_to_stem"); + Real snap_max_dy_f = paper_l ()->get_var ("slur_"+infix +"snap_max_slope_change"); if (!fix_broken_b) dy_f_drul_[RIGHT] += interstaff_f; @@ -338,22 +369,24 @@ Slur::do_post_processing () snapped_b_drul[LEFT] = snapped_b_drul[RIGHT] = false; do { - if ((note_column_drul[d] == spanned_drul_[d]) - && (note_column_drul[d]->stem_l_) - && (note_column_drul[d]->stem_l_->dir_ == dir_) - && (abs (note_column_drul[d]->stem_l_->extent (Y_AXIS)[dir_] - - dy_f_drul_[d] + (d == LEFT ? 0 : interstaff_f)) - <= snap_f)) + Note_column * nc = note_column_drul[d]; + if (nc == spanned_drul_[d] + && nc->stem_l_ + && nc->stem_l_->dir_ == dir_ + && abs (nc->stem_l_->extent (Y_AXIS)[dir_] + - dy_f_drul_[d] + (d == LEFT ? 0 : interstaff_f)) + <= snap_f) { /* prepare to attach to stem-end */ - Stem* stem_l = note_column_drul[d]->stem_l_; - snapx_f_drul[d] = stem_l->hpos_f () + snapx_f_drul[d] = nc->stem_l_->hpos_f () - spanned_drul_[d]->relative_coordinate (0, X_AXIS); - snapy_f_drul[d] = stem_l->extent (Y_AXIS)[dir_]; - snapy_f_drul[d] += info_drul[d].interstaff_f_; - snapy_f_drul[d] += dir_ * 2 * y_gap_f; + + snapy_f_drul[d] = nc->stem_l_->extent (Y_AXIS)[dir_] + + interstaff_interval[d] + + dir_ * 2 * y_gap_f; + snapped_b_drul[d] = true; } } @@ -365,39 +398,53 @@ Slur::do_post_processing () */ if (!fix_broken_b) dy_f += interstaff_f; + + + /* + (sigh) + + More refactoring could be done. + */ + Real maxsnap = abs (dy_f * snap_max_dy_f); if (snapped_b_drul[LEFT] && snapped_b_drul[RIGHT] && ((sign (snapy_f_drul[RIGHT] - snapy_f_drul[LEFT]) == sign (dy_f))) && (!dy_f || (abs (snapy_f_drul[RIGHT] - snapy_f_drul[LEFT] - dy_f) - < abs (dy_f * snap_max_dy_f)))) - { - do - { - dy_f_drul_[d] = snapy_f_drul[d]; - dx_f_drul_[d] = snapx_f_drul[d]; - } - while (flip (&d) != LEFT); - - } - else if (snapped_b_drul[LEFT] - && ((sign (dy_f_drul_[RIGHT] - snapy_f_drul[LEFT]) == sign (dy_f))) - && (!dy_f || (abs (dy_f_drul_[RIGHT] - snapy_f_drul[LEFT] - dy_f) - < abs (dy_f * snap_max_dy_f)))) + < maxsnap))) { - Direction d = LEFT; - dy_f_drul_[d] = snapy_f_drul[d]; - dx_f_drul_[d] = snapx_f_drul[d]; + dy_f_drul_ = snapy_f_drul; + dx_f_drul_ = snapx_f_drul; } - else if (snapped_b_drul[RIGHT] - && ((sign (snapy_f_drul[RIGHT] - dy_f_drul_[LEFT]) == sign (dy_f))) - && (!dy_f || (abs (snapy_f_drul[RIGHT] - dy_f_drul_[LEFT] - dy_f) - < abs (dy_f * snap_max_dy_f)))) + else + do + { + Direction od = (Direction)-d; + if (snapped_b_drul[d] + && d * sign (snapy_f_drul[d] - dy_f_drul_[od]) == sign (dy_f) + && (!dy_f || (abs (snapy_f_drul[d] - dy_f_drul_[od] - d * dy_f) + < maxsnap))) + { + dy_f_drul_[d] = snapy_f_drul[d]; + dx_f_drul_[d] = snapx_f_drul[d]; + } + } + while (flip (&d) != LEFT); +} + + +int +Slur::cross_staff_count ()const +{ + int k=0; + + for (int i = 0; i < encompass_arr_.size (); i++) { - Direction d = RIGHT; - dy_f_drul_[d] = snapy_f_drul[d]; - dx_f_drul_[d] = snapx_f_drul[d]; + if (calc_interstaff_dist (encompass_arr_[i], this)) + k++; } + return k; } + Array Slur::get_encompass_offset_arr () const { @@ -411,17 +458,6 @@ Slur::get_encompass_offset_arr () const offset_arr.push (Offset (0, dy_f_drul_[RIGHT])); return offset_arr; #endif - - int interstaff_i = 0; - for (int i = 0; i < encompass_arr_.size (); i++) - { - Encompass_info info (encompass_arr_[i], dir_, this); - if (info.interstaff_f_) - { - interstaff_i++; - } - } - bool interstaff_b = interstaff_i && (interstaff_i < encompass_arr_.size ()); Offset origin (relative_coordinate (0, X_AXIS), 0); @@ -429,15 +465,19 @@ Slur::get_encompass_offset_arr () const int last = encompass_arr_.size () - 2; offset_arr.push (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT])); + /* left is broken edge */ + + int cross_count = cross_staff_count (); + bool cross_b = cross_count && cross_count < encompass_arr_.size (); if (encompass_arr_[0] != spanned_drul_[LEFT]) { first--; - Encompass_info left_info (encompass_arr_[0], dir_, this); - if (interstaff_b) - offset_arr[0][Y_AXIS] += left_info.interstaff_f_; + Real is = calc_interstaff_dist (encompass_arr_[0], this); + if (cross_b) + offset_arr[0][Y_AXIS] += is; } /* @@ -450,8 +490,8 @@ Slur::get_encompass_offset_arr () const for (int i = first; i <= last; i++) { - Encompass_info info (encompass_arr_[i], dir_, this); - offset_arr.push (info.o_ - origin); + Offset o (encompass_offset (encompass_arr_[i])); + offset_arr.push (o - origin); } offset_arr.push (Offset (do_width ().length () + dx_f_drul_[RIGHT], diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 479855cdcd..967783c294 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -17,7 +17,6 @@ Spacing_spanner::Spacing_spanner () { - set_elt_property (break_helper_only_scm_sym, SCM_BOOL_T); set_elt_property (transparent_scm_sym, SCM_BOOL_T); } diff --git a/lily/staff-sym.cc b/lily/staff-sym.cc index 4c33372710..7ab14e91ba 100644 --- a/lily/staff-sym.cc +++ b/lily/staff-sym.cc @@ -56,7 +56,7 @@ Staff_symbol::do_brew_molecule_p() const - spanned_drul_[LEFT]->relative_coordinate (common, X_AXIS) ; - Real t = paper_l ()->get_var ("rulethickness"); + Real t = paper_l ()->get_var ("stafflinethickness"); Molecule rule = lookup_l ()->filledbox (Box (Interval (0,width), Interval (-t/2, t/2))); diff --git a/lily/stem-info.cc b/lily/stem-info.cc index 8578c0e71b..4a9e06e05e 100644 --- a/lily/stem-info.cc +++ b/lily/stem-info.cc @@ -9,24 +9,23 @@ #include "proto.hh" #include "misc.hh" -#include "debug.hh" -#include "dimension-cache.hh" +#include "cross-staff.hh" -#include "align-element.hh" #include "stem.hh" #include "paper-def.hh" #include "lookup.hh" #include "stem-info.hh" #include "beam.hh" -#include "staff-symbol.hh" + Stem_info::Stem_info () { } + + /* FIXME: y dims should not be in internote. */ - Stem_info::Stem_info (Stem*s, int mult) { mult_i_ =mult; @@ -41,14 +40,8 @@ Stem_info::Stem_info (Stem*s, int mult) Paper_def* paper_l = stem_l_->paper_l (); Real internote_f = stem_l_->staff_line_leading_f ()/2; Real interbeam_f = paper_l->interbeam_f (mult_i_); - Real beam_f = paper_l->beam_thickness_f (); + Real beam_f = paper_l->get_realvar (beam_thickness_scm_sym);; - { - static int i = 1; - DEBUG_OUT << "******" << i++ << "******\n" - << "begin_f: " << stem_l_->stem_begin_f () * dir_ - << "\nchord_f/i: " << stem_l_->chord_start_f () * dir_ / internote_f << '\n'; - } // strangely enough, dim(chord_start_f) == pt (and not internote!) idealy_f_ = stem_l_->chord_start_f () / internote_f; @@ -105,8 +98,6 @@ Stem_info::Stem_info (Stem*s, int mult) /* knee */ { idealy_f_ -= beam_f; - // idealy_f_ -= (mult_i_ - 1) * interbeam_f; - // idealy_f_ += (mult_i_ - stem_l_->flag_i_ >? 0) * interbeam_f; maxy_f_ = idealy_f_; miny_f_ = -INT_MAX; @@ -119,51 +110,15 @@ Stem_info::Stem_info (Stem*s, int mult) miny_f_ /= internote_f; maxy_f_ /= internote_f; - DEBUG_OUT << "dir_: " << dir_ << '\n'; - DEBUG_OUT << "mult_i_: " << mult_i_ << '\n'; - DEBUG_OUT << "idealy_f_: " << idealy_f_ << '\n'; - DEBUG_OUT << "miny_f_: " << miny_f_ << '\n'; - DEBUG_OUT << "maxy_f_: " << maxy_f_ << '\n'; - idealy_f_ = maxy_f_ ? idealy_f_; // interstaff beam Beam* beam_l = stem_l_->beam_l_; - Graphical_element *common = stem_l_->common_refpoint (beam_l, Y_AXIS); - Align_element * align = dynamic_cast (common); - if (align && align->axis() == Y_AXIS) - { - if (align->threshold_interval_[MIN] != - align->threshold_interval_[MAX]) - warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff beams/slurs may be broken")); - - interstaff_f_ = align->threshold_interval_[MIN] / internote_f; - - Graphical_element * beam_refpoint = beam_l; - Graphical_element * stem_refpoint = stem_l_; - - while (beam_refpoint->parent_l (Y_AXIS) != common) - beam_refpoint = beam_refpoint->parent_l (Y_AXIS); - while (stem_refpoint->parent_l (Y_AXIS) != common) - stem_refpoint = stem_refpoint->parent_l (Y_AXIS); - - - int beam_prio = - align->get_priority (dynamic_cast (beam_refpoint)); - int stem_prio = - align->get_priority (dynamic_cast (stem_refpoint)); - - /* - our staff is lower -> interstaff_f_ *= -1 - */ - if (beam_prio < stem_prio) - interstaff_f_ *= -1; - - idealy_f_ += interstaff_f_ * beam_dir_; - miny_f_ += interstaff_f_ * beam_dir_; - maxy_f_ += interstaff_f_ * beam_dir_; - } + Real is = calc_interstaff_dist (stem_l_, beam_l); + idealy_f_ += is* beam_dir_; + miny_f_ += is * beam_dir_; + maxy_f_ += is * beam_dir_; } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 5f2667bb79..71dead81d1 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -54,7 +54,7 @@ Stem_tremolo::do_brew_molecule_p () const Real space = stem_l_->staff_line_leading_f (); Real internote_f = space/2; - Real beam_f = paper_l ()->beam_thickness_f (); + Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym); int beams_i = 0; Real slope_f = internote_f / 4 / internote_f; // HUH? diff --git a/lily/stem.cc b/lily/stem.cc index aef8245546..919969187c 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -370,7 +370,8 @@ Stem::note_delta_f () const if (head_l_arr_.size()) { Interval head_wid(0, head_l_arr_[0]->extent (X_AXIS).length ()); - Real rule_thick(paper_l ()->rule_thickness ()); + Real rule_thick = paper_l ()->get_var ("stemthickness"); + Interval stem_wid(-rule_thick/2, rule_thick/2); if (dir_ == CENTER) r = head_wid.center (); diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index 953e802f4b..3fa208f15d 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -20,3 +20,50 @@ Timing_engraver::fill_staff_info (Staff_info &inf) ADD_THIS_TRANSLATOR(Timing_engraver); + + +void +Timing_engraver::do_post_move_processing( ) +{ + bar_req_l_ = 0; + Timing_translator::do_post_move_processing (); +} + +bool +Timing_engraver::do_try_music (Music*m) +{ + if (Bar_req * b= dynamic_cast (m)) + { + if (bar_req_l_ && bar_req_l_->equal_b (b)) // huh? + return false; + + bar_req_l_ = b; + return true; + } + + return Timing_translator::do_try_music (m); +} + + +String +Timing_engraver::which_bar () +{ + if (!bar_req_l_) + { + if (!now_mom ()) + return "|"; + + Scalar nonauto = get_property ("barNonAuto", 0); + if (!nonauto.to_bool ()) + { + Scalar always = get_property ("barAlways", 0); + if (!time_.whole_in_measure_ || always.to_bool ()) + return get_property ("defaultBarType" ,0); + } + return ""; + } + else + { + return bar_req_l_->type_str_; + } +} diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index cbc5e008a6..901d69f80b 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -49,7 +49,7 @@ Unfolded_repeat_iterator::next_element () { done_mom_ += mus->repeat_body_p_->length_mom (); - if (!mus->volta_fold_b_) + if (full_unfold_b_) done_count_ ++; if (alternative_cons_l_) @@ -57,7 +57,7 @@ Unfolded_repeat_iterator::next_element () current_iter_p_ = get_iterator_p (alternative_cons_l_->car_); do_main_b_ = false; } - else if (done_count_ < mus->repeats_i_ && !mus->volta_fold_b_) + else if (done_count_ < mus->repeats_i_ && full_unfold_b_) { current_iter_p_ = get_iterator_p (mus->repeat_body_p_); do_main_b_ = true; @@ -73,20 +73,20 @@ Unfolded_repeat_iterator::next_element () { done_mom_ += alternative_cons_l_->car_->length_mom (); - if (mus->volta_fold_b_ || + if (!full_unfold_b_ || mus->repeats_i_ - done_count_ < alternative_count_i_) alternative_cons_l_ = alternative_cons_l_->next_; /* we've done the main body as well, but didn't go over the other increment. */ - if (mus->volta_fold_b_) + if (full_unfold_b_) done_count_ ++; } if (done_count_ < mus->repeats_i_ && alternative_cons_l_) { - if (mus->volta_fold_b_) + if (!full_unfold_b_) current_iter_p_ = get_iterator_p (alternative_cons_l_->car_); else { @@ -114,6 +114,8 @@ void Unfolded_repeat_iterator::construct_children () { Repeated_music const* mus =dynamic_cast (music_l_); + full_unfold_b_ = playback_b_ || (!mus->volta_fold_b_); + alternative_cons_l_ = (mus->alternatives_p_) ? mus->alternatives_p_->music_p_list_p_->head_ : 0; diff --git a/ly/declarations.ly b/ly/declarations.ly index 3b44423d82..a6e51b9395 100644 --- a/ly/declarations.ly +++ b/ly/declarations.ly @@ -20,8 +20,8 @@ bigger = 1 center=0 -break = \penalty 10000; -nobreak = \penalty -10000; +break = \penalty -1000000; +nobreak = \penalty 1000000; major = 0 minor = 3 diff --git a/ly/engraver.ly b/ly/engraver.ly index fadc695390..1e8acfac43 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -188,7 +188,8 @@ StaffGroupContext= \translator { }; \translator { \StaffGroupContext } -\translator{ +% UGH! JUNKME +LyricsVoiceContext= \translator{ \type "Engraver_group_engraver"; \consistsend "Axis_group_engraver"; @@ -197,9 +198,10 @@ StaffGroupContext= \translator { \consists "Lyric_engraver"; \consists "Extender_engraver"; \consists "Hyphen_engraver"; -} +}; +\translator{ \LyricsVoiceContext } -\translator { +LyricsContext = \translator { \type "Engraver_group_engraver"; \name Lyrics; \consists Vertical_align_engraver;%need this for getting folded repeats right. @@ -207,7 +209,8 @@ StaffGroupContext= \translator { \consistsend "Axis_group_engraver"; \accepts "LyricVoice"; -} +}; +\translator { \LyricsContext } \translator{ \type "Engraver_group_engraver"; @@ -271,13 +274,14 @@ ScoreContext = \translator { \name Score; \consists "Timing_engraver"; + \consists "Span_score_bar_engraver"; \consists "Score_priority_engraver"; \consists "Spacing_engraver"; \consists "Vertical_align_engraver"; alignmentReference = \down; defaultClef = treble; - + defaultBarType = "|"; \accepts "Staff"; \accepts "StaffGroup"; \accepts "RhythmicStaff"; diff --git a/ly/midi.ly b/ly/midi.ly index 114d34f20f..d47242bf58 100644 --- a/ly/midi.ly +++ b/ly/midi.ly @@ -2,4 +2,5 @@ \midi { \tempo 4=60; \include "performer.ly" +% unfold_all = "1"; } diff --git a/ly/params.ly b/ly/params.ly index f0e9893b8d..96b0057fa8 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -9,12 +9,11 @@ paperfile = \papersize + ".ly"; interline = \staffheight / 4.0; -% thickness of stafflines -staffline = \interline / 10.0; +stafflinethickness = \interline / 10.0; % urg, need grace_ versions of these too? -beam_thickness = 0.52 * (\interline - \staffline); -interbeam = (2.0 * \interline + \staffline - \beam_thickness) / 2.0; +beam_thickness = 0.52 * (\interline - \stafflinethickness); +interbeam = (2.0 * \interline + \stafflinethickness - \beam_thickness) / 2.0; interbeam4 = (3.0 * \interline - \beam_thickness) / 3.0; % stems and beams @@ -153,8 +152,8 @@ tie_y_gap = 0.25 * \interline; tie_staffspace_length = 4.0 * \interline; % ugh: rename to bow (in bezier.cc and fonts.doc too...) -% slur_thickness = 1.8 * \staffline; -slur_thickness = 1.4 * \staffline; +% slur_thickness = 1.8 * \stafflinethickness; +slur_thickness = 1.4 * \stafflinethickness; %{ Specifies the maximum height of slurs. @@ -178,9 +177,6 @@ slur_rc_factor = 2.4; % ugh notewidth = (\quartwidth + \wholewidth) / 2.0; -% ugh -rulethickness = \staffline; - gourlay_energybound = 100000.; %{ Maximum number of measures per line to try when using Gourlay @@ -200,23 +196,23 @@ barthick_thin = 0.1*\interline; %} -bar_kern = 3.0 * \staffline; -bar_thinkern = 3.0 * \staffline; -barthick_thick = 6.0* \staffline; -barthick_thin = 1.6*\staffline; -barthick_score = 1.6*\staffline; +bar_kern = 3.0 * \stafflinethickness; +bar_thinkern = 3.0 * \stafflinethickness; +barthick_thick = 6.0* \stafflinethickness; +barthick_thin = 1.6*\stafflinethickness; +barthick_score = 1.6*\stafflinethickness; tuplet_spanner_gap = 2.0 * \interline; -tuplet_thick = 1.0*\staffline; -volta_thick = 1.6*\staffline; +tuplet_thick = 1.0*\stafflinethickness; +volta_thick = 1.6*\stafflinethickness; volta_spanner_height = 2.0 *\interline; % relative thickness of thin lines 1.6 : 1 : 0.8 -stemthickness = 0.8*\staffline; -rulethickness = \staffline; +stemthickness = 0.8*\stafflinethickness; +rulethickness = \stafflinethickness; -extender_height = 0.8*\staffline; +extender_height = 0.8*\stafflinethickness; hyphen_thickness = 0.05*\font_normal; hyphen_height = 0.2*\font_normal; @@ -228,12 +224,17 @@ mmrest_x_minimum = 1.4*\staffheight; % chop off this much when next to pp / ff sign. crescendo_shorten = 4.0 * \interline; -crescendo_thickness = \staffline; +crescendo_thickness = \stafflinethickness; +crescendo_height = 1.5 * \interline; % in internote. restcollision_minimum_dist = 3.0; restcollision_minimum_beamdist = 1.5; + +% unit for note collision resolving +collision_note_width = \notewidth; %ugh. + % deprecated! postBreakPadding = 0.0; diff --git a/ly/property.ly b/ly/property.ly index 351e34d008..ea41ac9656 100644 --- a/ly/property.ly +++ b/ly/property.ly @@ -66,17 +66,13 @@ voicefour = % ugh, cluttering global namespace... % ugh2. -none=0 -free=0 -normal=1 -traditional=2 infinity=10000 beamslopeproportional = - \property Score.beamslopedamping = \none + \property Score.beamslopedamping = 0 beamslopedamped = - \property Score.beamslopedamping = \normal + \property Score.beamslopedamping = 1 beamslopezero = @@ -86,15 +82,15 @@ beamslopezero = % this sucks, you'd want to pass an array, at least % (or embedded code: you still can't dictate the slope / stemlength) beamposfree = - \property Score.beamquantisation = \none + \property Score.beamquantisation = 0 beamposnormal = - \property Score.beamquantisation = \normal + \property Score.beamquantisation = 1 beampostraditional = - \property Score.beamquantisation = \traditional + \property Score.beamquantisation = 2 slurnormal = diff --git a/make/lilypond.spec.in b/make/lilypond.spec.in index 30d2c85045..74c0e642e9 100644 --- a/make/lilypond.spec.in +++ b/make/lilypond.spec.in @@ -17,7 +17,7 @@ Prereq: tetex %package documentation Summary: Prebuilt website containing all LilyPond documentation. Group: Applications/Publishing -BuildArchitectures: noarch +# BuildArchitectures: noarch %description documentation @BLURB@ diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 1b497ebb49..2997e73783 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,18 +1,15 @@ Begin3 Title: LilyPond -Version: 1.2.14 -Entered-date: 17OCT99 +Version: 1.2.15 +Entered-date: 18OCT99 Description: -LilyPond is a music typesetter. It produces beautiful sheet music -using a high level description file as input. LilyPond is part of -the GNU Project. Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.2.14.tar.gz + 1000k lilypond-1.2.15.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.2.14.tar.gz + 1000k lilypond-1.2.15.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 50e15ffa17..7105c3e1f6 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.2.14 +Version: 1.2.15 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.2.14.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.2.15.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys @@ -13,19 +13,14 @@ Prereq: tetex %description -LilyPond is a music typesetter. It produces beautiful sheet music -using a high level description file as input. LilyPond is part of -the GNU Project. %package documentation Summary: Prebuilt website containing all LilyPond documentation. Group: Applications/Publishing +# BuildArchitectures: noarch %description documentation -LilyPond is a music typesetter. It produces beautiful sheet music -using a high level description file as input. LilyPond is part of -the GNU Project. The documentation package is rather big, due to the many pictures and different documentation formats. It is really a rip-off from the @@ -63,10 +58,10 @@ cp buildscripts/out/lilypond-login $RPM_BUILD_ROOT/etc/profile.d/lilypond.csh #%install documentation #line 63: second %install # again, make sure that main package installs even if doco fails -mkdir -p htmldocs -tar -C htmldocs -xzf out/htmldoc.tar.gz +mkdir -p htmldocs/out +tar -C htmldocs -xzf out/htmldoc.tar.gz || true mkdir -p out/examples/ -tar -cf - input/ | tar -C out/examples/ -xf- +tar -cf - input/ | tar -C out/examples/ -xf- || true %post diff --git a/make/toplevel.make.in b/make/toplevel.make.in index 9dce8fb503..a311af2b92 100644 --- a/make/toplevel.make.in +++ b/make/toplevel.make.in @@ -9,14 +9,13 @@ depth = . # descent order into subdirectories: # SUBDIRS = scripts buildscripts flower lib lily mf midi2ly po debian \ - Documentation ly input tex make mutopia test intl stepmake\ + Documentation ly input tex make mutopia intl stepmake\ ps scm # SCRIPTS = configure aclocal.m4 -README_FILES = DEDICATION ANNOUNCE-0.1 ANNOUNCE-1.0 ANNOUNCE-1.2 \ - COPYING NEWS-0.1 NEWS-1.0 NEWS-0.0 NEWS-1.1 NEWS TODO AIMS CHANGES -README_TXT_FILES = README.txt AUTHORS.txt INSTALL.txt +README_FILES = DEDICATION COPYING NEWS TODO CHANGES +README_TXT_FILES = README.txt INSTALL.txt IN_FILES := $(wildcard *.in) EXTRA_DIST_FILES = dstreamrc mudela-mode.el vimrc VERSION $(README_FILES) $(SCRIPTS) $(IN_FILES) NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES) diff --git a/mutopia/N.W.Gade/README b/mutopia/N.W.Gade/README index fbffbfc7e5..dbd16551f6 100644 --- a/mutopia/N.W.Gade/README +++ b/mutopia/N.W.Gade/README @@ -11,13 +11,16 @@ The piece was performed in Ludvika and March 13-14, 1999, by Bergslagens Kammarsymfoniker conducted by Ola Karlsson. +The piece is for a small symphony orchestra with (using standard +notation for orchestral settings): 1121-2200-10-strings + Christian Mondrup has provided the following background on the piece: It was composed 1850 as a ouverture for the comedy "Imellem -Fjeldene" by the danish poet Carsten Hauch. In the Andante +Fjeldene" by the Danish poet Carsten Hauch. In the Andante introduction, Gade uses a melody from the collection ``Norske Folkesagn og Melodier'' (``Norwegian folksongs and melodies'') -by the danish composer A.P. Bergreen. The song has a norwegian +by the Danish composer A.P. Bergreen. The song has a Norwegian text ``Heimreise fraa Sæteren'' by Edvard Storm. The second theme of the Allegro part might very well come from the same collection, namely the song ``Saag du nokke Kjærringa mi''. diff --git a/mutopia/N.W.Gade/brass.ly b/mutopia/N.W.Gade/brass.ly index 9094208b4a..34deb5ed7c 100644 --- a/mutopia/N.W.Gade/brass.ly +++ b/mutopia/N.W.Gade/brass.ly @@ -203,13 +203,13 @@ R2 | e4 \fz r } -corIhelp=\notes\relative c''' { +corIcue=\notes\relative c''' { \key c; \tiny s2.*32 | s2*33 | \stemup -r4 r8 [g16^"oboe" \p ( a ] | +r4 r8 [g16^"oboe" ( a ] | [ ) g8-. fis16 ( g ][ ) fis8-. f16 ( g ] | [ ) f8-. e16 ( f ] ) e8-. s | \stemboth s2*66 | @@ -219,7 +219,7 @@ s2*66 | ) e4 r | } -corIIhelp=\notes\relative c'' { +corIIcue=\notes\relative c'' { \key c; \tiny @@ -517,7 +517,7 @@ R2 | g4 \fz r } -trpIhelp=\notes\relative c'' { +trpIcue=\notes\relative c'' { \tiny s2.*32 | @@ -545,7 +545,7 @@ r4^"Flauto" r8 [c'16 ( d] | )bes8 [a16 ( bes ] ) a8 } -trpIIhelp=\notes\relative c'' { +trpIIcue=\notes\relative c'' { \tiny [c8.^"Oboe" ( d16] ) c2 | @@ -845,7 +845,7 @@ r2 | f4 \fz r } -timphelp=\notes\relative c' { +timpcue=\notes\relative c' { \tiny [c8.^"Oboe, \\okt" ( d16] ) c2 | diff --git a/mutopia/N.W.Gade/parts.ly b/mutopia/N.W.Gade/parts.ly index f9326fc155..d6181f7dd5 100644 --- a/mutopia/N.W.Gade/parts.ly +++ b/mutopia/N.W.Gade/parts.ly @@ -43,7 +43,7 @@ my_paper = \paper { \marks \flauto > - \context Voice = help \flautohelp + \context Voice = cue \flautocue > \header{ instrument = "Flauto"; @@ -64,7 +64,7 @@ my_paper = \paper { \marks \oboe > - \context Voice = help \oboehelp + \context Voice = cue \oboecue > \header{ instrument = "Oboe"; @@ -139,7 +139,7 @@ my_paper = \paper { \marks \corI > - \context Voice = help \corIhelp + \context Voice = cue \corIcue > \header{ instrument = "Corno I in F"; @@ -160,7 +160,7 @@ my_paper = \paper { \marks \corII > - \context Voice = help \corIIhelp + \context Voice = cue \corIIcue > \header{ instrument = "Corno II in F"; @@ -181,7 +181,7 @@ my_paper = \paper { \marks \trpI > - \context Voice = help \trpIhelp + \context Voice = cue \trpIcue > \header{ instrument = "Tromba I in B\\textflat"; @@ -202,7 +202,7 @@ my_paper = \paper { \marks \trpII > - \context Voice = help \trpIIhelp + \context Voice = cue \trpIIcue > \header{ instrument = "Tromba II in B\\textflat"; @@ -223,7 +223,7 @@ my_paper = \paper { \marks \timpani > - \context Voice = help \timphelp + \context Voice = cue \timpcue > \header{ instrument = "Timpani \& Triangolo"; diff --git a/mutopia/N.W.Gade/score.ly b/mutopia/N.W.Gade/score.ly index 9daff0680a..7680cffced 100644 --- a/mutopia/N.W.Gade/score.ly +++ b/mutopia/N.W.Gade/score.ly @@ -135,8 +135,7 @@ copyright = "Mats Bengtsson, 1999. Free circulation permitted and " + markScriptPadding = "20.0"; } \translator { -% \HaraKiriStaffContext % Gives lost bar lines and misplaced marks!! - \StaffContext + \HaraKiriStaffContext \consists "Staff_margin_engraver"; marginScriptPadding = "15.0"; dynamicPadding = 3.0; diff --git a/mutopia/N.W.Gade/strings.ly b/mutopia/N.W.Gade/strings.ly index 8df8e869f5..0e17a3a0dd 100644 --- a/mutopia/N.W.Gade/strings.ly +++ b/mutopia/N.W.Gade/strings.ly @@ -566,7 +566,7 @@ vla=\notes\relative c' { \property Staff."midiInstrument" = "viola" [c8. \f ( d16 ] ) c2_"dim." | -\context Staff <{\voiceone s4 c2 | +\context Staff <{\voiceone [c8. d16 ] c2 | c2. ~ | c2. ~ | c2. ~ | diff --git a/mutopia/N.W.Gade/wood.ly b/mutopia/N.W.Gade/wood.ly index 0221e01cc5..84a5062b90 100644 --- a/mutopia/N.W.Gade/wood.ly +++ b/mutopia/N.W.Gade/wood.ly @@ -471,7 +471,7 @@ fis \> ~ | % cresc. added \! fis4 r | % dim. added R2*4 | e'2 \fz \> ( | -) \! fis,4 r | +) fis,4 \! r | b2 \> ( | ) \! ais4 r | fis2 \pp \< ~ | @@ -480,7 +480,7 @@ fis \> ~ | \! fis4 r | R2*4 | e'2 \fz \> ( | -) \! fis,4 r | +) fis,4 \! r | e'2 \p ( | ) ais, | R2*2 | @@ -902,7 +902,7 @@ e2 \p \< ~ | \! e \< ~ | \! e \> | \grace d'8 ( ) \! f2 \fz \> ( | -) \! e4. r8 | +) e4. \! r8 | f,2 \> ( ( | [ ) \! e8 d c ) b ] | a2 \pp \< ~ | @@ -914,7 +914,7 @@ e ~ | e ~ | e | \grace d'8 ( ) f2 \fz \> ( | -) \! e4. r8 | +) e4. \! r8 | f,2 \p ( | ) e4 r | f'2-> ( | @@ -1033,7 +1033,7 @@ f ( | ) c'4 \fz r } -oboehelp=\notes\relative c'' { +oboecue=\notes\relative c'' { \tiny s2.*32 | @@ -1045,7 +1045,7 @@ s2*106 | [e c ) d] s | } -flautohelp=\notes\relative c'' { +flautocue=\notes\relative c'' { \tiny s2.*32 | diff --git a/scm/lily.scm b/scm/lily.scm index 9c9ae7a896..8eafa4922a 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -267,7 +267,10 @@ (define (lily-def key val) (string-append - "\\def\\" (output-tex-string key) "{" (output-tex-string val) "}\n")) + "\\def\\" +; (regexp-substitute/global #f "_" (output-tex-string key) 'pre "X" 'post) + (output-tex-string key) + "{" (output-tex-string val) "}\n")) (define (number->dim x) (string-append diff --git a/test/GNUmakefile b/test/GNUmakefile deleted file mode 100644 index f4392fb708..0000000000 --- a/test/GNUmakefile +++ /dev/null @@ -1,17 +0,0 @@ -# title makefile for test -# test/Makefile - -depth = .. - -NAME = lily-test -MODULE_NAME = lily-test - -MODULE_CXXFLAGS = -I$(depth)/flower/include -I$(depth)/flower -I$(depth)/lily/include -I$(depth)/lily -STEPMAKE_TEMPLATES=c++ - -include $(depth)/make/stepmake.make - -# default: $(EXECUTABLE) - -# include $(stepdir)/Executable.make - diff --git a/test/bow.cc b/test/bow.cc deleted file mode 100644 index 418538880e..0000000000 --- a/test/bow.cc +++ /dev/null @@ -1,165 +0,0 @@ -// vim:sw=2 makeprg=g++\ -g\ bow.cc\ -o\ bow -#include -#define PT -// #define STAFFHEIGHT 16.0 -#define STAFFHEIGHT 20.0 - -#define UP 1 -#define DOWN (-1) - -// mmm -#define STANDALONE - -#include - -typedef void *Paper_def; - -bool experimental_features_global_b = true; -//bool experimental_features_global_b = false; - -#include "bezier.hh" - -#if 0 -#include "offset.cc" -#include "interval.cc" -#endif - -#include "misc.cc" -#include "bezier.cc" - -struct Point -{ - Real x, y; -}; - -void -out (Bezier_bow& b) -{ - cout << "save dx,dy,x,y;\n"; - for (int i = 0; i < 4; i++) - cout << "z" << i + 1 << " = (" << b.control_[i].x () - << ", " << b.control_[i].y () << ");\n"; - for (int i = 1; i < 3; i++) - cout << "z" << i + 4 << " = (" << b.return_[i].x () - << ", " << b.return_[i].y () << ");\n"; -#if 0 - cout << "pickup pencircle scaled 0.5pt#;\n"; - cout << "draw z2--z3; draw (50,0)-- 0.5[z2,z3];\n"; -#endif - cout << "pickup pencircle scaled 4pt#;\n"; - for (int i = 0; i < 4; i++) - cout << "drawdot z" << i + 1 << ";\n"; - cout << "path boogje;\n"; -#if 0 - cout << "pickup pencircle scaled 0.4pt#;\n"; - cout << "boogje=z1..controls z2 and z3..z4..controls z5 and z6..cycle;\n"; - cout << "filldraw boogje;\n"; -#else - cout << "pickup pencircle scaled 1.6pt#;\n"; - cout << "boogje=z1..controls z2 and z3..z4;\n"; - cout << "draw boogje;\n"; - cout << "pickup pencircle scaled 0.4pt#;\n"; - cout << "boogje:=z4..controls z5 and z6..z1;\n"; - cout << "draw boogje;\n"; -#endif - cout << "showit; shipit;clearit;" << endl; -} - -void -bow (Point* points, int n, int d) -{ - Array notes; - for (int i = 0; i < n; i++) - notes.push (Offset (points[i].x, points[i].y)); -#if 1 - cout << "pickup pencircle scaled 8pt#;\n"; -#else - cout << "pickup pencircle scaled 2pt#;\n"; -#endif - for (int i = 0; i < n; i++) - cout << "drawdot (" << notes[i].x () << ", " << notes[i].y () << ");\n"; - Bezier_bow b (0); - b.set (notes, d); - b.calc (); - out (b); - return; -} - -int -main () -{ - //cout.unsetf(ios::scientific); - cout.setf(ios::fixed); -#if 1 - bow ((Point[6]){ 0,0, 20,0, 40,0, 60,0, 80,0, 100,1 }, 6, 1); - bow ((Point[6]){ 0,0, 20,0, 40,30, 60,30, 80,0, 100,1 }, 6, 1); - bow ((Point[6]){ 0,0, 20,0, 40,0, 60,0, 80,10, 100,1 }, 6, 1); - bow ((Point[6]){ 0,0, 20,0, 40,0, 60,0, 80,40, 100,1 }, 6, 1); - bow ((Point[6]){ 0,0, 20,0, 40,0, 60,40, 80,0, 100,1 }, 6, 1); - bow ((Point[6]){ 0,10, 20,20, 40,0, 60,40, 80,20, 100,50 }, 6, 1); - bow ((Point[6]){ 0,10, 20,20, 40,0, 60,40, 80,20, 100,50 }, 6, -1); - bow ((Point[6]){ 0,10, 20,20, 40,0, 60,40, 80,20, 100,100 }, 6, -1); - bow ((Point[9]){ 0,0, 20,0, 40,-80, 60,0, 80,0, 100,0, 120,0, 140,0, 160,-1 }, 9, -1); - bow ((Point[9]){ 0,0, 40,0, 80,180, 120,0, 160,0, 200,0, 240,0, 280,0, 320,1 }, 9, 1); - bow ((Point[9]){ - {0, 0}, - {19.10645980317711, 1}, - {29.402919606354207, 28}, - {55.389379409531308, 1}, - {73.530839212708514, 1}, - {91.672299015885727, 1}, - {111.35901367452229, 1}, - {131.04572833315891, 1}, - {145.76744299179552, 0} - }, - 9, 1); - bow ((Point[6]){ 0,0, 20,0, 40,0, 60,0, 80,0, 100,40 }, 6, 1); - bow ((Point[2]){ 0,0, 20,0 }, 2, 1); - bow ((Point[2]){ 0,0, 20,-10 }, 2, 1); - bow ((Point[6]){ 0,0, 20,0, 40,0, 60,0, 80,0, 100,100 }, 6, 1); - - bow ((Point[6]){ 0,0, 20,-10, 40,20, 60,-20, 80,20, 100,0 }, 6, 1); - bow ((Point[6]){ 0,0, 20,-10, 40,20, 60,-20, 80,20, 100,0 }, 6, -1); - bow ((Point[6]){ 0,0, 20,20, 40,0, 60,40, 80,20, 100,50 }, 6, 1); - bow ((Point[6]){ 0,0, 20,20, 40,0, 60,40, 80,20, 100,50 }, 6, -1); - bow ((Point[6]){ 0,0, 20,20, 40,0, 60,40, 80,20, 100,100 }, 6, -1); - - bow ((Point[6]){ 0,-10, 20,-20, 40,0, 60,-40, 80,-20, 100,-50 }, 6, 1); - - bow ((Point[6]){ 0,10, 20,20, 40,0, 60,40, 80,20, 100,50 }, 6, -1); -#endif - -#if 1 - //clipping - - bow ((Point[6]){ 0,0, 20,60, 40,0, 60,0, 80,0, 100,1 }, 6, 1); - - bow ((Point[6]){ 0,1, 20,0, 40,0, 60,0, 80,60, 100,0 }, 6, 1); - bow ((Point[6]){ 0,0, 20,20, 40,40, 60,60, 80,140, 100,100 }, 6, 1); - bow ((Point[6]){ 0,0, 20,20, 40,40, 60,60, 80,20, 100,100 }, 6, -1); - bow ((Point[6]){ 0,0, 20,-20, 40,-40, 60,-60, 80,-20, 100,-100 }, 6, 1); - bow ((Point[6]){ 0,0, 20,-20, 40,-40, 60,-60, 80,-140, 100,-100 }, 6, -1); - bow ((Point[7]){ 0,0, 20,40, 100,0, 150,0, 200,0, 280,40, 300,0 }, 7, 1); - bow ((Point[7]){ 0,0, 20,-40, 100,0, 150,0, 200,0, 280,-40, 300,0 }, 7, -1); - bow ((Point[7]){ 0,20, 20,40, 100,0, 150,0, 200,0, 280,40, 300,20 }, 7, 1); - bow ((Point[3]){ 0,0, 10,10, 20,-20 }, 3, 1); - - bow ((Point[4]){ 0,0, 33,100, 75,0, 100,100 }, 4, -1); - bow ((Point[4]){ 0,0, 33,-100, 75,0, 100,-100 }, 4, 1); -#endif - -#if 1 - // infeasible - - bow ((Point[6]){ 0,0, 20,20, 40,40, 60,60, 80,140, 100,100 }, 6, 1); - bow ((Point[6]){ 0,0, 20,-40, 40,0, 60,20, 80,20, 100,40 }, 6, -1); - bow ((Point[6]){ 0,0, 20,-20, 40,-20, 60,-20, 80,-80, 100,-40 }, 6, -1); - bow ((Point[6]){ 0,0, 20,-20, 40,-40, 60,-60, 80,-140, 100,-100 }, 6, -1); - bow ((Point[6]){ 0,0, 20,20, 40,40, 60,60, 80,140, 100,100 }, 6, 1); -#endif - - cout << "\\end" << endl; - - return 0; -} - diff --git a/test/hash.cc b/test/hash.cc deleted file mode 100644 index ee67572b76..0000000000 --- a/test/hash.cc +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include "dictionary-iter.hh" - - - -main () -{ - Dictionary *dict = new Dictionary; - - char s[1000]; - - dict->elem("foo") = "bar"; - dict->elem("bla") = "ba"; - dict->elem("blo") = "bar"; - - while (gets (s)) - { - String str (s); - - int l = str.length_i (); - - dict->elem (str.left_str (l/2)) = str.right_str (l/2); - } - - int i=1000; - while (i--) - { - Dictionary *dict2=new Dictionary (*dict); - delete dict; - dict = dict2; - } - - for (Dictionary_iter i (*dict); i.ok (); i++) - { - cout << i.key () << " == " << i.val () << endl; - cout << "elem_b: " << dict->elem_b (i.key ()) << ", key " << i.key () << " val " << dict->elem (i.key ()) < -#define PT -// #define STAFFHEIGHT 16.0 -#define STAFFHEIGHT 20.0 - -#define UP 1 -#define DOWN (-1) - -// mmm -#define STANDALONE - -#include - -typedef void *Paper_def; - -bool experimental_features_global_b = true; - -#include "misc.cc" - -int -main () -{ - //cout.unsetf(ios::scientific); - cout.setf(ios::fixed); - - Array a; - a.push (3.4); - a.push (3.9); - Interval iv; - - iv = quantise_iv (a, 4, 3.5); - cout << "iv: " << iv.min () << ", " << iv.max () << endl; - - iv = quantise_iv (a, 4, -1.5); - cout << "iv: " << iv.min () << ", " << iv.max () << endl; - - iv = quantise_iv (a, 4, -7.5); - cout << "iv: " << iv.min () << ", " << iv.max () << endl; - - iv = quantise_iv (a, 4, 3.4); - cout << "iv: " << iv.min () << ", " << iv.max () << endl; - - iv = quantise_iv (a, 4, 3.9); - cout << "iv: " << iv.min () << ", " << iv.max () << endl; - - cout << "\\end" << endl; - - return 0; -} - diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index da9907c536..084d51ce55 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -8,13 +8,7 @@ % note the ! sign. See dvips.info for details. % -% Use of -% /foo { operatorname } bind def -% -% ``compiles'' operatorname binding in the body of foo, making -% the code faster, and more reliable (less flexible) - - +% ARG. Fix brackets \def\turnOnPostScript{% % This sets CTM so that you get to the currentpoint % by executing a 0 0 moveto @@ -23,7 +17,7 @@ } % \special{! -/stafflinethickness \mudelapaperstaffline\space def +/stafflinethickness \mudelapaperstafflinethickness\space def /interline \mudelapaperinterline\space def interline 3 div /bracket_b exch def interline 2 mul /bracket_w exch def -- 2.39.2