From 7539f6192227953252eb6c6015003a574c98dfa6 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:30:17 +0000 Subject: [PATCH] lilypond-0.0.27 --- Documentation/lilyinput.pod | 2 +- clearlily | 2 +- hdr/complexwalker.hh | 27 ++- hdr/const.hh | 2 +- hdr/debug.hh | 3 + hdr/inputcommands.hh | 2 +- hdr/inputscore.hh | 1 + hdr/main.hh | 2 + hdr/molecule.hh | 1 + hdr/notehead.hh | 1 + hdr/parseconstruct.hh | 10 +- hdr/proto.hh | 71 +++--- hdr/pstaff.hh | 1 + hdr/request.hh | 37 ++- hdr/score.hh | 1 + hdr/scoreline.hh | 2 +- hdr/source.hh | 22 ++ hdr/staffline.hh | 1 + hdr/textdef.hh | 6 +- hdr/voice.hh | 3 + input/martien.tex | 23 ++ input/mlalt.ly | 212 +++++++++++++++++ input/mlcello.ly | 219 ++++++++++++++++++ input/mlvio1.ly | 216 +++++++++++++++++ input/mlvio2.ly | 217 +++++++++++++++++ input/scales.ly | 6 +- input/scsii-menuetto.tex | 19 ++ input/standchen.tex | 24 ++ lilyponddefs.tex | 42 +++- src/grouping.cc | 6 +- src/inputscore.cc | 2 + src/lyriccolumn.cc | 4 +- src/main.cc | 21 +- src/melodicstaff.cc | 1 + src/misc.cc | 2 +- src/notehead.cc | 3 + src/request.cc | 54 ++++- src/score.cc | 7 + src/simplestaff.cc | 3 +- src/source.cc | 36 +++ src/staffcommands.cc | 6 +- src/stem.cc | 15 +- src/template3.cc | 2 + src/template4.cc | 1 + src/texslur.cc | 8 +- src/textdef.cc | 7 + src/timedescription.cc | 13 +- src/voice.cc | 24 +- src/warn.cc | 38 ++- ...indhoos-suck-suck-suck-thank-you-cygnus.cc | 48 ++++ 50 files changed, 1372 insertions(+), 104 deletions(-) create mode 100644 hdr/source.hh create mode 100644 input/martien.tex create mode 100644 input/mlalt.ly create mode 100644 input/mlcello.ly create mode 100644 input/mlvio1.ly create mode 100644 input/mlvio2.ly create mode 100644 input/scsii-menuetto.tex create mode 100644 input/standchen.tex create mode 100644 src/source.cc create mode 100644 src/windhoos-suck-suck-suck-thank-you-cygnus.cc diff --git a/Documentation/lilyinput.pod b/Documentation/lilyinput.pod index 4e8367d3d0..6e08669071 100644 --- a/Documentation/lilyinput.pod +++ b/Documentation/lilyinput.pod @@ -32,7 +32,7 @@ In musicmode, eg, and in lyricmode, eg, - Twink- le, twink- le litt- le star,2 + Twin- kle, twin- kle lit- tle star,2 a lot of characters parse differently than in "command" mode, eg, diff --git a/clearlily b/clearlily index 34eb6c982d..40b79c3aaa 100755 --- a/clearlily +++ b/clearlily @@ -1,4 +1,4 @@ #!/bin/sh # unclobber current dir. -rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~ \ No newline at end of file +rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out *.uit` *.orig *~ diff --git a/hdr/complexwalker.hh b/hdr/complexwalker.hh index 111945c762..fcdb84ef96 100644 --- a/hdr/complexwalker.hh +++ b/hdr/complexwalker.hh @@ -7,6 +7,7 @@ #ifndef COMPLEXWALKER_HH #define COMPLEXWALKER_HH +// this SUX #include "proto.hh" #include "grouping.hh" #include "voicegroup.hh" @@ -14,6 +15,7 @@ #include "staffwalker.hh" #include "key.hh" #include "clef.hh" +#include "register.hh" struct Complex_walker: Staff_walker { Local_key local_key_; @@ -29,15 +31,26 @@ struct Complex_walker: Staff_walker { IPointerList voice_reg_list_; -// Assoc voice_reg_map_; - //IPointerList voice_reg_list_; - //Assoc group_reg_map_; - Voice_group_registers group_regs_; + IPointerList group_reg_list_; + Assoc voice_group_map_; + Local_key_register local_key_reg_; Array announce_info_arr_; /****************/ + void do_change_group(const Voice * v, String group_id_str); + Voice_registers *find_voice_reg(Voice*v_l); + Voice_registers *get_voice_reg(Voice*v_l); + + /// search and return. return 0 if not found. + Voice_group_registers *find_voice_group(Voice* v_l); + /// search. Create if necessary + Voice_group_registers *get_voice_group(Voice* v_l); + /// search and return. return 0 if not found + Voice_group_registers *find_voice_group(const char* id); + /// Create if necessary + Voice_group_registers *get_voice_group(const char*); void regs_process_requests(); void do_announces(); @@ -50,16 +63,12 @@ struct Complex_walker: Staff_walker { virtual void do_post_move(); virtual void do_pre_move(); - void do_note(CNote_info); Complex_walker(Complex_staff*); Complex_column *col(); Complex_staff *staff(); - - void do_local_key(Note_req*, Notehead*); - }; -#endif // SIMPLEWALKER_HH +#endif // COMPLEXWALKER_HH diff --git a/hdr/const.hh b/hdr/const.hh index dce593b4a0..9c2f3f9ccc 100644 --- a/hdr/const.hh +++ b/hdr/const.hh @@ -8,5 +8,5 @@ const Real EPS=1e-7; // qlpsolve.hh const int MAXITER=100; // qlpsolve.hh -const Real INFTY=HUGE; +const Real INFTY=HUGE_VAL; #endif diff --git a/hdr/debug.hh b/hdr/debug.hh index a5a7d8d378..f6855fcabe 100644 --- a/hdr/debug.hh +++ b/hdr/debug.hh @@ -7,6 +7,9 @@ #include "real.hh" #include "proto.hh" +void message( String message_str, char const* context_ch_c_l ); +void warning( String message_str, char const* context_ch_c_l ); +void error( String message_str, char const* context_ch_c_l ); void error(String s); // errors void error_t(const String& s, Time_description const & t_tdes); void error_t(String const &s, const Moment &when); diff --git a/hdr/inputcommands.hh b/hdr/inputcommands.hh index 6457c1c686..bd6054f6e9 100644 --- a/hdr/inputcommands.hh +++ b/hdr/inputcommands.hh @@ -7,7 +7,7 @@ #ifndef INPUTCOMMANDS_HH #define INPUTCOMMANDS_HH -#include "pcursor.hh" +//#include "pcursor.hh" #include "proto.hh" #include "plist.hh" #include "real.hh" diff --git a/hdr/inputscore.hh b/hdr/inputscore.hh index 973d4814da..1555456778 100644 --- a/hdr/inputscore.hh +++ b/hdr/inputscore.hh @@ -10,6 +10,7 @@ struct Input_score { /// defined where? String define_spot_str_; + int errorlevel_i_; /// paper_, staffs_ and commands_ form the problem definition. Paperdef *paper_; diff --git a/hdr/main.hh b/hdr/main.hh index e73ba2390b..1102833fac 100644 --- a/hdr/main.hh +++ b/hdr/main.hh @@ -7,7 +7,9 @@ void set_debug(bool); void do_scores(); void add_score(Input_score * s); void set_default_output(String s); +Input_score* current_iscore_l(); String find_file(String); const char *get_version(); +extern Source* source_l; #endif diff --git a/hdr/molecule.hh b/hdr/molecule.hh index 7419e203de..9f20458fef 100644 --- a/hdr/molecule.hh +++ b/hdr/molecule.hh @@ -1,6 +1,7 @@ #ifndef MOLECULE_HH #define MOLECULE_HH +#include "proto.hh" #include "plist.hh" #include "boxes.hh" #include "symbol.hh" diff --git a/hdr/notehead.hh b/hdr/notehead.hh index 5f4c47d2d9..66bed0360e 100644 --- a/hdr/notehead.hh +++ b/hdr/notehead.hh @@ -11,6 +11,7 @@ /// ball at the end of the stem struct Notehead : Item { const char * name() const; + const char* defined_ch_c_l_m; //sorry, trying to find error in martien.ly int position; /// -1 = lowest, 0 = inside, 1 = top int extremal; diff --git a/hdr/parseconstruct.hh b/hdr/parseconstruct.hh index 7b0545b784..78d4f84861 100644 --- a/hdr/parseconstruct.hh +++ b/hdr/parseconstruct.hh @@ -9,8 +9,12 @@ #include "proto.hh" +extern char const* defined_ch_c_l; +extern char const* req_defined_ch_c_l; Voice_element*get_mark_element(String); void set_default_duration(int *); +void last_duration(int n); +void set_duration_mode(String s); void get_default_duration(int *); void set_default_octave(String); void set_plet(int,int); @@ -25,6 +29,10 @@ Text_def*get_text(String s); Request*get_script_req(int d , Script_def*def); Request*get_text_req(int d , Text_def*def); Voice_element*get_command_element(Input_command*); -Voice_element*get_barcheck_element(); +Voice_element* get_barcheck_element(); +Voice_element* get_stemdir_element(int); + + + #endif // PARSECONSTRUCT_HH diff --git a/hdr/proto.hh b/hdr/proto.hh index 8be03e72f7..4987a70547 100644 --- a/hdr/proto.hh +++ b/hdr/proto.hh @@ -11,7 +11,6 @@ #include "fproto.hh" #include "real.hh" - struct Absdynamic_req; struct Accidental; struct Atom; @@ -20,21 +19,36 @@ struct Beam; struct Beam_req; struct Box; struct Bracket_req; +struct CNote_info; struct Chord; struct Clef; struct Clef_item; +struct Col_configuration; struct Colinfo; struct Command; +struct Commands_at ; +struct Complex_column; +struct Complex_music; +struct Complex_staff; +struct Complex_walker; struct Cresc_req; struct Decresc_req; struct Dynamic; +struct Group_change_req; +struct Group_feature_req; struct Idealspacing; struct Identifier; +struct Input_command; struct Input_commands; +struct Input_file; +struct Input_music; +struct Input_score; +struct Input_staff; struct Item; struct Key; struct Keyitem; struct Keyword; +struct Keyword_table; struct Line_of_score; struct Line_of_staff; struct Linestaff; @@ -42,13 +56,16 @@ struct Local_key; struct Local_key_item; struct Lookup; struct Lyric_req; +struct Lyric_req; struct Mark_req; +struct Melodic_req; struct Mixed_qp; struct Molecule; -struct Rational; -typedef Rational Moment; +struct Music_general_chord; +struct Music_voice; struct Note_req; struct Notehead; +struct Notename_tab; struct Offset; struct Output; struct PCol; @@ -56,52 +73,52 @@ struct PScore; struct PStaff; struct Paperdef; struct Parametric_symbol; +struct Rational; struct Request; +struct Request_register; struct Rest; struct Rest_req; +struct Rhythmic_grouping; struct Rhythmic_req; struct Score; struct Score_column; -struct Staff_commands; +struct Script_def; +struct Script; struct Script_req; +struct Simple_music; struct Slur; struct Slur_req; +class Source; +class Source_file; struct Span_req; struct Spanner; struct Staff; -struct Col_configuration; struct Staff_column; +struct Staff_command_req; +struct Staff_commands; +struct Staff_commands_at ; +struct Staff_elem; +struct Staff_elem_info; +struct Staff_walker; struct Stem; struct Stem_req; +struct Stem_beam_register; struct String; struct Symbol; struct Symtable; struct Symtables; struct Tex_stream; +struct Terminate_voice_req; +struct Text_item ; +struct Text_def; struct Text_gob; +struct Text_req; +struct Time_description; struct Voice; struct Voice_element; -struct Voicegroup; - +struct Voice_group_registers; struct Voice_list; -struct Input_music; -struct Simple_music; -struct Complex_music; -struct Music_voice; -struct Music_general_chord; - -struct Input_score; -struct Input_staff; -struct Input_command; -struct Notename_tab; -struct Input_file; -struct Keyword_table; -struct Rhythmic_grouping; -struct Staff_commands_at ; -struct Commands_at ; -struct Time_description; -struct Script_def; -struct Text_def; -struct Text_req; -struct Melodic_req; +struct Voice_registers; +struct Voicegroup; +typedef Rational Moment; #endif // PROTO_HH diff --git a/hdr/pstaff.hh b/hdr/pstaff.hh index 87bd919c67..2c79427f78 100644 --- a/hdr/pstaff.hh +++ b/hdr/pstaff.hh @@ -1,6 +1,7 @@ #ifndef PSTAFF_HH #define PSTAFF_HH +#include "proto.hh" #include "plist.hh" #include "item.hh" #include "symbol.hh" diff --git a/hdr/request.hh b/hdr/request.hh index 2cc9decef1..9a01ade3fb 100644 --- a/hdr/request.hh +++ b/hdr/request.hh @@ -9,6 +9,7 @@ /// Hungarian postfix: req struct Request { Voice_element*elt_l_; + char const* defined_ch_c_l_m; /****************/ Request(); @@ -18,7 +19,7 @@ struct Request { virtual const char * name() const { return "Request";} virtual Request* clone() const =0; void print()const ; - + virtual Moment duration() const { return 0; } /* accessors for children */ @@ -36,6 +37,9 @@ struct Request { virtual Melodic_req *melodic() { return 0; } virtual Mark_req * mark() { return 0; } virtual Staff_command_req* command() { return 0;} + virtual Terminate_voice_req *terminate() {return 0;} + virtual Group_change_req * groupchange() { return 0;} + virtual Group_feature_req * groupfeature() { return 0; } protected: virtual void do_print()const ; }; @@ -47,7 +51,7 @@ see lilygut page #define REQUESTMETHODS(T,accessor) \ virtual T * accessor() { return this;}\ -virtual const char* name()const { return #T; }\ +virtual const char* name() const { return #T; }\ virtual Request *clone() const { return new T(*this); } \ virtual void do_print() const @@ -55,6 +59,21 @@ struct Barcheck_req : Request { REQUESTMETHODS(Barcheck_req,barcheck); }; +struct Terminate_voice_req : Request { + REQUESTMETHODS(Terminate_voice_req,terminate); +}; + +struct Group_feature_req : Request { + int stemdir_i_; + Group_feature_req(); + REQUESTMETHODS(Group_feature_req, groupfeature); +}; + +struct Group_change_req : Request { + String newgroup_str_; + REQUESTMETHODS(Group_change_req, groupchange); +}; + /// a request with a duration struct Rhythmic_req : virtual Request { int balltype; @@ -64,7 +83,7 @@ struct Rhythmic_req : virtual Request { static int compare(const Rhythmic_req &, const Rhythmic_req &); Moment duration() const; Rhythmic_req(); - Rhythmic_req(int,int); + Rhythmic_req(int,int); REQUESTMETHODS(Rhythmic_req, rhythmic); }; @@ -77,6 +96,7 @@ struct Text_req : virtual Request { Text_req(int d, Text_def*); ~Text_req(); Text_req(Text_req const&); + static int compare(const Text_req&,const Text_req&); REQUESTMETHODS(Text_req,text); }; @@ -125,6 +145,7 @@ Why a request? It might be a good idea to not typeset the rest, if the paper is /// attach a stem to the noteball struct Stem_req : Rhythmic_req { + int dir_i_; Stem_req(int s, int dots); REQUESTMETHODS(Stem_req,stem); }; @@ -172,10 +193,11 @@ struct Slur_req : Span_req { ///Put a script above or below this ``note'' struct Script_req : Request { - int dir; - Script_def *scriptdef; + int dir_i_; + Script_def *scriptdef_p_; /****************/ + static int compare(const Script_req &, const Script_req &); Script_req(int d, Script_def*); REQUESTMETHODS(Script_req,script); ~Script_req(); @@ -294,11 +316,6 @@ struct Spacing_req { struct Glissando_req : Span_req { -}; -struct Stemdir_req : Request { - int which; -}; -struct Group_change_req : Request { }; #endif #endif diff --git a/hdr/score.hh b/hdr/score.hh index 152e578493..61868a4719 100644 --- a/hdr/score.hh +++ b/hdr/score.hh @@ -17,6 +17,7 @@ struct Score { PScore *pscore_p_; String define_spot_str_; + int errorlevel_i_; Assoc markers_assoc_; /****************************************************************/ diff --git a/hdr/scoreline.hh b/hdr/scoreline.hh index 26e1285c44..3c6ee0de04 100644 --- a/hdr/scoreline.hh +++ b/hdr/scoreline.hh @@ -6,8 +6,8 @@ #ifndef SCORELINE_HH #define SCORELINE_HH -#include "plist.hh" #include "proto.hh" +#include "plist.hh" #include "varray.hh" /// the columns of a score that form one line. diff --git a/hdr/source.hh b/hdr/source.hh new file mode 100644 index 0000000000..b9d00f4650 --- /dev/null +++ b/hdr/source.hh @@ -0,0 +1,22 @@ +// +// source.hh -- part of LilyPond +// +// copyright 1997 Jan Nieuwenhuizen + +#ifndef SOURCE_HH +#define SOURCE_HH + +class Source +{ +public: + Source(); + ~Source(); + + void add( Source_file* sourcefile_p ); + Source_file* sourcefile_l( char const* ch_c_l ); + +private: + IPointerList sourcefile_p_iplist_m; +}; + +#endif // SOURCE_HH // diff --git a/hdr/staffline.hh b/hdr/staffline.hh index e08aabd17e..f44754a5d2 100644 --- a/hdr/staffline.hh +++ b/hdr/staffline.hh @@ -7,6 +7,7 @@ #ifndef STAFFLINE_HH #define STAFFLINE_HH +#include "proto.hh" #include "real.hh" #include "plist.hh" #include "varray.hh" diff --git a/hdr/textdef.hh b/hdr/textdef.hh index 6682221761..4e95c93a6e 100644 --- a/hdr/textdef.hh +++ b/hdr/textdef.hh @@ -14,10 +14,12 @@ struct Text_def { int align_i_; String text_str_; String style_str_; - + char const* defined_ch_c_l_m; + /*****************/ - + virtual ~Text_def() {}; + bool compare(const Text_def&); Text_def(); virtual void print() const; virtual Atom create_atom(Paperdef*) const; diff --git a/hdr/voice.hh b/hdr/voice.hh index 867827f029..03ea55b9ee 100644 --- a/hdr/voice.hh +++ b/hdr/voice.hh @@ -17,6 +17,7 @@ struct Voice { Voice(Voice const&); void add(Voice_element*); void print() const; + void set_default_group(String id); }; /** @@ -28,6 +29,7 @@ struct Voice { /// one horizontal bit. struct Voice_element { Moment duration; + char const* defined_ch_c_l_m; const Voice *voice_l_; IPointerList reqs; @@ -37,6 +39,7 @@ struct Voice_element { Voice_element(); Voice_element(Voice_element const & src ); void print ()const; + void set_default_group(String id); }; /** Apart from being a container for the requests, Voice_element is nothing */ diff --git a/input/martien.tex b/input/martien.tex new file mode 100644 index 0000000000..3a1b732290 --- /dev/null +++ b/input/martien.tex @@ -0,0 +1,23 @@ +\documentclass{article} %UGH +\usepackage{a4} +\oddsidemargin-1in\advance\oddsidemargin7.5mm +\evensidemargin\oddsidemargin +\textwidth\hsize\advance\textwidth-15mm +\topmargin-1in\advance\topmargin5mm +\vsize297mm % so what does a4 do, anyway? +\textheight\vsize\advance\textheight-30mm +\pagestyle{empty} +\begin{document} +\input lilyponddefs +\input titledefs +%\def\interstaffline{\vskip10pt} +%\def\interscoreline{\vskip12pt} +\def\interstaffline{\vskip1mm} +\def\interscoreline{\vskip2mm} +\vbox to 10mm{\vss} +\title{Viola Quartet} +\composer{Martien Lohman} +\instrument{} +\maketit +\input martien.out +\end{document} diff --git a/input/mlalt.ly b/input/mlalt.ly new file mode 100644 index 0000000000..9058f25dd2 --- /dev/null +++ b/input/mlalt.ly @@ -0,0 +1,212 @@ +% mlalt.ly +% +% Viola Quartet +% Martien Lohman (194x-????) +% +% Alto I +% +% quite alive at the time of writing; +% copyright by ml +% +% The purpose of this file is to demonstrate features of LilyPond; +% respect the copyright. +% +alto = music { + $ + \duration{16} + \octave{} +%1 + [ `b8. `a ] [ `g8 `b c ] | +%2 + [ d8 g8 ] d4 | +%3 + [ e fis g a ] d4 | +%4 + [ c `b `a `b ] `b4 | +%5=1 + [ `b8. `a ] [ `g8 `b c ] | +%6=2 + [ d8 g8 ] d4 | +%7 + [ c `b `a `g ] [ `fis `e `d `c ] | +%8 + [ `d8. `e ] [ `d `fis `a c ] | +%9=1 + [ `b8. `a ] [ `g8 `b c ] | +%10 + [ d8 `d8 ] d4 | +%11=4 + [ c `b `a `b ] `b4 | +%12 + [ `a8 d8 ] `b4 | +%13 + [ d8. c ] [ `b8 `a `g ] | +%14=10 + [ d8 `d8 ] d4 | +%15 + [ e8 fis8 ] [ g8 d8 ] | +%16 + \textstyle "italic" + [ c `a `fis `d ] `g4_"fine" | + \textstyle "roman" +% \scoreverb{\mulooseness=-1} +% \newline +%17 +%=1 + [ `b8. `a ] [ `g8 `b c ] | +%18=2 + [ d8 g8 ] d4 | +%19=3 + [ e fis g a ] d4 | +%20=4 + [ c `b `a `b ] `b4 | +%21=5=1 + [ `b8. `a ] [ `g8 `b c ] | +%22=6=2 + [ d8 g8 ] d4 | +%23=20=4 + [ c `b `a `b ] `b4 | +%24 + [ `a8. `g ] [ `a cis e g ] | +%first modulation +%25 + [ fis8. e ] [ d8 fis g ] | +%26 + [ a8 `a8 ] a4 | +%27 + [ g fis e fis ] fis4 | +%28 + [ e8 a8 ] fis4 | +%29 + [ a8. g ] [ fis8 e d ] | +%30 + [ a8 `a8 ] a4 | +%31 + [ b8 'cis8 ] [ 'd8 a8 ] | +%32 + [ g e cis `a ] d4 | +%variant a +%33 + [ `b8 `g `g ] [ `g8 `b c ] | +%34 + [ d8 `g `g ] `g4 | +%35 + [ e8 `g `g ] [ `g8 e fis ] | +%36 + [ g8. fis32 e32 ] d4 | +%37 + [ e8 c c ] [ c8 `b `a ] | +%38 + [ d8 `b `b ] [ `b8 `a `g ] | +%39 + [ c8 `a `a ] [ `a8 `b `a ] | +%40 + `a4 `g4 | +%41 + [ `g8 `a `g ] [ d8 e d ] | +%42 + [ `g8 `a `g ] [ g8 e8 ] | +%43 + [ d8 e d ] [ d8 c `b ] | +%44 + [ `b8. c32 `b32 ] `a4 | +%45 + \plet{ 4/6 } [ `g `a `g `a `g `a ] \plet{ 1/1 } \plet{ 4/6 } [ `g `b c d e fis ] \plet{ 1/1 } | +%46 + \plet{ 4/6 } [ g fis e d `b `g ] \plet{ 1/1 } [ `a8 `g8 ] | +%47 + \plet{ 4/6 } [ g fis e d c `b ] \plet{ 1/1 } \plet{ 4/6 } [ e d c `b `a `g ] \plet{ 1/1 } | +%48 + \plet{ 4/6 } [ d e d d `b `g ] \plet{ 1/1 } [ `a8 `g8 ] | +%theme 2 + \duration{8} +%49 + \plet{ 2/3 } [ f e d ] \plet{ 1/1 } f4 | +%50 + \plet{ 2/3 } [ e d c ] \plet{ 1/1 } e4 | +%51 + \plet{ 2/3 } [ d g `g ] \plet{ 1/1 } \plet{ 2/3 } [ `g `a `b ] \plet{ 1/1 } | +%52 + d4 e4 | +%53 + \plet{ 2/3 } [ f e d ] \plet{ 1/1 } f4 | +%54 + \plet{ 2/3 } [ e d c ] \plet{ 1/1 } e4 | +%55 + \plet{ 2/3 } [ d g `g ] \plet{ 1/1 } \plet{ 2/3 } [ `g `a `b ] \plet{ 1/1 } | +%56 + `b4 c4 | % || \key\Es +%57 + [ `b d ] [ `g `b ] | +%58 + [ c es ] [ `g c ] | +%59 + [ d f ] [ `g f ] | +%60 + [ es16 d16 es16 f16 ] g4 | +%61 + [ as f ] [ d as ] | +%62 + [ g es ] [ c `as ] | +%63 + [ `g `b ] [ es d ] | +%64 + [ c8. `g32 `es32 ] `c4 | % || \meter{6/8} +%65 + es4.( [ )es d c ] | +%66 + es2. | +%67 + d4.( [ )d c `b ] | +%68 + d2. | +%69 +% g4.\stemdown( [ ) g as g ] | + g4.( [ ) g as g ] | +%70 +% g4.\stemdown( [ ) g f es ] | + g4.( [ )g f es ] | +%71 + d2. | +%72 + c r4 r4. | % || \meter{2/4} +%73 + \duration{8} + [ `b d ] [ `g `b ] | +%74 + [ c es ] [ `g c ] | +%75 + [ d f ] [ `g f ] | +%76 + [ es16 d16 es16 f16 ] g4 | +%77 + [ as f ] [ d as ] | +%78 + [ g es ] [ c `as ] | +%79 + [ `g `b ] [ es d ] | +%80 + [ c8. `g32 `es32 ] `c4 | +%81 + g4 [ as g ] | +%82 + \duration{16} + [ g f es f ] g4 | +%83 + [ g f e f ] g4 | +%84 + [ as g f g ] as4 | +%85 + f4 [ f des c `bes ] | +%86 + `a2 | +%87 + `b2 | +%88 + \textstyle "italic" + c2_"dacapo" | + \textstyle "roman" +%\scoreverb{\mulooseness=1} +% \key\G || + $ +} diff --git a/input/mlcello.ly b/input/mlcello.ly new file mode 100644 index 0000000000..5795bb44c1 --- /dev/null +++ b/input/mlcello.ly @@ -0,0 +1,219 @@ +% mlcello.ly +% +% Viola Quartet +% Martien Lohman (194x-????) +% +% Cello +% +% quite alive at the time of writing; +% copyright by ml +% +% The purpose of this file is to demonstrate features of LilyPond; +% respect the copyright. +% +cello = music { + $ + \octave{`} + \duration{4} +%%1 + g `g | +%%2 + [ `g8. `a16 ] ``b | +%%3 + c d | +%%4 + g( [ ) g16 fis16 e16 fis16 ] | +%%5=1 + e2 | +%%6=2 + [ `g8. `a16 ] ``b | +%%7 + c d | +%%8 + `g d | +%%9=1 + `g2 | +%%10 + `g ``b | +%%11=4 + e [ g16 fis16 e16 d16( ] | +%%12 + ) d g | +%%13 + [ d8 'd8 ] g | +%%14=10 + [ d8 'd8 ] g | +%%15 + [ c8 e8 ] [ g8 `g8 ] | +%%16 + \textstyle "italic" + [ d8 'c8 ] b_"fine" + \textstyle "roman" | +% \newline +%%17=1 + g `g | +%%18=2 + [ `g8. `a16 ] ``b | +%%19=3 + c d | +%%20=4 + g( [ ) g16 fis16 e16 fis16 ] | +%%21=5=1 + e2 | +%%22=6=2 + [ `g8. `a16 ] ``b | +%%23=4 + c g | +%%24 + a `a | +%%25 + d2 | +%%first modulation +%%26 + d `fis | +%%27 + ``b [ dis16 c16 ``b16 `a16( ] | +%%28 + ) `a d | +%%29 + \duration{8} + [ `a a ] d4 | +%%30 + [ `a a ] d4 | +%%31 + [ `g ``b ] [ d `d ] | +%%32 + [ `a a ] d4 | +%%variant a +%%33 + \duration{16} + [ `g8 `g `g ] [ `g8 `g `g ] | +%%34 + [ `g8 `g `g ] g4 | +%%35 + [ c8 c c ] [ c8 'c 'c ] | +%%36 + g4 b4 | +%%37 + [ a8 a a ] [ `a8 `a `a ] | +%%38 + [ ``b8 ``b ``b ] [ ``b8 ``b ``b ] | +%%39 + [ `a8 `a `a ] [ `a8 `a `a ] | +%%40 + `d4 `g4 | +%%41 + \duration{8} + \textstyle "italic" + r_"pizz" + \textstyle "roman" + g r `g | +%%42 + r g e4 | +%%43 + r b r ``b | +%%44 + r e a4 | +%%45 + r e r e | +%%46 + r ``b [ d g ] | +%%47 + r e r `a | +%%48 + r ``b + [ `d `g ] | +%%theme 2 +%%49 + \textstyle "italic" + r4_"arco" + \plet{ 2/3 } [ `g `g `g ] \plet{ 1/1 } | + \textstyle "roman" +%%50 + r4 \plet{ 2/3 } [ c c c ] \plet{ 1/1 } | +%%51 + g2 | +%%52 + c2 | +%%53 + r4 \plet{ 2/3 } [ `g `g `g ] \plet{ 1/1 } | +%%54 + r4 \plet{ 2/3 } [ c c c ] \plet{ 1/1 } | +%%55 + g2 | +%%56 + `g4 `c4 | +% \key\`es || +%%57 + g r g r | +%%58 + c r c r | +%%59 + `g r `g r | +%%60 + c r c r | +%%61 + d4. ``b | +%%62 + c2 | +%%63 + g4 `g4 | +%%64 + c4 `c4 | +% \meter{6/8} || +%%65 + [ c c c ] c4. | +%%66 + [ `c `c `c ] `c4. | +%%67 + [ `g `g `g ] `g4. | +% \newline +%%68 + [ g g g ] g4. | +%%69 + c2. | +%%70 + c2. | +%%71 + g2. | +%%72 + 'c r4 r4. | +%%73 +% \meter{2/4} || + g r g r | +%%74 + c r c r | +%%75 + `g r `g r | +%%76 + c r c4 | +%%77 + d4. ``b | +%%78 + c2 | +%%79 + g4 `g4 | +%%80 + c4 `c4 | +%%81 + \duration{2} + `c | +%%82 + `c | +%%83 + `e | +%%84 + `f | +%%85 + `as | +%%86 + c | +%%87 + d | +%%88 + \textstyle "italic" + d_"dacapo" + \textstyle "roman" +% \key\`g || + $ +} diff --git a/input/mlvio1.ly b/input/mlvio1.ly new file mode 100644 index 0000000000..7ea613f53c --- /dev/null +++ b/input/mlvio1.ly @@ -0,0 +1,216 @@ +% mlvio1.ly +% +% Viola Quartet +% Martien Lohman (194x-????) +% +% Violin I +% +% quite alive at the time of writing; +% copyright by ml +% +% The purpose of this file is to demonstrate features of LilyPond; +% respect the copyright. +% +violin1 = music { + $ + \octave{} + \duration{4} +%1 + g [ b8. a16 ] | +%2 + g2 | +%3 + g [ a16 b16 'c16 a16 ] | +%4 + g2 | +%5=1 + g [ b8. a16 ] | +%6=2 + g2 | +%7 + e fis | +%8 + d fis | +%9=1 + g [ b8. a16 ] | +%10 + g f | +%11=4 + e d | +%12 + [ fis8 a8 ] [ g8 'd8 ] | +%13 + [ 'd8 a8 ] [ 'd8 b8 ] | +%14=10 + a b | +%15 + 'c b | +%16 + \textstyle "italic" + a g_"fine" + \textstyle "roman" | +%\newline +%17=1 + g [ b8. a16 ] | +%18=2 + g2 | +%19=3 + g [ a16 b16 'c16 a16 ] | +%20=4 + g2 | +%21=5 + g [ b8. a16 ] | +%22=6 + g2 | +%23=4 + e [ d16 c16 `b16 c16 ] | +%24 + cis 'cis | +%25 + 'd [ 'fis8. 'e16 ] | +%first modulation +%26 + 'd 'c | +%27 + b a | +%28 + [ a8 b16 'cis16 ] 'd | +%29 + 'cis 'd | +%30 + 'cis a | +%31 + [ g8 'd8( ] ) 'd | +%32 + 'cis 'c | +%variant 'a +%33 + \duration{16} [ b8 'd 'd ] [ 'd8 'd 'd ] | +%34 + [ 'g8 'd 'd ] b4 | +%35 + [ 'c8 'c 'c ] [ 'c8 'c 'c ] | +%36 + b2 | +%37 + [ 'c8 'e 'e ] [ 'e8 'd 'c ] | +%38 + [ b8 'd 'd ] [ 'd8 'd 'd ] | +%39 + [ 'e8 'c 'c ] [ 'c8 'd 'c ] | +%40 + 'c4 { b4 'd4 } | +%41 + \textstyle "italic" + \duration{8} + r_"pizz" d r g + \textstyle "roman" | +%42 + r d e4 | +%43 + r b r 'd | +%44 + r 'e 'c4 | +%45 + r b r b | +%46 + r b [ a b ] | +%47 + r b r 'c | +%48 + r 'd [ 'd b ] | +%theme 2 +%49 + \textstyle "italic" + r4_"arco" \plet{ 2/3 } [ b8 b b ] \plet{ 1/1 } + \textstyle "roman" | +%50 + r4 \plet{ 2/3 } [ g g g ] \plet{ 1/1 } | +%51 + b2 | +%52 + 'c2 | +%53 + r4 \plet{ 2/3 } [ b b b ] \plet{ 1/1 } | +%54 + r4 \plet{ 2/3 } [ g g g ] \plet{ 1/1 } | +%55 + b2 | +%56 + g2 | +% \key\Es || +%57 + f r f r | +%58 + es r 'c r | +%59 + b r b r | +%60 + 'c r 'c4 | +%61 + \duration{16} + \plet{ 4/6 } [ as f d f as 'd ] \plet{ 1/1 } \plet{ 4/6 } [ as f d `as d f ] \plet{ 1/1 } | +%62 + \plet{ 4/6 } [ g es c `g c es ] \plet{ 1/1 } \plet{ 4/6 } [ g 'c 'es 'c g es ] \plet{ 1/1 } | +%63 + \plet{ 4/6 } [ g d g bes 'd 'g ] \plet{ 1/1 } \plet{ 4/6 } [ 'f 'd bes g f d ] \plet{ 1/1 } | +%64 + \duration{8} + [ c g ] g4 | +% \meter{6/8} || +%65 + [ g g g ] g4. | +%66 + [ c c c ] c4. | +%67 + [ g g g ] g4. | +%68 + [ b8 b b ] b4. | +%69 + [ 'c g es ] 'c4. | +%70 + 'c4. 'es4. | +%71 + [ 'f 'd b ] [ g a8 b ] | +%72 + 'c r4 r4. | +% \meter{2/4} || +%73 + f r f r | +%74 + es r 'c r | +%75 + b r b r | +%76 + 'c r 'c4 | +%77 + \duration{16} + \plet{ 4/6 } [ as f d f as 'd ] \plet{ 1/1 } \plet{ 4/6 } [ as f d `as d f ] \plet{ 1/1 } | +%78 + \plet{ 4/6 } [ g es c `g c es ] \plet{ 1/1 } \plet{ 4/6 } [ f 'c 'es 'c g es ] \plet{ 1/1 } | +%79 + \plet{ 4/6 } [ g d f b 'd 'g ] \plet{ 1/1 } \plet{ 4/6 } [ 'f 'd b g f d ] \plet{ 1/1 } | +%80 + [ c8 g8 ] g4 | +%81 + \duration{2} + 'c | +%82 + 'c | +%83 + 'des | +%84 + 'c | +%85 + 'c | +%86 + es | +%87 + d | +%88 + \textstyle "italic" + a_"dacapo" + \textstyle "roman" +% \key\G || + $ +} diff --git a/input/mlvio2.ly b/input/mlvio2.ly new file mode 100644 index 0000000000..0a9df42f3f --- /dev/null +++ b/input/mlvio2.ly @@ -0,0 +1,217 @@ +% mlvio2.ly +% +% Viola Quartet +% Martien Lohman (194x-????) +% +% Violin II +% +% quite alive at the time of writing; +% copyright by ml +% +% The purpose of this file is to demonstrate features of LilyPond; +% respect the copyright. +% +violin2 = music { + $ + \octave{} + \duration{4} +%1 + d2 | +%2 + [ `b8. `a16 ] `g4 | +%3 + [ g8 e8 ] fis | +%4 + d2 | +%5=1 + e2 | +%6=2 + [ `b8. `a16 ] `g4 | +%7 + `g `a | +%8 + `b `a | +%9=1 + d2 | +%10 + `b `g | +%11=4 + `g2 | +%12 + [ d8 e16 fis16 ] g | +%13 + fis g | +%14=10 + fis d | +%15 + c d | +%16 + \textstyle "italic" + d2_"fine" | + \textstyle "roman" +% \newline +%17=1 + d2 | +%18=2 + [ `b8. `a16 ] `g4 | +%19=3 + [ g8 e8 ] fis | +%20=4 + d2 | +%21=5=1 + e2 | +%22=6=2 + [ `b8. `a16 ] `g4 | +%23=4 + `g2 | +%24 + cis e | +%25 + a2 | +%first modulation +%26 + fis d | +%27 + d2 | +%28 + [ cis8 e8 ] [ d8 a8 ] | +%29 + [ a8 e8 ] [ a8 fis8 ] | +%30 + e fis | +%31 + g fis | +%32 + a fis | +%variant a +%33 + \duration{16} + [ g8 b b ] [ b8 g a ] | +%34 + [ b8 b b ] f4 | +%35 + [ g8 e e ] [ e8 g g ] | +%36 + b4 fis4 | +%37 + [ a8 a a ] [ a8 a a ] | +%38 + [ fis8 fis fis ] [ fis8 fis fis ] | +%39 + [ e8 e e ] [ e8 e e ] | +%40 + fis4 g4 | +%41 + \duration{8} + \textstyle "italic" + r_"pizz" + \textstyle "roman" + `b r `b | +%42 + r `b `g4 | +%43 + r fis r fis | +%44 + r g e4 | +%45 + r e r g | +%46 + r fis [ fis g ] | +%47 + r g r e | +%48 + r fis [ fis d ] | +%theme 2 +%49 + \textstyle "italic" + r4_"arco" + \textstyle "roman" + \plet{ 2/3 } [ d8 d d ] \plet{ 1/1 } | +%50 + r4 \plet{ 2/3 } [ g8 g g ] \plet{ 1/1 } | +%51 + d2 | +%52 + c2 | +%53 + r4 \plet{ 2/3 } [ d8 d d ] \plet{ 1/1 } | +%54 + r4 \plet{ 2/3 } [ e e e ] \plet{ 1/1 } | +%55 + d2 | +%56 + f4 e4 | +% \key\Es || +%57 + d r `b r | +%58 + `g r es r | +%59 + g r g r | +%60 + g r es4 | +%61 + f2 | +%62 + es2 | +%63 + `b d4. | +%64 + es2 | +% \meter{6/8} || +%65 + \duration{8} + [ c c c ] c4. | +%66 + [ `g `g `g ] `g4. | +%67 + [ `b8 `b `b ] `b4. | +%68 + [ g g g ] g4. | +%69 + es2. | +%70 + [ c es g ] 'c4. | +%71 + b4 g4 d4 | +%72 + es r4 r4. | +%73 +% \meter{2/4} || + d r `b r | +%74 + `g r es r | +%75 + g r g r | +%76 + g r es4 | +%77 + \duration{2} + f | +%78 + es | +%79 + `b8 d4. | +%80 + es | +%81 + es | +%82 + es | +%83 + bes | +%84 + f | +%85 + f | +%86 + ges | +%87 +% = g | +%88 + \textstyle "italic" + fis_"dacapo" | + \textstyle "roman" +% \key\G || + $ +} diff --git a/input/scales.ly b/input/scales.ly index 63742f53c9..97d8dd89cb 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -54,11 +54,11 @@ score { geometric 1.4 } commands { - meter 6* 8 + meter 6*8 skip 6:0 - meter 4* 4 + meter 4*4 skip 2:0 skip 11:0 } -} \ No newline at end of file +} diff --git a/input/scsii-menuetto.tex b/input/scsii-menuetto.tex new file mode 100644 index 0000000000..4eb7231d64 --- /dev/null +++ b/input/scsii-menuetto.tex @@ -0,0 +1,19 @@ +\documentclass{article} %UGH +\usepackage{a4} +\oddsidemargin-1in\advance\oddsidemargin7.5mm +\evensidemargin\oddsidemargin +\textwidth\hsize\advance\textwidth-15mm +\begin{document} +\input lilyponddefs +\input titledefs +\def\interscoreline{\vskip12pt} +\title{Solo Cello Suites\normalsize\\[2ex]Suite II} +% \subtitle{Suite II} +\composer{J.\ S.\ Bach} +% \lefttitle{Menuetto} +% \tempo{Moderato} +% \metron{4=120} +\instrument{Menuetto I} % heu +\maketit +\input scsii-menuetto.out +\end{document} diff --git a/input/standchen.tex b/input/standchen.tex new file mode 100644 index 0000000000..9c87c4cc90 --- /dev/null +++ b/input/standchen.tex @@ -0,0 +1,24 @@ +\documentclass{article} %UGH +\usepackage{a4} +\oddsidemargin-1in\advance\oddsidemargin7.5mm +\evensidemargin\oddsidemargin +\textwidth\hsize\advance\textwidth-15mm +\topmargin-1in\advance\topmargin5mm +\vsize297mm % so what does a4 do, anyway? +\textheight\vsize\advance\textheight-30mm +\pagestyle{empty} +\begin{document} +\input lilyponddefs +\input titledefs +%\def\interstaffline{\vskip10pt} +%\def\interscoreline{\vskip12pt} +\def\interstaffline{\vskip1mm} +\def\interscoreline{\vskip2mm} +\vbox to 10mm{\vss} +\title{St\"andchen\normalsize\\[2ex](Serenade)} +\composer{Franz Schubert (1797-1828)} +\instrument{M\"a\ss ig} % heu +%#%\tempo{M\"a\ss ig} +\maketit +\input standchen.out +\end{document} diff --git a/lilyponddefs.tex b/lilyponddefs.tex index 1ad6d5e58c..fd0d0ed0ba 100644 --- a/lilyponddefs.tex +++ b/lilyponddefs.tex @@ -20,6 +20,7 @@ %% musix defs \parindent=0pt +\newdimen\smallspace \newdimen\interlinedist \newcount\n \newdimen\balkhoog @@ -41,6 +42,7 @@ \font\hslurhfont=xslhz20 \font\musicfnt=musix20 \font\italicfont=cmti10 + \font\dynfont=cmbxti10 scaled \magstep1 \balkhoog=20pt \notewidth=6pt \noteheight=5pt @@ -60,6 +62,7 @@ \font\hslurdfont=xslhd16 \font\hslurhfont=xslhz20 \font\musicfnt=musix16 + \font\dynfont=cmbxti10 \balkhoog=16pt \staffrulethickness=0.4pt \notewidth=5pt @@ -68,6 +71,8 @@ } \def\musixcalc{ + \interlinedist=\fontdimen5\musicfnt + \smallspace=.3\interlinedist \interstaffrule=\balkhoog \advance\interstaffrule by-\staffrulethickness \divide\interstaffrule by 4 @@ -79,7 +84,19 @@ \balkhalf=\balkhoog \rationalmultiply\balkhalf*1/2 } -\def\dyn{\italicfont} +% \def\dyn{\italicfont} +\def\dyn{\dynfont} +\def\dynf{f\kern-.1ex} +\def\dynm{f\kern-.15ex} +\def\dynp{p\kern-.15ex} +\def\ppp{\dynfont\dynp\dynp p} +\def\pp{\dynfont\dynp p} +\def\p{\dynfont p} +\def\mp{\dynfont\dynm p} +\def\mf{\dynfont\dynm f} +\def\f{\dynfont f} +\def\ff{\dynfont\dynf f} +\def\fff{\dynfont\dynf\dynf f} \def\slurcharh#1{{\slurhfont\char#1}} \def\slurcharu#1{{\slurufont\char#1}} @@ -124,13 +141,26 @@ \mdef\usixteenthflag{41} \mdef\uthirtysecondflag{42} -\def\maatstreep{\vrule height\balkhoog} -\def\finishbar{\vrule height\balkhoog width 1pt} \maccentdef\repeatcolon{55}{2/1} \def\emptybar{} -\def\repeatbar{\rightalign{\repeatcolon\kern 2pt\finishbar}} -\def\startrepeat{\hbox{\finishbar\kern 2pt\repeatcolon}} -\def\repeatbarstartrepeat{\hbox{\repeatbar\kern 1pt\startrepeat}} + +\def\thinbar{\vrule height\balkhoog} +%? what-s wrong with rightalign? +\def\thickbar{\vrule height\balkhoog width 2\smallspace} +\def\maatstreep{\thinbar} +% \def\finishbar{\rightalign{\thinbar\kern\smallspace\thickbar}} +\def\finishbar{\hss\rightalign{\thinbar\kern\smallspace\thickbar}} +% \def\repeatstopbar{\rightalign{\repeatcolon\hskip2\smallspace\thinbar\hskip\smallspace\thickbar}} +\def\repeatstopbar{\hss\rightalign{\repeatcolon\hskip2\smallspace\thinbar\hskip\smallspace\thickbar}} +% \def\repeatstopbar{\kern-3\smallspace\rightalign{\repeatcolon\kern2\smallspace\thinbar\kern\smallspace\thickbar}\kern3\smallspace} +\def\repeatstartbar{\hbox{\thickbar\kern\smallspace\thinbar\kern2\smallspace\repeatcolon}} +\def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\thinbar\kern\smallspace\thickbar\kern\smallspace\thickbar\kern\smallspace\thinbar\kern2\smallspace\repeatcolon}} +\def\doublebar{\hbox{\thinbar\hskip\smallspace\thinbar}} + +%compatability +\def\repeatbar{\repeatstopbar} +\def\startrepeat{\repeatstartbar} +\def\repeatbarstartrepeat{\repeatstopstart} \def\generalmeter#1#2{\botalign{\vbox to\balkhalf{\vss \meterfont#1}% \nointerlineskip diff --git a/src/grouping.cc b/src/grouping.cc index 06f906ff91..91c9a66d0a 100644 --- a/src/grouping.cc +++ b/src/grouping.cc @@ -84,7 +84,7 @@ Rhythmic_grouping::intersect(MInterval t) for (int i=0; i < children.size(); i++) { MInterval inter = intersection(t, children[i]->interval()); - if (inter.empty() || inter.length() <= 0) { + if (inter.empty() || inter.length() <= Rational( 0 )) { delete children[i]; children[i] =0; } else { @@ -151,10 +151,10 @@ Rhythmic_grouping::Rhythmic_grouping(MInterval t, int n) interval_ = new MInterval(t); return; } - Moment dt = t.length()/n; + Moment dt = t.length()/Rational(n); MInterval basic = MInterval(t.left, t.left+dt); for (int i= 0; i < n; i++) - children.push(new Rhythmic_grouping( dt*i + basic )); + children.push(new Rhythmic_grouping( dt*Rational(i) + basic )); } diff --git a/src/inputscore.cc b/src/inputscore.cc index 6ea13d9b5d..a5d4a31007 100644 --- a/src/inputscore.cc +++ b/src/inputscore.cc @@ -37,6 +37,7 @@ Input_score::parse() Paperdef* paper_p=new Paperdef(*paper_); Score *s_p = new Score(paper_p); s_p->define_spot_str_ = define_spot_str_; + s_p->errorlevel_i_ = errorlevel_i_; Array parsed_staffs; for (iter_top(staffs_,i); i.ok(); i++) { Staff* staf_p=i->parse(s_p); @@ -60,6 +61,7 @@ Input_score::~Input_score() Input_score::Input_score() { paper_= 0; + errorlevel_i_ = 0; } void diff --git a/src/lyriccolumn.cc b/src/lyriccolumn.cc index 45f30836ed..108d5953ce 100644 --- a/src/lyriccolumn.cc +++ b/src/lyriccolumn.cc @@ -3,12 +3,10 @@ #include "staffwalker.hh" #include "debug.hh" #include "staff.hh" -//#include "command.hh" #include "lyricstaff.hh" #include "lyriccolumn.hh" #include "sccol.hh" #include "pscore.hh" -//#include "paper.hh" Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l) @@ -25,7 +23,7 @@ Lyric_column::setup_requests() Request* req_l = j; if (req_l->barcheck()) { if (tdescription_->whole_in_measure) { - error("Barcheck failed, " + tdescription_->str()); + error( "Barcheck failed ", req_l->defined_ch_c_l_m ); } } if (req_l->lreq_l()) { diff --git a/src/main.cc b/src/main.cc index 8ac50296ee..7e20c89a70 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,13 +1,20 @@ #include #include +#include "proto.hh" +#include "plist.hh" #include "lgetopt.hh" #include "misc.hh" #include "string.hh" #include "main.hh" #include "path.hh" #include "config.hh" +#include "sourcefile.hh" +#include "source.hh" -extern void parse_file(String s); +Source source; +Source* source_l = &source; + +extern void parse_file(String,String); void @@ -17,6 +24,7 @@ long_option_init theopts[] = { 0, "warranty", 'w', 0, "help", 'h', 0, "debug", 'd', + 1, "init", 'i', 1, "include", 'I', 0,0,0 }; @@ -29,6 +37,7 @@ help() "--warranty, -w show warranty & copyright\n" "--output, -o set default output\n" "--debug, -d enable debug output\n" + "--init, -i set init file\n" "--include, -I add to file search path.\n" ; @@ -42,7 +51,7 @@ void notice() "Copyright (C) 1996,97 by\n" " Han-Wen Nienhuys \n" "Contributors\n" - " Jan-Nieuwenhuizen \n" + " Jan Nieuwenhuizen \n" " Mats Bengtsson \n" "\n" " This program is free software; you can redistribute it and/or\n" @@ -77,6 +86,7 @@ main (int argc, char **argv) { Getopt_long oparser(argc, argv,theopts); cout << get_version(); + String init_str("symbol.ini"); while (long_option_init * opt = oparser()) { switch ( opt->shortname){ @@ -90,6 +100,9 @@ main (int argc, char **argv) case 'I': path->push(oparser.optarg); break; + case 'i': + init_str = oparser.optarg; + break; case 'h': help(); exit(0); @@ -108,12 +121,12 @@ main (int argc, char **argv) while ( (arg= oparser.get_next_arg()) ) { String f(arg); destill_inname(f); - parse_file(f); + parse_file(init_str,f); do_scores(); p++; } if (!p) { - parse_file(""); + parse_file(init_str, ""); do_scores(); } diff --git a/src/melodicstaff.cc b/src/melodicstaff.cc index 849a64b209..df760d6a7a 100644 --- a/src/melodicstaff.cc +++ b/src/melodicstaff.cc @@ -28,6 +28,7 @@ Melodic_staff::get_notehead(Note_req *rq, int bottom) Notehead *n =new Notehead((NO_LINES-1)*2); n->set_rhythmic(rq->rhythmic()); n->position = rq->note()->height() + bottom; + n->defined_ch_c_l_m = rq->defined_ch_c_l_m; return n; } diff --git a/src/misc.cc b/src/misc.cc index 5618f8ae2a..a8fe2c026d 100644 --- a/src/misc.cc +++ b/src/misc.cc @@ -11,7 +11,7 @@ wholes(int dur, int dots) return 0.0; // stupid Intel: doesn't crash if !dur - Moment f = 1/Moment(dur); + Moment f = Rational(1)/Moment(dur); Moment delta = f; while (dots--) { diff --git a/src/notehead.cc b/src/notehead.cc index fb4e80719b..fc250288c9 100644 --- a/src/notehead.cc +++ b/src/notehead.cc @@ -17,12 +17,15 @@ Notehead::Notehead(int ss) balltype = 0; dots = 0; extremal = 0; + defined_ch_c_l_m = 0; } void Notehead::set_rhythmic(Rhythmic_req*r_req_l) { balltype = r_req_l->balltype; dots = r_req_l->dots; + if ( r_req_l->defined_ch_c_l_m ) + defined_ch_c_l_m = r_req_l->defined_ch_c_l_m; } void diff --git a/src/request.cc b/src/request.cc index 323932a6a9..3be4f8260e 100644 --- a/src/request.cc +++ b/src/request.cc @@ -9,12 +9,14 @@ void Stem_req::do_print() const { - Rhythmic_req::do_print(); + Rhythmic_req::do_print(); + mtor << "dir : " << dir_i_; } Stem_req::Stem_req(int s, int d) : Rhythmic_req(s,d) { + dir_i_ = 0; } /****************/ @@ -56,10 +58,12 @@ Span_req::do_print() const Request::Request() { elt_l_ = 0; + defined_ch_c_l_m = 0; } Request::Request(Request const&) { elt_l_ = 0; + defined_ch_c_l_m = 0; } /****************/ Melodic_req::Melodic_req() @@ -168,32 +172,64 @@ Span_req::Span_req() spantype = NOSPAN; } /****************/ +void +Group_feature_req::do_print() const +{ + mtor << "stemdir " << stemdir_i_; +} +Group_feature_req::Group_feature_req() +{ + stemdir_i_ = 0; +} +void +Group_change_req::do_print()const +{ + mtor << "id : " << newgroup_str_; +} +void +Terminate_voice_req::do_print()const +{ +} +/****************/ Script_req::Script_req(int d , Script_def*def) { - dir = d; - scriptdef = def; + dir_i_ = d; + scriptdef_p_ = def; +} + +int +Script_req::compare(const Script_req &d1, const Script_req &d2) +{ + return d1.dir_i_ == d2.dir_i_ && + d1.scriptdef_p_->compare(*d2.scriptdef_p_); } Script_req::Script_req(Script_req const &s) { - dir = s.dir; - scriptdef = new Script_def(*s.scriptdef); + dir_i_ = s.dir_i_; + scriptdef_p_ = new Script_def(*s.scriptdef_p_); } void Script_req::do_print() const { - mtor << " dir " << dir ; - scriptdef->print(); + mtor << " dir " << dir_i_ ; + scriptdef_p_->print(); } Script_req::~Script_req() { - delete scriptdef; + delete scriptdef_p_; } /****************/ - +int +Text_req:: compare(const Text_req &r1, const Text_req &r2) +{ + bool b1 = (r1.dir_i_ == r2.dir_i_); + bool b2 = (r1.tdef_p_ ->compare(*r2.tdef_p_)); + return b1 && b2; +} Text_req::~Text_req() { delete tdef_p_; diff --git a/src/score.cc b/src/score.cc index edd26aaf7b..feb7db93e7 100644 --- a/src/score.cc +++ b/src/score.cc @@ -160,6 +160,7 @@ Score::Score(Paperdef*p) { pscore_p_=0; paper_p_ = p; // ?? safe? + errorlevel_i_ = 0; } Score::~Score() @@ -175,6 +176,12 @@ Score::output(String s) if (paper_p_->outfile=="") paper_p_->outfile = s; + if ( errorlevel_i_ ) { + *mlog << "lilypond: warning: no output to: " << paper_p_->outfile + << " (errorlevel=" << errorlevel_i_ << ")" << endl; + return; + } + *mlog << "output to " << paper_p_->outfile << "...\n"; Tex_stream the_output(paper_p_->outfile); diff --git a/src/simplestaff.cc b/src/simplestaff.cc index 20f291fa8a..30ef3e84e1 100644 --- a/src/simplestaff.cc +++ b/src/simplestaff.cc @@ -37,7 +37,8 @@ Simple_column::setup_requests() Request *rq= j; if (rq->barcheck()) { if (tdescription_->whole_in_measure) { - error("Barcheck failed, " + tdescription_->str()); +// error("Barcheck failed, " + tdescription_->str()); + error( "Barcheck failed", rq->defined_ch_c_l_m ); } } if (rq->rhythmic()){ diff --git a/src/source.cc b/src/source.cc new file mode 100644 index 0000000000..dbdc501a4d --- /dev/null +++ b/src/source.cc @@ -0,0 +1,36 @@ +// +// source.cc +// + +#include + +#include "string.hh" +#include "proto.hh" +#include "plist.hh" + +#include "sourcefile.hh" +#include "source.hh" + +Source::Source() +{ +} + +Source::~Source() +{ +} + +void +Source::add( Source_file* sourcefile_p ) +{ + sourcefile_p_iplist_m.bottom().add( sourcefile_p ); +} + +Source_file* +Source::sourcefile_l( char const* ch_c_l ) +{ + PCursor sourcefile_p_pcur( sourcefile_p_iplist_m.top() ); + for ( ; sourcefile_p_pcur.ok(); sourcefile_p_pcur++ ) + if ( sourcefile_p_pcur->in_b( ch_c_l ) ) + return *sourcefile_p_pcur; + return 0; +} diff --git a/src/staffcommands.cc b/src/staffcommands.cc index d1bbc45c42..517e7d1dd7 100644 --- a/src/staffcommands.cc +++ b/src/staffcommands.cc @@ -70,9 +70,11 @@ Staff_commands_at::insert_between(Command victim, PCursor firstc, PCursor last) { PCursor c(firstc+1); - assert(firstc < last&&last.ok()); +// assert(firstc < last&&last.ok()); + assert(firstc->code < last->code && last.ok()); - while (c < last) { +// while (c < last) { + while (c->code < last->code ) { if (c->priority <= victim.priority) { c.insert(new Command(victim)); return; diff --git a/src/stem.cc b/src/stem.cc index 2e602c1cae..2e0d55474e 100644 --- a/src/stem.cc +++ b/src/stem.cc @@ -39,7 +39,8 @@ Stem::set_stemend(Real se) { // todo: margins - assert((dir > 0 && se >= maxnote) || (se <= minnote && dir <0)); + if (! ((dir > 0 && se >= maxnote) || (se <= minnote && dir <0)) ) + WARN << "Weird stem size; check for narrow beams.\n"; top = (dir < 0) ? maxnote : se; bot = (dir < 0) ? se : minnote; @@ -63,13 +64,19 @@ Stem::add(Notehead *n) } +int +Stem::get_default_dir() +{ + if (dir) + return dir; + Real mean = (minnote+maxnote)/2; + return (mean > staff_center) ? -1: 1; +} void Stem::set_default_dir() { - Real mean = (minnote+maxnote)/2; - dir = (mean > staff_center) ? -1: 1; + dir = get_default_dir(); } - void Stem::set_default_stemlen() { diff --git a/src/template3.cc b/src/template3.cc index 106260039a..bc7e4885a3 100644 --- a/src/template3.cc +++ b/src/template3.cc @@ -7,6 +7,7 @@ #include "inputcommands.hh" #include "molecule.hh" #include "staffcommands.hh" +#include "sourcefile.hh" #include "plist.tcc" @@ -19,3 +20,4 @@ IPL_instantiate(Commands_at); IPL_instantiate(Staff_commands_at); IPL_instantiate(Input_staff); IPL_instantiate(Input_music); +IPL_instantiate(Source_file); diff --git a/src/template4.cc b/src/template4.cc index c3b25320be..69f7513390 100644 --- a/src/template4.cc +++ b/src/template4.cc @@ -1,3 +1,4 @@ +#include "proto.hh" #include "list.tcc" #include "cursor.tcc" diff --git a/src/texslur.cc b/src/texslur.cc index a58a2cf94c..a3a29db444 100644 --- a/src/texslur.cc +++ b/src/texslur.cc @@ -50,7 +50,7 @@ Lookup::half_slur_middlepart(Real &dx, int dir) idx += 128; - f+=String( "{" ) + idx + "}"; + f+=String( "{" ) + String( idx ) + "}"; s.tex = f; Atom a(s); a.translate(Offset(dx/2,0)); @@ -99,7 +99,7 @@ Lookup::half_slur(int dy, Real &dx, int dir, int xpart) if (xpart < 0) idx += 128; - f+=String( "{" ) + idx + "}"; + f+=String( "{" ) + String( idx ) + "}"; s.tex = f; @@ -144,7 +144,7 @@ Lookup::slur (int dy , Real &dx, int dir) s.dim.x = Interval(0,dx); s.dim.y = Interval(min(0,dy), max(0,dy)); - String f = String("\\slurchar") + direction_char(y_sign); + String f = String("\\slurchar") + String( direction_char(y_sign) ); int idx=-1; if (y_sign) { @@ -159,7 +159,7 @@ Lookup::slur (int dy , Real &dx, int dir) idx += 54; } - f+=String( "{" ) + idx + "}"; + f+=String( "{" ) + String( idx ) + "}"; s.tex = f; Atom a(s); diff --git a/src/textdef.cc b/src/textdef.cc index e3829c65db..5dd44d91a1 100644 --- a/src/textdef.cc +++ b/src/textdef.cc @@ -8,6 +8,13 @@ Text_def::Text_def() { align_i_ = 1; // right style_str_ = "roman"; + defined_ch_c_l_m = 0; +} +bool +Text_def::compare(const Text_def&def) +{ + return align_i_ == def.align_i_ && text_str_ == def.text_str_ + && style_str_ == def.style_str_; } Atom diff --git a/src/timedescription.cc b/src/timedescription.cc index 275a47f0d9..cabaeb00cf 100644 --- a/src/timedescription.cc +++ b/src/timedescription.cc @@ -4,9 +4,12 @@ String Time_description::str()const { String s( "Time_description { "); - s+=String( " cadenza: ") + cadenza_b_ + " at "; + if (cadenza_b_) + s+=String( " (cadenza) "); + s+= "at "; s+=when; - s+="\nmeter " + String(whole_per_measure/one_beat) +":" +(1/one_beat); + s+="\nmeter " + String(whole_per_measure/one_beat) +":" + + String(Rational(1/one_beat)); s+= "\nposition "+String( bars) + ":"+ whole_in_measure +"\n}\n"; return s; } @@ -42,7 +45,7 @@ Time_description::set_cadenza(bool b) Time_description::Time_description(Moment dt, Time_description const *prev) { if (prev) { - assert(dt >= 0); + assert(dt >= Rational(0)); *this = *prev; when += dt; whole_in_measure += dt; @@ -65,7 +68,7 @@ void Time_description::set_meter(int l, int o) { assert(o); - one_beat = 1/Moment(o); + one_beat = Rational(1)/Moment(o); whole_per_measure = Moment(l) * one_beat; if(whole_in_measure) error_t("Meterchange should be at start of measure", *this); @@ -76,7 +79,7 @@ Time_description::setpartial(Moment p) { if (when) error_t ("Partial measure only allowed at beginning.", *this); - if (p<0||p > whole_per_measure) + if (p whole_per_measure) error_t ("Partial measure has incorrect size", *this); whole_in_measure = whole_per_measure - p; } diff --git a/src/voice.cc b/src/voice.cc index 818e723b42..2e7b0b5111 100644 --- a/src/voice.cc +++ b/src/voice.cc @@ -2,6 +2,12 @@ #include "voice.hh" #include "request.hh" +void +Voice::set_default_group(String s) +{ + elts.top()->set_default_group(s); +} + Voice::Voice(Voice const&src) { for (iter_top(src.elts, i); i.ok(); i++) @@ -71,14 +77,26 @@ Voice_element::add(Request*r) Voice_element::Voice_element() { voice_l_ = 0; -// group = 0; - duration = 0.0; + duration = 0; + defined_ch_c_l_m = 0; } Voice_element::Voice_element(Voice_element const&src) { + defined_ch_c_l_m = src.defined_ch_c_l_m; + // are you sure? They can be modified after copying. voice_l_=0; for (iter_top(src.reqs, i); i.ok(); i++) add(i->clone()); -// group=src.group; + +} +void +Voice_element::set_default_group(String s) +{ + for (iter_top(reqs, i); i.ok(); i++) + if (i->groupchange()) + return ; + Group_change_req *greq = new Group_change_req; + greq->newgroup_str_ = s; + add(greq); } diff --git a/src/warn.cc b/src/warn.cc index b44471201b..8328f64fb7 100644 --- a/src/warn.cc +++ b/src/warn.cc @@ -2,6 +2,11 @@ #include "lexer.hh" #include "moment.hh" #include "timedescription.hh" +#include "proto.hh" +#include "plist.hh" +#include "sourcefile.hh" +#include "source.hh" +#include "main.hh" ostream &warnout (cerr); ostream *mlog(&cerr); @@ -32,10 +37,39 @@ error_t(const String& s, const Moment& r) error(e); } - void error_t(const String& s, Time_description const &t_tdes) { - String e=s+ " (at t=" + t_tdes.bars + ": " + t_tdes.whole_in_measure + ")\n"; + String e=s+ " (at t=" + String(t_tdes.bars) + ": " + String(t_tdes.whole_in_measure) + ")\n"; error(e); } + +void +message( String message_str, char const* context_ch_c_l ) +{ + String str = "lilypond: "; + Source_file* sourcefile_l = source_l->sourcefile_l( context_ch_c_l ); + if ( sourcefile_l ) { + str += sourcefile_l->name_str() + ": "; + str += String( sourcefile_l->line_i( context_ch_c_l ) ) + ": "; + } + str += message_str; + if ( sourcefile_l ) { + str += "\n"; + str += sourcefile_l->error_str( context_ch_c_l ); + } + cerr << endl << str << endl; +} + +void +warning( String message_str, char const* context_ch_c_l ) +{ + message( "warning: " + message_str, context_ch_c_l ); +} + +void +error( String message_str, char const* context_ch_c_l ) +{ + message( message_str, context_ch_c_l ); + exit( 1 ); +} diff --git a/src/windhoos-suck-suck-suck-thank-you-cygnus.cc b/src/windhoos-suck-suck-suck-thank-you-cygnus.cc new file mode 100644 index 0000000000..8ed1d6b990 --- /dev/null +++ b/src/windhoos-suck-suck-suck-thank-you-cygnus.cc @@ -0,0 +1,48 @@ +// +// windhoos.cc +// +#ifdef _WIN32 + +#include +#include + +/* +HANDLE CreateFileMapping( + HANDLE hFile, // handle to file to map + LPSECURITY_ATTRIBUTES lpFileMappingAttributes, // optional security attributes + DWORD flProtect, // protection for mapping object + DWORD dwMaximumSizeHigh, // high-order 32 bits of object size + DWORD dwMaximumSizeLow, // low-order 32 bits of object size + LPCTSTR lpName // name of file-mapping object + ); + + +LPVOID MapViewOfFile( + HANDLE hFileMappingObject, // file-mapping object to map into address space + DWORD dwDesiredAccess, // access mode + DWORD dwFileOffsetHigh, // high-order 32 bits of file offset + DWORD dwFileOffsetLow, // low-order 32 bits of file offset + DWORD dwNumberOfBytesToMap // number of bytes to map + ); + +*/ + +caddr_t +mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +{ + (void)flags; + (void)prot; + HANDLE file_handle = CreateFileMapping( fd, (void*)0, PAGE_READONLY, + 0, len, 0 ); + return (caddr_t)MapViewOfFile( file_handle, addr, 0, offset, len ); +} + + +int +munmap(caddr_t addr, size_t len) +{ + (void)len; + return UnmapViewOfFile( addr ); +} + +#endif // _WIN32 // -- 2.39.5