* GUILE errors, simple guile test
-* TEX errors, simple tex test
+* (La)TEX errors, simple tex test
+
+]
+@ignore
+
+ guile -v
+ Guile 1.4.1
+
+ guile -e %load-path
+ ERROR: Wrong type to apply: ("/usr/share/guile/site" /usr/share/guile/1.4.1")
+
+
+
+Mats?
+
+Let's take this step by step.
+
+It should not be critical which MikTeX version you use.
+Let's first verify that your MikTeX works as it should.
+Open a DOS window. Run the commands
+>> latex sample2e
+ Should produce some lines of output
+>> yap sample2e
+ Should display a three page document.
+
+Next step; verify that the geometry package is in place.
+Save the attached file to the directory where you run
+your DOS window. Run the commands
+>> latex geometrytest
+>> yap geometrytest
+This one you should get a single page document with some text
+in each corner.
]
+@end ignore
\context Staff = corni <
\property Staff.midiInstrument = #"french horn"
\property Staff.instrument = #`(lines "Corno"
- (rows "(E" ,text-flat ")"))
+ (columns "(E" ,text-flat ")"))
\property Staff.instr = #`(lines "Cor."
- (rows "(E" ,text-flat ")"))
+ (columns "(E" ,text-flat ")"))
\property Staff.transposing = #3
\notes \key bes \major
\context Voice=one \corno
@separate
@example
\property Staff.instrument = #`(lines "Corno"
- (rows "(E" ,text-flat ")"))
+ (columns "(E" ,text-flat ")"))
@end example
The french horn has the most complex scheme markup name, made up of two
-lines of text. The second line has two elements (rows), the @code{E}
+lines of text. The second line has two elements (columns), the @code{E}
and the flat sign @code{text-flat} that we defined before.
@separate
* Songs with additional verses::
@end menu
-
-So what does this look like? Well, here is an example:
-@li lypond[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
-}
-@end lilypond
-If you are lucky, the above example show a nice feature of LilyPond
-and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics,
-La@TeX{} can insert pagebreaks between the lines of music.
-
-Notice that there is no @code{\paper} statement in the example
-above. Lilypond-book will insert some code for you that defines the
-linewidth and the font to use. If you don't want to change the default,
-there is no need to put an empty @code{\paper@{@}} inside the @code{\score}.
-In the example above, something like this might be inserted before your code:
-@example
-\include "paper16.ly"
-\paper@{ \paper_sixteen
- linewidth = 390.\pt
-@}
-@end example
-The actual values for linewidth will differ depending on papersize and
-number of columns. Also, if you use a different fontsize for the
-music, another file than @code{paper16.ly} should be included.
-
-If you want to make the music not so wide, you can insert a
-@code{\paper} statement to set the linewidth:
-
-@li lypond[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
- \paper{linewidth = 10.\cm }
-}
-@end lilypond
-
-Very often, if you mix music and text, the music is often only a
-few notes or at most a few bars. This music should be as short as
-possible and not stretched to be aligned to the right margin.
-
-If you only write voice-contents in the lilypond block, @command{lilypond-book}
-will set the @code{linewidth} variable to -1, so Lilypond
-will make the music as short as possible but without breaking the
-line. Here is a well know harmonic progression:
-@li lypond[veryverbatim, intertext="produce a well known harmonic progression:"]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@end lilypond
-
-If you want to place music examples in the text,
-@li lypond[eps]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@end lilypond
-, you can use the @code{eps} option. This will create the music as
-eps graphics and include it into the document with the
-@code{\includegraphics} command.
-
-The code used look like this:
-@example
-@@li lypond[eps]
- \context Voice @{ <c' e g> <b d g> <c2 e g> @}
-@@end lilypond
-@end example
-
-You can also use the @code{eps} option if the block is a complete
-lilypond source. This 5 cm long empty line,
-@li lypond[eps]
-\score{
- \notes{s}
- \paper{ linewidth = 5.\cm }
-}
-@end lilypond
-was created with this code:
-@example
-@@li lypond[eps]
-\score@{
- \notes@{s@}
- \paper@{ linewidth = 5.\cm@}
-@}
-@@end lilypond
-@end example
-
-To avoid that La@TeX{} places the music on a line of its one, there should
-be no empty lines between the normal text and the lilypond
-environment.
-
-You can also use @code{lilypondfile}, to include another file:
-@example
- @@li lypondfile[printfilename]@{foo.ly@}
-@end example
-
-@subsection Fontsize options
-
-You can use all lilypond fontsizes in @command{lilypond-book}. The
-default 16pt fontsize is probably to big to be included in the middle of
-the text, 11pt or 13pt is probably better.
-
-The code can look like this:
-@example
-@@li lypond[13pt, eps]
-<c' e g>
-@@end lilypond
-@end example
-
-The following options set the fontsize:
-@itemize
-@item @code{11pt}
-@li lypond[11pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{13pt}
-@li lypond[13pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{16pt}
-@li lypond[16pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{20pt}
-@li lypond[20pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{26pt}
-@li lypond[26pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- }
-@end lilypond
-@end itemize
-
-
-@subsection More options
-
-@itemize
-@item The @code{singleline} option sets @code{linewidth} to -1.0.
-@item The @code{multiline} option sets @code{linewidth} to a value letting
-the music be aligned to the right margin. The music can span several
-lines.
-@end itemize
-
-@subsection Just in case...
-The options @code{fragment} and @code{nofragment} will override
-@command{lilypond-book} when it scans the lilypond code to see if it is voice
-contents or complete code. This might be useful if @command{lilypond-book} choose
-wrong.
-
-Since there is no finder's fee which doubles every year, there is no
-need to wait for the price money to grow. So send a bug report today
-if you need this one of these options.
-
-@subsection Examples
-
-This was all options to @code{\begin}. The rest of the lilypond
-document will show some ways you can use lilypond in
-La@TeX{} documents. It will also act as a simple test-suite for
-lilypond-book. You can place @code{eps} lilypond in and marginspars just
-as any other included eps graphics.
-
-@li lypond
-\score{
- \notes\relative c'{
- \time 12/8
- r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm}
-}
-@end lilypond
-
-
-To the right you can see some bars from the trumpet fanfara from the
-beginning of the fantastic street opera ``Houdini the Great'', by the
-Danish composer Andy Pape. The music is put inside a
-@code{floatingfigure} environment, and the music will be aligned by
-the right margin if you set floatingfigure width and lilypond linewidth
-to the same value. The code looks like this:
-
-@li lypond[verbatim]
-\score{
- \notes\relative c'{
- \time 12/8
- r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8]
- [g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm }
-}
-@end lilypond
-
-If you have a lot of small music examples like this in the middle of
-your text, you might get a nicer look by using ``double'' line
-spacing. Put the @code{\linespread@{1.6@}} command into the preamble of
-your document. Then the line spacing will not be increased between the
-lines where you have music printed with the smallest font size.
-
-Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}.
-So the music will be adjusted to the new linewidth:
-
-Verbatim environments will also ignore the page margins. That is
-a feature of La@TeX{}. (But you usually put things inside a verbatim
-environment when you don't want La@TeX{} to do any linebreaking)
-
@end ignore
-Only in .: LilyPond.ico
diff -urN ../cinstall/Makefile.in ./Makefile.in
--- ../cinstall/Makefile.in Thu Feb 8 05:55:22 2001
-+++ ./Makefile.in Tue Apr 10 19:20:14 2001
-@@ -130,11 +130,16 @@
++++ ./Makefile.in Thu Apr 12 11:41:37 2001
+@@ -130,11 +130,15 @@
@chmod a-x $@
clean:
+ $(MAKE) -C zlib $@
realclean: clean
- rm -f Makefile config.cache
-+ rm -f *.d
-+ rm -f inilex.c iniparse.c iniparse.h version.c config.log config.status *.d
-+
+- rm -f Makefile config.cache
++ rm -f Makefile *.d
++ rm -f config.cache config.log config.status
++ rm -f inilex.c iniparse.c iniparse.h version.c
+
+distclean: realclean
$(SHELL) $(updir1)/mkinstalldirs $(bindir) $(etcdir)
diff -urN ../cinstall/desktop.cc ./desktop.cc
--- ../cinstall/desktop.cc Sat Nov 11 05:55:16 2000
-+++ ./desktop.cc Tue Apr 10 19:15:01 2001
++++ ./desktop.cc Thu Apr 12 11:39:52 2001
@@ -79,9 +79,7 @@
"done",
"",
diff -urN ../cinstall/ini.cc ./ini.cc
--- ../cinstall/ini.cc Thu Oct 5 05:55:27 2000
-+++ ./ini.cc Sun Apr 8 21:52:03 2001
++++ ./ini.cc Thu Apr 12 11:39:52 2001
@@ -174,7 +174,7 @@
{
*nl = 0;
diff -urN ../cinstall/msg.cc ./msg.cc
--- ../cinstall/msg.cc Sat Aug 26 05:55:14 2000
-+++ ./msg.cc Sun Apr 8 21:51:56 2001
++++ ./msg.cc Thu Apr 12 11:39:52 2001
@@ -44,7 +44,7 @@
vsprintf (buf, fmt, args);
void
diff -urN ../cinstall/res.rc ./res.rc
--- ../cinstall/res.rc Wed Mar 7 18:13:31 2001
-+++ ./res.rc Sun Apr 8 19:48:40 2001
++++ ./res.rc Fri Apr 13 16:06:40 2001
@@ -30,10 +30,10 @@
IDD_SOURCE DIALOG DISCARDABLE 0, 0, 215, 95
CYGWIN.ICON FILE DISCARDABLE "cygwin.ico"
/////////////////////////////////////////////////////////////////////////////
-@@ -354,7 +355,7 @@
+@@ -354,7 +355,8 @@
BEGIN
IDS_ROOT_SLASH "Warning: we recommend you do NOT use the root of your hard drive as the cygwin root. Proceed anyway?"
IDS_ROOT_SPACE "You should not choose a root path that include spaces in directory names. Proceed anyway?"
- IDS_MIRROR_LST "http://sources.redhat.com/cygwin/mirrors.lst"
-+ IDS_MIRROR_LST "http://appel.lilypond.org/lilypond/gnu-windows/mirrors.lst"
++ // IDS_MIRROR_LST "http://appel.lilypond.org/lilypond/gnu-windows/mirrors.lst"
++ IDS_MIRROR_LST "http://www.lilypond.org/gnu-windows/mirrors.lst"
IDS_DIALOG_FAILED "Unable to create Dialog Box"
IDS_CYGWIN_FUNC_MISSING "Error: unable to find function `%s' in %s"
IDS_DOWNLOAD_SHORT "Download error: %s too short (%d, wanted %d)"
diff -urN ../cinstall/resource.h ./resource.h
--- ../cinstall/resource.h Thu Mar 1 05:55:20 2001
-+++ ./resource.h Sun Apr 8 16:38:11 2001
++++ ./resource.h Thu Apr 12 11:39:52 2001
@@ -47,11 +47,12 @@
#define IDB_SPIN 118
#define IDB_RTARROW 119
#define IDC_SOURCE_DOWNLOAD 1000
#define IDC_SOURCE_NETINST 1001
#define IDC_SOURCE_CWD 1002
-Common subdirectories: ../cinstall/zlib and ./zlib
+diff -urN ../cinstall/zlib/Makefile.in ./zlib/Makefile.in
+--- ../cinstall/zlib/Makefile.in Tue Aug 8 05:55:18 2000
++++ ./zlib/Makefile.in Thu Apr 12 11:42:10 2001
+@@ -299,6 +299,10 @@
+
+ clean: clean-am
+
++realclean: clean
++ rm -f Makefile *.d
++ rm -f config.cache config.log config.status
++
+ distclean-am: distclean-noinstLIBRARIES distclean-compile \
+ distclean-tags distclean-generic clean-am
+
unsigned int string_hash (String);
-template<class V>
+template <class V>
struct Dict_initialiser
{
char *key_;
/*
interface to STL function.
*/
-template<class V>
-class Dictionary : public map<String, V>
+#include "cons.hh"
+template <class V>
+class Dictionary : public std::map<String, V> //map<String, V>
{
public:
Dictionary ()
}
bool elem_b (String s)
{
- map<String,V>::const_iterator ki (find (s));
+ std::map<String,V>::const_iterator ki (find (s));
return ki != end ();
}
#ifndef GETOPT_LONG_HH
#define GETOPT_LONG_HH
+#include <ostream.h> /* gcc 3.0 */
#include "string.hh"
-class ostream;
-
/**
a struct this for initialising the commandline options.
*/
#if !HAVE_MEMMEM // GNU extension.
void *memmem (void const * haystack, int haystack_len,
void const *needle, int needle_len);
-#endif HAVE_MEMMEM
+#endif /* HAVE_MEMMEM */
#if !HAVE_SNPRINTF // GNU extension.
int snprintf (char *str, size_t n, char const *format, ...);
#ifndef RATIONAL_HH
#define RATIONAL_HH
-
#include "compare.hh"
#include "arithmetic-operator.hh"
#include "flower-proto.hh"
-class String;
+#include "string.hh"
+
/**
Rational numbers. Included is support for + and - infinity.
den_ = r.den_;
}
-class ostream;
ostream &
operator << (ostream &, Rational);
#include "string.hh"
#include "interval.hh"
-class istream;
-
-
/**
class for reading and mapping a file.
#ifndef STRING_HH
#define STRING_HH
-
+#include <iostream.h> /* gcc 3.0 */
#include "arithmetic-operator.hh"
#include "flower-proto.hh"
#include "string-handle.hh"
-class ostream;
-
/**
Intuitive string class. provides
#define classname(class_ptr) demangle_classname (typeid (* (class_ptr)))
const char *
-demangle_classname (type_info const &);
+demangle_classname (std::type_info const &);
/**
const char *
-demangle_classname (type_info const &t)
+demangle_classname (std::type_info const &t)
{
char const *s = t.name ();
while (isdigit (*s))
else
{
istream_p_ = new istrstream ("", 0);
- istream_p_->set (ios::eofbit);
+ istream_p_->setstate (ios::eofbit);
+ // istream_p_->set (ios::eofbit);
}
}
return istream_p_;
--- /dev/null
+\header {
+ title="Chord Taxomony of LilyPond -- jazz"
+ subtitle="Amy's chord tests"
+}
+scheme = \chords {
+ c1
+ c:4
+ c:9
+ bes:9^7
+ c:11^7
+ c:9+
+ % TODO
+ }
+
+\score {
+ <
+ \property ChordNames.ChordName \set #'style = #'jazz
+ \context ChordNames \scheme
+ \context Staff \notes \transpose c'' \scheme
+ >
+}
--- /dev/null
+\header {
+texidoc="Test super/sub, raise and overstrike."
+}
+
+
+
+\score {
+ \notes \relative a'' {
+ c^#'("bar")
+ c^#'(("bar"))
+ c^#'((("bar")))
+ c^#'(bold "bar")
+ c^#'((bold) "bar")
+ c^#'(((bold)) "bar")
+ c^#'(bold ("bar"))
+ c^#'(bold "bar")
+ c^#'(columns "foe" ((raise . 3) "bar"))
+ c^#'(columns "foe" (((raise . 3) "bar")))
+ c^#'(columns "foe" (((raise . 3)) "bar"))
+ c^#'(columns "foe" (super "12") (sub "3 4"))
+ c^#'(columns "foe" (super (overstrike "o") "/") (sub "x"))
+ c^#'(columns "foe" (overstrike "o") "/")
+ c^#'(columns "foe" ((bold roman overstrike) "o") "/")
+ c^#'(columns "foe" ((extent . (0 . 0)) "o") "/")
+ c^#'(columns "foo" (super "bar" (super "baz")))
+ }
+}
\ No newline at end of file
\version "1.3.146"
-\header{
-filename = "title.ly"
-title = "Title"
-subtitle = "Subtitle"
-composer= "Composer (xxxx-yyyy)"
-arranger = "Arranger"
-copyright = "public domain"
-enteredby = "jcn"
-source = "urtext"
-instrument= "Instrument"
+\header {
+ filename = "title.ly"
+ title = "Title"
+ subtitle = "Subtitle"
+ subsubtitle = "Subsubtitle"
+ composer = "Composer (xxxx-yyyy)"
+ arranger = "Arranger"
+ copyright = "public domain"
+ enteredby = "jcn"
+ source = "urtext"
+ instrument = "Instrument"
}
-
-
-\score{
- \notes
- \relative c'{
- c' d e f f e d c \break
- c d e f f e d c
- }
- \header{
- opus = "Opus 0"
- piece = "Piece I"
- override="Overdriven"
- }
+\score {
+ \context Staff \notes \relative c' {
+ \repeat unfold 10 {
+ c d e f f e d c \break
+ c d e f f e d c
+ }
+ }
+ \header {
+ opus = "Opus 0"
+ piece = "Piece I"
+ }
}
-
-\score{
- \notes
- \relative c' {
- f' e d c c d e f \break
- f e d c c d e f
- }
- \header{
- piece = "Piece II"
- opus = "Opus 1"
- }
+\score {
+ \notes \relative c' {
+ f e d c c d e f \break
+ f e d c c d e f
+ }
+ \header {
+ opus = "Opus 1"
+ piece = "Piece II"
+ }
}
%}
>
>
- \paper{
- gourlay_maxmeasures = 14.0
- }
- \midi{
- \tempo 4 = 120
- }
+ \paper{ }
+ \midi{ \tempo 4 = 120 }
}
announce_grob (text_p_, 0);
Direction dir = UP;
- SCM text;
+ SCM text = SCM_EOL;
if (solo == SCM_BOOL_T)
{
state_ = SOLO;
AFM_CharMetricInfo const *
Adobe_font_metric::find_char_metric (String nm, bool warn) const
{
- map<String,int>::const_iterator ai = name_to_metric_dict_.find (nm);
+ std::map<String,int>::const_iterator ai = name_to_metric_dict_.find (nm);
if (ai == name_to_metric_dict_.end ())
{
#include "axis-group-interface.hh"
#include "paper-def.hh"
-/*
- This callback is set in the children of the align element. It does
- not compute anything, but a side effect of a->do_side_processing ()
- is that the elements are placed correctly. */
MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2);
SCM
Align_interface::alignment_callback (SCM element_smob, SCM axis)
*/
struct Grob_info {
Translator * origin_trans_l_;
- friend Engraver;
+ friend class Engraver;
public:
Link_array<Translator> origin_trans_l_arr (Translator*) const;
Grob * elem_l_;
bool isdir_b (SCM s);
bool isaxis_b (SCM s);
+bool ly_number_pair_p (SCM);
+bool ly_axis_p (SCM);
+
/*
these conversion functions also do a typecheck on the argument, and
return a default value if S has the wrong type.
typedef SCM (*Scheme_function_unknown) ();
-#if __GNUC_MINOR__ >= 96
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 96
typedef SCM (*Scheme_function_0) ();
typedef SCM (*Scheme_function_1) (SCM);
typedef SCM (*Scheme_function_2) (SCM,SCM);
extern int score_count_global;
extern Sources* source_global_l;
-class ostream;
+#include <iostream.h> /* gcc 3.0 */
void print_lilypond_versions (ostream &os);
#endif /* MAIN_HH */
Moment * unsmob_moment (SCM);
+#if 0
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / );
-IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + );
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, * );
+IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + );
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, - );
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % );
-
INSTANTIATE_COMPARE (Moment const&, Rational::compare);
-
+#endif
#endif /* MOMENT_HH */
void break_line ();
};
-class ostream;
-#include <streambuf.h>
+#include <iostream.h> /* gcc 3.0 */
+#if __GNUC__ > 2
+ostream *open_file_stream (String filename,
+ std::ios_base::openmode mode=std::ios::out);
+#else
ostream *open_file_stream (String filename, int mode=ios::out);
+#endif
void close_file_stream (ostream *os);
}
};
-typedef map<SCM,SCM, SCM_less> Scm_stl_map;
+typedef std::map<SCM,SCM, SCM_less> Scm_stl_map;
/**
auto resizing hash table.
#include <stdio.h>
#include <ctype.h>
+#include <iostream.h> /* gcc 3.0 */
#include "score.hh"
#include "lily-guile.hh"
return SCM_BOOL_F;
}
+bool
+ly_number_pair_p (SCM p)
+{
+ return gh_pair_p (p) && gh_number_p (gh_car (p)) && gh_number_p (gh_cdr (p));
+}
+bool
+ly_axis_p (SCM a)
+{
+ return gh_number_p (a) && (gh_scm2int (a) == 0 || gh_scm2int (a) == 1);
+}
typedef void (*Void_fptr) ();
Array<Void_fptr> *scm_init_funcs_;
export GUILE_MAX_SEGMENT_SIZE=576000
may considerably decrease memory footprint (~*0.85), with a small
- execution time penalty (~*1.10). */
+ execution time penalty (~*1.10). However, if this 15% gain in memory
+ usage prevents swapping, the execution time falls drastically. */
sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", "4194304");
sane_putenv ("GUILE_MAX_SEGMENT_SIZE", "8388608");
{
String s = oparser_p_static->optional_argument_ch_C_;
Path p = split_path (s);
- if (p.ext.empty_b ())
+ if (s != "-" && p.ext.empty_b ())
p.ext = format_to_ext (output_format_global);
output_name_global = p.str ();
}
Midi_stream::Midi_stream (String filename)
{
filename_str_ = filename;
+#if __GCC__ > 2
os_p_ = open_file_stream (filename, ios::out|ios::bin);
+#else
+ os_p_ = open_file_stream (filename, ios::out|ios::binary);
+#endif
}
Midi_stream::~Midi_stream ()
add_molecule (toadd);
}
-
-
-
-bool
-number_pair_p (SCM p)
-{
- return gh_pair_p (p) && gh_number_p (gh_car (p)) && gh_number_p (gh_cdr (p));
-}
-
-bool
-axis_p (SCM a)
-{
- return gh_number_p (a) && (gh_scm2int (a) == 0 || gh_scm2int (a) == 1);
-}
-
+/* ly_? Thought we had the ly_ prefix for wrapping/adding to gh_ */
SCM
Molecule::ly_set_molecule_extent_x (SCM mol, SCM axis, SCM np)
{
Molecule* m = unsmob_molecule (mol);
- if (m && axis_p (axis) && number_pair_p (np))
+ if (m && ly_axis_p (axis) && ly_number_pair_p (np))
{
Interval iv = ly_scm2interval (np);
m->dim_[Axis (gh_scm2int (axis))] = ly_scm2interval (np);
{
Molecule *m = unsmob_molecule (mol);
- if (!m || !axis_p (axis))
+ if (!m || !ly_axis_p (axis))
{
warning ("ly-get-molecule-extent: invalid arguments");
return ly_interval2scm (Interval (0,0));
Molecule * m2 = unsmob_molecule (second);
Molecule result;
- if (!m1 || !m2 || !isdir_b (direction) || !axis_p (axis) || !gh_number_p (padding))
+ if (!m1 || !m2 || !isdir_b (direction) || !ly_axis_p (axis) || !gh_number_p (padding))
{
warning ("ly-combine-molecule-at-edge: invalid arguments");
Molecule r;
#include "music-constructor.hh"
typedef Music* (*Music_ctor) ();
-static map<String,Music_ctor> *ctors_map_;
+static std::map<String,Music_ctor> *ctors_map_;
void
add_music_ctor (String s, Music_ctor c)
{
if (!ctors_map_)
- ctors_map_ = new map<String, Music_ctor>;
+ ctors_map_ = new std::map<String, Music_ctor>;
(*ctors_map_)[s] = c;
}
const int MAXLINELEN = 200;
+#if __GNUC__ > 2
+ostream *
+open_file_stream (String filename, std::ios_base::openmode mode)
+#else
ostream *
open_file_stream (String filename, int mode)
+#endif
{
ostream *os;
if ((filename == "-"))
- os = new ostream (cout._strbuf);
+ os = &cout;
else
{
Path p = split_path (filename);
warning (_ ("Error syncing file (disk full?)"));
exit_status_global = 1;
}
- delete os;
+ if (os != &cout)
+ delete os;
os = 0;
}
void
Property_iterator::process (Moment m)
{
- SCM sym = music_l_->get_mus_property ("grob-property");
+ SCM sym = music_l_->get_mus_property ("symbol");
if (gh_symbol_p (sym))
{
- SCM val = music_l_->get_mus_property ("grob-value");
+ SCM val = music_l_->get_mus_property ("value");
bool ok= true;
if (val != SCM_EOL)
ok = type_check_assignment (val, sym, ly_symbol2scm ("translation-type?"));
{
if (gh_string_p (text))
return string2molecule (me, text, alist_chain);
-
- /*
- ugh: gh_list_p () is linear.
- */
-
- else if (gh_list_p (text) && text != SCM_EOL && text != SCM_UNDEFINED)
+ else if (gh_pair_p (text))
{
+ /* urg, why not just do this in markup_text2molecule ? */
if (gh_string_p (gh_car (text)))
- return string2molecule (me, gh_car (text), alist_chain);
+ return markup_text2molecule (me,
+ gh_append2 (gh_list (SCM_EOL,
+ SCM_UNDEFINED),
+ text),
+ alist_chain);
+ /*
+ Allow (faulty) texts that are in an extra list:
+ #'(("foo"))
+ */
+ else if (scm_ilength (text) <= 1)
+ return text2molecule (me, gh_car (text), alist_chain);
else
return markup_text2molecule (me, text, alist_chain);
}
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Axis axis = X_AXIS;
-
/*
- TODO: change ALIGN into AXIS.
+ Line mode is default.
*/
- SCM a = ly_assoc_chain (ly_symbol2scm ("align"), p);
+ Axis axis = X_AXIS;
+
+ SCM a = ly_assoc_chain (ly_symbol2scm ("axis"), p);
if (gh_pair_p (a) && isaxis_b (gh_cdr (a)))
axis = (Axis)gh_scm2int (gh_cdr (a));
if (gh_pair_p (r) && gh_number_p (gh_cdr (r)))
raise = gh_scm2double (gh_cdr (r)) * staff_space;
- Offset o (0, (axis == Y_AXIS ? - kern[axis] : 0) + raise);
-
+ Interval extent;
+ bool extent_b = false;
+ SCM e = ly_assoc_chain (ly_symbol2scm ("extent"), p);
+ if (gh_pair_p (e) && ly_number_pair_p (gh_cdr (e)))
+ {
+ extent = Interval (gh_scm2double (gh_cadr (e)) * staff_space,
+ gh_scm2double (gh_cddr (e)) * staff_space);
+ extent_b = true;
+ }
+
+ Offset o (0, (axis == Y_AXIS ? - kern[axis] : 0));
+
Molecule mol;
while (gh_pair_p (text))
{
+
Molecule m = text2molecule (me, gh_car (text), p);
- SCM m_p = SCM_EOL;
+
+ /*
+ TODO: look at padding?
+
+ Look ahead here for kern and raise.
+
+ (cols "foo" ((raise . 1) "bar"))
+ (cols "foo" ((bold (raise . 1)) "bar"))
+
+ When constructing the molecule for bar, all normal extra
+ properties found, such as bold, are used for the construction
+ of bar's molecule. But for kern or raise, it seems that we're
+ too late then, translating bar's molecule has no effect (or
+ maybe the effect of translating gets nullified when bar's
+ molecule is `added_to_edge' of the molecule for foo?)
+
+ So, while constructing foo's molecule, we look ahead for the
+ raise of bar. The HEAD of the description of bar may be a
+ single property, or a list, so we must check that too.
+ */
+
+ SCM next_p = SCM_EOL;
if (gh_pair_p (gh_car (text)))
- m_p = gh_cons (gh_call2 (f, sheet, gh_caar (text)), alist_chain);
- SCM m_k = ly_assoc_chain (ly_symbol2scm ("kern"), m_p);
- Real m_kern = kern[axis];
- if (gh_pair_p (m_k) && gh_number_p (gh_cdr (m_k)))
- m_kern = gh_scm2double (gh_cdr (m_k)) * staff_space;
+ next_p = gh_list (gh_call2 (f, sheet, gh_caar (text)), SCM_UNDEFINED);
+ SCM next_k = ly_assoc_chain (ly_symbol2scm ("kern"), next_p);
+ Real next_kern = kern[axis];
+ if (gh_pair_p (next_k) && gh_number_p (gh_cdr (next_k)))
+ next_kern = gh_scm2double (gh_cdr (next_k)) * staff_space;
+
+ SCM next_r = ly_assoc_chain (ly_symbol2scm ("raise"), next_p);
+ Real next_raise = 0;
+ if (gh_pair_p (next_r) && gh_number_p (gh_cdr (next_r)))
+ next_raise = gh_scm2double (gh_cdr (next_r)) * staff_space;
+
+ o[Y_AXIS] = next_raise;
if (!m.empty_b ())
{
m.translate (o);
if (axis == Y_AXIS && baseline_skip)
- m_kern += baseline_skip - m.extent (Y_AXIS)[UP];
- mol.add_at_edge (axis, axis == X_AXIS ? RIGHT : DOWN, m, m_kern);
+ next_kern += baseline_skip - m.extent (Y_AXIS)[UP];
+ mol.add_at_edge (axis, axis == X_AXIS ? RIGHT : DOWN, m, next_kern);
}
text = gh_cdr (text);
}
+
+ if (extent_b)
+ {
+#if 0
+ /* Hmm, we're not allowed to change a Molecule's extent? */
+ mol.dim_[axis] = extent;
+ Molecule::ly_set_molecule_extent_x (mol.self_scm (), gh_int2scm (axis),
+ gh_cdr (e));
+#else
+ // burp: unpredictable names, these...
+ Box b = mol.extent_box ();
+ SCM expr = mol.get_expr ();
+
+ b[axis] = extent;
+ mol = Molecule (b, expr);
+#endif
+ }
return mol;
}
(LilyPond-command (LilyPond-command-query (LilyPond-master-file))
'LilyPond-master-file))
+;; FIXME, this is broken
(defun LilyPond-region-file (begin end)
(let (
;; (dir "/tmp/")
(defun LilyPond-shell-process (name buffer command)
(let ((old (current-buffer)))
(switch-to-buffer-other-window buffer)
- (goto-char (point-max))
+ ;; Hmm, if we goto the end of the buffer, we don't see
+ ;; the messages scroll by. I don't know how to fix this,
+ ;; so let's emty the buffer, then
+ ;;(goto-char (point-max))
+ (erase-buffer)
+ (goto-char (point-min))
(start-process-shell-command name buffer command)
(switch-to-buffer-other-window old)))
-\version "1.3.146"
+BABYL OPTIONS: -*- rmail -*-
+Version: 5
+Labels:
+Note: This is the header of an rmail file.
+Note: If you are seeing it in rmail,
+Note: it means the file has no messages in it.
+\1f\f
+1,,
+Return-Path: rz@daimi.au.dk
+Delivery-Date: Fri, 13 Apr 2001 13:33:44 +0200
+Received: from localhost (localhost [127.0.0.1])
+ by appel.lilypond.org (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id NAA02351
+ for <fred@localhost>; Fri, 13 Apr 2001 13:33:43 +0200
+X-XS4ALL-To: <jantien@xs4all.nl>
+Received: from pop.xs4all.nl
+ by localhost with POP3 (fetchmail-5.1.2)
+ for fred@localhost (single-drop); Fri, 13 Apr 2001 13:33:44 +0200 (CEST)
+Received: from smtp5.xs4all.nl (smtp5.xs4all.nl [194.109.6.49])
+ by maildrop7.xs4all.nl (8.11.1/8.11.1) with ESMTP id f3DBWCd93235
+ for <jantien@xs4all.nl>; Fri, 13 Apr 2001 13:32:12 +0200 (CEST)
+ (envelope-from rz@daimi.au.dk)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by smtp5.xs4all.nl (8.9.3/8.9.3) with ESMTP id NAA10302
+ for <jantien@xs4all.nl>; Fri, 13 Apr 2001 13:31:04 +0200 (CEST)
+Received: from nightcrawler.daimi.au.dk ([130.225.18.95])
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14o1n2-0008Pp-00
+ for <janneke@gnu.org>; Fri, 13 Apr 2001 07:31:00 -0400
+Received: from daimi.au.dk (localhost [127.0.0.1])
+ by nightcrawler.daimi.au.dk (8.11.2/8.11.2) with ESMTP id f3DBUwX31324
+ for <janneke@gnu.org>; Fri, 13 Apr 2001 13:30:58 +0200
+Sender: rz@daimi.au.dk
+Message-ID: <3AD6E372.640DEE61@daimi.au.dk>
+Date: Fri, 13 Apr 2001 13:30:58 +0200
+From: Rune Zedeler <rz@daimi.au.dk>
+X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-3 i686)
+X-Accept-Language: en
+MIME-Version: 1.0
+To: Jan Nieuwenhuizen <janneke@gnu.org>
+Subject: german-chords
+Content-Type: multipart/mixed;
+ boundary="------------69CC07F348020448DD291CA8"
+X-UIDL: 987161532.maildrop7.93237
+
+*** EOOH ***
+\version "1.3.148"
% german-chords.ly:
% german/norwegian/danish?
#(define german-Bb #f)
-#(define (pitch->chord-name-text-banter pitch additions)
- (if (equal? (cdr pitch) '(6 -1))
- (if german-Bb
- (cons "B" (accidental->text -1))
- '("B")
- )
+#(define (pitch->chord-name-text-banter pitch steps)
+ (let ((dopitch (if (member (cdr pitch) '((6 -1) (6 -2)))
+ (list 7 (+ (if german-Bb 0 1) (caddr pitch)))
+ (cdr pitch)
+ )))
(cons
- (list-ref '("C" "D" "E" "F" "G" "A" "H") (cadr pitch))
- (accidental->text (caddr pitch))
+ (list-ref '("C" "D" "E" "F" "G" "A" "H" "B") (car dopitch))
+ (accidental->text-super (cadr dopitch))
)
)
- )
+ )
+
#(define (pitch->note-name-text-banter pitch)
- (if (equal? (cdr pitch) '(6 -1))
- '("b")
- (cons
+ (let ((dopitch (if (member (cdr pitch) '((6 -1) (6 -2)))
+ (list 7 (+ 1 (caddr pitch)))
+ (cdr pitch)
+ )))
+ (list
(string-append
- (list-ref '("c" "d" "e" "f" "g" "a" "h") (cadr pitch))
- (if (or (equal? (cadr pitch) 2) (equal? (cadr pitch) 5))
- (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (caddr pitch)))
- (list-ref '("eses" "es" "" "is" "isis") (+ 2 (caddr pitch)))
+ (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car dopitch))
+ (if (or (equal? (car dopitch) 2) (equal? (car dopitch) 5))
+ (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (cadr dopitch)))
+ (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cadr dopitch)))
)
)
- '()
)
)
)
+
+\1f
\ No newline at end of file
\version "1.3.146"
% JUNKME.
+%% deprecated
papersizename = \papersize
+% ly2dvi now uses `papersize' internally (and on cmd line)
+papersize = \papersize
+
+% FIXME
+% direct PostScript line height for single line staffs
+lineheight = 14
+
paperfile = \papersize + ".ly"
% paperfile = "a4.ly"
#include <libintl.h>
#endif
+bool testing_level_global;
// ugh
String filename_str_g;
--- /dev/null
+ depth = ../../..
+ include $(depth)/ports/ports.make
+
%!PS-Adobe-1.0: lily.ps
%
-%
+% Functions for direct and embedded PostScript
% round cappings
1 setlinecap
show
} bind def
-% simple, but does it work everywhere?
-% explain ? --hwn
+% Simple, but does it work everywhere?
+% The filled circles are drawn by setting the linewidth
+% to 2*radius and drawing a point. Is that (defined to be)
+% a nice filled circle?
/draw_ez_ball % ch letter_col ball_col font
{
% font
%!PS-Adobe-1.0: lilyponddefs
+%
+% Functions for direct PostScript output
% hmm
% /setgray { 1 add } bind def
-/stafflinethickness lilypondpaperstafflinethickness def
-/staffheight lilypondpaperstaffheight def
+/staff-line-thickness lilypondpaperstafflinethickness def
+/staff-height lilypondpaperstaffheight def
+/line-width lilypondpaperlinewidth def
+
+% FIXME: why isn't this set (by default) by lily?
+% /text-height lilypondpapertextheight def
+
+/output-scale lilypondpaperoutputscale def
+/paper-size { lilypondpaperpapersize } bind def
+
+% FIXME
+% urg, read from paper block
+% fixed base line skip value, for single line staffs
+/base-line-skip lilypondpaperlineheight def
+
+
+/init-paper {
+ gsave
+ .1 setlinewidth
+ clippath pathbbox newpath
+ /vsize exch def
+ /hsize exch def pop pop pop
-/xoffset 30 def
-/yoffset 700 def
+ %FIXME:
+ %vsize text-height sub 2 div /top-margin exch def
+ 144 2 div /top-margin exch def
+ hsize line-width sub 2 div /left-margin exch def
+ grestore
+} bind def
-/placebox
+/place-box
{
/object exch def
gsave
% FIXME. translate to middle of box.
%
-/draw_box % breapth width depth height
+/draw-box % breapth width depth height
{
/h exch def
/d exch def
grestore
} bind def
-/start_line
+/start-line
{
+ line-y top-margin sub base-line-skip lt {
+ showpage
+ /line-y vsize top-margin sub def
+ } if
gsave
- xoffset yoffset translate
+ line-x line-y translate
} bind def
-/stop_line
+/stop-line
{
- /object exch def
- 0 0 moveto pathbbox exch pop sub exch pop
- object
+ /the-line exch def
+ 0 0 moveto the-line clippath pathbbox
+ stroke
grestore
- yoffset add /yoffset exch def
- % urg...
- yoffset lilypondpaperstaffheight 8 mul sub /yoffset exch def
+ exch 4 -1 roll
+ sub
+ 3 1 roll
+ exch sub
+ %pstack
+ %
+ % ugh: now we should have `width height' on stack,
+ % but it's probably just the width and height of last element
+ % (the last staff)
+ % How do we get all heights of all staffs in a line?
+ %
+ % output-scale div neg line-y add /line-y exch def
+ %
+ % discarding height...
+ pop
+ %
+ % discard width
+ pop
+ % use fixed base-line-skip for now
+ line-y base-line-skip output-scale mul sub /line-y exch def
+} bind def
+
+% FIXME: font definitions should come from LilyPond
+% built-in ps fonts are ugly
+/huge-bold-font {
+ /Times-Bold findfont 20.7 scalefont setfont
+} bind def
+
+/Large-bold-font {
+ /Times-Bold findfont 17.3 scalefont setfont
+} bind def
+
+/large-bold-font {
+ /Times-Bold findfont 14.4 scalefont setfont
+} bind def
+
+/large-font {
+ /Times-Roman findfont 14.4 scalefont setfont
+} bind def
+
+/large-smallcaps-font {
+ % urg
+ /Helvetica findfont 14.4 scalefont setfont
+} bind def
+
+/normal-font {
+ /Times-Roman findfont 12 scalefont setfont
+} bind def
+
+/footnote-font {
+ /Times-Roman findfont 10 scalefont setfont
+} bind def
+
+/get-text-dimensions % path .. width height
+{
+ dup true charpath pathbbox
+ newpath
+ line-x line-y moveto
+ exch 4 -1 roll
+ sub
+ 3 1 roll
+ exch sub
+} bind def
+
+/set-centered
+{
+ line-x line-y moveto
+ get-text-dimensions
+ neg line-y add /line-y exch def
+ neg line-width add 2 div 0 rmoveto
+ show
+} bind def
+
+/set-left
+{
+ line-x line-y moveto
+ get-text-dimensions
+ neg line-y add /line-y exch def
+ pop
+ show
+} bind def
+
+/set-right
+{
+ line-x line-y moveto
+ get-text-dimensions
+ neg line-y add /line-y exch def
+ neg line-width add 0 rmoveto
+ show
+} bind def
+
+/make-lilypond-title
+{
+ currentdict /lilypondtitle known {
+ huge-bold-font lilypondtitle set-centered
+ line-y 5 sub /line-y exch def
+ } if
+ currentdict /lilypondsubtitle known {
+ Large-bold-font lilypondsubtitle set-centered
+ line-y 5 sub /line-y exch def
+ } if
+ currentdict /lilypondsubsubtitle known {
+ large-bold-font lilypondsubsubtitle set-centered
+ } if
+ currentdict /lilypondcomposer known {
+ large-smallcaps-font lilypondcomposer set-right
+ } if
+ currentdict /lilypondopus known {
+ normal-font lilypondopus set-right
+ } if
+ currentdict /lilypondarranger known {
+ normal-font lilypondarranger set-right
+ } if
+ currentdict /lilypondinstrument known {
+ large-font lilypondinstrument set-centered
+ } if
+ currentdict /lilypondpiece known {
+ large-smallcaps-font lilypondpiece set-left
+ } if
+} bind def
+
+/end-lilypond-output
+{
+ /line-y top-margin def
+ footnote-font lilypondtagline set-left
+ showpage
} bind def
/turnOnExperimentalFeatures { } bind def
-stafflinethickness setlinewidth
+
+staff-line-thickness setlinewidth
+
+paper-size
+
+staff-height init-paper
+
+/line-x left-margin def
+/line-y vsize top-margin sub def
+
+make-lilypond-title
% see if we're there...
% 10 setlinewidth 0 0 moveto 400 800 lineto stroke
;; TODO
;;
+;; * easier tweakability:
+;; - split chord::names-alists up into logical bits,
+;; such as chord::exceptions-delta, exceptions-oslash
+;; - iso just the 'style parameter, use a list, eg:
+;; \property ChordNames.ChordName \set
+;; #'style = #'(jazz delta oslash german-tonic german-Bb)
+;;
;; * fix FIXMEs
+;;
;; * clean split/merge of bass/banter/american stuff
-;; * handy, documented hooks for user-override of:
-;; - tonic (chord) name
-;; -
+;;
;; * doc strings
(define chord::names-alist-banter '())
chord::names-alist-banter))
;;;;;;;;;;
+(define simple-super
+;; duh, no docstrings for
+;; "No real superscript, just raised and small"
+ '((raise . 1) (font-relative-size . -1)))
-
-;; FIXME
-(define (accidental->text acc)
+(define (accidental->textp acc pos)
(if (= acc 0)
'()
- (list '(music (font-relative-size . -2))
- (string-append "accidentals-" (number->string acc)))))
+ (list '(music (font-relative-size . -2))
+ (list pos (string-append "accidentals-" (number->string acc))))))
+(define (accidental->text acc) (accidental->textp acc 'columns))
(define (accidental->text-super acc)
- (if (= acc 0)
- '()
- (cons 'super (list (accidental->text acc)))))
-
-(define (accidental->text-sub acc)
- (if (= acc 0)
- '()
- (cons sub (list accidental->text acc))))
-
-
-;; these look nice, but don't work together with current inner-name-jazz
-;; (inner-name-jazz is a bit broken: apply append etc)
-(define (xaccidental->textp acc pos)
- (if (= acc 0)
- '()
- (list (list '(music (font-relative-size . -2))
- (list pos (string-append "accidentals-" (number->string acc))))))
-)
-
-(define (xaccidental->text acc) (accidental->textp acc 'rows))
-(define (xaccidental->text-super acc) (accidental->textp acc 'super))
-(define (xaccidental->text-sub acc) (accidental->textp acc 'sub))
+ (accidental->textp acc '((raise . 0.6) (font-relative-size . -1))))
+(define (accidental->text-sub acc) (accidental->textp acc 'sub))
(define (pitch->note-name pitch)
(cons (cadr pitch) (caddr pitch)))
-;; FIXME: see german-chords.ly
(define (pitch->text pitch)
- (cons
- (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65)))
+ (text-append
+ (list
+ '(font-relative-size . 2)
+ (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65))))
(accidental->text-super (caddr pitch))))
dirty
'())))
-(define (chord::text-append l . r)
+(define (text-append l . r)
(if (not (chord::text? r))
l
(if (not (chord::text? l))
r
- (cons l r))))
-
+ (if (empty? (cdr r))
+ (list 'columns l (car r))
+ (text-append (list 'columns l (car r)) (cdr r))))))
+
(define (chord::step tonic pitch)
(- (pitch::note-pitch pitch) (pitch::note-pitch tonic)))
(modulo (+ i 6) 7)))))))))
(define (chord::additions steps)
- " Return:
+" Return:
* any even step (2, 4, 6)
* any uneven step that is chromatically altered,
(where 7-- == -1, 7- == 0, 7 == +1)
* highest step
-and you need also:
+?and jazz needs also:
* TODO: any uneven step that's lower than an uneven step which is
chromatically altered
(define (chord::additions->text-banter additions subtractions)
(if (pair? additions)
- (cons (apply append
- (chord::text-cleanup
- (list
- (cons 'super (step->text-banter (car additions)))
- (if (or (pair? (cdr additions))
- (pair? subtractions))
- '(super "/")))))
- (chord::additions->text-banter (cdr additions) subtractions))))
+ (text-append
+ (let ((step (step->text-banter (car additions))))
+ (if (or (pair? (cdr additions))
+ (pair? subtractions))
+ (text-append step "/")
+ step))
+ (chord::additions->text-banter (cdr additions) subtractions))
+ '()))
(define (chord::subtractions->text-banter subtractions)
(if (pair? subtractions)
- (cons (apply append
- (chord::text-cleanup
- (list
- '(super "no")
- (cons 'super (step->text-banter (car subtractions)))
- (if (pair? (cdr subtractions))
- '(super "/")))))
- (chord::subtractions->text-banter (cdr subtractions)))))
+ (text-append
+ '("no")
+ (let ((step (step->text-jazz (car subtractions))))
+ (if (pair? (cdr subtractions))
+ (text-append step "/")
+ step))
+ (chord::subtractions->text-banter (cdr subtractions)))
+ '()))
(define (chord::bass-and-inversion->text-banter bass-and-inversion)
(if (and (pair? bass-and-inversion)
(sep-text (if (and (string-match "super" (format "~s" exception-part))
(or (pair? additions)
(pair? subtractions)))
- '((super "/"))))
+ (list simple-super "/")))
(adds-text (chord::additions->text-banter additions subtractions))
(subs-text (chord::subtractions->text-banter subtractions))
(b+i-text (chord::bass-and-inversion->text-banter bass-and-inversion)))
- (apply append
- (map chord::text-cleanup
- (list
- '(rows) tonic-text except-text sep-text adds-text subs-text
- b+i-text)))))
+ (text-append
+ tonic-text except-text sep-text
+ (list (list simple-super) adds-text subs-text)
+ b+i-text)))
(define (chord::name-banter tonic exception-part unmatched-steps
bass-and-inversion steps)
'())))
(chord::name->text style (car pitches) steps bass-and-inversion)))
-
-
;;;
;;; American style
;;;
(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . ("m(maj7)"))
;jazz: the delta, see jazz-chords.ly
;;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . math) "N"))
- ;; ugh, kludge slashed o
- ;; (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((kern . -0.85) ((raise . 0.57) ((font-relative-size . -3) "/"))) "7")) ; slashed o
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") (((kern . -0.85) (raise . 1.1) (font-relative-size . -2)) "/") "7")) ; slashed o
+ ;; slashed o
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (columns (super (overstrike "o") "/") "7"))
(((0 . 0) (2 . 0) (4 . 1) (6 . -1)) . ("aug7"))
- (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
- (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
+ (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (columns "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
+ (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (columns "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
(((0 . 0) (3 . 0) (4 . 0) (6 . -1)) . ("7sus4"))
;; Common ninth chords
(((0 . 0) (2 . 0) (4 . 0) (5 . 0) (1 . 0)) . ("6/9")) ;; we don't want the '/no7'
;;
;; This is getting out-of hand? Only exceptional chord names that
;; cannot be generated should be here.
-;; Maybe we should have inner-jazz-name and inner-american-name functions;
+;; Maybe we should have inner-name-jazz and inner-name-american functions;
;;
;;
;;
;; minor chords
; minor sixth chord = m6
- (((0 . 0) (2 . -1) (4 . 0) (5 . 0)) . (rows("m")((raise . 0.5) "6")))
+ (((0 . 0) (2 . -1) (4 . 0) (5 . 0)) . (columns("m")((raise . 0.5) "6")))
;; minor major seventh chord = m triangle
;; shouldn't this be a filled black triange, like this: ? --jcn
- ;;(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (rows ("m") ((raise . 0.5)((font-family . math) "N"))))
- (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (rows ("m") ((raise . 0.5)((font-family . math) "M"))))
+ ;;(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (columns ("m") ((raise . 0.5)((font-family . math) "N"))))
+ (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (columns ("m") ((raise . 0.5)((font-family . math) "M"))))
; minor seventh chord = m7
- (((0 . 0) (2 . -1) (4 . 0) (6 . -1)) . (rows("m")((raise . 0.5) "7")))
+ (((0 . 0) (2 . -1) (4 . 0) (6 . -1)) . (columns("m")((raise . 0.5) "7")))
; minor sixth nine chord = m6/9
- (((0 . 0) (2 . -1) (4 . 0) (5 . 0) (1 . 0)) . (rows("m")((raise . 0.5) "6/9")))
+ (((0 . 0) (2 . -1) (4 . 0) (5 . 0) (1 . 0)) . (columns("m")((raise . 0.5) "6/9")))
; minor with added nine chord = madd9
- (((0 . 0) (2 . -1) (4 . 0) (1 . 0)) . (rows("m")((raise . 0.5) "add9")))
+ (((0 . 0) (2 . -1) (4 . 0) (1 . 0)) . (columns("m")((raise . 0.5) "add9")))
; minor ninth chord = m9
- (((0 . 0) (2 . -1) (4 . 0) (6 . -1) (1 . 0)) . (rows("m")((raise . 0.5) "9")))
+ (((0 . 0) (2 . -1) (4 . 0) (6 . -1) (1 . 0)) . (columns("m")((raise . 0.5) "9")))
;; dominant chords
; dominant seventh = 7
(((0 . 0) (2 . 0) (4 . 0) (6 . -1)) . (((raise . 0.5) "7")))
; augmented dominant = +7
;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (((raise . 0.5) "+7"))) ; +7 with both raised
- (((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (rows("+")((raise . 0.5) "7"))) ; +7 with 7 raised
- ;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (rows((raise . 0.5) "7(")
+ (((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (columns("+")((raise . 0.5) "7"))) ; +7 with 7 raised
+ ;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (columns((raise . 0.5) "7(")
; ((raise . 0.3)(music (named ("accidentals-1"))))
; ((raise . 0.5) "5)"))); 7(#5)
; dominant flat 5 = 7(b5)
- (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows((raise . 0.5) "7(")
+ (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (columns((raise . 0.5) "7(")
((raise . 0.3)(music (named ("accidentals--1"))))
((raise . 0.5) "5)")))
; dominant 9 = 7(9)
;; half diminshed chords
;; half diminished seventh chord = slashed o
;; (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (((raise . 0.8) "/o")))
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") (((kern . -0.85) (raise . 1.1) (font-relative-size . -2)) "/") "7")) ; slashed o
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (columns (super (overstrike "o") "/") "7")) ; slashed o
; half diminished seventh chord with major 9 = slashed o cancelation 9
(((0 . 0) (2 . -1) (4 . -1) (6 . -1) (1 . 0)) . (
chord::names-alist-american))
(define (step->text-alternate-jazz pitch)
- (cons
+ (text-append
(accidental->text (caddr pitch))
- (list (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8))))))
+ (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8)))))
(define (step->text-jazz pitch)
(if (= (cadr pitch) 6)
(case (caddr pitch)
;; sharp 7 only included for completeness?
- ((-2) (cons (accidental->text -1) '("7")))
+ ((-2) (text-append (accidental->text -1) '("7")))
((-1) '("7"))
((0) '("maj7"))
- ((1) (cons (accidental->text-super 1) '("7")))
- ((2) (cons (accidental->text-super 2) '("7"))))
+ ((1) (text-append (accidental->text-super 1) '("7")))
+ ((2) (text-append (accidental->text-super 2) '("7"))))
(step->text-alternate-jazz pitch)))
-(define (chord::additions->text-jazz additions subtractions)
+(define (xchord::additions->text-jazz additions subtractions)
(if (pair? additions)
- (cons (apply append
- (chord::text-cleanup
- (list
- (cons 'super (step->text-jazz (car additions)))
- (if (or (pair? (cdr additions))
- (pair? subtractions))
- '(super "/")))))
- (chord::additions->text-jazz (cdr additions) subtractions))
- '()))
+ (text-append
+ (let ((step (step->text-jazz (car additions))))
+ (if (or (pair? (cdr additions))
+ (pair? subtractions))
+ (text-append step "/")
+ step))
+ (chord::additions->text-jazz (cdr additions) subtractions))
+ '()))
+
+(define (chord::>5? x)
+ (or (> (car x) 0)
+ (> (cadr x) 4)))
+
+
+;; FIXME:
+;; Perhaps all logic like this should be done earlier,
+;; so that in this text-construction printing phase
+;; we can just blindly create text from all additions.
+;;
+;; This depends maybe on the fact of code sharing,
+;; in this layout, we can share the functions chord::additions
+;; and chord::subtractions with banter.
+(define (chord::additions->text-jazz additions subtractions)
+ (text-append
+ (chord::additions<=5->text-jazz (filter-out-list chord::>5? additions)
+ (filter-out-list chord::>5? subtractions))
+ (chord::additions>5->text-jazz (filter-list chord::>5? additions)
+ (filter-list chord::>5? subtractions))))
+
+;; FIXME
+(define (chord::additions<=5->text-jazz additions subtractions)
+ (let ((sus (chord::sus-four-jazz additions)))
+ (if (pair? sus)
+ (text-append '("sus") (step->text-jazz (car sus)))
+ '())))
+
+(define (chord::additions>5->text-jazz additions subtractions)
+ "
+Compose text of all additions
+ * if there's a subtraction:
+ - add `add'
+ - list all up to highest
+ * list all steps that are below an chromatically altered step
+ "
+ (text-append
+ (if (not (empty? subtractions)) "add" '())
+ (let ((radds (reverse additions)))
+ (reverse (chord::additions>5->text-jazz-helper
+ radds
+ subtractions
+ (if (or (empty? subtractions) (empty? radds))
+ #f (car radds)))))))
+
+(define (chord::additions>5->text-jazz-helper additions subtractions list-step)
+ "
+Create texts for all additions
+If list-step != #f, list all steps down to 5
+If we encounter a chromatically altered step, turn on list-step
+"
+
+ (if list-step
+ (if (not (member list-step subtractions))
+ (if (> 5 (cadr list-step))
+ (cons (step->text-jazz list-step)
+ (chord::additions>5->text-jazz-helper
+ additions
+ subtractions
+ (chord::get-create-step additions
+ (- (cadr list-step) 2))))
+ (step->text-jazz list-step))
+ (chord::get-create-step additions (- (cadr list-step) 2)))
+ (if (pair? additions)
+ (let ((step (car additions)))
+ (cons (step->text-jazz step)
+ (chord::additions>5->text-jazz-helper
+ (cdr additions)
+ subtractions
+ (if (or (and (!= 6 (cadr step)) (!= 0 (caddr step)))
+ (and (= 6 (cadr step)) (!= -1 (caddr step))))
+ (chord::get-create-step additions (- (cadr step) 2))
+ #f))))
+ '())))
+
+(define (chord::sus-four-jazz chord-pitches)
+ "List of pitches that are step 2 or step 4"
+ (filter-list (lambda (x)
+ (and (= 0 (car x))
+ (or (= 1 (cadr x)) (= 3 (cadr x))))) chord-pitches))
+
+(define (chord::get-create-step steps n)
+ (let* ((i (if (< n 0) (+ n 7) n))
+ (found (filter-list (lambda (x) (= i (cadr x))) steps)))
+ (if (empty? found)
+ (if (!= i 6)
+ (list 0 i 0)
+ (list 0 6 -1))
+ (car found))))
+
(define (chord::subtractions->text-jazz subtractions)
(if (pair? subtractions)
- (cons (apply append
- (chord::text-cleanup
- (list
- '(super "omit")
- (cons 'super (step->text-jazz (car subtractions)))
- (if (pair? (cdr subtractions))
- '(super "/")))))
- (chord::subtractions->text-jazz (cdr subtractions)))
- '()))
+ (text-append
+ (if (= 5 (cadr (car subtractions)))
+ (text-append
+ '("omit")
+ (let ((step (step->text-jazz (car subtractions))))
+ (if (pair? (cdr subtractions))
+ (text-append step "/")
+ step)))
+ '())
+ (chord::subtractions->text-jazz (cdr subtractions)))
+ '()))
;; TODO: maybe merge with inner-name-banter
;; additions, subtractions and bass or inversion into chord name
(define (chord::inner-name-jazz tonic exception-part additions subtractions
bass-and-inversion steps)
-
- ;; ugh
- (apply
- append
-
- (chord::text-cleanup
- (list '(rows)
- (pitch->chord-name-text-banter tonic steps)
- exception-part
- ;; why does list->string not work, format seems only hope...
- (if (and (string-match "super" (format "~s" exception-part))
- (or (pair? additions)
- (pair? subtractions)))
- '((super "/")))
- (chord::additions->text-jazz additions subtractions)
- (chord::subtractions->text-jazz subtractions)
- (chord::bass-and-inversion->text-banter bass-and-inversion)))))
+ (text-append
+ (pitch->chord-name-text-banter tonic steps)
+ exception-part
+ ;; why does list->string not work, format seems only hope...
+ (if (and (string-match "super" (format "~s" exception-part))
+ (or (pair? additions)
+ (pair? subtractions)))
+ (list simple-super "/"))
+
+ (list `(,simple-super)
+ (chord::additions->text-jazz additions subtractions)
+ (chord::subtractions->text-jazz subtractions))
+ (chord::bass-and-inversion->text-banter bass-and-inversion)))
;; Jazz style--basically similar to american with minor changes
;;
(properties-to-font .
,Font_interface::properties_to_font_name)
- ;; FIXME: this is a not-so-cool idea to use ALIGN
- ;; RAISE, LOOKUP, since they are not proper elt-properties,
- ;; and might interfere with them.
(markup-to-properties . ,markup-to-properties)
(abbreviation-alist
- . ((rows . ((align . 0)))
- (lines . ((align . 1)))
+ . ((columns . ((axis . 0)))
+ (lines . ((axis . 1)))
(roman . ((font-family . roman)))
(music . ((font-family . music) (lookup . name)))
(finger . ((font-style . finger)))
(upright . ((font-shape . upright)))
(italic . ((font-shape . italic)))
(named . ((lookup . name)))
- (super . ((raise . 1) (font-relative-size . -1)))
- (sub . ((raise . -1) (font-relative-size . -1)))
+ (overstrike . ((extent . (0 . 0))))
+ (super . ((raise . 1) (font-relative-size . -1) (extent . (0 . 0))))
+ (sub . ((raise . -1) (font-relative-size . -1) (extent . (0 . 0))))
(text . ((lookup . value)))
)
)
;; (display "'\n")
(if (pair? markup)
- (if (and (symbol? (car markup)) (not (pair? (cdr markup))))
+ ;; This is hairy. We want to allow:
+ ;; ((foo bar) "text")
+ ;; ((foo (bar . 1)) "text")
+ ;; ((foo . (0 . 1)))
+
+ (if (and (symbol? (car markup))
+ (or (not (pair? (cdr markup)))
+ (number? (cadr markup))))
(if (equal? '() (cdr markup))
(markup-to-properties sheet (car markup))
(list markup))
head: markup | (markup+)
markup-item: property | abbrev
property: (@var{key} . @var{value})
-abbrev: @code{rows lines roman music bold italic named super sub text}
+abbrev: @code{columns lines roman music bold italic named super sub overstrike text}
@code{finger volta timesig mmrest mark script large Large dynamic}
@end example
The following abbreviations are currently defined:
@table @samp
-@item rows
-horizontal mode: set all text on one line (default)
+@item columns
+ horizontal mode: set all text on one line (default)
@item lines
vertical mode: set every text on new line
@item roman
select roman font
@item music
- select feta font
+ select feta font, and lookup by character name
@item bold
select bold series
@item italic
superscript
@item sub
subscript
+@item overstrike
+ the next text or character overstrikes this one
@item finger
select fingering number fontstyle
@item volta
(cons (car list) rest)
rest))))
+(define (filter-out-list pred? list)
+ "return that part of LIST for which PRED is true."
+ (if (null? list) '()
+ (let* ((rest (filter-list pred? (cdr list))))
+ (if (not (pred? (car list)))
+ (cons (car list) rest)
+ rest))))
+
(define (uniqued-alist alist acc)
(if (null? alist) acc
(if (assoc (caar alist) acc)
" draw_repeat_slash"))
(define (end-output)
- "\nshowpage\n")
+ "\nend-lilypond-output\n")
(define (experimental-on) "")
(define (filledbox breapth width depth height)
(string-append (numbers->string (list breapth width depth height))
- " draw_box" ))
+ " draw-box" ))
;; obsolete?
(define (font-def i s)
(define (placebox x y s)
(string-append
- (ly-number->string x) " " (ly-number->string y) " {" s "} placebox\n"))
+ (ly-number->string x) " " (ly-number->string y) " {" s "} place-box\n"))
(define (bezier-sandwich l thick)
(string-append
" draw_bezier_sandwich"))
(define (start-line height)
- "\nstart_line {
+ "\nstart-line {
lilypondpaperoutputscale lilypondpaperoutputscale scale
")
(define (stem breapth width depth height)
(string-append (numbers->string (list breapth width depth height))
- " draw_box" ))
+ " draw-box" ))
(define (stop-line)
- "}\nstop_line\n")
+ "}\nstop-line\n")
(define (text s)
(string-append "(" s ") show "))
return str
conversions.append (((1,3,147), conv, 'default-neutral-direction -> neutral-direction'))
+if 1:
+ def conv (str):
+ str = re.sub ('\(align', '(axis', str)
+ str = re.sub ('\(row', '(columns', str)
+ return str
+ conversions.append (((1,3,148), conv, '(align -> (axis, (row -> columns'))
+
################################
# END OF CONVERSIONS
'''
TODO:
+
+ * use urllib iso ftplib
+
* more flexible build/ftp/patches/releases paths
- * flexible build command
- * show only?
+
+
+ show only: --command='echo "latest is: %n-%v"'
'''
-import os
+import ftplib
import fnmatch
+import getopt
+import re
+import operator
+import os
+import tempfile
import stat
import string
-import re
-import getopt
import sys
import __main__
-import operator
-import tempfile
try:
import gettext
list_ = list_file
-#
-# ugh: use ftp module.
-#
def list_ftp (user, passwd, host, dir, file):
if user == 'None':
user = 'anonymous'
if passwd == 'None':
passwd = program_name
- command = '''
-open -u%s,%s -p21 %s
-set passive-mode off
-cd "%s"
-ls -1 "%s"
-''' % (user, passwd, host, dir, file)
- temp = tempfile.mktemp (program_name)
- f = open (temp, 'w')
- f.write (command)
- f.close ()
- p = os.popen ('lftp -f %s' % temp, 'r')
- s = p.read ()
- status = p.close ()
- return string.split (s[:-1], '\n')
+ ftp = ftplib.FTP (host)
+ ftp.login (user, passwd)
+ ftp.set_pasv (1)
+ ftp.cwd (dir)
+ list = ftp.nlst (file)
+ try:
+ ftp.quit ()
+ except:
+ ftp.close ()
+ return list
def split_url (url):
m = re.match ('([^:/]*)(:)?(/*([^:]*):)?(/*([^@]*)@)?(//([^/]*))?(.*)/(.*)',
if passwd == 'None':
passwd = program_name
- command = '''
-open -u%s,%s -p21 %s
-set passive-mode off
-cd "%s"
-get "%s"
-''' % (user, passwd, host, dir, file)
- temp = tempfile.mktemp (program_name)
- f = open (temp, 'w')
- f.write (command)
- f.close ()
- p = os.popen ('lftp -f %s' % temp, 'r')
- s = p.read ()
- status = p.close ()
+ ftp = ftplib.FTP (host)
+ ftp.login (user, passwd)
+ ftp.set_pasv (1)
+ t = tempfile.mktemp (program_name)
+ try:
+ f = open (t, 'w')
+ ftp.retrbinary ('RETR %s/%s' % (dir, file),
+ lambda x, f=f: f.write (x))
+ f.close ()
+ # huh? Invalid cross-device link
+ # os.rename (t, file)
+ system ('mv %s %s' % (t, file))
+ except:
+ os.remove (t)
+ raise 'Foo'
+ try:
+ ftp.quit ()
+ except:
+ ftp.close ()
+ return list
+
+
def copy_url (url, dir):
os.chdir (dir)
s = "copy_%s ('%s', '%s', '%s', '%s', '%s')" % split_url (url)
if 1:
latest = find_latest (url)
- if os.path.isdir ('%s/%s' % (build_root, latest)):
+ # if os.path.isdir ('%s/%s' % (build_root, latest)):
+ if os.path.exists ('%s/%s/index.html' % (build_root, latest)):
progress (_ ("latest is: %s") % latest)
progress (_ ("relax, %s is up to date" % package_name))
sys.exit (0)
if not os.path.isdir (build_root):
build_root = temp_dir
+
if not os.path.isdir (release_dir):
release_dir = temp_dir
setup_temp ()
progress (_ ("building %s...") % latest)
os.chdir (build_root)
- if build (latest):
+ if not build (latest):
if previous and remove_previous_p:
system ('rm -rf %s' % os.path.join (build_root, previous))
else: