From 422004486569407b8809da7f3c7053c1e4767bff Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 1 Sep 2000 14:13:25 +0200 Subject: [PATCH] release: 1.3.83 ====== * small doc updates. * Cleanups related to barline handling: - Removed Translator_group::get_simple_translator (), and - - use properties to communicate about barlines and time sigs. (NOTE: by default a time-signature of 4/4 is printed.) - fix repeat bar behavior. * cleaned up Directional_element_interface * add name field to score-elements. * comment in some unprotects for Music in parser. Should bring down cpu time and plug some leaks. * robustness fixes for etf2ly, tuplets, grace notes. 1.3 --- CHANGES | 20 +- .../bibliography/computer-notation.bib | 3 +- Documentation/faq.texi | 53 +++-- Documentation/topdocs/INSTALL.texi | 21 +- Documentation/user/mudela-book.tely | 6 +- INSTALL.txt | 23 +- VERSION | 4 +- buildscripts/pmx2ly.py | 206 +++++++++++++++++- flower/include/cons.hh | 2 +- lily/align-note-column-engraver.cc | 2 +- lily/bar-engraver.cc | 98 +++------ lily/bar.cc | 4 +- lily/beam.cc | 36 +-- lily/breathing-sign.cc | 4 +- lily/chord-tremolo-engraver.cc | 2 +- lily/chord.cc | 62 +++++- lily/command-request.cc | 17 +- lily/directional-element-interface.cc | 27 ++- lily/dot-column.cc | 2 +- lily/dots.cc | 6 +- lily/dynamic-engraver.cc | 5 +- lily/engraver.cc | 3 - lily/group-interface.cc | 7 +- lily/include/bar-engraver.hh | 1 + lily/include/chord.hh | 9 + lily/include/command-request.hh | 9 +- lily/include/directional-element-interface.hh | 12 +- lily/include/group-interface.hh | 8 +- lily/include/music.hh | 2 + lily/include/repeated-music.hh | 3 - lily/include/score-element.hh | 2 +- lily/include/span-bar.hh | 1 + lily/include/timing-engraver.hh | 32 --- lily/include/timing-translator.hh | 3 - lily/include/translator-group.hh | 3 +- lily/key-engraver.cc | 2 +- lily/my-lily-parser.cc | 66 +----- lily/parser.yy | 7 +- lily/pointer-group-interface.cc | 17 +- lily/repeat-engraver.cc | 92 ++++---- lily/repeated-music.cc | 24 +- lily/score-element.cc | 8 +- lily/score-engraver.cc | 2 +- lily/separating-group-spanner.cc | 2 +- lily/slur.cc | 24 +- lily/span-bar-engraver.cc | 11 +- lily/span-bar.cc | 55 +++-- lily/spanner.cc | 4 +- lily/stem-tremolo.cc | 2 +- lily/stem.cc | 10 +- lily/tie-column.cc | 15 +- lily/tie.cc | 14 +- lily/time-signature-engraver.cc | 34 +-- lily/timing-engraver.cc | 68 +++--- lily/timing-translator.cc | 18 +- lily/translator-group.cc | 12 +- lily/tuplet-spanner.cc | 10 +- lily/volta-spanner.cc | 2 +- ly/engraver.ly | 104 +++++++-- make/out/lilypond.lsm | 8 +- make/out/lilypond.spec | 4 +- scripts/etf2ly.py | 4 +- 62 files changed, 749 insertions(+), 568 deletions(-) delete mode 100644 lily/include/timing-engraver.hh diff --git a/CHANGES b/CHANGES index ac2b7778ce..1e2dd72443 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,22 @@ -1.3.82.hwn1 -=========== +1.3.83 +====== + +* small doc updates. + +* Cleanups related to barline handling: + + - Removed Translator_group::get_simple_translator (), and - + + - use properties to communicate about barlines and time sigs. (NOTE: + by default a time-signature of 4/4 is printed.) + + - fix repeat bar behavior. + + +* cleaned up Directional_element_interface + +* add name field to score-elements. * comment in some unprotects for Music in parser. Should bring down cpu time and plug some leaks. diff --git a/Documentation/bibliography/computer-notation.bib b/Documentation/bibliography/computer-notation.bib index 72ce9c38aa..00a3e9cd8d 100644 --- a/Documentation/bibliography/computer-notation.bib +++ b/Documentation/bibliography/computer-notation.bib @@ -541,7 +541,8 @@ surprising that LilyPond is more mature. title = {how to read and write tab: a guide to tab notation}, author = {Howard Wright}, email={Howard.Wright@ed.ac.uk}, - HTML={http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html}, + HTML={http://www.guitartabs.cc/tabfaq.shtml} +% HTML={http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html}, } diff --git a/Documentation/faq.texi b/Documentation/faq.texi index ae39d2e12b..298e69af76 100644 --- a/Documentation/faq.texi +++ b/Documentation/faq.texi @@ -22,6 +22,8 @@ @node Miscellaneous, ,,top @section Miscellaneous +[FIXME: rewrite FAQ, include general questions] + @subsubsection HELP! I'm stuck! Please read this document carefully. If you are still at loss, send @@ -160,7 +162,7 @@ symbols (notably lyrics and @code{^"text"} commands). Yes, see the @file{twinkle-pop} example. -@subsubsection Do you support guitar chord diagrams? +@subsubsection Do you support guitar fret diagrams? No. We ourselves don't play guitar, and don't know the fine points of this notation. We would welcome anyone who could give this a try. @@ -169,7 +171,6 @@ this notation. We would welcome anyone who could give this a try. No. The same as for the previous question goes. - @subsubsection Do you support multiple staff-sizes? Yes. At this time you can choose between 11, 13, 16, 19, 20, 23 and 20 @@ -249,7 +250,7 @@ staff/lyricline @end example -@subsubsection How do I put more than one marking on a note. +@subsubsection How do I put more than one marking on a note? You can stack them @example @@ -276,7 +277,7 @@ This also works for crescendi, eg, @end example -@subsubsection How do I combine multiple pieces into one document +@subsubsection How do I combine multiple pieces into one document? There are several solutions: @@ -308,10 +309,6 @@ in each individual piece from toplevel into the @code{\paper} block. There are several examples in the @file{mutopia} directory. -@subsubsection How do I get bar numbers? - -See @file{input/test/bar-scripts.ly}. - @subsubsection How do I change the tagline 'Lily was here'? In the @code{\header} field, add a @code{tagline} entry, e.g. @@ -384,23 +381,16 @@ participate. @subsubsection Is there a GUI frontend? Should I start building one? -LilyPond currently has no graphical interface. We (LilyPond authors) -don't feel the need to write a GUI, but several others do: - -Matthew Hiller has extended Midiscore and Koobase to handle mudela. -Check out @uref{http://zoo.cs.yale.edu/~meh25/}. He is now working on -`Denemo', a GTK based notation program (which is still being developed). - -Federico Mena-Quintero and Elliot Lee of RedHat Advanced Development -labs have plans to write a GNOME based Music notation program. However, -there is no code, only plans. +Matthew Hiller has extended Midiscore and Koobase to handle mudela, He +is now working on @uref{http://denemo.sourceforge.net/,Denemo}, a GTK +based notation program. This is the most advanced LilyPond front-end +currently available. Chris Cannam is working a rewrite of Rosegarden. The new design should be more modular, and could conceivably be used to output mudela. However, the not much seems to have happened the past year. See @uref{http://www.all-day-breakfast.com/rosegarden/development.html}. - @subsubsection I want to implement XXXX! How should I do this? Your best bet of getting us to include code, is to present it as a @@ -427,7 +417,7 @@ the file ~/.gdbinit. @example define printstr - print $arg0->strh_.data->data_byte_p_ + print $arg0->ch_C() end define printscm @@ -449,8 +439,8 @@ LilyPond uses a lot CPU time, and insane amounts of memory. The amount of memory it requires is proportional to the size of the score, in other words. For a moderately complex piano scores of 5 pages, the footprint can easily become 20 megs. (Our favorite test is the coriolan: -approx. 100 megs for a 50 page orchestral). If your system has not got -enough memory, it can easily start swapping. +approx. 100 megs for a 50 page orchestral score). If your system has not +got enough memory, it can easily start swapping. A part of the memory is used as temporary storage, and is reclaimed through GUILE's garbage collection. A way to trade in CPU time for @@ -587,8 +577,8 @@ i.e. do something like: @end itemize -Direct PS output is still experimental. For creating nice looking ps -output, use TeX and @code{dvips}. +Direct PS output is not used often, and therefore likely to exhibit +bugs. For creating nice looking ps output, use TeX and @code{dvips}. @subsubsection The beams and slurs are gone when using the XDvi magnifying glass!? @@ -764,6 +754,21 @@ See @uref{http://www.geocities.com/Vienna/Studio/1714/harpsichord.html} for a summary of copyright relative to old music, also for the expert forum for such subsubsections. +Benjy (benjy@@indiansprings.org) + +@quotation +(In the UK, the typesetting of a piece of music goes out of copyright 25 year\s +after it is published. Maybe you can tell me what copyright law says in othe\r +countries.) +@end quotation + +The US has had several schemes over the last century meaning that +anything published after January 1, 1923 and before 1964 requires that +you put in some work to determine its status. However, anything +published before 1923 is fair game in the US. See +@uref{http://www.loc.gov/copyright/circs/circ22.html} for the whole +twisted tale. + @node Windows32,, ,top @section Windows32 diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 3583f2a772..d06812d6e4 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -182,9 +182,6 @@ man2html can be had from @uref{http://askdonald.ask.uni-karlsruhe.de/hppd/hpux/N The website will build without this utility, but you will not see our hypertextified bibliography. -@item @uref{http://www.zib.de/Visual/software/doc++/index.html,DOC++} - A documentation system for C++ sources, which is used for the - LilyPond sources. @end itemize @section Configuring and compiling @@ -203,17 +200,20 @@ to install GNU LilyPond, simply type: This will install a number of files, something close to: @example - /usr/local/man/man1/mi2mu.1 + /usr/local/man/man1/midi2ly.1 + /usr/local/man/man1/abc2ly.1 + /usr/local/man/man1/etf2ly.1 /usr/local/man/man1/convert-mudela.1 /usr/local/man/man1/mudela-book.1 /usr/local/man/man1/lilypond.1 /usr/local/bin/lilypond - /usr/local/bin/mi2mu + /usr/local/bin/midi2ly /usr/local/bin/convert-mudela /usr/local/bin/mudela-book /usr/local/bin/abc2ly + /usr/local/bin/etf2ly /usr/local/share/lilypond/* - /usr/local/share/locale/@{it,nl@}/LC_MESSAGES/lilypond.mo + /usr/local/share/locale/@{....@}/LC_MESSAGES/lilypond.mo @end example @@ -339,8 +339,7 @@ You can make the rpm by issuing @end example Precompiled i386 RedHat RPMS are available from -@uref{ftp://freshmeat.net/pub/rpms/lilypond/,ftp://freshmeat.net/pub/rpms/lilypond/} and -@uref{http://linux.umbc.edu/software/lilypond/rpms/,http://linux.umbc.edu/software/lilypond/rpms/}. +@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/}. For compilation on a RedHat system you need these packages, in addition to the those needed for running: @@ -374,10 +373,10 @@ mailing your problems. If you find bugs, please send bug reports to @email{bug-gnu-music@@gnu.org}. -Known bugs that are LilyPond's fault are listed in @file{TODO}, or -demonstrated in @file{input/bugs/}. +Bugs that are LilyPond's fault are listed in our TODO list on the +web, or demonstrated in @file{input/bugs/}. -Known bugs that are not LilyPond's fault are documented here. +Bugs that are not LilyPond's fault are documented here. @unnumbered LinuxPPC Bugs: diff --git a/Documentation/user/mudela-book.tely b/Documentation/user/mudela-book.tely index 6c7bdacef2..65ef7fa736 100644 --- a/Documentation/user/mudela-book.tely +++ b/Documentation/user/mudela-book.tely @@ -150,12 +150,12 @@ will set the @code{linewidth} variable to -1, so Lilypond will make the music as short as possible but without breaking the line. Here is a well know harmonic progression: @mudela[veryverbatim, intertext="produce a well known harmonic progression:"] - + \context Voice { } @end mudela If you want to place music examples in the text, @mudela[eps] - +\context Voice { } @end mudela , you can use the @code{eps} option. This will create the music as eps graphics and include it into the document with the @@ -164,7 +164,7 @@ eps graphics and include it into the document with the The code used look like this: @example @@mudela[eps] - + \context Voice { } @@end mudela @end example diff --git a/INSTALL.txt b/INSTALL.txt index 378400dc44..73a3a997dd 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -170,9 +170,6 @@ additional conversion tools. The website will build without this utility, but you will not see our hypertextified bibliography. - * DOC++ (http://www.zib.de/Visual/software/doc++/index.html) A - documentation system for C++ sources, which is used for the - LilyPond sources. Configuring and compiling ========================= @@ -187,17 +184,20 @@ Configuring and compiling This will install a number of files, something close to: - /usr/local/man/man1/mi2mu.1 + /usr/local/man/man1/midi2ly.1 + /usr/local/man/man1/abc2ly.1 + /usr/local/man/man1/etf2ly.1 /usr/local/man/man1/convert-mudela.1 /usr/local/man/man1/mudela-book.1 /usr/local/man/man1/lilypond.1 /usr/local/bin/lilypond - /usr/local/bin/mi2mu + /usr/local/bin/midi2ly /usr/local/bin/convert-mudela /usr/local/bin/mudela-book /usr/local/bin/abc2ly + /usr/local/bin/etf2ly /usr/local/share/lilypond/* - /usr/local/share/locale/{it,nl}/LC_MESSAGES/lilypond.mo + /usr/local/share/locale/{....}/LC_MESSAGES/lilypond.mo The above assumes that you are root and have the GNU development tools, and your make is GNU make. If this is not the case, you can @@ -300,10 +300,7 @@ Redhat linux rpm -i /usr/src/redhat/RPMS/i386/lilypond-x.y.z Precompiled i386 RedHat RPMS are available from -ftp://freshmeat.net/pub/rpms/lilypond/ -(ftp://freshmeat.net/pub/rpms/lilypond/) and -http://linux.umbc.edu/software/lilypond/rpms/ -(http://linux.umbc.edu/software/lilypond/rpms/). +`ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/'. For compilation on a RedHat system you need these packages, in addition to the those needed for running: @@ -343,10 +340,10 @@ your problems. If you find bugs, please send bug reports to . - Known bugs that are LilyPond's fault are listed in `TODO', or -demonstrated in `input/bugs/'. + Bugs that are LilyPond's fault are listed in our TODO list on the +web, or demonstrated in `input/bugs/'. - Known bugs that are not LilyPond's fault are documented here. + Bugs that are not LilyPond's fault are documented here. LinuxPPC Bugs: ************** diff --git a/VERSION b/VERSION index f51aeee26b..745ecaa54b 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=82 -MY_PATCH_LEVEL=hwn1 +PATCH_LEVEL=83 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/pmx2ly.py b/buildscripts/pmx2ly.py index 58d32cb4bb..2f9155005e 100644 --- a/buildscripts/pmx2ly.py +++ b/buildscripts/pmx2ly.py @@ -1,25 +1,217 @@ #!@PYTHON@ + +# (urg! wat een pokkeformaat (pokkenformaat?)) + import string +import sys +import re + +fn = sys.argv[1] -ls = open ('barsant.pmx').readlines () +ls = open (fn).readlines () def stripcomment (l): - return re.sub ('^%.*$', '', l) + return re.sub ('[ \t]*%.*$\n', '', l) + +def stripwhite (l): + return re.sub ('[ \n\t]+', ' ', l) + +def stripeols (l): + return re.sub ('^ ', '', re.sub (' $', '', l)) ls = map (stripcomment, ls) +ls = map (stripwhite, ls) +ls = map (stripeols, ls) + + ls = filter (lambda x: x <> '', ls) opening = ls[0] ls = ls[1:] + opening = map (string.atoi, re.split ('[\t ]+', opening)) -(nv,noinst,mtrnuml,mtrdenl,mtrnump,mtrdenp,xmtrnum0,isig) = tuple (opening) + +(no_staffs, no_instruments, timesig_num,timesig_den, ptimesig_num, + ptimesig_den, pickup_beats,keysig_number) = tuple (opening) opening = ls[0] ls = ls[1:] -opening = map (string.atoi, re.split ('[\t ]+', opening)) -(npages,nsyst,musicsize,fracindent) = tuple (opening) -for l in ls: - pass +# ignore this. +# opening = map (string.atoi, re.split ('[\t ]+', opening)) +# (no_pages,no_systems, musicsize, fracindent) = tuple (opening) + +instruments = [] +while len (instruments) < no_instruments: + instruments.append (ls[0]) + ls = ls[1:] + +class Staff: + def __init__ (self): + self.voices = ([],[]) + self.clef = None + self.instrument = 0 +l = ls[0] +ls = ls[1:] + +staffs = map (lambda x: Staff (), range(0, no_staffs)) +staff_idx = 0 + +for s in staffs: + s.clef = l[0] + l = l[1:] + +# dump path +ls = ls[1:] + +# dump more ? +ls = ls[2:] + +actab = {-2: 'eses', -1: 'es', 0 : '', 1: 'is', 2:'isis'} + +def pitch_to_lily_string (tup): + (o,n,a) = tup + + nm = chr((n + 2) % 7 + ord ('a')) + nm = nm + actab[a] + if o > 0: + nm = nm + "'" * o + elif o < 0: + nm = nm + "," * -o + return nm + +class Chord: + def __init__ (self): + self.pitches = [] + self.dots = 0 + self.basic_duration = 0 + + def dump (self): + str = '' + + for p in self.pitches: + if str: + str = str + ' ' + str = str + pitch_to_lily_string (p) + + if len (self.pitches) > 1: + str = '<%s>' % str + elif len (self.pitches) == 0: + str = 'r' + + + sd = '' + if self.basic_duration == 0.5: + sd = '\\breve' + else: + sd = '%d' % self.basic_duration + + str = str + sd + '.' * self.dots + return str + + +input_left = string.join (ls, ' ') + + +input_left = re.sub ('[ \t\n]+', ' ', input_left) + +SPACE=' \t\n' +DIGITS ='0123456789' +basicdur_table = { + 9: 0.5, + 0: 0 , + 2: 2 , + 4: 4 , + 8: 8 , + 1: 16, + 3: 32, + 6: 64 + } + +class Parser: + def __init__ (self): + self.chords = [] + self.forced_duration = None + self.last_octave = 4 + + def parse_note (self, str): + ch = Chord () + + name = None + if str[0] <> 'r': + name = (ord (str[0]) - ord('a') + 5) % 7 + str = str[1:] + + forced_duration = 0 + alteration = 0 + dots = 0 + oct = None + durdigit = None + multibar = 0 + while str[0] in 'dsfmnul0123456789.,': + c = str[0] + str = str[1:] + if c == 'f': + alteration = alteration -1 + elif c == 'n': + alteration = 0 + elif c == 'm': + multibar = 1 + elif c == 's': + alteration = alteration +1 + elif c == 'd': + dots = dots + 1 + elif c in DIGITS and durdigit == None: + durdigit = string.atoi (c) + elif c in DIGITS: + oct = string.atoi (c) - 4 + elif c == '.': + dots = dots+ 1 + forced_duration = 2 + elif c == ',': + forced_duration = 2 + + + if durdigit: + ch.basic_duration = basicdur_table[durdigit] + self.last_basic_duration = ch.basic_duration + else: + ch.basic_duration = self.last_basic_duration + + if name: + if oct: + self.last_octave =oct + else: + oct = self.last_octave + + if name: + ch.pitches.append ((oct, name, alteration)) + + ch.dots = dots + + + if forced_duration: + self.forced_duration = ch.basic_duration / forced_duration + + + self.chords.append (ch) + while str[0] in SPACE: + str = str [1:] + return str + + +parser = Parser() +while input_left: + while input_left[0] in 'abcdefgr': + input_left = parser.parse_note (input_left) + print input_left[0] + + sys.stderr.write ("\nHuh? Unknown directive %s" %input_left[0:1]) + input_left = input_left[1:] + + + +for c in parser.chords: + print c.dump () diff --git a/flower/include/cons.hh b/flower/include/cons.hh index 266b9ce51c..a2ebc352d7 100644 --- a/flower/include/cons.hh +++ b/flower/include/cons.hh @@ -75,7 +75,7 @@ template int cons_list_size_i (Cons *l) template Cons * last_cons (Cons * head) { - while (head->next_) + while (head && head->next_) { head = head->next_; } diff --git a/lily/align-note-column-engraver.cc b/lily/align-note-column-engraver.cc index 75fb5b94e3..d29bc1d78c 100644 --- a/lily/align-note-column-engraver.cc +++ b/lily/align-note-column-engraver.cc @@ -61,7 +61,7 @@ Align_note_column_engraver::do_removal_processing () if (isdir_b (al)) { Direction d = to_dir (al); - Directional_element_interface (align_item_p_).set (d); + Directional_element_interface::set (align_item_p_,d); } typeset_element (align_item_p_); diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index bbb1af8238..c9d1466f6f 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -13,7 +13,7 @@ #include "musical-request.hh" #include "multi-measure-rest.hh" #include "command-request.hh" -#include "timing-engraver.hh" + #include "engraver-group-engraver.hh" #include "warn.hh" #include "item.hh" @@ -30,77 +30,54 @@ Bar_engraver::create_bar () if (!bar_p_) { bar_p_ = new Item (get_property ("basicBarProperties")); - - SCM default_type = get_property ("defaultBarType"); - if (gh_string_p (default_type)) - { - bar_p_->set_elt_property ("glyph", default_type); // ugh - } - announce_element (bar_p_, 0); } } -/** - Make a barline. If there are both |: and :| requested, merge them - to :|:. -*/ -void -Bar_engraver::request_bar (String requested_type) +void +Bar_engraver::do_creation_processing () { - if (!now_mom ()) - { - SCM prop = get_property ("barAtLineStart"); - if (!to_boolean (prop)) - return; - } - bool bar_existed = bar_p_; - create_bar (); - if (bar_existed && requested_type == "") - { - return; - } - - String current = ly_scm2string (bar_p_->get_elt_property ("glyph")); - - if ((requested_type == "|:" && current== ":|") - || (requested_type == ":|" && current == "|:")) - requested_type = ":|:"; +} - - bar_p_->set_elt_property ("glyph", - ly_str02scm (requested_type.ch_C ())); +void +Bar_engraver::do_removal_processing () +{ + typeset_bar (); } -void -Bar_engraver::do_creation_processing () +/* + Bar_engraver should come *after* any engravers that expect bars to + modify whichBar in do_process_music () be typeset +*/ +void +Bar_engraver::do_process_music() { + SCM b =get_property ("whichBar"); + if (gh_string_p (b)) + { + create_bar (); + } } void -Bar_engraver::do_removal_processing () +Bar_engraver::typeset_bar () { if (bar_p_) { + SCM gl = get_property ("whichBar"); + if (scm_equal_p (gl, bar_p_->get_elt_property ("glyph")) != SCM_BOOL_T) + bar_p_->set_elt_property ("glyph", gl); typeset_element (bar_p_); bar_p_ =0; } } -void -Bar_engraver::do_process_music() -{ - Translator * t = daddy_grav_l ()->get_simple_translator ("Timing_engraver"); // UGH.! - - Timing_engraver * te = dynamic_cast(t); - String which = (te) ? te->which_bar () : ""; - - if (which.length_i ()) - { - create_bar(); - bar_p_->set_elt_property ("glyph", ly_str02scm (which.ch_C ())); - } - +/* + lines may only be broken if there is a barline in all staffs +*/ +void +Bar_engraver::do_pre_move_processing() +{ if (!bar_p_) { Score_engraver * e = 0; @@ -109,23 +86,14 @@ Bar_engraver::do_process_music() { e = dynamic_cast (t); } - + if (!e) programming_error ("No score engraver!"); else - e->forbid_breaks (); - } -} - - -void -Bar_engraver::do_pre_move_processing() -{ - if (bar_p_) - { - typeset_element (bar_p_); - bar_p_ =0; + e->forbid_breaks (); // guh. Use properties! } + else + typeset_bar (); } ADD_THIS_TRANSLATOR(Bar_engraver); diff --git a/lily/bar.cc b/lily/bar.cc index 00625374fe..5419f3fa4b 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -158,9 +158,11 @@ Bar::before_line_breaking (SCM smob) { me->set_elt_property ("molecule-callback", SCM_BOOL_T); me->set_extent_callback (0, X_AXIS); + // leave y_extent for spanbar? } - else if (! gh_equal_p (g, orig)) + + if (! gh_equal_p (g, orig)) me->set_elt_property ("glyph", g); diff --git a/lily/beam.cc b/lily/beam.cc index a9ba9b076e..ad90e51814 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -84,8 +84,8 @@ Beam::before_line_breaking (SCM smob) warning (_ ("beam has less than two stems")); } - if (!Directional_element_interface (me).get ()) - Directional_element_interface (me).set (get_default_dir (me)); + if (!Directional_element_interface::get (me)) + Directional_element_interface::set (me, get_default_dir (me)); auto_knees (me); set_stem_directions (me); @@ -112,7 +112,7 @@ Beam::get_default_dir (Score_element*me) for (int i=0; i stems =Pointer_group_interface__extract_elements (me, (Item*) 0, "stems"); - Direction d = Directional_element_interface (me).get (); + Direction d = Directional_element_interface::get (me); for (int i=0; i remove_elt_property ("dir-forced"); if (!gh_boolean_p (force) || !gh_scm2bool (force)) - Directional_element_interface (s).set (d); + Directional_element_interface ::set (s,d); } } @@ -183,8 +183,8 @@ Beam::auto_knee (Score_element*me, String gap_str, bool interstaff_b) bool knee_b = false; int knee_y = 0; SCM gap = me->get_elt_property (gap_str.ch_C()); - - Direction d = Directional_element_interface (me).get (); + + Direction d = Directional_element_interface::get (me); Link_array stems= Pointer_group_interface__extract_elements (me, (Item*)0, "stems"); @@ -218,7 +218,7 @@ Beam::auto_knee (Score_element*me, String gap_str, bool interstaff_b) int y = (int)(Stem::head_positions(s)[d]) + (int)calc_interstaff_dist (s, dynamic_cast (me)); - Directional_element_interface (s).set (y < knee_y ? UP : DOWN); + Directional_element_interface::set (s,y < knee_y ? UP : DOWN); s->set_elt_property ("dir-forced", SCM_BOOL_T); } } @@ -300,8 +300,8 @@ Beam::after_line_breaking (SCM smob) /* until here, we used only stem_info, which acts as if dir=up */ - y *= Directional_element_interface (me).get (); - dy *= Directional_element_interface (me).get (); + y *= Directional_element_interface::get (me); + dy *= Directional_element_interface::get (me); Real half_space = Staff_symbol_referencer::staff_space (me) / 2; @@ -343,7 +343,7 @@ Beam::after_line_breaking (SCM smob) */ int quant_dir = 0; if (abs (y_shift) > half_space / 2) - quant_dir = sign (y_shift) * Directional_element_interface (me).get (); + quant_dir = sign (y_shift) * Directional_element_interface::get (me); y = quantise_y_f (me, y, dy, quant_dir); } } @@ -459,8 +459,8 @@ Beam::calc_stem_y_f (Score_element*me,Item* s, Real y, Real dy) Real stem_y = (dy && dx ? (s->relative_coordinate (0, X_AXIS) - x0) / dx * dy : 0) + y; /* knee */ - Direction dir = Directional_element_interface(me).get (); - Direction sdir = Directional_element_interface (s).get (); + Direction dir = Directional_element_interface::get (me); + Direction sdir = Directional_element_interface::get (s); /* knee */ if (dir!= sdir) @@ -473,7 +473,7 @@ Beam::calc_stem_y_f (Score_element*me,Item* s, Real y, Real dy) // huh, why not for first visible? if (Staff_symbol_referencer::staff_symbol_l (s) != Staff_symbol_referencer::staff_symbol_l (last_visible_stem (me))) - stem_y += Directional_element_interface (me).get () + stem_y += Directional_element_interface::get (me) * (beam_multiplicity - stem_multiplicity) * interbeam_f; } @@ -485,7 +485,7 @@ Beam::check_stem_length_f (Score_element*me,Real y, Real dy) { Real shorten = 0; Real lengthen = 0; - Direction dir = Directional_element_interface (me).get (); + Direction dir = Directional_element_interface::get (me); Link_array stems= Pointer_group_interface__extract_elements (me, (Item*)0, "stems"); @@ -596,7 +596,7 @@ Beam::quantise_y_f (Score_element*me,Real y, Real dy, int quant_dir) if (a.size () <= 1) return y; - Real up_y = Directional_element_interface (me).get () * y; + Real up_y = Directional_element_interface::get (me) * y; Interval iv = quantise_iv (a, up_y/staff_space) * staff_space; Real q = up_y - iv[SMALLER] <= iv[BIGGER] - up_y @@ -604,7 +604,7 @@ Beam::quantise_y_f (Score_element*me,Real y, Real dy, int quant_dir) if (quant_dir) q = iv[(Direction)quant_dir]; - return q * Directional_element_interface (me).get (); + return q * Directional_element_interface::get (me); } void @@ -674,7 +674,7 @@ Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev) nw_f = me->paper_l ()->get_var ("quartwidth"); - Direction dir = Directional_element_interface (me).get (); + Direction dir = Directional_element_interface::get (me); /* half beams extending to the left. */ if (prev) diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 8dd2d4298d..f6225e51e1 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -43,11 +43,11 @@ Breathing_sign::offset_callback (Score_element * b, Axis a) Score_element * me = (Score_element*)b; Real space = Staff_symbol_referencer::staff_space (b); - Direction d = Directional_element_interface (b). get (); + Direction d = Directional_element_interface::get (b); if (!d) { d = UP; - Directional_element_interface (me).set (d); + Directional_element_interface::set (me, d); } return 2.0 * space * d; diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 289ad00b28..1891eea844 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -151,7 +151,7 @@ Chord_tremolo_engraver::acknowledge_element (Score_element_info info) It's amazing Mike: Stem:: type_i () ->first_head ()->get_direction () -> - Directional_element_interface (me).set (d); + Directional_element_interface::set (me, d); don't understand this comment. diff --git a/lily/chord.cc b/lily/chord.cc index ef1c58a66f..5cb2870461 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -10,10 +10,8 @@ #include "musical-request.hh" #include "warn.hh" #include "debug.hh" -#include "molecule.hh" -#include "paper-def.hh" -#include "lookup.hh" -#include "lookup.hh" +#include "music-list.hh" +#include "musical-request.hh" int compare (Chord* left, Chord* right) @@ -516,3 +514,59 @@ Chord::rebuild_with_bass (Array* pitch_arr_p, int bass_i) pitch_arr_p->insert (bass, 0); } + +// junk me +Simultaneous_music * +get_chord (Musical_pitch tonic, + Array* add_arr_p, + Array* sub_arr_p, + Musical_pitch* inversion_p, + Musical_pitch* bass_p, + Duration d) +{ + + /* + UARGAUGRAGRUAUGRUINAGRAUGIRNA + + ugh + */ + Chord chord = to_chord (tonic, add_arr_p, sub_arr_p, inversion_p, bass_p); + inversion_p = 0; + bass_p = 0; + + Tonic_req* t = new Tonic_req; + t->pitch_ = tonic; + SCM l = gh_cons (t->self_scm (), SCM_EOL); + + //urg + if (chord.inversion_b_ + && Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0) + { + Inversion_req* i = new Inversion_req; + i->pitch_ = chord.inversion_pitch_; + l = gh_cons (i->self_scm (), l); + } + + if (chord.bass_b_) + { + Bass_req* b = new Bass_req; + b->pitch_ = chord.bass_pitch_; + l = gh_cons (b->self_scm (), l); + } + + Array pitch_arr = chord.to_pitch_arr (); + for (int i = pitch_arr.size (); --i >= 0;) + { + Musical_pitch p = pitch_arr[i]; + Note_req* n = new Note_req; + n->pitch_ = p; + n->duration_ = d; + l = gh_cons (n->self_scm (), l); + } + + Simultaneous_music*v = new Request_chord (l); + + return v; +} + + diff --git a/lily/command-request.cc b/lily/command-request.cc index bc919f63e7..1aaaea84ea 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -11,24 +11,9 @@ #include "musical-request.hh" -bool -Bar_req::do_equal_b (Request const *r) const -{ - Bar_req const* b = dynamic_cast (r); - return b && type_str_ == b->type_str_; -} - -void -Bar_req::do_print () const -{ -#ifndef NPRINT - DEBUG_OUT << type_str_; -#endif -} - Bar_req::Bar_req (String s) { - type_str_ = s; + set_mus_property ("type", ly_str02scm (s.ch_C())); } bool diff --git a/lily/directional-element-interface.cc b/lily/directional-element-interface.cc index 4a6a9e4d11..9689529f43 100644 --- a/lily/directional-element-interface.cc +++ b/lily/directional-element-interface.cc @@ -10,25 +10,27 @@ #include "directional-element-interface.hh" -Directional_element_interface::Directional_element_interface (Score_element const *s) +static SCM Directional_element_interface::direction_sym; + +static void +init_functions () { - elt_l_ = (Score_element*)s; + Directional_element_interface::direction_sym = scm_permanent_object (ly_symbol2scm ("direction")); } +ADD_SCM_INIT_FUNC(Directional, init_functions); + bool -Directional_element_interface::has_interface () const +Directional_element_interface::has_interface (Score_element*me) { - return isdir_b (elt_l_->get_elt_property ("direction")); + return isdir_b (me->get_elt_property (direction_sym)); } - - - Direction -Directional_element_interface::get () const +Directional_element_interface::get (Score_element*me) { // return dir_; - SCM d= elt_l_->get_elt_property ("direction"); + SCM d= me->get_elt_property (direction_sym); if (!isdir_b(d)) return CENTER; @@ -36,7 +38,10 @@ Directional_element_interface::get () const } void -Directional_element_interface::set (Direction d) +Directional_element_interface::set (Score_element*me, Direction d) { - elt_l_->set_elt_property ("direction", gh_int2scm (d)); + SCM sd = gh_int2scm (d); + + if (me->get_elt_property (direction_sym) != sd) + me->set_elt_property (direction_sym, sd); } diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 5557790b33..38777cb569 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -40,7 +40,7 @@ void Dot_column::set_interface (Score_element* me) { me->set_elt_property ("dots", SCM_EOL); - Directional_element_interface (me).set (RIGHT); + Directional_element_interface::set (me, RIGHT); Axis_group_interface::set_interface (me); Axis_group_interface::set_axes (me, X_AXIS,X_AXIS); diff --git a/lily/dots.cc b/lily/dots.cc index 1b702e2932..c249d6a1cf 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -23,13 +23,13 @@ Dots::quantised_position_callback (Score_element * me, Axis a) SCM d= me->get_elt_property ("dot-count"); if (gh_number_p (d) && gh_scm2int (d)) { - if (!Directional_element_interface (me).get ()) - Directional_element_interface (me).set (UP); + if (!Directional_element_interface::get (me)) + Directional_element_interface::set (me, UP); int pos = int (Staff_symbol_referencer::position_f (me)); if (!(pos % 2)) - return Staff_symbol_referencer::staff_space (me) / 2.0 * Directional_element_interface (me).get (); + return Staff_symbol_referencer::staff_space (me) / 2.0 * Directional_element_interface::get (me); } return 0.0; diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index c399d36f63..9093c2aa66 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -167,7 +167,7 @@ Dynamic_engraver::do_process_music () text_p_ = new Item (get_property ("basicDynamicTextProperties")); text_p_->set_elt_property ("text", ly_str02scm (loud.ch_C ())); if (Direction d=text_req_l_->get_direction ()) - Directional_element_interface (line_spanner_).set (d); + Directional_element_interface::set (line_spanner_, d); Axis_group_interface::add_element (line_spanner_, text_p_); @@ -199,8 +199,7 @@ Dynamic_engraver::do_process_music () { accepted_spanreqs_drul_[START]->origin ()->warning (current_cresc_req_->span_dir_ == 1 - ? - _ ("already have a crescendo") + ? _ ("already have a crescendo") : _ ("already have a decrescendo")); } else diff --git a/lily/engraver.cc b/lily/engraver.cc index 896c206f12..60a72fa594 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -25,9 +25,6 @@ Engraver::announce_element (Score_element_info inf) void Engraver::announce_element (Score_element* e, Music *m) { - if (e->get_elt_property ("interfaces") == SCM_EOL) - Group_interface (e, "interfaces").add_thing (ly_symbol2scm (e->name())); - if (m && m->origin ()->location_str ().length_i ()) { e->set_elt_property ("origin", m->get_mus_property ("origin")); diff --git a/lily/group-interface.cc b/lily/group-interface.cc index 7337f84c3b..ffbbf06c5d 100644 --- a/lily/group-interface.cc +++ b/lily/group-interface.cc @@ -9,14 +9,17 @@ #include "group-interface.hh" #include "score-element.hh" -Group_interface::Group_interface (Score_element const* e) +/* + ugh: clean me, junk elt_l_ field + */ +Group_interface::Group_interface (Score_element * e) { elt_l_ = (Score_element*)e; name_ = "elements"; } -Group_interface::Group_interface (Score_element const *e, String s) +Group_interface::Group_interface (Score_element *e, String s) { elt_l_ =(Score_element*)e; name_ = s; diff --git a/lily/include/bar-engraver.hh b/lily/include/bar-engraver.hh index 89ad0898f7..5d91c15b89 100644 --- a/lily/include/bar-engraver.hh +++ b/lily/include/bar-engraver.hh @@ -31,6 +31,7 @@ protected: private: + void typeset_bar (); void create_bar (); Item * bar_p_; diff --git a/lily/include/chord.hh b/lily/include/chord.hh index ce00613275..561032eefb 100644 --- a/lily/include/chord.hh +++ b/lily/include/chord.hh @@ -52,4 +52,13 @@ Chord to_chord (Array pitch_arr, Tonic_req* tonic_req, Inversion_ int compare (Chord*, Chord*); +Simultaneous_music *get_chord (Musical_pitch tonic, + Array* add_arr_p, + Array* sub_arr_p, + Musical_pitch* inversion_p, + Musical_pitch* bass_p, + Duration d); + + + #endif // CHORD_HH diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 7593325081..7ef86dda91 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -26,10 +26,8 @@ protected: class Mark_req : public Request { public: - SCM mark_label (); - - virtual bool do_equal_b (Request const*) const; + SCM mark_label (); VIRTUAL_COPY_CONS(Music); }; @@ -84,12 +82,9 @@ public: the latter should only happen at the start of a measure. */ class Bar_req : public Request { public: - String type_str_; + Bar_req (String); protected: - virtual bool do_equal_b (Request const*) const; - virtual void do_print () const; - VIRTUAL_COPY_CONS(Music); }; diff --git a/lily/include/directional-element-interface.hh b/lily/include/directional-element-interface.hh index 57e1e228df..92546cee4e 100644 --- a/lily/include/directional-element-interface.hh +++ b/lily/include/directional-element-interface.hh @@ -14,15 +14,11 @@ struct Directional_element_interface { - public: - Score_element *elt_l_; - - Directional_element_interface (Score_element const *); - void set (Direction d); - Direction get () const; - bool has_interface () const; - // bool set_interface (); + static SCM direction_sym ; + static void set (Score_element*,Direction d); + static Direction get (Score_element*) ; + static bool has_interface (Score_element*) ; }; diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index 9ae9cac612..66308caf44 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -28,8 +28,8 @@ struct Group_interface Score_element * elt_l_; String name_; public: - Group_interface (Score_element const*); - Group_interface (Score_element const*, String); + Group_interface (Score_element *); + Group_interface (Score_element *, String); int count (); void add_thing (SCM); bool has_interface (); @@ -40,8 +40,8 @@ struct Pointer_group_interface { Score_element * elt_l_; String name_; public: - Pointer_group_interface (Score_element const*); - Pointer_group_interface (Score_element const*, String); + Pointer_group_interface (Score_element*); + Pointer_group_interface (Score_element*, String); int count (); void set_interface (); static bool has_interface (Score_element*); diff --git a/lily/include/music.hh b/lily/include/music.hh index fc3d8ae05c..9e50aa0998 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -27,6 +27,8 @@ @see Music_sequence + + TODO: make a equalp function for general music. */ class Music { public: diff --git a/lily/include/repeated-music.hh b/lily/include/repeated-music.hh index cb9b9b5760..3c70ae5a30 100644 --- a/lily/include/repeated-music.hh +++ b/lily/include/repeated-music.hh @@ -70,7 +70,6 @@ public: Moment body_length_mom () const; Moment alternatives_length_mom () const; - void print() const; /// Transpose, with the interval central C to #p# virtual void transpose (Musical_pitch p); @@ -80,8 +79,6 @@ public: Repeated_music (Music*, int , Music_sequence*); Repeated_music (Repeated_music const&); -protected: - virtual void do_print() const; }; diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index f1a86dee28..b867d2119e 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -72,7 +72,7 @@ public: 0 means ORPHAN, */ char status_i_; - char const * name () const; + String name () const; /* IDEA: make this a global variable. This is the same for all diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index da2de18188..b13a68364f 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -29,6 +29,7 @@ public: static bool has_interface (Score_element*); static Interval get_spanned_interval (Score_element*); static void add_bar (Score_element*,Score_element*); + static void evaluate_glyph (Score_element*); static void evaluate_empty (Score_element*); static Interval width_callback(Score_element *, Axis) ; static SCM get_bar_size (SCM); diff --git a/lily/include/timing-engraver.hh b/lily/include/timing-engraver.hh deleted file mode 100644 index 5ac4f8a338..0000000000 --- a/lily/include/timing-engraver.hh +++ /dev/null @@ -1,32 +0,0 @@ -/* - timing-engraver.hh -- declare Timing_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--2000 Han-Wen Nienhuys -*/ - - -#ifndef TIMING_GRAV_HH -#define TIMING_GRAV_HH - -#include "timing-translator.hh" -#include "engraver.hh" - -/** - Do time bookkeeping - */ -class Timing_engraver : public Timing_translator, public Engraver -{ - - Bar_req * bar_req_l_; -protected: - virtual bool do_try_music (Music * ); - virtual void do_post_move_processing (); -public: - String which_bar (); - VIRTUAL_COPY_CONS(Translator); - -}; - -#endif // TIMING_GRAV_HH diff --git a/lily/include/timing-translator.hh b/lily/include/timing-translator.hh index 7735562b3d..579b158484 100644 --- a/lily/include/timing-translator.hh +++ b/lily/include/timing-translator.hh @@ -19,7 +19,6 @@ class Timing_translator : public virtual Translator { public: VIRTUAL_COPY_CONS(Translator); - Time_signature_change_req * time_signature_req_l () const; Timing_translator (); Link_array timing_req_l_arr_; @@ -31,10 +30,8 @@ protected: virtual void do_post_move_processing(); public: - Moment measure_position () const; Moment measure_length () const; void set_time_signature (int, int); - }; #endif // TIMING_TRANSLATOR_HH diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 126c232c8d..4701c48bbb 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -63,7 +63,6 @@ public: VIRTUAL_COPY_CONS(Translator); Translator_group(Translator_group const &); Translator_group(); - void add_simple_translator (Translator *trans_p); void add_group_translator (Translator *trans_p); @@ -75,7 +74,7 @@ public: void terminate_translator (Translator*r_l); Translator *remove_translator_p (Translator*trans_l); void check_removal (); - Translator *get_simple_translator (String) const; + // Translator *get_simple_translator (String) const; Translator_group *find_existing_translator_l (String n, String id); Translator_group *find_create_translator_l (String n, String id); Link_array path_to_acceptable_translator (String alias, Music_output_def*) const; diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 8fcae86fd2..104687dbd5 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -50,7 +50,7 @@ protected: void Key_engraver::do_removal_processing () { - old_accs_ = SCM_EOL; // unprotect can be called from dtor. + old_accs_ = SCM_EOL; // unprotect can not be called from dtor. } Key_engraver::Key_engraver () diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index b7bd385961..faf2a68b86 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -11,17 +11,9 @@ #include "my-lily-lexer.hh" #include "debug.hh" #include "main.hh" -#include "music-list.hh" -#include "musical-request.hh" -#include "command-request.hh" -#include "lily-guile.hh" #include "parser.hh" -#include "scope.hh" #include "file-results.hh" -#include "midi-def.hh" -#include "paper-def.hh" -#include "identifier.hh" -#include "chord.hh" +#include "scope.hh" My_lily_parser::My_lily_parser (Sources * source_l) { @@ -97,62 +89,6 @@ My_lily_parser::set_last_duration (Duration const *d) default_duration_ = *d; } -// junk me -Simultaneous_music * -My_lily_parser::get_chord (Musical_pitch tonic, - Array* add_arr_p, - Array* sub_arr_p, - Musical_pitch* inversion_p, - Musical_pitch* bass_p, - Duration d) -{ - - /* - UARGAUGRAGRUAUGRUINAGRAUGIRNA - - ugh - */ - Chord chord = to_chord (tonic, add_arr_p, sub_arr_p, inversion_p, bass_p); - inversion_p = 0; - bass_p = 0; - - Tonic_req* t = new Tonic_req; - t->pitch_ = tonic; - SCM l = gh_cons (t->self_scm (), SCM_EOL); - - //urg - if (chord.inversion_b_ - && Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0) - { - Inversion_req* i = new Inversion_req; - i->pitch_ = chord.inversion_pitch_; - l = gh_cons (i->self_scm (), l); - } - - if (chord.bass_b_) - { - Bass_req* b = new Bass_req; - b->pitch_ = chord.bass_pitch_; - l = gh_cons (b->self_scm (), l); - } - - Array pitch_arr = chord.to_pitch_arr (); - for (int i = pitch_arr.size (); --i >= 0;) - { - Musical_pitch p = pitch_arr[i]; - Note_req* n = new Note_req; - n->pitch_ = p; - n->duration_ = d; - l = gh_cons (n->self_scm (), l); - } - - Simultaneous_music*v = new Request_chord (l); - v->set_spot (here_input ()); - - return v; -} - - Input My_lily_parser::pop_spot() diff --git a/lily/parser.yy b/lily/parser.yy index 3c4ff7b867..8db7014cdf 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -43,6 +43,7 @@ #include "auto-change-music.hh" #include "part-combine-music.hh" #include "output-property.hh" +#include "chord.hh" bool is_duration_b (int t) @@ -90,12 +91,11 @@ print_mudela_versions (ostream &os) Music *music; Score *score; Scope *scope; - Interval *interval; + Musical_req* musreq; Music_output_def * outputdef; Musical_pitch * pitch; Midi_def* midi; - Moment *moment; Real real; Request * request; @@ -1394,7 +1394,8 @@ simple_element: chord: steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass { - $$ = THIS->get_chord (*$1, $3, $4, $5, $6, *$2); + $$ = get_chord (*$1, $3, $4, $5, $6, *$2); + $$->set_spot (THIS->here_input ()); }; chord_additions: diff --git a/lily/pointer-group-interface.cc b/lily/pointer-group-interface.cc index f1a6ae4011..aef7b46a4f 100644 --- a/lily/pointer-group-interface.cc +++ b/lily/pointer-group-interface.cc @@ -9,18 +9,25 @@ #include "group-interface.hh" #include "score-element.hh" -Pointer_group_interface::Pointer_group_interface (Score_element const* e) +/* + UGH clean me . + */ +Pointer_group_interface::Pointer_group_interface (Score_element * e) { - elt_l_ = (Score_element*)e; + elt_l_ = e; name_ = "elements"; } -Pointer_group_interface::Pointer_group_interface (Score_element const *e, String s) +Pointer_group_interface::Pointer_group_interface (Score_element *e, String s) { elt_l_ =(Score_element*)e; name_ = s; } + +/* + duh. + */ bool Pointer_group_interface::has_interface () { @@ -47,9 +54,5 @@ Pointer_group_interface::count () void Pointer_group_interface::set_interface () { - if (!has_interface ()) - { - elt_l_->set_elt_property (name_.ch_C(), SCM_EOL); - } } diff --git a/lily/repeat-engraver.cc b/lily/repeat-engraver.cc index 2cae99cb09..96b11d5e11 100644 --- a/lily/repeat-engraver.cc +++ b/lily/repeat-engraver.cc @@ -136,10 +136,10 @@ Repeat_engraver::queue_events () happens at the begin of the alt. The :| bar event at the ending. */ - for (SCM s = repeated_music_l_->alternatives ()->music_list (); - gh_pair_p (s); s = gh_cdr (s)) - { - Music *mus =unsmob_music (gh_car (s)); + for (SCM s = repeated_music_l_->alternatives ()->music_list (); + gh_pair_p (s); s = gh_cdr (s)) + { + Music *mus =unsmob_music (gh_car (s)); /* some idiot might typeset a repeat not starting on a @@ -164,8 +164,8 @@ Repeat_engraver::queue_events () becel.append (c); last_number = volta_number; volta_number ++; - SCM l (get_property ("voltaSpannerDuration")); - if (unsmob_moment(l)) + SCM l (get_property ("voltaSpannerDuration")); + if (unsmob_moment(l)) { Moment vSD_mom = *unsmob_moment (l); if ( vSD_mom < mus->length_mom() ) // terminate volta early ? @@ -185,11 +185,15 @@ Repeat_engraver::queue_events () } } - Cons *&tail = create_barmoments_queue_ - ? last_cons (create_barmoments_queue_)->next_ - : create_barmoments_queue_; + /* + ugh, should merge :| and |: here. + */ + Cons * last = last_cons (create_barmoments_queue_); + Cons **tail = last? & last->next_ + : & create_barmoments_queue_; - tail = becel.head_ ; + *tail = becel.head_ ; + becel.head_ = 0; } @@ -203,13 +207,10 @@ Repeat_engraver::do_process_music () } - Cons * head = create_barmoments_queue_; + Cons * head = create_barmoments_queue_; if (!head) return; - Bar_engraver* bar_engraver_l = dynamic_cast - (daddy_grav_l ()->get_simple_translator ("Bar_engraver")); // UGH - /* Do all the events that need to be done now. */ @@ -217,41 +218,52 @@ Repeat_engraver::do_process_music () { create_barmoments_queue_ = create_barmoments_queue_->next_; head->next_ =0; - if (bar_engraver_l) + String t = head->car_->type_; + if (head->car_->bar_b_) { - String t = head->car_->type_; - if (head->car_->bar_b_) + if (t == "stop" || t == ":|") { - if (t == "stop" || t == ":|") - { - end_volta_span_p_ = volta_span_p_; - volta_span_p_ =0; - } - - if (t != "stop") - bar_engraver_l->request_bar (t); - else - bar_engraver_l->request_bar (""); + end_volta_span_p_ = volta_span_p_; + volta_span_p_ =0; } - else + + SCM whsym = ly_symbol2scm ("whichBar"); + Translator_group* where = daddy_trans_l_->where_defined (whsym); + SCM which = where->get_property (whsym); + + /* + Should use symbols for bar glyphs. + */ + if (t == "stop" && which == SCM_UNDEFINED) + which = ly_str02scm (""); + else if (t != "stop") { - assert (!volta_span_p_); - volta_span_p_ = new Spanner (get_property ("basicVoltaSpannerProperties")); - Volta_spanner::set_interface (volta_span_p_); - announce_element (volta_span_p_,0); - volta_span_p_->set_elt_property ("text", - ly_str02scm (t.ch_C())); - volta_span_p_->set_elt_property ("last-volta", - gh_bool2scm (head->car_->last_b_)); - // voltaSpannerDuration stuff here. - // other property stuff here. + SCM l = ly_str02scm (":|"); + SCM r = ly_str02scm ("|:"); + + if ( (t == "|:" && scm_equal_p (which, l) == SCM_BOOL_T) + || (t == ":|" && scm_equal_p (which, r)== SCM_BOOL_T)) + t = ":|:"; + + if (t != "" || !gh_string_p (which)) + which = ly_str02scm (t.ch_C()); } - + where->set_property (whsym, which); } else { - warning (_ ("No bar engraver found. Ignoring repeats.")); + assert (!volta_span_p_); + volta_span_p_ = new Spanner (get_property ("basicVoltaSpannerProperties")); + Volta_spanner::set_interface (volta_span_p_); + announce_element (volta_span_p_,0); + volta_span_p_->set_elt_property ("text", + ly_str02scm (t.ch_C())); + volta_span_p_->set_elt_property ("last-volta", + gh_bool2scm (head->car_->last_b_)); + // voltaSpannerDuration stuff here. + // other property stuff here. } + delete head->car_; delete head; diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index f817ab0d33..baae892504 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -26,7 +26,11 @@ Repeated_music::alternatives ()const Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts) { - set_mus_property ("body", beg->self_scm ()); + if (beg) + { + set_mus_property ("body", beg->self_scm ()); + scm_unprotect_object (beg->self_scm ()); + } fold_b_ = false; repeats_i_ = times; volta_fold_b_ = true; @@ -34,10 +38,8 @@ Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts) { alts->truncate (times); set_mus_property ("alternatives", alts->self_scm ()); + scm_unprotect_object (alts->self_scm ()); } - - scm_unprotect_object (beg->self_scm ()); - scm_unprotect_object (alts->self_scm ()); } Repeated_music::Repeated_music (Repeated_music const &s) @@ -50,20 +52,6 @@ Repeated_music::Repeated_music (Repeated_music const &s) } -void -Repeated_music::do_print () const -{ -#ifndef NPRINT - DEBUG_OUT << "Fold = " << fold_b_ << " reps: " << repeats_i_; - - if (body ()) - body ()->print(); - - if (alternatives ()) - alternatives ()->print(); -#endif -} - Musical_pitch Repeated_music::to_relative_octave (Musical_pitch p) { diff --git a/lily/score-element.cc b/lily/score-element.cc index 26a62293fc..06a9cf70fc 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -629,10 +629,12 @@ Score_element::common_refpoint (SCM elist, Axis a) const return common; } -char const * +String Score_element::name () const { - return classname (this); + SCM nm = get_elt_property ("name"); + + return nm == SCM_EOL ? classname (this) :ly_scm2string (nm) ; } void @@ -749,7 +751,7 @@ Score_element::print_smob (SCM s, SCM port, scm_print_state *) Score_element *sc = (Score_element *) gh_cdr (s); scm_puts ("#name (), port); + scm_puts ((char *)sc->name ().ch_C(), port); /* don't try to print properties, that is too much hassle. diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 80ad78157a..2cbeafd1eb 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -148,7 +148,7 @@ Score_engraver::typeset_all() if (!s->get_bound (d)) { s->set_bound(d, command_column_l_); - ::warning (_f ("unbound spanner `%s'", classname(s))); + ::warning (_f ("unbound spanner `%s'", s->name().ch_C())); } } while (flip(&d) != LEFT); } diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index e0082e84b0..628af83903 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -106,5 +106,5 @@ Separating_group_spanner::add_spacing_unit (Score_element* me ,Item*i) void Separating_group_spanner::set_interface (Score_element*me) { - me->set_elt_property ("elements", SCM_EOL); + } diff --git a/lily/slur.cc b/lily/slur.cc index e59f5fdf03..5be17a25d6 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -122,8 +122,8 @@ Slur::after_line_breaking (SCM smob) void Slur::set_extremities (Score_element*me) { - if (!Directional_element_interface (me).get ()) - Directional_element_interface (me).set (get_default_dir (me)); + if (!Directional_element_interface::get (me)) + Directional_element_interface ::set (me,get_default_dir (me)); Direction dir = LEFT; do @@ -234,12 +234,12 @@ Slur::get_attachment (Score_element*me,Direction dir, if (str == "head") { o = Offset (0, Stem::head_positions (stem) - [Directional_element_interface (me).get ()] * hs); + [Directional_element_interface::get (me)] * hs); /* Default position is centered in X, on outer side of head Y */ o += Offset (0.5 * n->extent (X_AXIS).length (), - 0.5 * ss * Directional_element_interface (me).get ()); + 0.5 * ss * Directional_element_interface::get (me)); } else if (str == "alongside-stem") { @@ -249,7 +249,7 @@ Slur::get_attachment (Score_element*me,Direction dir, */ o += Offset (n->extent (X_AXIS).length () * (1 + Stem::get_direction (stem)), - 0.5 * ss * Directional_element_interface (me).get ()); + 0.5 * ss * Directional_element_interface::get (me)); } else if (str == "stem") { @@ -287,7 +287,7 @@ Slur::get_attachment (Score_element*me,Direction dir, SCM l = scm_assoc (scm_listify (a, gh_int2scm (stem ? Stem::get_direction (stem) : 1 * dir), - gh_int2scm (Directional_element_interface (me).get () * dir), + gh_int2scm (Directional_element_interface::get (me) * dir), SCM_UNDEFINED), scm_eval2 (ly_symbol2scm ("slur-extremity-offset-alist"), SCM_EOL)); @@ -317,7 +317,7 @@ Slur::encompass_offset (Score_element*me, Offset o; Score_element* stem_l = unsmob_element (col->get_elt_property ("stem")); - Direction dir = Directional_element_interface (me).get (); + Direction dir = Directional_element_interface::get (me); if (!stem_l) { @@ -326,7 +326,7 @@ Slur::encompass_offset (Score_element*me, o[Y_AXIS] = col->relative_coordinate (common[Y_AXIS], Y_AXIS); return o; } - Direction stem_dir = Directional_element_interface (stem_l).get (); + Direction stem_dir = Directional_element_interface::get (stem_l); o[X_AXIS] = stem_l->relative_coordinate (0, X_AXIS); /* @@ -467,7 +467,7 @@ Slur::brew_molecule (SCM smob) if (gh_number_p (d)) a = me->lookup_l ()->dashed_slur (one, thick, thick * gh_scm2double (d)); else - a = me->lookup_l ()->slur (one, Directional_element_interface (me).get () * thick, thick); + a = me->lookup_l ()->slur (one, Directional_element_interface::get (me) * thick, thick); return a.create_scheme(); } @@ -481,7 +481,7 @@ Slur::set_control_points (Score_element*me) Real r_0 = me->paper_l ()->get_var ("slur_ratio"); Slur_bezier_bow bb (get_encompass_offset_arr (me), - Directional_element_interface (me).get (), + Directional_element_interface::get (me), h_inf, r_0); if (bb.fit_factor () > 1.0) @@ -530,7 +530,7 @@ Slur::get_curve (Score_element*me) Bezier b; int i = 0; - if (!Directional_element_interface (me).get () + if (!Directional_element_interface::get (me) || ! gh_symbol_p (index_cell (me->get_elt_property ("attachment"), LEFT))) set_extremities (me); @@ -544,7 +544,7 @@ Slur::get_curve (Score_element*me) } Array enc (get_encompass_offset_arr (me)); - Direction dir = Directional_element_interface (me).get (); + Direction dir = Directional_element_interface::get (me); Real x1 = enc[0][X_AXIS]; Real x2 = enc.top ()[X_AXIS]; diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index a228a1b298..5fbd94f254 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -59,10 +59,7 @@ Span_bar_engraver::acknowledge_element (Score_element_info i) { spanbar_p_ = new Item (get_property ("basicSpanBarProperties")); Span_bar::set_interface (spanbar_p_); - spanbar_p_->set_elt_property ("glyph", bar_l_arr_[0]->get_elt_property ("glyph")); - spanbar_p_->set_elt_property ("visibility-lambda", - bar_l_arr_[0]->get_elt_property ("visibility-lambda")); - + spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS); spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS); @@ -77,6 +74,12 @@ Span_bar_engraver::do_pre_move_processing() { for (int i=0; i < bar_l_arr_.size() ; i++) Span_bar::add_bar( spanbar_p_,bar_l_arr_[i]); + + SCM vissym =ly_symbol2scm ("visibility-lambda"); + SCM vis = bar_l_arr_[0]->get_elt_property (vissym); + if (scm_equal_p (spanbar_p_->get_elt_property (vissym), vis) != SCM_BOOL_T) + spanbar_p_->set_elt_property (vissym, vis); + typeset_element (spanbar_p_); spanbar_p_ =0; } diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 722dd45d77..54b5ef953c 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -43,10 +43,13 @@ MAKE_SCHEME_CALLBACK(Span_bar,before_line_breaking); SCM Span_bar::before_line_breaking (SCM smob) { - Bar::before_line_breaking (smob); - evaluate_empty (unsmob_element (smob)); + evaluate_glyph (unsmob_element (smob)); + /* + no need to call Bar::before_line_breaking (), because the info + in ELEMENTS already has been procced by Bar::before_line_breaking(). + */ return SCM_UNSPECIFIED; } @@ -77,31 +80,39 @@ Span_bar::evaluate_empty (Score_element*me) { me->suicide (); } - - SCM gl = me->get_elt_property ("glyph"); +} + +void +Span_bar::evaluate_glyph (Score_element*me) +{ + SCM elts = me->get_elt_property ("elements"); + Score_element * b = unsmob_element (gh_car (elts)); + SCM glsym =ly_symbol2scm ("glyph"); + SCM gl =b ->get_elt_property (glsym); if (!gh_string_p (gl)) { me->suicide (); return ; } - else { - String type_str = ly_scm2string (gl); - String orig = type_str; - if (type_str == "|:") - { - type_str= ".|"; - } - else if (type_str== ":|") - { - type_str= "|."; - } - else if (type_str== ":|:") - { - type_str= ".|."; - } - if (orig != type_str) - me->set_elt_property ("glyph", ly_str02scm (type_str.ch_C())); - } + + String type = ly_scm2string (gl); + + if (type == "|:") + { + type = ".|"; + } + else if (type== ":|") + { + type = "|."; + } + else if (type== ":|:") + { + type = ".|."; + } + + gl = ly_str02scm (type.ch_C()); + if (scm_equal_p (me->get_elt_property (glsym), gl) != SCM_BOOL_T) + me->set_elt_property (glsym, gl); } Interval diff --git a/lily/spanner.cc b/lily/spanner.cc index 3328d26636..131f19e5af 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -41,8 +41,8 @@ Spanner::do_break_processing () if (!parent->spanned_rank_iv ().contains_b (this->spanned_rank_iv ())) { programming_error (to_str ("Spanner `%s' is not fully contained in parent spanner `%s'.", - classname (this), - classname (parent))); + name().ch_C(), + parent->name ().ch_C ())); } } } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index fc0ed1023f..e52df9fd05 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -95,7 +95,7 @@ Stem_tremolo::brew_molecule (SCM smob) int beams_i = Stem::beam_count(stem, RIGHT) >? Stem::beam_count (stem, LEFT); mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - me->relative_coordinate (0, X_AXIS), Stem::stem_end_position (stem ) * ss / 2 - - Directional_element_interface (beam).get () * beams_i * interbeam_f)); + Directional_element_interface::get (beam) * beams_i * interbeam_f)); } else { diff --git a/lily/stem.cc b/lily/stem.cc index 36f9c46793..b64f89bafa 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -94,13 +94,13 @@ Stem::stem_end_position (Score_element*me) Direction Stem::get_direction (Score_element*me) { - Direction d = Directional_element_interface (me).get (); + Direction d = Directional_element_interface::get (me); if (!d) { d = get_default_dir (me); // urg, AAARGH! - Directional_element_interface (me).set (d); + Directional_element_interface::set (me, d); } return d ; } @@ -289,7 +289,7 @@ Stem::get_default_stem_end_position (Score_element*me) if (!dir) { dir = get_default_dir (me); - Directional_element_interface (me).set (dir); + Directional_element_interface::set (me, dir); } /* @@ -522,7 +522,7 @@ Stem::calc_stem_info (Score_element*me) { Score_element * beam = beam_l (me); - Direction beam_dir = Directional_element_interface (beam).get (); + Direction beam_dir = Directional_element_interface::get (beam); if (!beam_dir) { programming_error ("Beam dir not set."); @@ -565,7 +565,7 @@ Stem::calc_stem_info (Score_element*me) Real stem_length = a[multiplicity paper_l ()->get_var ("tie_height_limit_factor") * staff_space; Real r_0 = me->paper_l ()->get_var ("tie_ratio"); @@ -290,7 +290,7 @@ Tie::brew_molecule (SCM smob) i++; } - Molecule a = me->lookup_l ()->slur (b, Directional_element_interface (me).get () * thick, thick); + Molecule a = me->lookup_l ()->slur (b, Directional_element_interface::get (me) * thick, thick); return a.create_scheme (); } diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 99f7898328..8eeb7e3109 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -10,7 +10,7 @@ #include "command-request.hh" #include "engraver.hh" -#include "timing-engraver.hh" + #include "engraver-group-engraver.hh" @@ -24,7 +24,7 @@ protected: public: VIRTUAL_COPY_CONS(Translator); Item * time_signature_p_; - + SCM last_time_fraction_; Time_signature_engraver(); }; @@ -32,39 +32,25 @@ public: Time_signature_engraver::Time_signature_engraver() { time_signature_p_ =0; + last_time_fraction_ = SCM_EOL; } void Time_signature_engraver::do_process_music() { /* - UGH. - this should use properties. - */ - Translator * result = - daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh - - if (!result) - { - warning (_ ("lost in time:")); - warning (_f ("can't find: `%s'", " Timing_translator")); - return ; - } - - Timing_engraver * timing_grav_l= dynamic_cast (result); - - Time_signature_change_req *req = timing_grav_l->time_signature_req_l(); - if (req) + not rigorously safe, since the value might get GC'd and + reallocated in the same spot */ + SCM fr= get_property ("timeSignatureFraction"); + if (last_time_fraction_ != fr) { + last_time_fraction_ = fr; time_signature_p_ = new Item (get_property ("basicTimeSignatureProperties")); - time_signature_p_->set_elt_property ("fraction", - gh_cons (gh_int2scm (req->beats_i_), - gh_int2scm (req->one_beat_i_))); + time_signature_p_->set_elt_property ("fraction",fr); } - if (time_signature_p_) - announce_element (time_signature_p_, req); + announce_element (time_signature_p_, 0); } void diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index 68c34aeff6..95b68d0369 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -6,11 +6,27 @@ (c) 1997--2000 Han-Wen Nienhuys */ -#include "score-engraver.hh" -#include "timing-engraver.hh" +#include "translator-group.hh" #include "command-request.hh" #include "score-element-info.hh" #include "multi-measure-rest.hh" +#include "timing-translator.hh" +#include "engraver.hh" + +/** + Do time bookkeeping + */ +class Timing_engraver : public Timing_translator, public Engraver +{ + Bar_req * bar_req_l_; +protected: + virtual bool do_try_music (Music * ); + virtual void do_post_move_processing (); + virtual void do_process_music (); +public: + String which_bar (); + VIRTUAL_COPY_CONS(Translator); +}; ADD_THIS_TRANSLATOR(Timing_engraver); @@ -19,7 +35,21 @@ Timing_engraver::do_post_move_processing( ) { bar_req_l_ = 0; Timing_translator::do_post_move_processing (); + + SCM nonauto = get_property ("barNonAuto"); + SCM which = now_mom () ? SCM_UNDEFINED : ly_str02scm ("|"); + if (which == SCM_UNDEFINED && !to_boolean (nonauto)) + { + SCM always = get_property ("barAlways"); + if (!measure_position () + || (to_boolean (always))) + { + which=get_property ("defaultBarType" ); + } + } + + daddy_trans_l_->set_property ("whichBar", which); } bool @@ -27,7 +57,7 @@ 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? + if (bar_req_l_ && !bar_req_l_->equal_b (b)) return false; bar_req_l_ = b; @@ -37,32 +67,10 @@ Timing_engraver::do_try_music (Music*m) return Timing_translator::do_try_music (m); } -/* - TODO make properties of this. - */ -String -Timing_engraver::which_bar () +void +Timing_engraver::do_process_music () { - if (!bar_req_l_) - { - if (!now_mom ()) - return "|"; - - SCM nonauto = get_property ("barNonAuto"); - if (!to_boolean (nonauto)) - { - SCM always = get_property ("barAlways"); - if (!measure_position () - || (to_boolean (always))) - { - SCM def=get_property ("defaultBarType" ); - return (gh_string_p (def))? ly_scm2string (def) : ""; - } - } - return ""; - } - else - { - return bar_req_l_->type_str_; - } + if (bar_req_l_) + daddy_trans_l_->set_property ("whichBar", bar_req_l_->get_mus_property ("type")); } + diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index ab453e5a45..430a9939bc 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -44,20 +44,6 @@ Timing_translator::do_try_music (Music*r) } return false; } - -/*ugh. - */ -Time_signature_change_req* -Timing_translator::time_signature_req_l() const -{ - Time_signature_change_req *m_l=0; - for (int i=0; !m_l && i < timing_req_l_arr_.size (); i++) - { - m_l=dynamic_cast (timing_req_l_arr_[i]); - } - return m_l; -} - void Timing_translator::do_process_music() { @@ -127,6 +113,8 @@ Timing_translator::do_creation_processing() daddy_trans_l_->set_property ("measurePosition", m.make_scm ()); daddy_trans_l_->set_property ("beatLength", Moment (1,4).make_scm ()); daddy_trans_l_->set_property ("measureLength", Moment (1).make_scm()); + daddy_trans_l_->set_property ("timeSignatureFraction", + gh_cons (gh_int2scm (4), gh_int2scm (4))); } Moment @@ -147,6 +135,8 @@ Timing_translator::set_time_signature (int l, int o) Moment len = Moment (l) * one_beat; daddy_trans_l_->set_property ("measureLength", len.make_scm ()); daddy_trans_l_->set_property ("beatLength", one_beat.make_scm ()); + daddy_trans_l_->set_property ("timeSignatureFraction", + gh_cons (gh_int2scm (l), gh_int2scm (o))); } Timing_translator::Timing_translator() diff --git a/lily/translator-group.cc b/lily/translator-group.cc index d2b7c83a04..74cee77b61 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -73,11 +73,6 @@ Translator_group::add_translator (SCM list, Translator *t) return list; } void -Translator_group::add_simple_translator (Translator*t) -{ - simple_trans_list_ = add_translator (simple_trans_list_, t); -} -void Translator_group::add_group_translator (Translator *t) { trans_group_list_ = add_translator (trans_group_list_,t); @@ -247,7 +242,10 @@ Translator_group::remove_translator_p (Translator*trans_l) return trans_l; } - +#if 0 +/* + should not use, instead: use properties to communicate between engravers. + */ Translator* Translator_group::get_simple_translator (String type) const { @@ -260,7 +258,7 @@ Translator_group::get_simple_translator (String type) const return daddy_trans_l_->get_simple_translator (type); return 0; } - +#endif bool Translator_group::is_bottom_translator_b () const diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index a86a222c84..a74e155f0f 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -73,7 +73,7 @@ Tuplet_spanner::brew_molecule (SCM smob) Real w = dynamic_cast(me)->spanner_length () + ncw; Real staff_space = me->paper_l ()->get_var ("interline"); - Direction dir = Directional_element_interface (me).get (); + Direction dir = Directional_element_interface::get (me); Real dy = gh_scm2double (me->get_elt_property ("delta-y")); SCM number = me->get_elt_property ("text"); if (gh_string_p (number) && number_visibility) @@ -131,7 +131,7 @@ Tuplet_spanner::calc_position_and_height (Score_element*me,Real *offset, Real * Score_element * commony = me->common_refpoint (me->get_elt_property ("columns"), Y_AXIS); Score_element * commonx = me->common_refpoint (me->get_elt_property ("columns"), X_AXIS); - Direction d = Directional_element_interface (me).get (); + Direction d = Directional_element_interface::get (me); /* Use outer non-rest columns to determine slope @@ -186,7 +186,7 @@ Tuplet_spanner::calc_dy (Score_element*me,Real * dy) Link_array column_arr= Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns"); - Direction d = Directional_element_interface (me).get (); + Direction d = Directional_element_interface::get (me); *dy = column_arr.top ()->extent (Y_AXIS) [d] - column_arr[0]->extent (Y_AXIS) [d]; } @@ -207,11 +207,11 @@ Tuplet_spanner::after_line_breaking (SCM smob) return SCM_UNSPECIFIED; } - Direction d = Directional_element_interface (me).get (); + Direction d = Directional_element_interface::get (me); if (!d) { d = Tuplet_spanner::get_default_dir (me); - Directional_element_interface (me).set (d); + Directional_element_interface::set (me, d); } Real dy, offset; diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 295e1665ae..7e73842989 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -24,7 +24,7 @@ Volta_spanner::set_interface (Score_element*me) { me->set_elt_property ("bars", SCM_EOL); Side_position::set_axis (me, Y_AXIS); - Directional_element_interface (me).set (UP); + Directional_element_interface::set (me, UP); } diff --git a/ly/engraver.ly b/ly/engraver.ly index 3671d3c46c..8b6a2f63eb 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -16,6 +16,7 @@ StaffContext=\translator { \consists "Repeat_engraver"; + \consists "Separating_line_group_engraver"; @@ -424,7 +425,9 @@ ScoreContext = \translator { % staffspace (distances) % basicBarProperties = #`( + (interfaces . (bar-interface staff-bar-interface)) (break-align-symbol . Staff_bar) + (glyph . "|") (barsize-procedure . ,Bar::get_staff_bar_size) (molecule-callback . ,Bar::brew_molecule) (visibility-lambda . ,all-visible) @@ -437,14 +440,14 @@ ScoreContext = \translator { (thin-kern . 3.0) (hair-thickness . 1.6) (thick-thickness . 6.0) - - (interfaces . (bar-interface staff-bar-interface)) + (name . "barline") ) basicBarNumberProperties = #`( (molecule-callback . ,Text_item::brew_molecule) (breakable . #t) (visibility-lambda . ,begin-of-line-visible) + (name . "barnumber") ) basicBeamProperties = #`( @@ -455,6 +458,7 @@ ScoreContext = \translator { (default-neutral-direction . 1) (interfaces . (beam-interface)) (damping . 1) + (name . "beam") ) basicBreakAlignProperties = #`( @@ -462,54 +466,64 @@ ScoreContext = \translator { (interfaces . (break-align-interface)) (stacking-dir . 1) (axes 0) + (name . "break alignment") ) basicBreakAlignGroupProperties = #`( (interfaces . (axis-group-interface)) (axes . (0)) + (name . "break alignment group") ) basicBreathingSignProperties = #`( + (interfaces . (breathing-sign-interface)) (break-align-symbol . Breathing_sign) (breakable . #t ) (molecule-callback . ,Breathing_sign::brew_molecule) (visibility-lambda . ,begin-of-line-invisible) - (interfaces . (breathing-sign-interface)) + (name . "breathing sign") ) basicClefItemProperties = #`( + (interfaces . (clef-interface)) (molecule-callback . ,Score_element::brew_molecule) (before-line-breaking-callback . ,Clef::before_line_breaking) (breakable . #t) (break-align-symbol . Clef_item) (visibility-lambda . ,begin-of-line-visible) - (interfaces . (clef-interface)) + (name . "clef") ) basicChordNameProperties = #`( (molecule-callback . ,Chord_name::brew_molecule) (interfaces . (chord-name-interface)) - (after-line-breaking-callback . ,Chord_name::after_line_breaking) + (after-line-breaking-callback . ,Chord_name::after_line_breaking) + (name . "chord name") ) basicCollisionProperties = #`( (axes 0 1) (interfaces . (collision-interface)) + (name . "note collision") ) basicCrescendoProperties = #`( (molecule-callback . ,Crescendo::brew_molecule) (interfaces . (crescendo-interface dynamic-interface)) + (name . "crescendo") ) basicDotColumnProperties = #`( (interfaces . (dot-column-interface axis-group-interface )) (axes 0 ) + (name . "dot column") ) basicDotsProperties = #`( + (interfaces . (dot-interface)) (molecule-callback . ,Dots::brew_molecule) (dot-count . 1) - (interfaces . (dot-interface)) + (name . "augmentation dot") ) - basicDynamicTextProperties = # `( + basicDynamicTextProperties = #`( (style . "dynamic") (interfaces . (dynamic-interface)) (molecule-callback . ,Text_item::brew_molecule) (script-priority . 100) (self-alignment-Y . 0) + (name . "dynamic text") ) basicDynamicLineSpannerProperties = #`( @@ -517,25 +531,31 @@ ScoreContext = \translator { (axes . ( 1)) (padding . 3) (minimum-space . 6) + (name . "dynamic alignment") ) + leftEdgeBasicProperties = #`( (break-align-symbol . Left_edge_item) (breakable . #t) + (name . "left edge") ) basicGraceAlignItemProperties = #`( (axes . (0)) (interfaces . (axis-group-interface align-interface)) (before-line-breaking-callback . ,Grace_align_item::before_line_breaking) + (name . "grace alignment") ) basicHaraKiriVerticalGroupspannerProperties = #`( (interfaces . (hara-kiri-interface)) (axes 1) + (name . "hara kiri") ) basicHyphenSpannerProperties = #`( (thickness . 1.0) (height . 0.4) (minimum-length . 0.5) (molecule-callback . ,Hyphen_spanner::brew_molecule) + (name . "hyphen") ) basicInstrumentNameProperties = #`( @@ -543,6 +563,7 @@ ScoreContext = \translator { (molecule-callback . ,Text_item::brew_molecule) (break-align-symbol . Instrument_name) (visibility-lambda . ,begin-of-line-visible) + (name . "instrument name") ) basicKeyProperties = #`( (molecule-callback . ,Key_item::brew_molecule) @@ -550,51 +571,61 @@ ScoreContext = \translator { (break-align-symbol . Key_item) (visibility-lambda . ,begin-of-line-visible) (breakable . #t) + (name . "key signature") ) basicLocalKeyProperties = #`( (molecule-callback . ,Local_key_item::brew_molecule) (left-padding . 0.2) (right-padding . 0.4) (interfaces . (accidentals-interface)) + (name . "accidentals") ) basicLineOfScoreProperties = #`( (axes . (0 1)) (interfaces . (axis-group-interface)) + (name . "godzilla") ) basicLyricExtenderProperties = #`( + (interfaces . (lyric-extender-interface)) (molecule-callback . ,Lyric_extender::brew_molecule) (right-trim-amount . 0.5) - (interfaces . (lyric-extender-interface)) + (name . "extender line") ) basicLyricTextProperties = #`( + (interfaces . (lyric-syllable-interface text-item-interface)) (molecule-callback . ,Text_item::brew_molecule) (self-alignment-X . 0) (non-rhythmic . #t) (word-space . 0.6) - (interfaces . (lyric-syllable-interface text-item-interface)) + (name . "lyric syllable") ) basicMarkProperties = #`( + (interfaces . (mark-interface)) (molecule-callback . ,Text_item::brew_molecule) (breakable . #t) - (interfaces . (mark-interface)) (visibility-lambda . ,end-of-line-invisible) (padding . 4.0) + (name . "rehearsal mark") ) basicMultiMeasureRestProperties = #`( (spacing-procedure . ,Multi_measure_rest::set_spacing_rods) (molecule-callback . ,Multi_measure_rest::brew_molecule) (staff-position . 0) + (name . "multi-measure rest") ) basicNoteColumnProperties = #`( - (axes 0 1) (interfaces . (axis-group-interface note-column-interface)) + (axes 0 1) + (name . "note column") ) basicNoteHeadProperties = #`( (interfaces . (note-head-interface rhythmic-head-interface)) (molecule-callback . ,Note_head::brew_molecule) + (name . "note head") ) basicNoteNameProperties = #`( (molecule-callback . ,Text_item::brew_molecule) + (name . "note name") ) basicOctavateEightProperties = #`( (self-alignment-X . 0) @@ -614,40 +645,48 @@ ScoreContext = \translator { (after-line-breaking-callback . ,Rest::after_line_breaking) (molecule-callback . ,Rest::brew_molecule) (minimum-beam-collision-distance . 1.5) + (name . "rest") ) basicRestCollisionProperties = #`( - (minimum-distance . 0.75) (interfaces . (rest-collision-interface)) + (minimum-distance . 0.75) + (name . "rest collision") ) - basicScriptProperties = #`( + basicScriptProperties = #`( (molecule-callback . ,Script::brew_molecule) (interfaces . (script-interface)) + (name . "script") ) basicScriptColumnProperties = #`( (before-line-breaking-callback . ,Script_column::before_line_breaking) + (name . "script column") ) basicSlurProperties = #`( + (interfaces . (slur-interface)) (molecule-callback . ,Slur::brew_molecule) (thickness . 1.2) - (spacing-procedure . ,Slur::set_spacing_rods) e + (spacing-procedure . ,Slur::set_spacing_rods) (minimum-length . 1.5) - (after-line-breaking-callback . ,Slur::after_line_breaking) + (after-line-breaking-callback . ,Slur::after_line_breaking) + (name . "slur") ) basicSpacingSpannerProperties =#`( (spacing-procedure . ,Spacing_spanner::set_springs) ;; assume that notes at least this long are present. (maximum-duration-for-spacing . ,(make-moment 1 8)) + (name . "spacing spanner") ) basicSpanBarProperties = #`( + (interfaces . (bar-interface span-bar-interface)) (break-align-symbol . Staff_bar) (barsize-procedure . ,Span_bar::get_bar_size) (molecule-callback . ,Bar::brew_molecule) (visibility-lambda . ,begin-of-line-invisible) (breakable . #t) + (glyph . "|") (before-line-breaking-callback . ,Span_bar::before_line_breaking) - ;; ugh duplication! ;; @@ -657,19 +696,21 @@ ScoreContext = \translator { (thin-kern . 3.0) (hair-thickness . 1.6) (thick-thickness . 6.0) - (interfaces . (bar-interface span-bar-interface)) + (name . "cross staff bar-line") ) basicStanzaNumberProperties = #`( (breakable . #t) (molecule-callback . ,Text_item::brew_molecule) (break-align-symbol . Clef_item) (visibility-lambda . ,begin-of-line-visible) + (name . "stanza number") ) staffSymbolBasicProperties = #`( + (interfaces . (staff-symbol-interface )) (molecule-callback . ,Staff_symbol::brew_molecule) (staff-space . 1.0) (line-count . 5 ) - (interfaces . (staff-symbol-interface )) + (name . "staff symbol") ) basicSystemStartDelimiterProperties = #`( (molecule-callback . ,System_start_delimiter::brew_molecule) @@ -682,30 +723,35 @@ ScoreContext = \translator { (arch-width . 1.5) (bracket-thick . 0.25) (bracket-width . 2.0) + (name . "system start bracket") ) basicTextScriptProperties = #`( (molecule-callback . ,Text_item::brew_molecule) (no-spacing-rods . #t) (interfaces . (text-script-interface text-item-interface)) - (padding . 3.0) + (padding . 3.0) + (name . "text script") ) basicTieProperties = #`( + (interfaces . (tie-interface)) (molecule-callback . ,Tie::brew_molecule) (spacing-procedure . ,Tie::set_spacing_rods) (thickness . 1.2) (minimum-length . 2.5) - (interfaces . (tie-interface)) + (name . "tie") ) basicTieColumnProperties = #`( (after-line-breaking-callback . ,Tie_column::after_line_breaking) (interfaces . (tie-column-interface)) + (name . "tie column") ) basicTimeSignatureProperties = #`( + (interfaces . (time-signature-interface)) (molecule-callback . ,Time_signature::brew_molecule) (break-align-symbol . Time_signature) (visibility-lambda . ,all-visible) (breakable . #t) - (interfaces . (time-signature-interface)) + (name . "time signature") ) basicTupletSpannerProperties = #`( (number-gap . 2.0) @@ -720,50 +766,60 @@ ScoreContext = \translator { (style . "italic") (no-spacing-rods . #t) (self-alignment-X . 0) + (name . "sostenuto pedal") ) basicStemTremoloProperties = #`( (molecule-callback . ,Stem_tremolo::brew_molecule) (beam-width . 2.0) ; staff-space (beam-thickness . 0.42) ; staff-space + (name . "stem tremolo") ) basicStemProperties = #`( + (interfaces . (stem-interface)) (before-line-breaking-callback . ,Stem::before_line_breaking) (molecule-callback . ,Stem::brew_molecule) ; if stem is on middle line, choose this direction. (default-neutral-direction . 1) - (interfaces . (stem-interface)) + (name . "stem") ) basicSeparationItemProperties = #`( (interfaces . (separation-item-interface)) + (name . "separation item") ) basicSeparatingGroupSpannerProperties = #`( (interfaces . (separation-spanner-interface)) (spacing-procedure . ,Separating_group_spanner::set_spacing_rods) + (name . "separation spanner") ) basicSustainPedalProperties = #`( + (interfaces . (sustain-pedal-interface)) (no-spacing-rods . #t) (molecule-callback . ,Sustain_pedal::brew_molecule) (self-alignment-X . 0) - (interfaces . (sustain-pedal-interface)) + (name . "sustain pedal") ) basicUnaChordaPdealProperties = #`( (molecule-callback . ,Text_item::brew_molecule) (style . "italic") (no-spacing-rods . #t) (self-alignment-X . 0) + (name . "una chorda pedal") ) basicVoltaSpannerProperties = #`( (molecule-callback . ,Volta_spanner::brew_molecule) - (interfaces . (volta-spanner-interface)) + (interfaces . (volta-spanner-interface side-position-interface)) + (direction . 1) (padding . 5) (minimum-space . 25) + (name . "volta brace") ) basicVerticalAxisGroupProperties = #`( (axes 1) (interfaces . (axis-group-interface)) + (name . "Y-axis group") ) }; diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 951fe62c35..38d3df23ec 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.82 -Entered-date: 31AUG00 +Version: 1.3.83 +Entered-date: 01SEP00 Description: 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.3.82.tar.gz + 1000k lilypond-1.3.83.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.82.tar.gz + 1000k lilypond-1.3.83.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index d6ee4e0161..71d33beb67 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.3.82 +Version: 1.3.83 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.82.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.83.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond # Icon: lilypond-icon.gif diff --git a/scripts/etf2ly.py b/scripts/etf2ly.py index 3363872a42..1835fd340b 100644 --- a/scripts/etf2ly.py +++ b/scripts/etf2ly.py @@ -239,6 +239,8 @@ articulation_dict ={ 12: '\\mordent', 8: '\\fermata', 4: '^', + 1: '.', + 3: '>', 18: '"arp"' , # arpeggio }; @@ -252,7 +254,7 @@ class Articulation: try: a = articulation_dict[self.type] except KeyError: - sys.stderr.write ("\nUnknown articulation %d" % self.type) + sys.stderr.write ("\nUnknown articulation no. %d on note no. %d" % (self.type, self.notenumber)) a = '"art"' c.note_suffix = '-' + a + c.note_suffix -- 2.39.2