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,
#!/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 *~
#ifndef COMPLEXWALKER_HH
#define COMPLEXWALKER_HH
+// this SUX
#include "proto.hh"
#include "grouping.hh"
#include "voicegroup.hh"
#include "staffwalker.hh"
#include "key.hh"
#include "clef.hh"
+#include "register.hh"
struct Complex_walker: Staff_walker {
Local_key local_key_;
IPointerList<Voice_registers *> voice_reg_list_;
-// Assoc<Voice*, Voice_registers*> voice_reg_map_;
- //IPointerList<Voice_group_registers *> voice_reg_list_;
- //Assoc<int, Voice_group_registers*> group_reg_map_;
- Voice_group_registers group_regs_;
+ IPointerList<Voice_group_registers*> group_reg_list_;
+ Assoc<const Voice *, Voice_group_registers *> voice_group_map_;
+
Local_key_register local_key_reg_;
Array<Staff_elem_info> 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();
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
const Real EPS=1e-7; // qlpsolve.hh
const int MAXITER=100; // qlpsolve.hh
-const Real INFTY=HUGE;
+const Real INFTY=HUGE_VAL;
#endif
#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);
#ifndef INPUTCOMMANDS_HH
#define INPUTCOMMANDS_HH
-#include "pcursor.hh"
+//#include "pcursor.hh"
#include "proto.hh"
#include "plist.hh"
#include "real.hh"
struct Input_score {
/// defined where?
String define_spot_str_;
+ int errorlevel_i_;
/// paper_, staffs_ and commands_ form the problem definition.
Paperdef *paper_;
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
#ifndef MOLECULE_HH
#define MOLECULE_HH
+#include "proto.hh"
#include "plist.hh"
#include "boxes.hh"
#include "symbol.hh"
/// 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;
#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);
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
#include "fproto.hh"
#include "real.hh"
-
struct Absdynamic_req;
struct Accidental;
struct Atom;
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;
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;
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
#ifndef PSTAFF_HH
#define PSTAFF_HH
+#include "proto.hh"
#include "plist.hh"
#include "item.hh"
#include "symbol.hh"
/// Hungarian postfix: req
struct Request {
Voice_element*elt_l_;
+ char const* defined_ch_c_l_m;
/****************/
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 */
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 ;
};
#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
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;
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);
};
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);
};
/// attach a stem to the noteball
struct Stem_req : Rhythmic_req {
+ int dir_i_;
Stem_req(int s, int dots);
REQUESTMETHODS(Stem_req,stem);
};
///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();
struct Glissando_req : Span_req {
-};
-struct Stemdir_req : Request {
- int which;
-};
-struct Group_change_req : Request {
};
#endif
#endif
PScore *pscore_p_;
String define_spot_str_;
+ int errorlevel_i_;
Assoc<String, Moment> markers_assoc_;
/****************************************************************/
#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.
--- /dev/null
+//
+// source.hh -- part of LilyPond
+//
+// copyright 1997 Jan Nieuwenhuizen <jan@digicash.nl>
+
+#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<Source_file*> sourcefile_p_iplist_m;
+};
+
+#endif // SOURCE_HH //
#ifndef STAFFLINE_HH
#define STAFFLINE_HH
+#include "proto.hh"
#include "real.hh"
#include "plist.hh"
#include "varray.hh"
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;
Voice(Voice const&);
void add(Voice_element*);
void print() const;
+ void set_default_group(String id);
};
/**
/// one horizontal bit.
struct Voice_element {
Moment duration;
+ char const* defined_ch_c_l_m;
const Voice *voice_l_;
IPointerList<Request*> reqs;
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
*/
--- /dev/null
+\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}
--- /dev/null
+% 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 ||
+ $
+}
--- /dev/null
+% 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 ||
+ $
+}
--- /dev/null
+% 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 ||
+ $
+}
--- /dev/null
+% 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 ||
+ $
+}
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
+}
--- /dev/null
+\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}
--- /dev/null
+\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}
%% musix defs
\parindent=0pt
+\newdimen\smallspace
\newdimen\interlinedist
\newcount\n
\newdimen\balkhoog
\font\hslurhfont=xslhz20
\font\musicfnt=musix20
\font\italicfont=cmti10
+ \font\dynfont=cmbxti10 scaled \magstep1
\balkhoog=20pt
\notewidth=6pt
\noteheight=5pt
\font\hslurdfont=xslhd16
\font\hslurhfont=xslhz20
\font\musicfnt=musix16
+ \font\dynfont=cmbxti10
\balkhoog=16pt
\staffrulethickness=0.4pt
\notewidth=5pt
}
\def\musixcalc{
+ \interlinedist=\fontdimen5\musicfnt
+ \smallspace=.3\interlinedist
\interstaffrule=\balkhoog
\advance\interstaffrule by-\staffrulethickness
\divide\interstaffrule by 4
\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}}
\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
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 {
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 ));
}
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<Staff*> parsed_staffs;
for (iter_top(staffs_,i); i.ok(); i++) {
Staff* staf_p=i->parse(s_p);
Input_score::Input_score()
{
paper_= 0;
+ errorlevel_i_ = 0;
}
void
#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)
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()) {
#include <iostream.h>
#include <assert.h>
+#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
0, "warranty", 'w',
0, "help", 'h',
0, "debug", 'd',
+ 1, "init", 'i',
1, "include", 'I',
0,0,0
};
"--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"
;
"Copyright (C) 1996,97 by\n"
" Han-Wen Nienhuys <hanwen@stack.nl>\n"
"Contributors\n"
- " Jan-Nieuwenhuizen <jan@digicash.com>\n"
+ " Jan Nieuwenhuizen <jan@digicash.com>\n"
" Mats Bengtsson <matsb@s3.kth.se>\n"
"\n"
" This program is free software; you can redistribute it and/or\n"
{
Getopt_long oparser(argc, argv,theopts);
cout << get_version();
+ String init_str("symbol.ini");
while (long_option_init * opt = oparser()) {
switch ( opt->shortname){
case 'I':
path->push(oparser.optarg);
break;
+ case 'i':
+ init_str = oparser.optarg;
+ break;
case 'h':
help();
exit(0);
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();
}
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;
}
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--) {
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
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;
}
/****************/
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()
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_;
{
pscore_p_=0;
paper_p_ = p; // ?? safe?
+ errorlevel_i_ = 0;
}
Score::~Score()
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);
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()){
--- /dev/null
+//
+// source.cc
+//
+
+#include <assert.h>
+
+#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<Source_file*> 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;
+}
PCursor<Command*> last)
{
PCursor<Command*> 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;
{
// 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;
}
+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()
{
#include "inputcommands.hh"
#include "molecule.hh"
#include "staffcommands.hh"
+#include "sourcefile.hh"
#include "plist.tcc"
IPL_instantiate(Staff_commands_at);
IPL_instantiate(Input_staff);
IPL_instantiate(Input_music);
+IPL_instantiate(Source_file);
+#include "proto.hh"
#include "list.tcc"
#include "cursor.tcc"
idx += 128;
- f+=String( "{" ) + idx + "}";
+ f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
Atom a(s);
a.translate(Offset(dx/2,0));
if (xpart < 0)
idx += 128;
- f+=String( "{" ) + idx + "}";
+ f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
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) {
idx += 54;
}
- f+=String( "{" ) + idx + "}";
+ f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
Atom a(s);
{
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
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;
}
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;
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);
{
if (when)
error_t ("Partial measure only allowed at beginning.", *this);
- if (p<0||p > whole_per_measure)
+ if (p<Rational(0)||p > whole_per_measure)
error_t ("Partial measure has incorrect size", *this);
whole_in_measure = whole_per_measure - p;
}
#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++)
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);
}
#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);
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 );
+}
--- /dev/null
+//
+// windhoos.cc
+//
+#ifdef _WIN32
+
+#include <sys/types.h>
+#include <winbase.h>
+
+/*
+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 //