+1.3.23.uu1
+==========
+
+* Added a ROADMAP file explaining the source directory layout.
+
+* Minor tweak in the feta 6 and 9 numeral
+
+* Moved files from lib/ to flower/
+
+* Removed Note_head_side class.
+
+* Updated the webpage to be a little more chatty.
+
+* Small Local_key_engraver optimization: only lookup timing engraver once.
+
+* Fixed dashed slurs
+
+* Rewrite of Slur code. Be much more picky about slur shapes. We try
+to offset the slur instead of bending it too much
+
+* Look at stem directions for tie direction.
+
+* Compound multimeasure rests. Put measures_i_ variable in an element
+property. Made the symbol a lot wider.
+
+* Time signature small cleanups.
+
1.3.22.hwn2
===========
-* Symbols opposite to stem (eg marcato) now get the proper glyph.
+* Symbols opposite to stem (eg marcato) now get the proper glyph in up
+version.
* Breathing marks now have a direction by default.
* Rewrote multi measure rest support: now they are entered as spanners
(\commandspanrequest \start "rest"). RXXXX is an abbreviation for
-\commandspanrequest \start "rest" SXXXX \commandspanrequest \stop "rest".
+
+ { \commandspanrequest \start "rest"
+ SXXXX
+ \commandspanrequest \stop "rest"
+ }
* Removed support of percent style repetitions.
@node Documentation, Language- mudela, Installing, FAQ - GNU LilyPond FAQs
@section Documentation
-@subsubsection Why is the documentation/website/etc. so lousy?
+@subsubsection What a sober website/manual you have there!
LilyPond development is moving quite fast, documentation will often lag
-a bit behind. We must always make a choice between writing more
-documentation, writing HTML, writing more code and answering email.
-
-If you think you can make a correction, or devised a solution that
-should be documented, please write it up, and us a diff.
+a bit behind. But don't hesitate to point out inaccuracies. Whip up
+your mail reader and write to the mailing list.
@node Language- mudela, Do you support -, Documentation, FAQ - GNU LilyPond FAQs
@section Language: mudela
the symbol string. You can access the symbol string easily for some
symbols (notably lyrics and @code{^"text"} commands).
-@node Do you support -, How do I -, Language- mudela, FAQ - GNU LilyPond FAQs
+@node Do you support -, How do I -, Language- mudela, FAQ - GNU LilyPond FAQs
@section Do you support ...
@subsubsection Do you support pop songs (chords, single staff, lyrics)?
@subsubsection Do you support guitar chord diagrams?
-No. Go ahead and send a patch.
-
-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.
+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.
@subsubsection Do you support TAB notation?
-No. The same as for the previous subsubsection goes.
+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
-pt staff-size. Use the @code{staffLineLeading} property for setting the
+pt staff-size. Use the @code{staffSpace} property for setting the
size of the staff, and @code{fontSize} for setting the size of the
glyphs.
@subsubsection Do you support grace notes?
-Yes. See @file{input/test/grace.ly}
+Yes. See @file{input/test/grace.ly}.
@node How do I -, Development, Do you support -, FAQ - GNU LilyPond FAQs
@section How do I ....
staves (lyric and melodic), otherwise they will end up in the same
staff/lyricline
@example
-
-4 \score @{
+ \score @{
< \melodic \type Staff = "treble" \trebleMelody
\lyric \type Lyrics = "tlyrics" \trebtext
\type Staff = "bass" \melodic \bassMelody
See @file{input/test/bar-scripts.ly}.
-@subsubsection How do I change the tagline 'Lily was here'
+@subsubsection How do I change the tagline 'Lily was here'?
-In the @code{\header} field, add a @code{tagline} entry, eg
+In the @code{\header} field, add a @code{tagline} entry, e.g.
@example
tagline="Typeset by GNU LilyPond"
@end example
-to get a bit less frivolous tagging.
-
@node Development, Running, How do I -, FAQ - GNU LilyPond FAQs
@section Development
@end itemize
-@unnumberedsubsec Links
-
-@itemize @bullet
-@item @uref{links.html, interesting links}
-@end itemize
-
@unnumberedsubsec Logo:
@itemize @bullet
@item @uref{../pictures/out-www/lelieblond.png, logo} in large size
@top
-
-For programs which are part of the GNU music project, the following
-mailing list have been setup:
-
-@table @samp
-@item info-gnu-music@@gnu.org
- A moderated list for information on the GNU Music project, to
- subscribe: send mail with subject "subscribe" to
- info-gnu-music-request@@gnu.org.
-
- As this list is moderated, normal people should ask to
- @email{drl@@gnu.org, David R. Linn} or
- @email{hanwen@@cs.uu.nl, Han-Wen} to forward announces instead of
- sending it to info-gnu-music@@gnu.org
-
-Since the GNU Music project currently only has LilyPond, this list is
-mainly for announcing new versions of LilyPond.
-
-@uref{http://www.mail-archive.com/info-gnu-music@@gnu.org}
-
-@item help-gnu-music@@gnu.org
- For help with programs from the GNU music project. To subscribe: send
- mail with subject "subscribe" to
- @email{help-gnu-music-request@@gnu.org}
-
- Since the GNU Music project currently only has LilyPond, this list is mainly about using and extending LilyPond.
-
- @uref{http://www.mail-archive.com/help-gnu-music@@gnu.org}
-
-@item bug-gnu-music@@gnu.org
- If you have bugreports, you should send them to this list. If you want
- to read all bugreports, you should subscribe to this list. To
- subscribe: send mail with subject "subscribe" to
- @email{bug-gnu-music-request@@gnu.org}
- @uref{http://www.mail-archive.com/bug-gnu-music@@gnu.org}
-@item gnu-music-discuss@@gnu.org,
- For discussions concerning the GNU Music project, to subscribe: send
- mail with subject "subscribe" to
- @email{gnu-music-discuss-request@@gnu.org}
- This list is archived at
- @uref{http://www.mail-archive.com/gnu-music-discuss@@gnu.org}
-@end table
-
-Announces of new versions will be sent to info-gnu-music and
-gnu-music-discuss.
-
+The following mailing list have been setup for LilyPond.
@bye
You can then install the new pnmtopng into @file{/usr/local/bin/}
-@item Bib2html @uref{http://pertsserver.cs.uiuc.edu/~hull/bib2html.,http://pertsserver.cs.uiuc.edu/~hull/bib2html.}
+@item @uref{http://pertsserver.cs.uiuc.edu/~hull/bib2html,Bib2html}.
Which, in turn depends on man2html for proper installation.
man2html can be had from @uref{http://askdonald.ask.uni-karlsruhe.de/hppd/hpux/Networking/WWW/Man2html-1.05,http://askdonald.ask.uni-karlsruhe.de/hppd/hpux/Networking/WWW/Man2html-1.05}.
The website will build without this utility, but you will not see our
hypertextified bibliography.
-@item Doc++ (optional) to read the source code.
-
+@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
@c something breaks on 3.12 f
+LilyPond is a music typesetter. It produces beautiful sheet music using
+a high level description file as input. It excels at typesetting
+classical music, but you can also print pop-songs. With LilyPond we
+hope to make music publication software available to anyone on the
+internet.
+The program also has limited MIDI functionality: you can write MIDI
+files with lilypond, and we have a simple MIDI to lilypond conversion
+tool, @file{midi2ly}.
-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.
-
-
-
-@unnumberedsec Sheet music
-
+LilyPond is free software. It is licensed under GNU General Public
+License, and it is part of the @uref{http://www.gnu.org/,GNU Project}.
@quotation
@end mudela
@end quotation
-@itemize @bullet
+
-@item @uref{./input/out-www/index.html,Examples}:
+The version numbers are in Linux-kernel style: even unnumbered versions
+are `stable'. The webpages for the stable version reside at GNU, here:
+ @uref{http://www.gnu.org/software/lilypond}. Big enhancements go
+into the odd numbered versions, whose webpages are on
+ @uref{http://www.cs.uu.nl/~hanwen/lilypond/,Han-Wen's site}.
-simple pieces, tests and bugs. MIDI, PNG, PostScript, and Source.
+If want more information, you can browse the
+@uref{Documentation/user/out-www/lilypond.html, manual} or other
+@uref{Documentation/out-www/index.html, documentation}.
-@item @uref{./mutopia/out-www/index.html,Music in Mutopia}:
-LilyPond handling real music. MIDI, view PNG, PostScript, and Source.
-@end itemize
+@unnumberedsec Mailing list
-@unnumberedsec More information
-
+If you have questions do write to the mailing lists
+ (but don't forget to read the @uref{Documentation/out-www/faq.html,
+Frequently Asked Questions} first:
-@itemize @bullet
-@item @uref{Documentation/out-www/index.html, Documentation}
-@item @uref{Documentation/out-www/mail.html,Mailing Lists}
-@item @uref{./docxx/index.html,Source code documentation}
-@end itemize
-@unnumberedsec Sites
-
+@table @samp
+@item info-gnu-music@@gnu.org
+ is a moderated list for information on the GNU Music project, to
+ subscribe: send mail with subject "subscribe" to
+ info-gnu-music-request@@gnu.org.
+
+ As this list is moderated, normal people should ask to
+ @email{drl@@gnu.org, David R. Linn} or
+ @email{hanwen@@cs.uu.nl, Han-Wen} to forward announces instead of
+ sending it to info-gnu-music@@gnu.org
+
+ This list is archived at
+ @uref{http://www.mail-archive.com/info-gnu-music@@gnu.org}
+
+@item help-gnu-music@@gnu.org
+ For help with LilyPond music project. To subscribe: send
+ mail with subject "subscribe" to
+ @email{help-gnu-music-request@@gnu.org} The archive is at
+ @uref{http://www.mail-archive.com/help-gnu-music@@gnu.org}.
+
+@item bug-gnu-music@@gnu.org
+ If you have bugreports, you should send them to this list. If you
+want to know about bugs, subscribe: send mail with subject "subscribe" to
+ @email{bug-gnu-music-request@@gnu.org}. The archive is at
+@uref{http://www.mail-archive.com/bug-gnu-music@@gnu.org}
+@item gnu-music-discuss@@gnu.org,
+ For discussions concerning LilyPond, to subscribe: send
+ mail with subject "subscribe" to
+ @email{gnu-music-discuss-request@@gnu.org}
+ The archive is at
+ @uref{http://www.mail-archive.com/gnu-music-discuss@@gnu.org}
+@end table
+
+@unnumberedsec News
+
+For the latest and greatest features, check out the
+@uref{Documentation/out-www/CHANGES.txt, Change Log}.
+
+@unnumberedsec Sheet music
+
+
+If you are interested in sheet music typeset by LilyPond, have a look at
+the examples included. We have @uref{./input/out-www/index.html,short
+examples} and @uref{./mutopia/out-www/index.html,longer examples}. The
+examples include sound bites in MIDI, pictures in PNG, printable scores
+in PostScript, and LilyPond input.
+
+Other use LilyPond too.
+@uref{http://www.geocities.com/Vienna/Studio/1714/harpsichord.html,John
+Sankey}, harpsichordist to the internet, is typesetting the complete
+@uref{http://www.geocities.com/Vienna/Studio/1714/scarlattidwn.html/,sonatas
+by Scarlatti}. Jeff Covey, guitar player and overall nice guy, is
+putting @uref{http://www4.smart.net/~jcovey/scores/,guitar music} on the
+net. The @uref{http://sca.uwaterloo.ca/Mutopia/,Mutopia project} is a
+large archive of public domain sheet music under construction.
-@itemize @bullet
-@item @uref{http://www.gnu.org/software/lilypond} LilyPond is part of the GNU
-project. The webpages for the stable version reside at GNU.
-@item @uref{http://www.cs.uu.nl/~hanwen/lilypond/} Han-Wen's site
-has the development pages.
-@end itemize
@unnumberedsec Download
+If you want to compile LilyPond from sources, download them here:
@itemize @bullet
-@item
- Download development releases at
+@item Download stable releases at
+@uref{ftp://ftp.gnu.org/gnu/lilypond/}
+@item Download development releases at
@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/}
-
@item Canadian mirror @uref{http://sca.uwaterloo.ca/lilypond/} and @uref{ftp://sca.uwaterloo.ca/pub/}
+@item Another site in Europe
+@uref{ftp://ftp.lilypond.org/pub/LilyPond/}
+@end itemize
+
+Installing and compiling requires many additional packages, which are
+listed in the @uref{Documentation/topdocs/out-www/INSTALL.html, installation instructions}.
-@item Another site in Europe @uref{ftp://ftp.lilypond.org/pub/LilyPond/}
+There are binaries available, but alas they are not updated for every version released.
+@itemize @bullet
@item RedHat i386
binary RPMs: @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/RPMS/}
--- /dev/null
+
+Here is an attempt at a simple explanation of the directory layout for
+LilyPond's source files.
+
+ Documentation/
+ bibliography/ .bib files with references to books and articles
+ ntweb/ building on NT
+ pictures/ .xpms of the logo
+ programmer/ programmers documentation, including a test document
+ topdocs/ sources for the toplevel files (README.txt, INSTALL.txt, etc.)
+ user/ User manuals
+ buildscripts/ Scripts used during the build process
+ debian/ Files for building .deb packages.
+ flower/ A generic library.
+ include/
+ input/ Various input files
+ test/ Test features: one file per feature
+ bugs/ Show bugs
+ tutorial/ Examples from the tutorial
+ lily/ Source code for LilyPond
+ include/
+ ly/ Standard include files.
+ make/ LilyPond specific Make subroutine files
+ mf/ MetaFont sources for the feta font
+ midi2ly/ midi2ly source code
+ include/
+ mutopia/ Larger examples with full music pieces.
+ Coriolan/
+ D.Zipoli/
+ E.Satie/
+ F.Schubert/
+ Hymns/
+ J.S.Bach/
+ L.Mozart/
+ N.W.Gade/
+ W.A.Mozart/
+ intl/ library for gettext
+ po/ translations
+ ps/ postscript library files
+ tex/ TeX library files
+ scripts/ User scripts
+ stepmake/ Generic make subroutine files
. * interstaff stems
. * junk dstream output.
. * Change website to be index to documentation.
+. * \grace { c d } c1 in midi
. * \prop slurdir in grace notes
. * \eltproperty "=Context" "Elt_name" "prop-name" #value
. * script columns
. * \accepts -> \acceptedby
. * context in embedded SCM errors.
. * acc at tied note after linebreak.
+. * fontSize for time sigs and beams.
. * fix font-naming and selecting
. * add context information to warnings
Paper:
. * don't shorten stems/staffs closer to each other.
. * to space the staffs/staffgroups contained in the score.
. * heavier beams?
-
-. * tuplets that are written as "number : note", for example
- "3 : [image of a half note here]". possible?
-. * a note with a circle after it, meaning:
-
- note + circle = note + 1/4 of its length
-
- the circle is like a dot that's not filled in. for example, on
- page three, the c-sharp on the second line should be a quarter with
- a circle, not a quarter tied to a sixteenth. is this at all
- possible with lily?
-. * deprecate hangOnClef.
. * Abstraction for engravers:
. * make "in-between" engraver (Tie)
. * make wide_spanner_engraver (line_group_spanner, staff_symbol)
. * Glissando
. * trill
-. * Collisions
-. * left/right note balls should be handled by Collision:
- < \multi 2; { \stem 1; <b c> } { <f as b> } >
-
. * Keys:
. * merge key{item} & localkey{item}?
. * spacing
--- /dev/null
+/*
+ binary-source-file.cc -- implement Binary_source_file
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997--2000 Jan Nieuwenhuizen
+*/
+
+
+#include <limits.h> // INT_MAX
+#include <assert.h>
+
+#include "proto.hh"
+#include "string.hh"
+#include "source-file.hh"
+#include "binary-source-file.hh"
+#include "string-convert.hh"
+
+Binary_source_file::Binary_source_file (String& filename_str)
+ : Source_file (filename_str)
+{
+}
+
+Binary_source_file::~Binary_source_file ()
+{
+}
+
+String
+Binary_source_file::error_str (char const* pos_ch_C) const
+{
+ assert (this);
+ if (!in_b (pos_ch_C))
+ return "";
+
+ char const* begin_ch_C = pos_ch_C - 8 >? ch_C ();
+ char const* end_ch_C = pos_ch_C + 7 <? ch_C () + length_i ();
+
+ String pre_str ((Byte const*)begin_ch_C, pos_ch_C - begin_ch_C);
+ pre_str = String_convert::bin2hex_str (pre_str);
+ for (int i = 2; i < pre_str.length_i (); i += 3)
+ pre_str = pre_str.left_str (i) + " " + pre_str.cut_str (i, INT_MAX);
+ String post_str ((Byte const*)pos_ch_C, end_ch_C - pos_ch_C);
+ post_str = String_convert::bin2hex_str (post_str);
+ for (int i = 2; i < post_str.length_i (); i += 3)
+ post_str = post_str.left_str (i) + " " + post_str.cut_str (i, INT_MAX);
+
+ String str = pre_str
+ + to_str ('\n')
+ + to_str (' ', pre_str.length_i () + 1)
+ + post_str;
+ return str;
+}
+
+int
+Binary_source_file::line_i (char const* pos_ch_C) const
+{
+ if (!in_b (pos_ch_C))
+ return 0;
+
+ return pos_ch_C - ch_C ();
+}
+
+U8
+Binary_source_file::get_U8 ()
+{
+ return *(U8*)forward_ch_C (1);
+}
+
+
+U16
+Binary_source_file::get_U16 ()
+{
+ U16 b;
+
+ b = get_U8 () << 8;
+ b |= get_U8 ();
+
+ return b;
+}
+
+
+U32
+Binary_source_file::get_U32()
+{
+ U32 b;
+
+ b = get_U8 () << 24;
+ b |= get_U8 () << 16;
+ b |= get_U8 () << 8;
+ b |= get_U8 ();
+
+ return b;
+}
+
+
--- /dev/null
+//
+// binary-source-file.hh -- declare Binary_source_file
+//
+// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+
+#ifndef BINARY_SOURCE_FILE_HH
+#define BINARY_SOURCE_FILE_HH
+
+#include "source-file.hh"
+
+class Binary_source_file : public Source_file
+{
+public:
+ Binary_source_file (String& filename_str );
+ virtual ~Binary_source_file ();
+
+ U8 get_U8 ();
+ U16 get_U16 ();
+ U32 get_U32 ();
+ Byte get_Byte () {return get_U8 (); }
+ int get_int () { return get_U32 (); }
+
+ virtual String error_str (char const* pos_ch_C ) const;
+ virtual int line_i (char const* pos_ch_C ) const;
+};
+
+#endif // BINARY_SOURCE_FILE_HH
--- /dev/null
+/*
+ file-storage.hh -- declare File_storage, Mapped_file_storage, Simple_file_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef FILE_STORAGE_HH
+#define FILE_STORAGE_HH
+
+#include "proto.hh"
+
+
+/**
+ store a file in-memory.
+ */
+class File_storage
+{
+public:
+ virtual char const* ch_C () const=0;
+ virtual int length_i () const=0;
+ virtual ~File_storage (){}
+};
+
+#endif // FILE_STORAGE_HH
--- /dev/null
+/*
+ input.hh -- declare Input
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef INPUT_HH
+#define INPUT_HH
+
+#include "proto.hh"
+
+/**
+ Base class for anything that records its poisition in the parse file.
+ */
+class Input {
+ char const *defined_ch_C_ ;
+ Source_file * source_file_l_;
+public:
+
+ void warning (String) const; // should use member func?
+ void non_fatal_error (String) const;
+ void error (String) const;
+ void message (String) const;
+ void set_spot (Input const &);
+ Input spot () const;
+ String location_str () const;
+ String line_number_str () const;
+ Input (Source_file*, char const*);
+ Input ();
+};
+
+#endif // INPUT_HH
--- /dev/null
+/*
+ mapped-file-storage.hh -- declare Mapped_file_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef MAPPED_FILE_STORAGE_HH
+#define MAPPED_FILE_STORAGE_HH
+
+
+
+#include "file-storage.hh"
+
+/**
+ Use mmap to "copy" a file into memory
+ */
+class Mapped_file_storage:public File_storage
+{
+public:
+ Mapped_file_storage (String);
+protected:
+ virtual char const* ch_C () const;
+ virtual int length_i () const;
+ virtual ~Mapped_file_storage ();
+private:
+ void open (String name);
+ void close ();
+
+ void map ();
+ void unmap ();
+ int fildes_i_;
+ off_t size_off_;
+ caddr_t data_caddr_;
+};
+
+#endif /* MAPPED_FILE_STORAGE_HH */
+
--- /dev/null
+
+/*
+ proto.hh -- part of LilyPond
+
+ (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef PROTO_HH
+#define PROTO_HH
+
+#include "flower-proto.hh"
+#include "real.hh"
+struct Duration;
+struct Duration_iterator;
+struct Source_file;
+struct Binary_source_file;
+struct Sources;
+struct File_storage;
+struct Mapped_file_storage;
+struct Simple_file_storage;
+
+#endif // PROTO_HH
--- /dev/null
+/*
+ simple-file-storage.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef SIMPLE_FILE_STORAGE_HH
+#define SIMPLE_FILE_STORAGE_HH
+
+#include "file-storage.hh"
+
+/**
+ read file char by char and copy into a malloc array.
+ */
+class Simple_file_storage : public File_storage
+{
+ char * data_p_;
+ int len_i_;
+
+ void load_stdin ();
+ void load_file (String);
+public:
+ virtual char const*ch_C () const;
+ virtual int length_i () const;
+ virtual ~Simple_file_storage ();
+ Simple_file_storage (String);
+};
+
+#endif /* SIMPLE_FILE_STORAGE_HH */
+
--- /dev/null
+//
+// source-file.hh -- declare Source_file
+//
+// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+
+#ifndef SOURCE_FILE_HH
+#define SOURCE_FILE_HH
+
+#include "proto.hh"
+#include "string.hh"
+#include "interval.hh"
+
+class istream;
+
+
+/**
+ class for reading and mapping a file.
+
+ duplicates a lot of Data_file and Text_stream.
+ should look at including Data_file's functionality:
+ get_line (), get_word () here.
+*/
+
+class Source_file
+{
+public:
+ /** Ugh! filename gets changed! The path to the opened file may
+ change, since it might be searched in multiple directories. */
+ Source_file (String filename_str_r );
+
+ Source_file (String name_str, String data_str);
+ virtual ~Source_file ();
+
+ char const* ch_C () const;
+ virtual String error_str (char const* pos_ch_C ) const;
+ istream * istream_l ();
+ bool in_b (char const* pos_ch_C ) const;
+ int length_i () const;
+ virtual int line_i (char const* pos_ch_C ) const;
+ String name_str () const;
+ String file_line_column_str (char const* ch_C ) const;
+
+ // return start + n
+ char const* seek_ch_C (int n);
+ // return here + n bytes
+ char const* forward_ch_C (int n);
+ char const* pos_ch_C () { return pos_ch_C_; }
+ String get_str (int n);
+ void set_pos (char const * pos_ch_C);
+
+ // tbd
+ // String get_line ();
+ // String get_word ();
+ // only used in binary-source-file, currently
+
+
+protected:
+ Slice line_slice (char const* pos_ch_C) const;
+ String line_str (char const* pos_ch_C) const;
+ int column_i (char const* pos_ch_C) const;
+ int char_i (char const* pos_ch_C) const;
+
+ char const* pos_ch_C_;
+
+private:
+ String name_str_;
+ istream* istream_p_;
+ File_storage * storage_p_;
+};
+
+#endif // SOURCE_FILE_HH //
+
--- /dev/null
+//
+// source.hh -- part of LilyPond
+//
+// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+
+#ifndef SOURCE_HH
+#define SOURCE_HH
+#include "cons.hh"
+#include "proto.hh"
+
+/**
+ a set of sourcefiles.
+
+ TODO:
+ */
+class Sources
+{
+ Sources (Sources const&) {}
+public:
+ Sources ();
+ ~Sources();
+
+ Source_file * get_file_l (String &filename );
+ Source_file* sourcefile_l (char const* ch_C );
+ void add (Source_file* sourcefile_p );
+ void set_path (File_path*p_C);
+ void set_binary (bool);
+
+ const File_path * path_C_;
+private:
+ Cons<Source_file> *sourcefile_p_list_;
+ bool binary_b_ ;
+};
+
+
+
+#endif // SOURCE_HH //
--- /dev/null
+/*
+ string-storage.hh -- declare String_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ */
+
+#ifndef STRING_STORAGE_HH
+#define STRING_STORAGE_HH
+
+#include "string.hh"
+#include "file-storage.hh"
+
+/**
+ Urg, let String act as file storage.
+ */
+class String_storage : public File_storage, protected String
+{
+public:
+ String_storage (String s) : String (s) { }
+
+protected:
+ virtual char const* ch_C () const { return String::ch_C (); }
+ virtual int length_i () const { return String::length_i (); }
+};
+
+#endif /* STRING_STORAGE_HH */
+
--- /dev/null
+/*
+ warn.hh -- declare Error message functions
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef WARN_HH
+#define WARN_HH
+
+#include "string.hh"
+
+void programming_error (String s);
+void warning (String message_str);
+void error (String message_str);
+void non_fatal_error (String);
+#endif // WARN_HH
--- /dev/null
+/*
+ input.cc -- implement Input
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+#include <iostream.h>
+#include "proto.hh"
+#include "input.hh"
+#include "string.hh"
+#include "source.hh"
+#include "source-file.hh"
+
+Input::Input (Source_file*s, char const *cl)
+{
+ source_file_l_=s;
+ defined_ch_C_=cl;
+}
+
+Input::Input ()
+{
+ source_file_l_ = 0;
+ defined_ch_C_ = 0;
+}
+
+Input
+Input::spot () const
+{
+ return *this;
+}
+
+void
+Input::set_spot (Input const &i)
+{
+ *this = i;
+}
+
+/*
+ Produce almost GNU-compliant error message. Lily used to be rather
+ GNU-compliant in this too, but correcting mudela is such a breeze if
+ you('re edidor) know(s) the error column too (there's no GNU standard
+ on columns, is there?).
+
+ Format:
+
+ [file:line:column:][warning:]message
+
+ */
+void
+Input::message (String message_str) const
+{
+ String str;
+
+ /*
+ marked "Work in prgress" in GNU iostream
+ libg++ 2.7.2.8
+ libstdc++ 2.8.1
+
+ why not just return always -1 (unknown),
+ iso breaking the interface?
+
+ int col = cerr.rdbuf ()->column ();
+
+ */
+
+ // well, we don't want to loose first warning...
+ int col = 1;
+ if (col > 0)
+ str += "\n";
+
+ if (source_file_l_)
+ str += location_str () + String (": ");
+
+ str += message_str;
+ if (source_file_l_)
+ {
+ str += ":\n";
+ str += source_file_l_->error_str (defined_ch_C_);
+ }
+ cerr << str << endl;
+}
+
+void
+Input::warning (String message_str) const
+{
+ message (_ ("warning: ") + message_str);
+}
+void
+Input::error (String s) const
+{
+ message (_ ("error: ")+ s);
+}
+
+void
+Input::non_fatal_error (String s) const
+{
+ message (_ ("Non fatal error: ") + s);
+}
+String
+Input::location_str () const
+{
+ if (source_file_l_)
+ return source_file_l_->file_line_column_str (defined_ch_C_);
+ else
+ return "(" + _ ("position unknown") + ")";
+}
+
+String
+Input::line_number_str () const
+{
+ if (source_file_l_)
+ return to_str (source_file_l_->line_i (defined_ch_C_));
+ else
+ return "?";
+}
--- /dev/null
+#ifdef HAIRY_STUFF
+
+/*
+ file-storage.cc -- implement Mapped_file_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ Jan Nieuwenhuizen <janneke@gnu.org>.
+
+ Nextstep fixes by tiggr@ics.ele.tue.nl
+*/
+
+#include <sys/types.h> // open, mmap
+#include <sys/stat.h> // open
+#include <sys/mman.h> // mmap
+#include <limits.h> // INT_MAX
+#include <fcntl.h> // open
+#include <unistd.h> // close, stat
+#include <stdio.h> // fdopen
+#include <string.h> // strerror
+#include <errno.h> // errno
+
+
+
+#ifdef __NeXT__
+#include <mach/mach.h>
+#include <mach/mach_traps.h>
+#include <mach/mach_error.h>
+#endif
+
+#include "string.hh"
+#include "proto.hh"
+#include "warn.hh"
+#include "file-storage.hh"
+
+Mapped_file_storage::Mapped_file_storage (String s)
+{
+ data_caddr_ = 0;
+ fildes_i_ = 0;
+ size_off_ = 0;
+ open (s);
+}
+
+char const*
+Mapped_file_storage::ch_C () const
+{
+ return (char const*)data_caddr_;
+}
+
+void
+Mapped_file_storage::map ()
+{
+ if (fildes_i_ == -1)
+ return;
+
+#ifdef __NeXT__
+ /* Should be #if !HAVE_MMAP && HAVE_MAP_FD... */
+ {
+ vm_offset_t address;
+ kern_return_t r;
+
+ r = map_fd (fildes_i_, (vm_offset_t) 0, &address, TRUE, size_off_);
+ if (r != KERN_SUCCESS)
+ warning (String ("map_fd: ") + mach_error_string (r));
+ else
+ data_caddr_ = (char *) address;
+ }
+#else
+
+ data_caddr_ = (caddr_t)mmap ((void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0);
+
+ if ((int)data_caddr_ == -1)
+ warning (_ ("Can't map file") + ": " + strerror (errno));
+
+#endif
+}
+
+
+void
+Mapped_file_storage::open (String name_str)
+{
+ fildes_i_ = ::open (name_str.ch_C (), O_RDONLY);
+
+ if (fildes_i_ == -1)
+ {
+ warning (_f ("Can't open file: `%s'", name_str)
+ + ": " + strerror (errno));
+ return;
+ }
+
+ struct stat file_stat;
+ fstat (fildes_i_, &file_stat);
+ size_off_ = file_stat.st_size;
+ map ();
+}
+
+void
+Mapped_file_storage::unmap ()
+{
+ if (data_caddr_)
+ {
+#ifdef __NeXT__
+ kern_return_t r;
+
+ r = vm_deallocate (task_self (), (vm_address_t) data_caddr_,
+size_off_);
+ if (r != KERN_SUCCESS)
+ warning (String ("vm_deallocate: ") + mach_error_string (r));
+#else
+ munmap (data_caddr_, size_off_);
+#endif
+
+ data_caddr_ = 0;
+ size_off_ = 0;
+ }
+}
+
+void
+Mapped_file_storage::close ()
+{
+ unmap ();
+ if (fildes_i_)
+ {
+ ::close (fildes_i_);
+ fildes_i_ = 0;
+ }
+}
+
+int
+Mapped_file_storage::length_i () const
+{
+ return size_off_;
+}
+
+Mapped_file_storage::~Mapped_file_storage ()
+{
+ close ();
+}
+#endif
--- /dev/null
+/*
+ simple-file-storage.cc -- implement Simple_file_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include <stdio.h>
+
+#ifndef SEEK_END
+#define SEEK_END 2
+#endif
+
+#include "simple-file-storage.hh"
+#include "array.hh"
+#include "string.hh"
+#include "warn.hh"
+
+void
+Simple_file_storage::load_stdin ()
+{
+ len_i_ = 0;
+
+ int c;
+ Array<char> ch_arr;
+ while ((c = fgetc (stdin)) != EOF)
+ ch_arr.push (c);
+ len_i_ = ch_arr.size ();
+ data_p_ = ch_arr.remove_array_p ();
+}
+
+void
+Simple_file_storage::load_file (String s)
+{
+ /*
+ let's hope that "b" opens anything binary, and does not apply
+ CR/LF translation
+ */
+ FILE * f = fopen (s.ch_C (), "rb");
+
+ if (!f)
+ {
+ warning (_f ("Can't open file: `%s'", s));
+ return ;
+ }
+
+ int ret = fseek (f, 0, SEEK_END);
+ len_i_ = ftell (f);
+ rewind (f);
+ data_p_ = new char[len_i_+1];
+ data_p_[len_i_] = 0;
+ ret = fread (data_p_, sizeof (char), len_i_, f);
+
+ if (ret!=len_i_)
+ warning (_f ("Huh? Got %d, expected %d characters", ret, len_i_));
+
+ fclose (f);
+}
+
+/**
+ Stupid but foolproof way of opening files.
+
+ TODO
+ Should check IO status
+
+ This is of course a build it yourself version of mmap, so we should
+ have been using that..., but this is simple & portable
+
+*/
+
+Simple_file_storage::Simple_file_storage (String s)
+{
+ data_p_ = 0;
+ len_i_ = 0;
+
+ if (!s.length_i () || (s == "-"))
+ load_stdin ();
+ else
+ load_file (s);
+}
+
+char const*
+Simple_file_storage::ch_C () const
+{
+ return data_p_;
+}
+
+int
+Simple_file_storage::length_i () const
+{
+ return len_i_;
+}
+
+
+Simple_file_storage::~Simple_file_storage ()
+{
+ delete []data_p_;
+}
--- /dev/null
+/*
+ source-file.cc -- implement Source_file
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ & Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#include <assert.h>
+#include <strstream.h>
+
+#include "string.hh"
+#include "proto.hh"
+#include "warn.hh"
+#include "source-file.hh"
+#include "simple-file-storage.hh"
+#include "string-storage.hh"
+
+Source_file::Source_file (String filename_str)
+{
+ name_str_ = filename_str;
+ istream_p_ = 0;
+ storage_p_ = new Simple_file_storage (filename_str);
+ pos_ch_C_ = ch_C ();
+}
+
+Source_file::Source_file (String name_str, String data_str)
+{
+ name_str_ = name_str;
+ istream_p_ = 0;
+ storage_p_ = new String_storage (data_str);
+ pos_ch_C_ = ch_C ();
+}
+
+istream*
+Source_file::istream_l ()
+{
+ /*
+ if (!name_str_.length_i ())
+ return &cin;
+ */
+
+ if (!istream_p_)
+ {
+ if (length_i ()) // can-t this be done without such a hack?
+ istream_p_ = new istrstream (ch_C (), length_i ());
+ else
+ {
+ istream_p_ = new istrstream ("", 0);
+ istream_p_->set (ios::eofbit);
+ }
+ }
+ return istream_p_;
+}
+
+String
+Source_file::file_line_column_str (char const *context_ch_C) const
+{
+ if (!ch_C ())
+ return "(" + _ ("position unknown") + ")";
+ else
+ return name_str () + ":" + to_str (line_i (context_ch_C))
+ + ":" + to_str (char_i (context_ch_C));
+}
+
+String
+Source_file::name_str () const
+{
+ return name_str_;
+}
+
+Source_file::~Source_file ()
+{
+ delete istream_p_;
+ istream_p_ = 0;
+ delete storage_p_;
+}
+
+Slice
+Source_file::line_slice (char const* pos_ch_C) const
+{
+ if (!in_b (pos_ch_C))
+ return Slice (0,0);
+
+ char const* data_ch_C = ch_C ();
+ char const * eof_C_ = data_ch_C + length_i ();
+
+ if (pos_ch_C == eof_C_)
+ pos_ch_C --;
+ char const* begin_ch_C = pos_ch_C;
+ while (begin_ch_C > data_ch_C)
+ if (*--begin_ch_C == '\n')
+ {
+ begin_ch_C++;
+ break;
+ }
+
+ char const* end_ch_C = pos_ch_C;
+ while (end_ch_C < eof_C_)
+ if (*end_ch_C++ == '\n')
+ {
+ end_ch_C--;
+ break;
+ }
+
+ return Slice (begin_ch_C - data_ch_C, end_ch_C - data_ch_C);
+}
+
+String
+Source_file::line_str (char const* pos_ch_C) const
+{
+ if (!in_b (pos_ch_C))
+ return "";
+
+ Slice line = line_slice (pos_ch_C);
+ char const* data_ch_C = ch_C ();
+ return String ((Byte const*)data_ch_C + line[LEFT], line.length ());
+}
+
+int
+Source_file::char_i (char const* pos_ch_C) const
+{
+ if (!in_b (pos_ch_C))
+ return 0;
+
+ char const* data_ch_C = ch_C ();
+ return pos_ch_C - (line_slice (pos_ch_C)[SMALLER] + data_ch_C);
+}
+
+int
+Source_file::column_i (char const* pos_ch_C) const
+{
+ if (!in_b (pos_ch_C))
+ return 0;
+
+ int ch_i = char_i (pos_ch_C);
+ String line = line_str (pos_ch_C);
+
+ int col_i = 0;
+ for (int i = 0; i < ch_i; i++)
+ if (line[i] == '\t')
+ col_i = (col_i / 8 + 1) * 8;
+ else
+ col_i++;
+
+ return col_i;
+}
+
+String
+Source_file::error_str (char const* pos_ch_C) const
+{
+ if (!in_b (pos_ch_C))
+ return "(" + _ ("position unknown") + ")";
+
+ int ch_i = char_i (pos_ch_C);
+ String line = line_str (pos_ch_C);
+ String context = line.left_str (ch_i)
+ + to_str ('\n')
+ + to_str (' ', column_i (pos_ch_C))
+ + line.cut_str (ch_i, INT_MAX);
+
+ return context;
+}
+
+bool
+Source_file::in_b (char const* pos_ch_C) const
+{
+ return (pos_ch_C && (pos_ch_C >= ch_C ()) && (pos_ch_C <= ch_C () + length_i ()));
+}
+
+int
+Source_file::line_i (char const* pos_ch_C) const
+{
+ if (!in_b (pos_ch_C))
+ return 0;
+
+ int i = 1;
+ char const* scan_ch_C = ch_C ();
+ if (!scan_ch_C)
+ return 0;
+
+ while (scan_ch_C < pos_ch_C)
+ if (*scan_ch_C++ == '\n')
+ i++;
+ return i;
+}
+
+int
+Source_file::length_i () const
+{
+ return storage_p_->length_i ();
+}
+
+char const *
+Source_file::ch_C () const
+{
+ return storage_p_->ch_C ();
+}
+
+void
+Source_file::set_pos (char const * pos_ch_C)
+{
+ if (in_b (pos_ch_C))
+ pos_ch_C_ = pos_ch_C;
+ else
+ error (error_str (pos_ch_C) + "invalid pos");
+}
+
+char const*
+Source_file::seek_ch_C (int n)
+{
+ char const* new_ch_C = ch_C () + n;
+ if (n < 0)
+ new_ch_C += length_i ();
+ if (in_b (new_ch_C))
+ pos_ch_C_ = new_ch_C;
+ else
+ error (error_str (new_ch_C) + "seek past eof");
+
+ return pos_ch_C_;
+}
+
+char const*
+Source_file::forward_ch_C (int n)
+{
+ char const* old_pos_C = pos_ch_C_;
+ char const* new_ch_C = pos_ch_C_ + n;
+ if (in_b (new_ch_C))
+ pos_ch_C_ = new_ch_C;
+ else
+ error (error_str (new_ch_C) + "forward past eof");
+
+ return old_pos_C;
+}
+
+String
+Source_file::get_str (int n)
+{
+ String str ((Byte const*)forward_ch_C (n), n);
+ return str;
+}
--- /dev/null
+/*
+ source.cc -- implement Sources
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#include <assert.h>
+#include "killing-cons.tcc"
+#include "binary-source-file.hh"
+#include "string.hh"
+#include "proto.hh"
+#include "source-file.hh"
+#include "source.hh"
+#include "file-path.hh"
+
+Sources::Sources ()
+{
+ sourcefile_p_list_ = 0;
+ path_C_= 0;
+ binary_b_ = false;
+}
+
+void
+Sources::set_binary (bool bo)
+{
+ binary_b_ = bo;
+}
+
+void
+Sources::set_path (File_path *f_C)
+{
+ path_C_ = f_C;
+}
+
+/**
+ open a file
+
+ @param file_str the file to be opened, name might be changed if it
+ is found in a search path. UGH!
+
+ @return 0 if no file found
+ */
+Source_file*
+Sources::get_file_l (String &file_str) //UGH
+{
+ if ((file_str != "-") && path_C_)
+ {
+ String file_str_o = path_C_->find (file_str);
+ if ((file_str_o == "") && (file_str != ""))
+ return 0;
+ file_str = file_str_o;
+ }
+ Source_file * f_p = (!binary_b_) ?
+ new Source_file (file_str) : new Binary_source_file (file_str);
+ add (f_p);
+ return f_p;
+}
+
+void
+Sources::add (Source_file* sourcefile_p)
+{
+ sourcefile_p_list_ = new Killing_cons<Source_file> (sourcefile_p, sourcefile_p_list_);
+}
+
+Sources::~Sources ()
+{
+ delete sourcefile_p_list_;
+}
+/**
+ search the list for file whose map contains pointer #ch_C#
+
+ @return 0 if not found.
+ */
+Source_file*
+Sources::sourcefile_l (char const* ch_C)
+{
+
+ for (Cons<Source_file> *i = sourcefile_p_list_; i; i = i->next_)
+ if (i->car_->in_b (ch_C))
+ return i->car_;
+ return 0;
+}
+
--- /dev/null
+#include <stream.h>
+#include "warn.hh"
+
+
+void
+error (String s)
+{
+ cerr << _ ("error: ") << s << '\n';
+
+ exit (1);
+}
+
+void
+non_fatal_error (String s)
+{
+ cerr << _ ("error: ") << s << '\n';
+}
+
+void
+warning (String m)
+{
+ cerr << _ ("warning: ") <<m <<endl;
+
+}
+
+void
+message (String m)
+{
+ cerr << m<<endl;
+}
+
+void
+programming_error (String s)
+{
+ cerr << _("programming error: ") << s << _(" (Continuing; cross thumbs)") << '\n';
+}
+
-\version "1.3.5";
+\header{
+filename = "beam-pos.ly";
+composer = "jcn";
+enteredby = "jcn";
+copyright = "PD";
-\score{
- \notes\transpose c''{
- % \property Score.beamQuantisation = 'test
+TestedFeatures = "beam quant positions";
+}
- [c8 c] [c c] [c c] [c c]
- [a' a'] [a' a'] [a' a'] [a' a']
- [c16 c] [c c] [c c] [c c]
- [a' a'] [a' a'] [a' a'] [a' a']
+\score{
+ \notes\relative c' {
+ [c8 c] [a'' a]
+ [a, a] [c c]
+ [d,8 d] [g' g]
+ [g, g] [d' d]
+ [c,16 c c c] [a'' a a a]
+ [a, a a a] [c c c c]
+ \break
+ [c,32 c c c c c c c] [a'' a a a a a a a]
+ [f, f f f f f f f] [e' e e e e e e e]
+ \break
+ [c,8 d] [a'' g]
+ [g, f] [d' e]
+ \break
}
\paper{
- castingalgorithm = \Wordwrap;
- linewidth = 60.0\mm;
}
}
--- /dev/null
+
+% a few 32nds shouldn't stretch spacing enormously.
+\score {
+\notes { \time 3/4;
+\relative c'{
+ g'8. c16 es8. d16 c8. bes32 as g8. c,16
+ es4 r8 es |
+ [d es f g as c ]
+ b4 g r
+}
+
+}
+\paper { linewidth = -1.0; }
+}
}
\score { < \context Staff \thenotes
- \context NoteNames \thenotes
+
>
}
-\score { \notes { \time 3/4; \key cis; R2.*5 R2. R2.*5 }
+\score { \notes { \time 3/4; \key cis;
+ R2.*15 R2. R2.*7 }
\paper {
\translator {
\ScoreContext
c( d e )c |
\slurnormal
c( d e )c |
- \property Voice.slurDash = 3
+ \property Voice.slurDash = #0.0
c( d e )c |
\slurnormal
c( d e )c |
#include "local-key-item.hh"
#include "warn.hh"
#include "directional-element-interface.hh"
+#include "side-position-interface.hh"
/**
Catch notes, and put them in a row. Used for aligning grace notes.
Align_note_column_engraver::do_creation_processing ()
{
align_item_p_ = new Grace_align_item;
+ side_position (align_item_p_).set_axis (X_AXIS);
+ side_position (align_item_p_).set_direction (LEFT);
// needed for setting font size.
announce_element (Score_element_info (align_item_p_, 0));
}
#include "paper-column.hh"
#include "paper-def.hh"
#include "dimension-cache.hh"
-
+#include "staff-symbol-referencer.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol.hh"
Bar_script_engraver::Bar_script_engraver ()
{
axis_ = Y_AXIS;
text_p_ =0;
-
visibility_lambda_
= ly_eval_str ("non-postbreak-visibility");
}
{
if (text_p_)
{
+ Staff_symbol * st = staff_symbol_referencer (text_p_).staff_symbol_l();
+
+ if (st)
+ side_position (text_p_).add_support (st);
+
typeset_element (text_p_);
text_p_ =0;
}
auto_knees ();
set_stem_directions ();
-
set_stem_shorten ();
}
#include "direction.hh"
#include "debug.hh"
#include "main.hh"
+#include "lily-guile.hh"
void
flipy (Array<Offset> &c)
void
Bezier_bow::blow_fit ()
{
- Real f = fit_factor ();
+ Real len = curve_.control_[3][X_AXIS] ;
+ Real ind = curve_.control_[1][X_AXIS] / len;
+ Real h = curve_.control_[1][Y_AXIS] * fit_factor () / len;
+
+ // ugh. Unhardcode this
+ if (h > 4 * ind)
+ {
+ h = 4* ind;
+ }
+
+ if (h > 0.8 + -2 * ind)
+ {
+ h = 0.8 - 2 *ind;
+ }
- curve_.control_[1][Y_AXIS] *= f;
- curve_.control_[2][Y_AXIS] *= f;
+ curve_.control_[1][Y_AXIS] = h * len;
+ curve_.control_[2][Y_AXIS] = h * len;
curve_.check_sanity ();
}
void
Bezier_bow::calculate ()
{
- calc_default (0.0);
+ calc_default ();
if (fit_factor () > 1.0)
{
- calc_tangent_controls ();
+ // calc_tangent_controls ();
blow_fit ();
}
}
+
+
+
Bezier
Bezier_bow::get_curve ()const
{
rv.rotate (alpha_);
rv.translate (origin_);
+
return rv;
}
See Documentation/fonts.tex
*/
void
-Bezier_bow::calc_default (Real h)
+Bezier_bow::calc_default ()
{
Real pi = M_PI;
Real b = delta.length ();
Real indent = alpha * atan (beta * b);
- Real height = indent + h;
+ Real height = indent;
curve_.control_ [0] = Offset (0, 0);
curve_.control_ [1] = Offset (indent, height);
}
+
#include "dot-column-engraver.hh"
#include "rhythmic-head.hh"
#include "dot-column.hh"
+#include "side-position-interface.hh"
Dot_column_engraver::Dot_column_engraver ()
{
if (!dotcol_p_)
{
dotcol_p_ = new Dot_column;
+ side_position (dotcol_p_).set_axis (X_AXIS);
+ side_position (dotcol_p_).set_direction (RIGHT);
announce_element (Score_element_info (dotcol_p_, 0));
}
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
#include "directional-element-interface.hh"
+#include "side-position-interface.hh"
void
Dot_column::add_dots (Dots *d)
if (!r->dots_l ())
return ;
- add_support (r);
+ side_position (this).add_support (r);
add_dots (r->dots_l ());
}
{
Staff_symbol_referencer_interface s1(d1);
Staff_symbol_referencer_interface s2(d2);
-
return int (s1.position_f () - s2.position_f ());
}
Axis_align_item::do_pre_processing ();
- Note_head_side::do_pre_processing ();
-
translate_axis (-0.5* nhw, X_AXIS); // ugh.
}
#include "local-key-item.hh"
#include "paper-column.hh"
#include "dimension-cache.hh"
+#include "side-position-interface.hh"
class Grace_position_engraver:public Engraver
{
if (align_l_)
{
for (int i=0; i < support_.size (); i++)
- align_l_->add_support (support_[i]);
+ side_position (align_l_).add_support (support_[i]);
support_.clear ();
}
}
void
Grace_position_engraver::do_pre_move_processing ()
{
+ if (align_l_ && !side_position (align_l_).supported_b ())
+ {
/*
We don't have support. Either some moron tried attaching us to a rest,
or we're at the end of the piece. In the latter case, we have a
Solution: attach ourselves to the last musical column known. A little intricate.
*/
- if (align_l_ && !align_l_->supported_b ())
- {
+
Score_element * elt = align_l_->parent_l (X_AXIS);
if (elt)
return;
#include "bezier.hh"
#include "lily-proto.hh"
-
+#include "lily-guile.hh"
/**
Implement bow specific bezier curve. Calculate bezier curve for bow
{
Bezier curve_;
Array<Offset> encompass_;
-
+
void blow_fit ();
- void calc_default (Real h);
+ void calc_default ();
void to_canonic_form ();
void calc_tangent_controls ();
Real fit_factor () const;
Real alpha_;
Offset origin_;
public:
- Real rc_factor_,
- height_limit_,
- ratio_;
+ Real rc_factor_;
+ Real height_limit_;
+ Real ratio_;
+ Real vertical_offset_needed () const;
+
+
+ SCM ugly_scm () const;
Bezier_bow (Array<Offset> points, Direction dir);
void calculate ();
Bezier get_curve () const;
#define DOT_COLUMN_HH
#include "axis-group-item.hh"
-#include "note-head-side.hh"
+
/**
Group dots. This is needed because, the dots have to be aligned per voice
*/
-class Dot_column : public Axis_group_item, public Note_head_side
+class Dot_column : public Axis_group_item
{
static int compare (Dots * const&,Dots * const&);
void add_dots (Dots*);
#ifndef GRACE_ALIGN_ITEM_HH
#define GRACE_ALIGN_ITEM_HH
-#include "note-head-side.hh"
+
#include "axis-align-item.hh"
-class Grace_align_item : public Axis_align_item, public Note_head_side
+class Grace_align_item : public Axis_align_item
{
public:
VIRTUAL_COPY_CONS (Score_element);
#ifndef LOCALKEYGRAV_HH
#define LOCALKEYGRAV_HH
-#include "engraver.hh"
-#include "key.hh"
-#include "parray.hh"
-/**
- Make accidentals. Catches note heads, ties and notices key-change
- events. Due to interaction with ties (which don't come together
- with note heads), this needs to be in a context higher than Tie_engraver.
- (FIXME).
- */
-struct Local_key_engraver : Engraver {
- Local_key_item *key_item_p_;
-protected:
- VIRTUAL_COPY_CONS(Translator);
- virtual void do_process_requests();
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing();
- virtual void do_creation_processing ();
- virtual void process_acknowledged ();
- virtual void do_removal_processing ();
-public:
-
- Key local_key_;
- Key_engraver *key_grav_l_;
- Array<Note_req* > mel_l_arr_;
- Array<Item* > support_l_arr_;
- Link_array<Item > forced_l_arr_;
- Link_array<Item > tied_l_arr_;
- Local_key_engraver();
- bool self_grace_b_;
- Grace_align_item * grace_align_l_;
-};
-
#endif // LOCALKEYGRAV_HH
#include "array.hh"
#include "musical-pitch.hh"
-#include "note-head-side.hh"
+
struct Local_key_cautionary_tuple
{
*/
-class Local_key_item : public Note_head_side
+class Local_key_item : public Item
{
Array<Local_key_cautionary_tuple> accidental_arr_;
Molecule accidental (int,bool,bool) const;
public:
- Local_key_item ();
+
void add_pitch (Musical_pitch, bool cautionary, bool natural);
protected:
virtual void do_pre_processing();
Molecule ledger_line (Interval) const;
Molecule fill (Box b) const;
Molecule filledbox (Box b) const;
- Molecule tuplet_bracket (Real dy, Real dx, Real gap, Real thick,Real height, Direction dir) const;
Molecule accordion (SCM arg, Real interline_f) const;
Molecule slur (Bezier controls, Real cthick, Real thick) const;
Molecule text (String style, String text, Paper_def*) const;
{
public:
Multi_measure_rest ();
- int measures_i_;
- void add_column (Item*);
+ void add_column (Item*);
+ Molecule compound_rest (int)const;
protected:
virtual Molecule *do_brew_molecule_p () const;
VIRTUAL_COPY_CONS (Score_element);
-/*
- note-head-side.hh -- declare Note_head_side
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef NOTE_HEAD_SIDE_HH
-#define NOTE_HEAD_SIDE_HH
-
-#include "item.hh"
-
-/**
- be next to noteheads.
- */
-class Note_head_side: public virtual Item
-{
-public:
- Note_head_side ();
- bool supported_b () const;
- void add_support (Item*);
- VIRTUAL_COPY_CONS (Score_element);
-};
-
-
-#endif /* NOTE_HEAD_SIDE_HH */
+#error
Lookup const * lookup_l (int sz) const; // TODO naming
- /** convert a duration to an idealspacing
- influence using the geometric_ and paratime_signatures.
- */
- Real length_mom_to_dist (Moment, Real) 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();
Real stem_dir_correction (Paper_column*,Paper_column*) const;
Real default_bar_spacing (Paper_column*,Paper_column*,Moment) const;
- Real note_spacing (Paper_column*,Paper_column*,Moment) const;
+ Real note_spacing (Paper_column*,Paper_column*,Moment) const;
+ Real get_duration_space (Moment dur, Moment shortest) const;
};
#endif /* SPACING_SPANNER_HH */
#include "engraver-group-engraver.hh"
#include "grace-align-item.hh"
#include "staff-symbol-referencer.hh"
+#include "side-position-interface.hh"
+#include "engraver.hh"
+#include "key.hh"
+#include "parray.hh"
+
+
+/**
+ Make accidentals. Catches note heads, ties and notices key-change
+ events. Due to interaction with ties (which don't come together
+ with note heads), this needs to be in a context higher than Tie_engraver.
+ (FIXME).
+ */
+struct Local_key_engraver : Engraver {
+ Local_key_item *key_item_p_;
+protected:
+ VIRTUAL_COPY_CONS(Translator);
+ virtual void do_process_requests();
+ virtual void acknowledge_element (Score_element_info);
+ virtual void do_pre_move_processing();
+ virtual void do_creation_processing ();
+ virtual void process_acknowledged ();
+ virtual void do_removal_processing ();
+public:
+
+ Key local_key_;
+ Key_engraver *key_grav_l_;
+ Array<Note_req* > mel_l_arr_;
+ Array<Item*> support_l_arr_;
+ Link_array<Item > forced_l_arr_;
+ Link_array<Item > tied_l_arr_;
+ Local_key_engraver();
+ bool self_grace_b_;
+ Grace_align_item * grace_align_l_;
+ Timing_translator * time_trans_l_ ;
+};
+
+
Local_key_engraver::Local_key_engraver()
{
key_grav_l_ = 0;
key_item_p_ =0;
grace_align_l_ =0;
+ time_trans_l_ = 0;
}
void
UGHGUHGUH.
Breaks if Key_engraver is removed from under us.
- */
+ */
Translator * result =
daddy_grav_l()->get_simple_translator ("Key_engraver");
TODO
(if we are grace) get key info from parent Local_key_engraver
*/
+
+ Translator * tr = daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh
+ time_trans_l_ = dynamic_cast<Timing_translator*> (tr);
}
void
Local_key_engraver::process_acknowledged ()
{
- if (!key_item_p_ && mel_l_arr_.size())
+ if (!key_item_p_ && mel_l_arr_.size())
{
- SCM f = get_property ("forgetAccidentals",0);
- bool forget = to_boolean (f);
- for (int i=0; i < mel_l_arr_.size(); i++)
+ SCM f = get_property ("forgetAccidentals",0);
+ bool forget = to_boolean (f);
+ for (int i=0; i < mel_l_arr_.size(); i++)
+ {
+ Item * support_l = support_l_arr_[i];
+ Note_req * note_l = mel_l_arr_[i];
+
+ /* see if there's a tie that "changes" the accidental */
+ /* works because if there's a tie, the note to the left
+ is of the same pitch as the actual note */
+ bool tie_changes = tied_l_arr_.find_l (support_l)
+ && !local_key_.different_acc (note_l->pitch_);
+
+ if (!forget
+
+ && ((note_l->forceacc_b_
+ || !local_key_.different_acc (note_l->pitch_)
+ || local_key_.internal_forceacc (note_l->pitch_)))
+
+ && !tie_changes)
{
- Item * support_l = support_l_arr_[i];
- Note_req * note_l = mel_l_arr_[i];
-
- /* see if there's a tie that "changes" the accidental */
- /* works because if there's a tie, the note to the left
- is of the same pitch as the actual note */
- bool tie_changes = tied_l_arr_.find_l (support_l)
- && !local_key_.different_acc (note_l->pitch_);
-
- if (!forget
-
- && ((note_l->forceacc_b_
- || !local_key_.different_acc (note_l->pitch_)
- || local_key_.internal_forceacc (note_l->pitch_)))
-
- && !tie_changes)
- {
- if (!key_item_p_)
- {
- key_item_p_ = new Local_key_item;
- Staff_symbol_referencer_interface si(key_item_p_);
- si.set_interface ();
+ if (!key_item_p_)
+ {
+ key_item_p_ = new Local_key_item;
+ side_position (key_item_p_).set_axis (X_AXIS);
+ side_position (key_item_p_).set_direction (LEFT);
+ staff_symbol_referencer(key_item_p_).set_interface ();
- announce_element (Score_element_info (key_item_p_, 0));
- }
+ announce_element (Score_element_info (key_item_p_, 0));
+ }
- key_item_p_->add_pitch (note_l->pitch_,
+ key_item_p_->add_pitch (note_l->pitch_,
note_l->cautionary_b_,
- local_key_.double_to_single_acc(note_l->pitch_));
- key_item_p_->add_support (support_l);
- }
+ local_key_.double_to_single_acc(note_l->pitch_));
+ side_position (key_item_p_).add_support (support_l);
+ }
- if (!forget)
- {
- local_key_.set (note_l->pitch_);
- if (!tied_l_arr_.find_l (support_l))
- {
- local_key_.clear_internal_forceacc (note_l->pitch_);
- }
- else if (tie_changes)
- {
- local_key_.set_internal_forceacc (note_l->pitch_);
- }
- }
+ if (!forget)
+ {
+ local_key_.set (note_l->pitch_);
+ if (!tied_l_arr_.find_l (support_l))
+ {
+ local_key_.clear_internal_forceacc (note_l->pitch_);
+ }
+ else if (tie_changes)
+ {
+ local_key_.set_internal_forceacc (note_l->pitch_);
+ }
+ }
}
}
- if (key_item_p_ && grace_align_l_)
+ if (key_item_p_ && grace_align_l_)
{
- grace_align_l_->add_support (key_item_p_);
- grace_align_l_ =0;
+ side_position (grace_align_l_).add_support (key_item_p_);
+ grace_align_l_ =0;
}
}
if (key_item_p_)
{
for (int i=0; i < support_l_arr_.size(); i++)
- key_item_p_->add_support (support_l_arr_[i]);
+ side_position (key_item_p_).add_support (support_l_arr_[i]);
typeset_element (key_item_p_);
key_item_p_ =0;
mel_l_arr_.push (note_l);
support_l_arr_.push (note_head);
}
- else if (Tie * tie_l = dynamic_cast<Tie *> (info.elem_l_))
+ else if (Tie * tie_l = dynamic_cast<Tie *> (info.elem_l_))
{
tied_l_arr_.push (tie_l->head (RIGHT));
}
void
Local_key_engraver::do_process_requests()
{
- Translator * tr = daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh
- Timing_translator * time_C_ = dynamic_cast<Timing_translator*> (tr);
-
- if (time_C_ && !time_C_->measure_position ())
+ if (time_trans_l_ && !time_trans_l_->measure_position ())
{
- SCM n = get_property ("noResetKey",0);
- bool no_res = to_boolean (n);
- if (!no_res && key_grav_l_)
+ if (!to_boolean (get_property ("noResetKey",0)) && key_grav_l_)
local_key_= key_grav_l_->key_;
}
else if (key_grav_l_ && key_grav_l_->key_changed_b ())
#include "local-key-item.hh"
#include "molecule.hh"
#include "staff-symbol-referencer.hh"
-
#include "lookup.hh"
#include "paper-def.hh"
#include "musical-request.hh"
#include "note-head.hh"
#include "misc.hh"
-Local_key_item::Local_key_item ()
-{
-}
void
Local_key_item::add_pitch (Musical_pitch p, bool cautionary, bool natural)
Local_key_item::do_pre_processing()
{
accidental_arr_.sort (Local_key_cautionary_tuple::compare);
- Note_head_side::do_pre_processing ();
}
Molecule
Molecule m (lookup_l ()->afm_find (String ("accidentals-") + to_str (j)));
if (natural)
{
- Molecule prefix = lookup_l ()->afm_find (String ("accidentals-0"));
- m.add_at_edge(X_AXIS, LEFT, Molecule(prefix), 0);
- }
+ Molecule prefix = lookup_l ()->afm_find (String ("accidentals-0"));
+ m.add_at_edge(X_AXIS, LEFT, Molecule(prefix), 0);
+ }
if (cautionary)
{
Molecule open = lookup_l ()->afm_find (String ("accidentals-("));
}
Atom *at = new Atom(gh_list (ly_symbol2scm ("dashed-slur"),
- gh_double2scm (thick),
- gh_double2scm (dash),
- ly_quote_scm (l),
- SCM_UNDEFINED));
+ gh_double2scm (thick),
+ gh_double2scm (dash),
+ ly_quote_scm (l),
+ SCM_UNDEFINED));
Molecule m;
m.add_atom (at->self_scm_);
return m;
}
-
-Molecule
-Lookup::special_time_signature (String s, int n, int d, Paper_def*pap) const
-{
- // First guess: s contains only the signature style
- String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d);
-
- Molecule m = afm_find (symbolname, false);
- if (!m.empty_b())
- return m;
-
- // Second guess: s contains the full signature name
- m = afm_find ("timesig-"+s, false);
- if (!m.empty_b ())
- return m;
-
- // Resort to default layout with numbers
- return time_signature (n,d,pap);
-}
-
Molecule
Lookup::filledbox (Box b ) const
{
-
-Molecule
-Lookup::time_signature (int num, int den, Paper_def *paper_l) const
-{
- String sty = "number";
- Molecule n (text (sty, to_str (num), paper_l));
- Molecule d (text (sty, to_str (den), paper_l));
- n.align_to (X_AXIS, CENTER);
- d.align_to (X_AXIS, CENTER);
- Molecule m;
- if (den)
- {
- m.add_at_edge (Y_AXIS, UP, n, 0.0);
- m.add_at_edge (Y_AXIS, DOWN, d, 0.0);
- }
- else
- {
- m = n;
- m.align_to (Y_AXIS, CENTER);
- }
- return m;
-}
-
Molecule
Lookup::staff_brace (Real y, int staff_size) const
{
}
-
-Molecule
-Lookup::tuplet_bracket (Real dy , Real dx, Real thick, Real gap,
- Real height, Direction dir) const
-{
- Molecule m;
-
- Atom *at = new Atom (gh_list(ly_symbol2scm ("tuplet"),
- gh_double2scm (height),
- gh_double2scm (gap),
- gh_double2scm (dx),
- gh_double2scm (dy),
- gh_double2scm (thick),
- gh_int2scm (dir),
- SCM_UNDEFINED));
- m.add_atom (at->self_scm_);
-
- return m;
-}
-
/*
Make a smooth curve along the points
*/
if (mmrest_p_ && !time->measure_position ())
{
lastrest_p_ = mmrest_p_;
- lastrest_p_->measures_i_
- = gh_scm2int (time->get_property ("currentBarNumber", 0)) - start_measure_i_;
+ int cur = gh_scm2int (time->get_property ("currentBarNumber", 0));
+ lastrest_p_->set_elt_property ("measure-count",
+ gh_int2scm (cur - start_measure_i_));
mmrest_p_ = 0;
}
}
Multi_measure_rest::Multi_measure_rest ()
{
- measures_i_ = 0;
set_elt_property ("columns", SCM_EOL);
}
/*
- [TODO] 17
+ [TODO] 17
* variable-sized multi-measure rest symbol: |====| ??
-
- * build 3, 5, 6, 7, 8 symbols (how far, property?)
- from whole, brevis and longa rests
-
*/
Molecule*
Multi_measure_rest::do_brew_molecule_p () const
{
+ Real staff_space
+ = staff_symbol_referencer (this).staff_space ();
+
Interval sp_iv;
Direction d = LEFT;
do
Molecule s;
- bool rest_symbol=true;
- SCM alt_symbol_sym =get_elt_property ("alt-symbol");
- if (gh_string_p (alt_symbol_sym))
+
+ int measures = 1;
+ SCM m (get_elt_property ("measure-count"));
+ if (gh_number_p (m))
{
- s = lookup_l () -> afm_find (ly_scm2string (alt_symbol_sym));
- rest_symbol = false;
+ measures = gh_scm2int (m);
}
- else if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4)
+
+
+ if (measures <= paper_l() ->get_var ("multi_measure_rest_expand_limit"))
{
- s = lookup_l ()->afm_find ("rests-" + to_str (- intlog2(measures_i_)));
- s.translate_axis (-s.extent ()[X_AXIS].length () / 2, X_AXIS);
+ /*
+ Build a rest from smaller parts. Distances inbetween are
+ really variable, see Wanske pp. 125 */
+
+ int l = measures;
+ while (l)
+ {
+ int k;
+ if (l >= 4)
+ {
+ l-=4;
+ k = -2;
+ }
+ else if (l>= 2)
+ {
+ l -= 2;
+ k = -1;
+ }
+ else
+ {
+ k = 0;
+ l --;
+ }
+
+ Real pad = s.empty_b ()
+ ? 0.0 : paper_l ()->get_var ("multi_measure_rest_padding");
+
+ Molecule r (lookup_l ()->afm_find ("rests-" + to_str (k)));
+ if (k == 0)
+ r.translate_axis (staff_space, Y_AXIS);
+
+ s.add_at_edge (X_AXIS, RIGHT, r, pad);
+ }
+
+
+ s.align_to (X_AXIS, CENTER);
}
else
{
}
mol_p->add_molecule (s);
- Real staff_space
- = staff_symbol_referencer (this).staff_space ();
- if (measures_i_ == 1 && rest_symbol)
- {
- mol_p->translate_axis (staff_space, Y_AXIS);
- }
- else if (measures_i_ > 1)
+
+ if (measures > 1)
{
- Molecule s (lookup_l ()->text ("number", to_str (measures_i_), paper_l ()));
+ Molecule s (lookup_l ()->text ("number", to_str (measures), paper_l ()));
s.align_to (X_AXIS, CENTER);
s.translate_axis (3.0 * staff_space, Y_AXIS);
mol_p->add_molecule (s);
set_bounds (LEFT, column_arr[0 >? column_arr.size () - 2]);
set_bounds (RIGHT, column_arr.top ());
}
+
+ // set columns to SCM_EOL?
}
void
should do something more advanced.
*/
rod.distance_f_ = l->extent (X_AXIS)[BIGGER] - r->extent (X_AXIS)[SMALLER]
- + paper_l ()->get_var ("mmrest_x_minimum");
+ + paper_l ()->get_var ("multi_measure_rest_x_minimum");
a.push (rod);
}
bool
Paper_column::musical_b () const
{
- SCM m = get_elt_property ("shortest-starter");
+ SCM m = get_elt_property ("shortest-starter-duration");
Moment s (0);
if (SMOB_IS_TYPE_B(Moment, m))
{
gh_scm2double (gh_cdr (pair)));
}
-Real
-Paper_def::length_mom_to_dist (Moment d,Real k) const
-{
- return arithmetic_spacing (d,k);
-}
-
-
-/**
- Get the measure wide constant for arithmetic spacing.
-
- @see
- John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
- OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
- The Ohio State University, 1987.
-
- */
-Real
-Paper_def::arithmetic_constant (Moment d) const
-{
- return get_var ("arithmetic_basicspace") - log_2 (Moment (1,8) <? d);
-}
-
-Real
-Paper_def::arithmetic_spacing (Moment d ,Real k) const
-{
- return (log_2 (d) + k)* get_var ("arithmetic_multiplier");
-}
-
void
Paper_def::set_lookup (int i, Lookup*l)
{
}
+/*
+ junkme.
+ */
Real
Paper_def::interbeam_f (int multiplicity_i) const
{
#ifndef NPRINT
Music_output_def::print ();
DEBUG_OUT << "Paper {";
-
for (Hash_table_iter<int, Lookup*> ai(*lookup_p_tab_p_); ai.ok (); ai++)
{
DEBUG_OUT << "Lookup: " << ai.key () << " = " << ai.val ()->font_name_ << '\n';
}
-
DEBUG_OUT << "}\n";
#endif
}
}
else
{
- Item *item_p = dynamic_cast <Item *> (elem_p);
-
- if (!item_p->parent_l (X_AXIS))
+ if (!elem_p->parent_l (X_AXIS))
{
- bool br = to_boolean (item_p->remove_elt_property ("breakable"));
+ bool br = to_boolean (elem_p->remove_elt_property ("breakable"));
if (br)
- command_column_l_->add_element(item_p);
+ command_column_l_->add_element(elem_p);
else
- musical_column_l_->add_element(item_p);
+ musical_column_l_->add_element(elem_p);
}
}
if (!elem_p->parent_l(Y_AXIS))
void
Script_column_engraver::acknowledge_element( Score_element_info inf)
{
- Item *thing = dynamic_cast<Item*>(inf.elem_l_);
- if (!thing)
- return;
-
- if (Side_position_interface (thing).has_interface_b ())
+ if (side_position (inf.elem_l_).has_interface_b ())
{
- if (!thing->breakable_b () && Side_position_interface (thing).get_axis () == Y_AXIS)
+ Item *thing = dynamic_cast<Item*> (inf.elem_l_);
+ if (thing
+ && !thing->breakable_b ()
+ && side_position (inf.elem_l_).get_axis () == Y_AXIS)
{
script_l_arr_.push (thing);
}
if (!directional_element (this).get ())
directional_element (this).set (get_default_dir ());
+
/*
Slur and tie placement [OSU]
}
}
+ if (!fix_broken_b)
+ dy_f_drul_[RIGHT] += interstaff_f;
+
+
+
+ return;
/*
Now we've got a fine slur
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;
-
+ Real dx_f = spanner_length ()+ dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
if (!fix_broken_b)
dy_f -= interstaff_f;
- Real dx_f = spanner_length ()+ dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
/*
Avoid too steep slurs.
+#if 0
+SCM
+ugly_scm (Bezier b)
+{
+ b.translate (-b.control_[0]);
+ Real alpha = b.control_[3].arg ();
+
+ b.rotate ( -alpha);
+ if (b.control_[1][Y_AXIS] < 0)
+ {
+ b.control_[1][Y_AXIS] *= -1;
+ b.control_[2][Y_AXIS] *= -1;
+ }
+
+ Real len = b.control_[3][X_AXIS];
+ Real indent = 10 *b.control_[1][X_AXIS] / len ;
+ Real ht = 10 *b.control_[1][Y_AXIS] / len ;
+
+ SCM res = scm_eval (scm_listify (ly_symbol2scm ("slur-ugly"), gh_double2scm (indent), gh_double2scm (ht), SCM_UNDEFINED ));
+
+ return res;
+}
+#endif
+/*
+ Ugh should have dash-length + dash-period
+ */
Molecule*
Slur::do_brew_molecule_p () const
{
Molecule a;
SCM d = get_elt_property ("dashed");
if (gh_number_p (d))
- a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
+ a = lookup_l ()->dashed_slur (one, thick, thick * gh_scm2double (d));
else
a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
-
+
+#if 0
+ SCM u = ugly_scm (one);
+ if (gh_pair_p (u))
+ {
+ Molecule mark = lookup_l ()-> text ( "roman",
+ to_str (gh_scm2double (gh_car (u)), "%0.2f") + "," +
+ to_str(gh_scm2double (gh_cdr (u)), "%0.2f"),
+ paper_l ());
+
+ mark.translate_axis (20 , Y_AXIS);
+ a.add_molecule (mark);
+ }
+#endif
return new Molecule (a);
}
Bezier
Slur::get_curve () const
{
- Bezier_bow b (get_encompass_offset_arr (), directional_element (this).get ());
+ Array<Offset> enc (get_encompass_offset_arr ());
+ Direction dir = directional_element (this).get ();
+ Bezier_bow b (enc,dir);
b.ratio_ = paper_l ()->get_var ("slur_ratio");
b.height_limit_ = paper_l ()->get_var ("slur_height_limit");
b.rc_factor_ = paper_l ()->get_var ("slur_rc_factor");
b.calculate ();
- return b.get_curve ();
-}
-
-#if 0
-
-/*
- TODO: FIXME.
- */
-
-/*
- Clipping
-
- This function tries to address two issues:
- * the tangents of the slur should always point inwards
- in the actual slur, i.e. *after rotating back*.
- * slurs shouldn't be too high
- let's try : h <= 1.2 b && h <= 3 staffheight?
+ Bezier curve = b.get_curve ();
- We could calculate the tangent of the bezier curve from
- both ends going inward, and clip the slur at the point
- where the tangent (after rotation) points up (or inward
- with a certain maximum angle).
+ Real x1 = enc[0][X_AXIS];
+ Real x2 = enc.top ()[X_AXIS];
- However, we assume that real clipping is not the best
- answer. We expect that moving the outer control point up
- if the slur becomes too high will result in a nicer slur
- after recalculation.
-
- Knowing that the tangent is the line through the first
- two control points, we'll clip (move the outer control
- point upwards) too if the tangent points outwards.
- */
-
-bool
-Bezier_bow::calc_clipping ()
-{
- Real clip_height = paper_l_->get_var ("slur_clip_height");
- Real clip_ratio = paper_l_->get_var ("slur_clip_ratio");
- Real clip_angle = paper_l_->get_var ("slur_clip_angle");
-
- Real b = curve_.control_[3][X_AXIS] - curve_.control_[0][X_AXIS];
- Real clip_h = clip_ratio * b <? clip_height;
- Real begin_h = curve_.control_[1][Y_AXIS] - curve_.control_[0][Y_AXIS];
- Real end_h = curve_.control_[2][Y_AXIS] - curve_.control_[3][Y_AXIS];
- Real begin_dy = 0 >? begin_h - clip_h;
- Real end_dy = 0 >? end_h - clip_h;
-
- Real pi = M_PI;
- Real begin_alpha = (curve_.control_[1] - curve_.control_[0]).arg () + dir_ * alpha_;
- Real end_alpha = pi - (curve_.control_[2] - curve_.control_[3]).arg () - dir_ * alpha_;
-
- Real max_alpha = clip_angle / 90 * pi / 2;
- if ((begin_dy < 0) && (end_dy < 0)
- && (begin_alpha < max_alpha) && (end_alpha < max_alpha))
- return false;
-
- transform_back ();
-
- if ((begin_dy > 0) || (end_dy > 0))
- {
- Real dy = (begin_dy + end_dy) / 4;
- dy *= cos (alpha_);
- encompass_[0][Y_AXIS] += dir_ * dy;
- encompass_.top ()[Y_AXIS] += dir_ * dy;
- }
- else
+ Real off = 0.0;
+ for (int i=1; i < enc.size ()-1; i++)
{
- //ugh
- Real c = 0.4;
- if (begin_alpha >= max_alpha)
- begin_dy = 0 >? c * begin_alpha / max_alpha * begin_h;
- if (end_alpha >= max_alpha)
- end_dy = 0 >? c * end_alpha / max_alpha * end_h;
-
- encompass_[0][Y_AXIS] += dir_ * begin_dy;
- encompass_.top ()[Y_AXIS] += dir_ * end_dy;
-
- Offset delta = encompass_.top () - encompass_[0];
- alpha_ = delta.arg ();
+ Real x = enc[i][X_AXIS];
+ if (x > x1 && x <x2)
+ {
+ Real y = curve.get_other_coordinate (X_AXIS, x);
+ off = off >? dir * (enc[i][Y_AXIS] - y);
+ }
}
-
- to_canonic_form ();
-
- return true;
+ curve.translate (Offset (0, dir * off));
+ return curve;
}
-#endif
-
{
Moment m = (playing_durations_[i].info_.req_l_)->length_mom ();
if (m)
- shortest_playing = shortest_playing <? m;
+ {
+ shortest_playing = shortest_playing <? m;
+ }
}
-
+
Moment starter, inf;
inf.set_infinite (1);
starter=inf;
Paper_column * sc
= dynamic_cast<Paper_column*> (get_staff_info ().musical_pcol_l ());
- sc->set_elt_property ("shortest-playing", (new Moment (shortest_playing))->smobify_self ());
+ sc->set_elt_property ("shortest-playing-duration",
+ (new Moment (shortest_playing))->smobify_self ());
- sc->set_elt_property ("shortest-starter", (new Moment (starter))->smobify_self ());
+ sc->set_elt_property ("shortest-starter-duration",
+ (new Moment (starter))->smobify_self ());
}
void
#include "directional-element-interface.hh"
#include "molecule.hh"
#include "bezier-bow.hh"
+#include "stem.hh"
void
Tie::set_head (Direction d, Item * head_l)
Direction
Tie::get_default_dir () const
{
+ Stem * sl = head(LEFT) ? head (LEFT)->stem_l () :0;
+ Stem * sr = head(RIGHT) ? head (RIGHT)->stem_l () :0;
+
+ if (sl && directional_element (sl).get () == UP
+ && sr && directional_element (sr).get () == UP)
+ return DOWN;
+ else
+ return UP;
+
+#if 0
Real p1 = Staff_symbol_referencer_interface (head (LEFT)).position_f () ;
Real p2 = Staff_symbol_referencer_interface (head (RIGHT)).position_f () ;
*/
Direction neutral_dir = (Direction)(int)paper_l ()->get_var ("stem_default_neutral_direction");
return (m == 0) ? other_dir (neutral_dir) : (m < 0) ? DOWN : UP;
+#endif
}
void
return;
}
+ if (!directional_element (this).get ())
+ directional_element (this).set (get_default_dir ());
+
Real staff_space = paper_l ()->get_var ("interline");
Real half_staff_space = staff_space / 2;
Real x_gap_f = paper_l ()->get_var ("tie_x_gap");
Molecule*
Tie::do_brew_molecule_p () const
{
- Real thick = paper_l ()->get_var ("slur_thickness");
+ Real thick = paper_l ()->get_var ("tie_thickness");
Bezier one = get_curve ();
Molecule a;
(c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
+#include "atom.hh"
#include "beam.hh"
#include "box.hh"
#include "debug.hh"
#include "directional-element-interface.hh"
-
Tuplet_spanner::Tuplet_spanner ()
{
set_elt_property ("beams", SCM_EOL);
if (bracket_visibility)
{
Real gap = paper_l () -> get_var ("tuplet_spanner_gap");
-
- mol_p->add_molecule (lookup_l ()->tuplet_bracket (dy, w, thick, gap, staff_space, dir));
+ Real height = staff_space;
+ Atom *at = new Atom (gh_list(ly_symbol2scm ("tuplet"),
+ gh_double2scm (height),
+ gh_double2scm (gap),
+ gh_double2scm (w),
+ gh_double2scm (dy),
+ gh_double2scm (thick),
+ gh_int2scm (dir),
+ SCM_UNDEFINED));
+
+ mol_p->add_atom (at->self_scm_);
}
mol_p->translate_axis (dir * staff_space, Y_AXIS);
Direction
Tuplet_spanner::get_default_dir () const
{
- assert (false);
-
Direction d = UP;
SCM dir_sym =get_elt_property ("dir-forced");
- if (gh_number_p (dir_sym))
+ if (isdir_b (dir_sym))
{
d= to_dir (dir_sym);
if (d != CENTER)
return d;
}
+ d = UP ;
for (SCM s = get_elt_property ("columns"); gh_pair_p (s); s = gh_cdr (s))
{
Score_element * sc = unsmob_element (gh_car (s));
tie_staffspace_length = 4.0 * \interline;
% ugh: rename to bow (in bezier.cc and fonts.doc too...)
-% slur_thickness = 1.8 * \stafflinethickness;
-slur_thickness = 1.4 * \stafflinethickness;
+
+% used to be 1.4 .
+slur_thickness = 1.2 * \stafflinethickness;
+tie_thickness = 1.2 * \stafflinethickness;
%{
Specifies the maximum height of slurs.
hyphen_minimum_length = 0.25*\font_normal;
% Multi-measure rests
-mmrest_x_minimum = 1.4*\staffheight;
-
+multi_measure_rest_x_minimum = 2.5*\staffheight;
+multi_measure_rest_padding = 2.0 *\interline;
+multi_measure_rest_expand_limit = 10.0;
% chop off this much when next to pp / ff sign.
crescendo_shorten = 4.0 * \interline;
#'Staff_symbol::staff-space = \interline ;
#'Staff_symbol::line-count = #5
+
fff = \textscript "fff" "dynamic"
fp = \textscript "fp" "dynamic"
cresc = \textscript "cresc." "italic"
+decresc = \textscript "decresc." "italic"
+dim = \textscript "dim." "italic"
+
sf = \textscript "sf" "dynamic"
sfp = \textscript "sfp" "dynamic"
sff = \textscript "sff" "dynamic"
# descent order into subdirectories:
#
-SUBDIRS = scripts buildscripts flower lib lily mf midi2ly po debian \
+SUBDIRS = scripts buildscripts flower lily mf midi2ly po debian \
Documentation ly input tex make mutopia intl stepmake\
ps scm
#
SCRIPTS = configure aclocal.m4
-README_FILES = DEDICATION COPYING NEWS TODO CHANGES
+README_FILES = DEDICATION COPYING NEWS TODO CHANGES ROADMAP
README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt
IN_FILES := $(wildcard *.in)
EXTRA_DIST_FILES = dstreamrc lilypond-mode.el vimrc VERSION $(README_FILES) $(SCRIPTS) $(IN_FILES)
breve_rest_y# = staff_space#;
breve_rest_x# = 3/5 staff_space#;
-multi_rest_x# = 2 staff_space#;
-multi_rest_y# = 1/3 staff_space#;
+multi_rest_x# = 4 staff_space#;
+multi_beam_height# = 1/3 staff_space#;
-define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_rest_y);
+define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height);
fet_beginchar("breve rest", "-1", "breverest");
set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
fet_beginchar("multi rest", "-4", "multirest");
set_char_box(multi_rest_x#, multi_rest_x#,
breve_rest_y#, breve_rest_y#);
- draw_block ((-multi_rest_x, -multi_rest_y),
- (multi_rest_x, multi_rest_y));
- draw_block ((-multi_rest_x,-breve_rest_y),
- (rthin-multi_rest_x, breve_rest_y));
- draw_block ((multi_rest_x-rthin,-breve_rest_y),
- (multi_rest_x, breve_rest_y));
+ draw_block ((- b, - multi_beam_height),
+ (w, multi_beam_height));
+ draw_block ((- b,-breve_rest_y),
+ (rthin - b, breve_rest_y));
+ draw_block ((w - rthin,-breve_rest_y),
+ (w, breve_rest_y));
fet_endchar;
fet_beginchar("Quarter rest","2","quartrest");
input feta-klef;
input feta-timesig;
else:
- input feta-bolletjes;
+% input feta-bolletjes;
% input feta-banier;
-% input feta-eindelijk;
+ input feta-eindelijk;
% input feta-klef;
% input feta-toevallig;
% input feta-schrift;
penpos1(thin,90);
z1=(thick,h/2+thin-hair/2);
penpos2(hair,90);
+
z2=(w/2,y1);
penpos3(7/8thick,0);
% yup, should use the path fract [] "everywhere"
z10r=(0,y3);
penlabels(1,2,3,4,5,6,7,8,9,10,11);
save t; t=tense;
- fill z5{right}..z2r{right}..tension t..z3r{down}
+ fill z7{right}..z2r{right}..tension t..z3r{down}
..tension t..z4r{left}
..tension t..z7r{up}..tension t..z6r{right}
..z6l{left}..tension t..z7l{down}..z10l{up}..cycle;
--- /dev/null
+
+staffsize# = 1pt#;
+stafflinethickness# = staffsize#/10;
+define_pixels (stafflinethickness, staffsize);
+
+input feta-sleur;
+
+
+
+% beginchar
+
+indent = 1.17 staffsize;
+height = 6.15 staffsize;
+len = 10 staffsize;
+
+path boogje;
+
+
+
+z1 = (0,0);
+z2 = (indent, height);
+z3 = (len - indent, height);
+z4 = (len, 0);
+
+boogje=z1..controls z2 and z3..z4;
+pickup pencircle scaled stafflinethickness;
+draw boogje;
+shipit;
+
+
+bye
"\\placebox{"
(number->dim y) "}{" (number->dim x) "}{" s "}\n"))
-
-
(define (bezier-sandwich l thick)
(embedded-ps ((ps-scm 'bezier-sandwich) l thick)))
-
(define (start-line ht)
(begin
(string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
(numbers->string (list w h (inexact->exact cont) thick))
" draw_crescendo"))
+ ;; what the heck is this interface ?
(define (dashed-slur thick dash l)
(string-append
(apply string-append (map control->string l))
(number->string thick)
" [ "
- (if (> 1 dash)
- (number->string (- (* thick dash) thick))
- "0")
+ (number->string dash)
" "
- (number->string (* 2 thick))
+ (number->string (* 10 thick)) ;UGH. 10 ?
" ] 0 draw_dashed_slur"))
(define (decrescendo thick w h cont)
)
+(define (slur-ugly ind ht)
+ (if (and
+; (< ht 4.0)
+ (< ht (* 4 ind))
+ (> ht (* 0.4 ind))
+ (> ht (+ (* 2 ind) -4))
+ (< ht (+ (* -2 ind) 8)))
+ #f
+ (cons ind ht)
+ ))
(define beam-sit (/ (+ beam-thickness staff-line) 2))
(define beam-hang (- 1 (/ (- beam-thickness staff-line) 2)))
+;; Note: quanting period is take as quants.top () - quants[0],
+;; which should be 1 (== 1 interline)
+
(define beam-normal-dy-quants
(list 0 (/ (+ beam-thickness staff-line) 2) (+ beam-thickness staff-line) 1))
;; two popular veritcal beam quantings
;; see params.ly: #'beam-vertical-quants
(define (beam-normal-y-quants multiplicity dy)
- (let ((quants (list beam-hang 1)))
+ (let ((quants (list beam-hang)))
(if (or (<= multiplicity 1) (>= (abs dy) (/ staff-line 2)))
(set! quants (cons beam-sit quants)))
(if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2)))
(set! quants (cons beam-straddle quants)))
- quants))
+ ;; period: 1 (interline)
+ (append quants (list (+ 1 (car quants))))))
(define (beam-traditional-y-quants multiplicity dy)
- (let ((quants '(1)))
+ (let ((quants '()))
(if (>= dy (/ staff-line -2))
(set! quants (cons beam-hang quants)))
(if (and (<= multiplicity 1) (<= dy (/ staff-line 2)))
(set! quants (cons beam-sit quants)))
(if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2)))
(set! quants (cons beam-straddle quants)))
- quants))
+ ;; period: 1 (interline)
+ (append quants (list (+ 1 (car quants))))))
;; There are several ways to calculate the direction of a beam