--- /dev/null
+LilyPond is the GNU Project music typesetter. This program can print
+beautiful sheet music from a music definition file. It can also play
+mechanical performances to a MIDI file. Features include multiple
+staffs, meters, clefs, keys, lyrics, versatile input language, cadenzas,
+beams, slurs, triplets, formatting scores, part extraction. It includes
+a nice font of musical symbols.
/** find a file.
It will search in the current dir, in the construction-arg, and
in any other added path, in this order.
+
+ @return
+ The full path if found, or empty string if not found
*/
String
File_path::find (String nm) const
{
- fdebug << _("looking for ") << nm << ": ";
+ fdebug << "looking for" << nm << ": ";
if (!nm.length_i() || (nm == "-") )
return nm;
for (int i=0; i < size(); i++)
{
String path = elem(i);
- String sep (DIRSEP);
+ String sep = to_str (DIRSEP);
String right(path.right_str (1));
if (path.length_i () && right != sep)
- path += DIRSEP;
+ path += to_str (DIRSEP);
path += nm;
FILE *f = fopen (path.ch_C(), "r"); // ugh!
if (f)
{
- fdebug << _("found\n");
+ fdebug << "found\n";
fclose (f);
return path;
}
}
- fdebug << "\n";
+ fdebug << '\n';
return "";
}
Text_db (String fn):Data_file (fn) { }
Data_file::error;
- bool eof();
+ bool eof_b ();
/// get next line.
Text_record operator++(int) {
}
/// are we done yet?
operator bool() {
- return !eof();
+ return !eof_b ();
}
};
#include <stdio.h>
#include <ctype.h>
#include "string.hh"
-#include "varray.hh"
+#include "array.hh"
/**
line counting input stream.
public:
Text_stream (String fn);
String get_name() { return name; }
- bool eof() {
- return feof (f);
- }
- char get() {
+ bool eof_b();
+ char get() {
char c;
if (pushback.empty())
pushback.push (c);
}
char peek() {
+ if (eof_b ())
+ return -1;
char c = get();
unget (c);
return c;
}
~Text_stream(){
- if (!eof())
+ if (!eof_b())
cerr <<__FUNCTION__<< ": closing unended file";
fclose (f);
#include "text-db.hh"
bool
-Text_db::eof()
+Text_db::eof_b ()
{
Data_file::gobble_leading_white();
- return Data_file::eof();
+ return Data_file::eof_b();
}
void
{
while (1)
{
- Data_file::gobble_leading_white();
- if (eof())
- return ;
- char c;
- if ((c = data_get()) !='\n')
- {
- data_unget (c);
- return ;
+ Data_file::gobble_leading_white();
+ if (eof_b ())
+ return ;
+ char c;
+ if ((c = data_get()) !='\n')
+ {
+ data_unget (c);
+ return ;
}
- }
+ }
}
Text_record
Text_db::get_record()
{
- while (1)
- {
- String s;
- Array<String> fields;
- assert (!eof());
+ while (1)
+ {
+ String s;
+ Array<String> fields;
+ assert (!eof_b ());
- while ((s = get_word()) != "")
- {
- fields.push (s);
- gobble_white();
- }
+ while ((s = get_word()) != "")
+ {
+ fields.push (s);
+ gobble_white();
+ }
- if (get_line() != "")
- assert (false);
+ if (get_line() != "")
+ assert (false);
- assert (fields.size());
- return Text_record (fields, get_name(), line ());
- }
+ assert (fields.size());
+ return Text_record (fields, get_name(), line ());
+ }
}
{
ios::sync_with_stdio();
if (fn == "")
- {
- name = _("<STDIN>");
- f = stdin;
- }
-
- else
- {
- name = fn;
- f = fopen (fn.ch_C (), "r");
- }
+ {
+ name = _ ("<stdin>");
+ f = stdin;
+ }
- if (!f)
- {
- cerr <<__FUNCTION__<< _(": can't open `") << fn << "'\n";
- exit (1);
- }
+ else
+ {
+ name = fn;
+ f = fopen (fn.ch_C (), "r");
+ }
- line_no = 1;
+ if (!f)
+ {
+ cerr << __FUNCTION__
+ << ": " << _f ("can't open file: `%s'", fn) << '\n';
+ exit (1);
}
+ line_no = 1;
+}
+
void
Text_stream::message (String s)
{
- cerr << "\n"<<get_name() << ": " << line ()<<": "<<s<<endl;
+ cerr << '\n'<<get_name() << ": " << line ()<<": "<<s<<endl;
+}
+
+bool
+Text_stream::eof_b ()
+{
+ /* UGH UGH ugh*/
+ return
+ // !pushback.size () &&
+ feof (f);
}
--- /dev/null
+a''2 ~ c4( [e8 )e] [a,16 a a a]
+
+% Some beamed and slurred notes of different taste in Mudela.
+%
+% Type:
+%
+% ly2dvi example-2
+% xdvi example-2 # or your dvi viewer here
+%
+% For more elaborate examples see twinkle.ly, kortjakje.ly and mutopia/*.
+%
+% A docmument on Mudela is under construction: Documentation/tex/mudela.doc
+% (available as .ps from the website too).
--- /dev/null
+one = \melodic\relative c{
+ c'' d e f
+}
+
+two = \melodic\relative c{
+ \clef "bass";
+ c'2 g2
+}
+
+\score{
+ <
+ \one
+ \two
+ >
+ \paper{}
+ \midi{}
+}
+
+% A full-mudala example with two staffs
+%
+% Type:
+%
+% ly2dvi example-3
+% xdvi example-3 # or your dvi viewer here
+%
+% For more elaborate examples see twinkle.ly, kortjakje.ly and mutopia/*.
+%
+% A docmument on Mudela is under construction: Documentation/tex/mudela.doc
+% (available as .ps from the website too).