-1.3.114.jcn1
-============
-* Moved writing of \header strings feature from lilypond-book to lilypond.
-1.3.113.jcn2
+1.3.114.mb1
+===========
+
+* Bugfix: convert-ly
+
+* Bugfix: Included FAQ.txt in the top directory
+
+* Allow for instrument names with multiple lines and font selection,
+ see input/test/coriolan-margin.ly
+
+* Added example for figured bass: input/test/figbass.ly
+
+1.3.114.lec1
============
+* abc2ly fixes
+ * allow a g_8 clef to be specified by treble8
+
+ * allow full mode names, as well as 3 character abbreviations
+
+ * support breves and longas (no abc program that I know of has
+ longas, but a couple of them have breves, and one can always hope.)
+
+ * translate text annotations beginning with _ and ^ for above and
+ below the staff.
+
+ * quote lyrics syllables with (
+
+ * handle real repeat syntax, for appropriately written ABC.
+
+ * %%LY slyrics now works for longer than one character lyric strings.
+
+ * N: fields are now in header.
+
+1.3.114.uu1
+===========
+
+* Prepare for Music type-unification: remove all args from Music
+constructor, and set everything in the parser.
+
+* Moved writing of \header strings feature from lilypond-book to lilypond. (1.3.114.jcn1)
+
+* Bugfix: tied chords.
+
+* Turn off .info creation by default.
+
+1.3.114
+=======
+
* Moved all documentation from regtest to individual example files.
* Added feature to lilypond-book to write out \header texidoc string.
If you are still at loss, send your questions to the @strong{mailing
list}, and not to authors directly.
-@subsection My symbols are all messed up!
-
-After I upgraded, I get the wrong symbols and dvi-checksum errors!
-
-We obviously mucked with the fonts in the upgrade. Remove @strong{all}
-previous fonts, including the @file{.pk} and @file{.tfm} fonts in
-@file{/var/lib/texmf} and your current directory. A script automating
-this has been included, see @file{buildscripts/clean-fonts.sh}.
-
@node Installation
@section Installation
PS_GZ_FILES= $(addsuffix .gz, $(PS_FILES))
-INFO_FILES = $(addprefix $(outdir)/, lilypond.info lilypond-internals.info)
+# INFO_FILES = $(addprefix $(outdir)/, lilypond.info lilypond-internals.info)
STEPMAKE_TEMPLATES=tex texinfo documentation
LOCALSTEPMAKE_TEMPLATES=lilypond ly
# Cancel default info rule
$(outdir)/%.info: $(outdir)/%.texi
+default:
+
# info is now built by default via texinfo-rules
# we must build them by default, otherwise they get built during make install
info: $(INFO_FILES)
-default:
DEEP_HTML_FILES = $(outdir)/lilypond/lilypond.html $(outdir)/lilypond-internals/lilypond-internals.html
--- /dev/null
+FAQ - GNU LilyPond Frequently Asked Questions
+*********************************************
+
+General
+=======
+
+I'm stuck, HELP!
+----------------
+
+ Please read the full online FAQs
+(http://appel.lilypond.org/wiki?LilyPondFaqs). Also, please look in
+the searchable mailinglist archives:
+
+ * help-gnu-music (http://www.mail-archive.com/help-gnu-music@gnu.org)
+
+ * bug-gnu-music (http://www.mail-archive.com/bug-gnu-music@gnu.org)
+
+ * gnu-music-discuss
+ (http://www.mail-archive.com/gnu-music-discuss@gnu.org)
+
+ If you are still at loss, send your questions to the *mailing list*,
+and not to authors directly.
+
+Installation
+============
+
+Where is guile, libguileX, guile-config?
+----------------------------------------
+
+ RedHat users need to install guile-1.4 and guile-devel-1.4, Debian
+users need to get guile1.4, libguile9 and libguile9-dev.
+
+ If you're building from source, you need guile 1.3.4 or newer.
+Verify that the correct guile, guile-config, and libguile* in your PATH
+and LD_LIBRARY_PATH (or `/etc/ld.so.conf').
+
+I upgraded by applying a patch, and now my configure/build breaks.
+------------------------------------------------------------------
+
+ Patches don't include automatically generated files, i.e.
+`configure' and files generated by `configure'. Regenerate them
+yourself:
+
+ autoconf
+ configure
+
+Is there an emacs mode?
+-----------------------
+
+ Yes. It is included with the source archive as `lilypond-mode.el'
+and `lilypond-font-lock.el'. If you have an RPM or .deb it is in
+`/usr/share/doc/lilypond-X/'. You have to install it yourself.
+
+ Add this to your .emacs.el:
+ (load-library "lilypond-mode.el")
+ (setq auto-mode-alist
+ (append '(("\\.ly$" . LilyPond-mode) auto-mode-alist)))
+
+I downloaded the windows32 port, and it doesn't match the website!
+------------------------------------------------------------------
+
+ The website is usually made from the latest snapshots. Binary
+releases, in particular the windows32 binaries, are only made every
+once in a while. They may lag several versions behind the latest
+version.
+
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=114
-MY_PATCH_LEVEL=jcn1
+PATCH_LEVEL=115
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
examples= font20
LOCALSTEPMAKE_TEMPLATES=mutopia
+EXTRA_DISTFILES=features.abc
+
include $(depth)/make/stepmake.make
+
+#(define raisedflat '((raise . 0.4) (music (named "accidentals--1"))))
+
flauti = \notes \relative c' {
\property Staff.instrument = #"2 Flauti"
\property Staff.instr = #"Fl."
}
clarinetti = \notes \relative c' {
- \property Staff.instrument = #"2 Clarinetti\n(B\\textflat)"
- \property Staff.instr = #"Cl.\n(B\\textflat)"
+ \property Staff.instrument = #`(lines "2 Clarinetti" (rows "(B" ,raisedflat ")"))
+ \property Staff.instr = #`(lines "Cl." (rows "(B" ,raisedflat ")"))
c1 c
}
}
corni = \notes \relative c' {
- \property Staff.instrument = #"2 Corni\n(E\\textflat)"
- \property Staff.instr = #"Cor.\n(E\\textflat)"
+ \property Staff.instrument = #`(lines "2 Corni" (rows "(E" ,raisedflat ")"))
+ \property Staff.instr = #`(lines "Cor." (rows "(E" ,raisedflat ")"))
c1 c
}
trombe = \notes \relative c' {
- \property Staff.instrument = #"2 Trombe\n(C)"
- \property Staff.instr = #"Tbe.\n(C)"
+ \property Staff.instrument = #'(lines "2 Trombe" "(C)")
+ \property Staff.instr = #'(lines "Tbe." "(C)")
c1 c
}
timpani = \notes \relative c' {
- \property Staff.instrument = #"Timpani\n(C-G)"
+ \property Staff.instrument = #'(lines "Timpani" "(C-G)")
\property Staff.instr = #"Timp."
c1 c
}
violoncello = \notes \relative c' {
- \property Staff.instrument = #"Violoncello\ne\nContrabasso"
- \property Staff.instr = #"Vc.\nCb."
+ \property Staff.instrument = #'(lines "Violoncello" "e" "Contrabasso")
+ \property Staff.instr = #'(lines "Vc." "Cb.")
c1 c
}
--- /dev/null
+% Example of figured bass, using text scripts.
+% (An alternative is to use a lyrics line if you want the figures
+% aligned vertically.)
+
+\version "1.3.112";
+
+% Scheme macros for accidentals. Note how they can be combined
+% with other strings, for example in: d^#`(rows ,sharp "4")
+
+#(define sharp '((raise . 0.2) (music (named "accidentals-1"))))
+#(define natural '((raise . 0.2) (music (named "accidentals-0"))))
+#(define flat '((raise . 0.2) (music (named "accidentals--1"))))
+
+
+\score{
+ \notes \relative c'{
+ \clef bass;
+
+ c^"5" d^#natural g,^"7 6" [a8 e] |
+ fis4^"7 6" [g8 d] e4^"7 6" [f?8 c] |
+ [d^#sharp d b g][c^"7" c^"5" a^"6" f] |
+ [bes^"7" bes^"5" g^"6" e] a4^#sharp d^"6" ~ |
+ d^#`(rows ,sharp "4") c^"6" d e^#sharp |
+ }
+}
+
\score {
\context Voice \notes\relative c {
- \property Staff.textEmptyDimension = 1
- \property Voice.textEmptyDimension = 1
- \property Staff.timeSignatureStyle = "C"
- \time 1/1;
- c''1^"timeSignatureStyle = \"C\""
- \time 2/2;
- c1
- \time 2/4;
- c2
- \time 3/4;
- c2.
- \time 4/4;
- c1
- \time 5/4;
- c2. c2
- \time 6/4;
- c1.
- \time 3/2;
- c1.
- \time 7/4;
- c1 c2.
- \time 8/4;
- c\breve
- \time 9/4;
- c2. c2. c2.
- \break
- \property Staff.timeSignatureStyle = "old"
- \time 1/1;
- c1^"timeSignatureStyle = \"old\""
- \time 2/2;
- c1
- \time 2/4;
- c2
- \time 3/4;
- c2.
- \time 4/4;
- c1
- \time 5/4;
- c2. c2
- \time 6/4;
- c1.
- \time 3/2;
- c1.
- \time 7/4;
- c1 c2.
- \time 8/4;
- c\breve
- \time 9/4;
- c2. c2. c2.
- \time 6/8;
- c2.
- \time 9/8;
- c4. c4. c4.
- \break
- \property Staff.timeSignatureStyle = ""
- \time 1/1;
- c1^"timeSignatureStyle = \"\""
- \time 2/2;
- c1
- \time 2/4;
- c2
- \time 3/4;
- c2.
- \time 4/4;
- c1
- \time 5/4;
- c2. c2
- \time 6/4;
- c1.
- \time 3/2;
- c1.
- \time 7/4;
- c1 c2.
- \time 8/4;
- c\breve
- \time 9/4;
- c2. c2. c2.
- \break
- \property Staff.timeSignatureStyle = "1"
- \time 1/1;
- c1^"timeSignatureStyle = \"1\""
- \time 2/2;
- c1
- \time 2/4;
- c2
- \time 3/4;
- c2.
- \time 4/4;
- c1
- \time 5/4;
- c2. c2
- \time 6/4;
- c1.
- \time 3/2;
- c1.
- \time 7/4;
- c1 c2.
- \time 8/4;
- c\breve
- \time 9/4;
- c2. c2. c2.
- \break
- \property Staff.textalignment = \center
- \property Staff.timeSignatureStyle = "old9/8"
- \time 1/1;
- c1^"old9/8"
- \property Staff.timeSignatureStyle = "old6/8"
- \time 1/1;
- c1^"old6/8"
- \property Staff.timeSignatureStyle = "old6/8alt"
- \time 1/1;
- c1^"old6/8alt"
- \property Staff.timeSignatureStyle = "old9/4"
- \time 1/1;
- c1^"old9/4"
- \property Staff.timeSignatureStyle = "old6/4"
- \time 1/1;
- c1^"old6/4"
- \property Staff.timeSignatureStyle = "old3/2"
- \time 1/1;
- c1^"old3/2"
- \property Staff.timeSignatureStyle = "old4/4"
- \time 1/1;
- c1^"old4/4"
- \property Staff.timeSignatureStyle = "old2/2"
- \time 1/1;
- c1^"old2/2"
- \property Staff.timeSignatureStyle = "old2/4"
- \time 1/1;
- c1^"old2/4"
- \property Staff.timeSignatureStyle = "old4/8"
- \time 1/1;
- c1^"old4/8"
- \property Staff.timeSignatureStyle = "C4/4"
- \time 1/1;
- c1^"C4/4"
- \property Staff.timeSignatureStyle = "C2/2"
- \time 1/1;
- c1^"C2/2"
-
+ \property Staff.TimeSignature \override #'style = #'C
+ \time 1/1;
+ c''1^"TimeSignature style = \#'C"
+ \time 2/2;
+ c1
+ \time 2/4;
+ c2
+ \time 3/4;
+ c2.
+ \time 4/4;
+ c1
+ \time 5/4;
+ c2. c2
+ \time 6/4;
+ c1.
+ \time 3/2;
+ c1.
+ \time 7/4;
+ c1 c2.
+ \time 8/4;
+ c\breve
+ \time 9/4;
+ c2. c2. c2.
+ \break
+ \property Staff.TimeSignature \set #'style = #'old
+ \time 1/1;
+ c1^"TimeSignature style = \#'old"
+ \time 2/2;
+ c1
+ \time 2/4;
+ c2
+ \time 3/4;
+ c2.
+ \time 4/4;
+ c1
+ \time 5/4;
+ c2. c2
+ \time 6/4;
+ c1.
+ \time 3/2;
+ c1.
+ \time 7/4;
+ c1 c2.
+ \time 8/4;
+ c\breve
+ \time 9/4;
+ c2. c2. c2.
+ \time 6/8;
+ c2.
+ \time 9/8;
+ c4. c4. c4.
+ \break
+ % Lilypond doesn't understand 'default => it does what you want
+ \property Staff.TimeSignature \set #'style = #'default
+ \time 1/1;
+ c1^"TimeSignature style = \#'default"
+ \time 2/2;
+ c1
+ \time 2/4;
+ c2
+ \time 3/4;
+ c2.
+ \time 4/4;
+ c1
+ \time 5/4;
+ c2. c2
+ \time 6/4;
+ c1.
+ \time 3/2;
+ c1.
+ \time 7/4;
+ c1 c2.
+ \time 8/4;
+ c\breve
+ \time 9/4;
+ c2. c2. c2.
+ \break
+ % If the style starts with a '1', you get this style
+ \property Staff.TimeSignature \set #'style = #'1style
+ \time 1/1;
+ c1^"TimeSignature style = \#'1xxx"
+ \time 2/2;
+ c1
+ \time 2/4;
+ c2
+ \time 3/4;
+ c2.
+ \time 4/4;
+ c1
+ \time 5/4;
+ c2. c2
+ \time 6/4;
+ c1.
+ \time 3/2;
+ c1.
+ \time 7/4;
+ c1 c2.
+ \time 8/4;
+ c\breve
+ \time 9/4;
+ c2. c2. c2.
+ \break
+ \property Staff.TextScript \override #'self-alignment-X = #1
+ \property Staff.TimeSignature \set #'style = #'old9/8
+ \time 1/1;
+ c1^"old9/8"
+ \property Staff.TimeSignature \set #'style = #'old6/8
+ \time 1/1;
+ c1^"old6/8"
+ \property Staff.TimeSignature \set #'style = #'old6/8alt
+ \time 1/1;
+ c1^"old6/8alt"
+ \property Staff.TimeSignature \set #'style = #'old9/4
+ \time 1/1;
+ c1^"old9/4"
+ \property Staff.TimeSignature \set #'style = #'old6/4
+ \time 1/1;
+ c1^"old6/4"
+ \property Staff.TimeSignature \set #'style = #'old3/2
+ \time 1/1;
+ c1^"old3/2"
+ \property Staff.TimeSignature \set #'style = #'old4/4
+ \time 1/1;
+ c1^"old4/4"
+ \property Staff.TimeSignature \set #'style = #'old2/2
+ \time 1/1;
+ c1^"old2/2"
+ \property Staff.TimeSignature \set #'style = #'old2/4
+ \time 1/1;
+ c1^"old2/4"
+ \property Staff.TimeSignature \set #'style = #'old4/8
+ \time 1/1;
+ c1^"old4/8"
+ \property Staff.TimeSignature \set #'style = #'C4/4
+ \time 1/1;
+ c1^"C4/4"
+ \property Staff.TimeSignature \set #'style = #'C2/2
+ \time 1/1;
+ c1^"C2/2"
+
}
\paper { }
\midi { }
if (tfm->info_.checksum != afm->checksum_)
{
- String s = _("Font checksum mismatch");
+ String s = _f("Font checksum mismatch for font file `%s'", path.ch_C());
s+= "\n";
s += " TFM: " + to_str ((int) tfm->info_.checksum);
s += " AFM: " + to_str ((int) afm->checksum_);
s += "\n";
- s += _(" Rebuild all AFM files, and remove all .pk and .tfm files");
+ s += _(" Rebuild all AFM files, and remove all .pk and .tfm files. Rerun with -V to show font paths.");
error (s);
}
#include "auto-change-music.hh"
#include "auto-change-iterator.hh"
-Auto_change_music::Auto_change_music (Music * m)
+Auto_change_music::Auto_change_music (SCM m)
: Music_wrapper (m)
{
set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_cxx_function);
*/
#include "context-specced-music.hh"
-Context_specced_music::Context_specced_music(Music *m)
+Context_specced_music::Context_specced_music(SCM m)
: Music_wrapper (m)
{
set_mus_property ("type",
return 0;
}
-Grace_music::Grace_music (Music *p)
+Grace_music::Grace_music (SCM p)
: Music_wrapper (p)
{
set_mus_property ("iterator-ctor",
class Auto_change_music : public Music_wrapper
{
public:
- Auto_change_music (Music *);
+ Auto_change_music (SCM);
};
class Context_specced_music : public Music_wrapper
{
public:
- Context_specced_music (Music*);
+ Context_specced_music (SCM);
VIRTUAL_COPY_CONS(Music);
};
#endif /* CONTEXT_SPECCED_MUSIC_HH */
{
public:
VIRTUAL_COPY_CONS(Music);
- Grace_music (Music*);
+ Grace_music (SCM);
protected:
virtual void compress (Moment);
virtual Moment length_mom () const;
Music * music_l () const;
Music * lyrics_l () const;
- Lyric_combine_music (Music*, Music*);
+ Lyric_combine_music (SCM);
virtual void transpose (Pitch);
VIRTUAL_COPY_CONS(Music);
class Music_wrapper : public Music
{
public:
- Music_wrapper (Music*);
+ Music_wrapper (SCM);
Music * element () const;
virtual void transpose (Pitch);
virtual void compress (Moment factor);
VIRTUAL_COPY_CONS(Music);
Music (Music const &m);
- Music();
+ Music (SCM);
protected:
-
DECLARE_SMOBS(Music,);
SCM immutable_property_alist_;
SCM mutable_property_alist_;
-
};
{
public:
VIRTUAL_COPY_CONS (Music);
- Part_combine_music (SCM what_str, Music*, Music*);
+ Part_combine_music (SCM l);
Music * first_l () const;
Music * second_l () const;
class Relative_octave_music : public Music_wrapper
{
public:
- Pitch last_pitch_;
-
-
- Relative_octave_music (Music*, Pitch);
+ Relative_octave_music (SCM l);
VIRTUAL_COPY_CONS(Music);
virtual Pitch to_relative_octave (Pitch);
virtual void compress (Moment factor);
VIRTUAL_COPY_CONS(Music);
- Repeated_music (Music*, int , Music_sequence*);
- Repeated_music (Repeated_music const&);
+ Repeated_music (SCM);
};
class Time_scaled_music : public Music_wrapper
{
public:
- int num_i_;
- int den_i_;
-
- Time_scaled_music (int, int, Music *);
+ Time_scaled_music (SCM);
VIRTUAL_COPY_CONS(Music);
};
class Transposed_music : public Music_wrapper
{
public:
- Transposed_music (Music*, Pitch);
+ Transposed_music (SCM);
VIRTUAL_COPY_CONS(Music);
virtual Pitch to_relative_octave (Pitch);
}
}
+/*
+ FIXME: use different mechanics, and use a markup-p function?
+ */
void
Instrument_name_engraver::create_text (SCM txt)
{
if(!text_)
{
text_ = new Item (get_property ("InstrumentName"));
- text_->set_grob_property ("text", txt);
-
+ if (txt != SCM_EOL)
+ {
+ text_->set_grob_property ("text", txt);
+ }
+ else if (text_->get_grob_property ("text") == SCM_EOL)
+ {
+ return;
+ }
if (delim_)
- text_->set_parent (delim_, Y_AXIS);
-
+ text_->set_parent (delim_, Y_AXIS);
+
announce_grob (text_,0);
}
}
if (now_mom () > Moment (0))
s = get_property ("instr");
- if (gh_string_p (s))
- {
+ // if (gh_string_p (s))
+ // {
create_text (s);
- }
+ // }
}
if (Align_interface::has_interface (i.elem_l_)
#include "lyric-combine-music-iterator.hh"
#include "pitch.hh"
-Lyric_combine_music::Lyric_combine_music (Music * m, Music * l)
+Lyric_combine_music::Lyric_combine_music (SCM l)
+ : Music (l)
{
- set_mus_property ("music", m->self_scm ());
- set_mus_property ("lyrics", l->self_scm ());
-
set_mus_property ("iterator-ctor",
Lyric_combine_music_iterator::constructor_cxx_function);
}
scm_unprotect_object (m->self_scm ());
}
-Music_sequence::Music_sequence(SCM h)
+Music_sequence::Music_sequence(SCM l)
+ : Music (l)
{
- set_mus_property ("elements", h);
}
void
}
-Music_wrapper::Music_wrapper(Music*p)
+Music_wrapper::Music_wrapper(SCM l)
+ : Music (l)
{
- set_mus_property ("element", p->self_scm ());
- scm_unprotect_object (p->self_scm ());
}
Moment
}
-Music::Music()
+Music::Music(SCM l)
{
- immutable_property_alist_ = SCM_EOL;
+ immutable_property_alist_ = l;
mutable_property_alist_ = SCM_EOL;
smobify_self ();
}
Repeated_music:
REPEAT STRING bare_unsigned Music Alternative_music
{
- Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
- if (m && $3 < m->length_i ())
+ Music_sequence* alts = dynamic_cast <Music_sequence*> ($5);
+ if (alts && $3 < alts->length_i ())
$5->origin ()->warning (_ ("More alternatives than repeats. Junking excess alternatives."));
+ Music *beg = $4;
+ int times = $3;
+ Repeated_music * r = new Repeated_music (SCM_EOL);
+
+ if (beg)
+ {
+ r-> set_mus_property ("body", beg->self_scm ());
+ scm_unprotect_object (beg->self_scm ());
+ }
+ r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
+
+ if (alts)
+ {
+ alts->truncate (times);
+ r-> set_mus_property ("alternatives", alts->self_scm ());
+ scm_unprotect_object (alts->self_scm ());
+ }
SCM func = scm_eval2 (ly_symbol2scm ("repeat-name-to-ctor"), SCM_EOL);
SCM result = gh_call1 (func, $2);
- Repeated_music * r = new Repeated_music ($4, $3 >? 1, m);
+
set_music_properties (r, result);
r->set_spot (*$4->origin ());
;
Music_sequence: '{' Music_list '}' {
- $$ = new Music_sequence (gh_car ($2));
+ $$ = new Music_sequence (SCM_EOL);
+ $$->set_mus_property ("elements", gh_car ($2));
}
;
Sequential_music:
SEQUENTIAL '{' Music_list '}' {
- $$ = new Sequential_music (gh_car ($3));
+ $$ = new Sequential_music (SCM_EOL);
+ $$->set_mus_property ("elements", gh_car ($3));
}
| '{' Music_list '}' {
- $$ = new Sequential_music (gh_car ($2));
+ $$ = new Sequential_music (SCM_EOL);
+ $$->set_mus_property ("elements", gh_car ($2));
}
;
Simultaneous_music:
SIMULTANEOUS '{' Music_list '}'{
- $$ = new Simultaneous_music (gh_car ($3));
+ $$ = new Simultaneous_music (SCM_EOL);
+ $$->set_mus_property ("elements", gh_car ($3));
+
}
| '<' Music_list '>' {
- $$ = new Simultaneous_music (gh_car ($2));
+ $$ = new Simultaneous_music (SCM_EOL);
+ $$->set_mus_property ("elements", gh_car ($2));
}
;
THIS->parser_error (_("First argument must be a procedure taking 1 argument"));
}
- Music *m = new Music;
+ Music *m = new Music (SCM_EOL);
m->set_mus_property ("predicate", pred);
m->set_mus_property ("symbol", $3);
m->set_mus_property ("value", $5);
Composite_music:
CONTEXT STRING Music {
- Context_specced_music *csm = new Context_specced_music ($3);
+ Context_specced_music *csm = new Context_specced_music (SCM_EOL);
+ csm->set_mus_property ("element", $3->self_scm ());
+ scm_unprotect_object ($3->self_scm ());
csm->set_mus_property ("context-type",$2);
csm->set_mus_property ("context-id", ly_str02scm (""));
$$ = csm;
}
| AUTOCHANGE STRING Music {
- Auto_change_music * chm = new Auto_change_music ($3);
+ Auto_change_music * chm = new Auto_change_music (SCM_EOL);
+ chm->set_mus_property ("element", $3->self_scm ());
+
+ scm_unprotect_object ($3->self_scm ());
chm->set_mus_property ("what", $2);
$$ = chm;
chm->set_spot (*$3->origin ());
}
| GRACE Music {
- $$ = new Grace_music ($2);
+ $$ = new Grace_music (SCM_EOL);
+ $$->set_mus_property ("element", $2->self_scm ());
+ scm_unprotect_object ($2->self_scm ());
+
}
| CONTEXT STRING '=' STRING Music {
- Context_specced_music *csm = new Context_specced_music ($5);
+ Context_specced_music *csm = new Context_specced_music (SCM_EOL);
+ csm->set_mus_property ("element", $5->self_scm ());
+ scm_unprotect_object ($5->self_scm ());
csm->set_mus_property ("context-type", $2);
csm->set_mus_property ("context-id", $4);
bare_unsigned '/' bare_unsigned Music
{
- $$ = new Time_scaled_music ($3, $5, $6);
+ int n = $3; int d = $5;
+ Music *mp = $6;
+ $$ = new Time_scaled_music (SCM_EOL);
$$->set_spot (THIS->pop_spot ());
+
+
+ $$->set_mus_property ("element", mp->self_scm ());
+ scm_unprotect_object (mp->self_scm ());
+ $$->set_mus_property ("numerator", gh_int2scm (n));
+ $$->set_mus_property ("denominator", gh_int2scm (d));
+ $$->compress (Moment (n,d));
+
}
| Repeated_music { $$ = $1; }
| Simultaneous_music { $$ = $1; }
| Sequential_music { $$ = $1; }
| TRANSPOSE musical_pitch Music {
- $$ = new Transposed_music ($3, *unsmob_pitch ($2));
+ $$ = new Transposed_music (SCM_EOL);
+ Music *p = $3;
+ Pitch pit = *unsmob_pitch ($2);
+
+ p->transpose (pit);
+ $$->set_mus_property ("element", p->self_scm ());
+ scm_unprotect_object (p->self_scm ());
}
| TRANSPOSE steno_tonic_pitch Music {
- $$ = new Transposed_music ($3, *unsmob_pitch ($2));
+ $$ = new Transposed_music (SCM_EOL);
+ Music *p = $3;
+ Pitch pit = *unsmob_pitch ($2);
+
+ p->transpose (pit);
+ $$->set_mus_property ("element", p->self_scm ());
+ scm_unprotect_object (p->self_scm ());
+
}
| APPLY embedded_scm Music {
SCM ret = gh_call1 ($2, $3->self_scm ());
Music *m = unsmob_music (ret);
if (!m) {
THIS->parser_error ("\\apply must return a Music");
- m = new Music ();
+ m = new Music (SCM_EOL);
}
$$ = m;
}
relative_music:
RELATIVE absolute_musical_pitch Music {
- $$ = new Relative_octave_music ($3, *unsmob_pitch ($2));
+ Music * p = $3;
+ Pitch pit = *unsmob_pitch ($2);
+ $$ = new Relative_octave_music (SCM_EOL);
+
+ $$->set_mus_property ("element", p->self_scm ());
+ scm_unprotect_object (p->self_scm ());
+
+ $$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ());
+
}
;
re_rhythmed_music:
ADDLYRICS Music Music {
- Lyric_combine_music * l = new Lyric_combine_music ($2, $3);
- $$ = l;
+ Lyric_combine_music * l = new Lyric_combine_music (SCM_EOL);
+ l->set_mus_property ("music", $2->self_scm ());
+ l->set_mus_property ("lyrics", $3->self_scm ());
+ scm_unprotect_object ($3->self_scm ());
+ scm_unprotect_object ($2->self_scm ());
+ $$ = l;
}
;
part_combined_music:
PARTCOMBINE STRING Music Music {
- Part_combine_music * p = new Part_combine_music ($2, $3, $4);
+ Part_combine_music * p = new Part_combine_music (SCM_EOL);
+
+ p->set_mus_property ("what", $2);
+ p->set_mus_property ("one", $3->self_scm ());
+ p->set_mus_property ("two", $4->self_scm ());
+
+ scm_unprotect_object ($3->self_scm());
+ scm_unprotect_object ($4->self_scm());
+
+
$$ = p;
}
;
translator_change:
TRANSLATOR STRING '=' STRING {
- Music * t = new Music;
+ Music * t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
Change_iterator::constructor_cxx_function);
t-> set_mus_property ("change-to-type", $2);
property_def:
PROPERTY STRING '.' STRING '=' scalar {
- Music *t = new Music;
+ Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
Property_iterator::constructor_cxx_function);
t->set_mus_property ("symbol", scm_string_to_symbol ($4));
t->set_mus_property ("value", $6);
- Context_specced_music *csm = new Context_specced_music (t);
+ Context_specced_music *csm = new Context_specced_music (SCM_EOL);
+
+ csm->set_mus_property ("element", t->self_scm ());
+ scm_unprotect_object (t->self_scm ());
+
$$ = csm;
$$->set_spot (THIS->here_input ());
csm-> set_mus_property ("context-type", $2);
}
| PROPERTY STRING '.' STRING SET embedded_scm '=' embedded_scm {
- Music *t = new Music;
+ Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
Push_property_iterator::constructor_cxx_function);
t->set_mus_property ("symbols", scm_string_to_symbol ($4));
t->set_mus_property ("pop-first", SCM_BOOL_T);
t->set_mus_property ("grob-property", $6);
t->set_mus_property ("grob-value", $8);
- Context_specced_music *csm = new Context_specced_music (t);
+ Context_specced_music *csm = new Context_specced_music (SCM_EOL);
+ csm->set_mus_property ("element", t->self_scm ());
+ scm_unprotect_object (t->self_scm ());
$$ = csm;
$$->set_spot (THIS->here_input ());
csm-> set_mus_property ("context-type", $2);
}
| PROPERTY STRING '.' STRING OVERRIDE embedded_scm '=' embedded_scm {
- Music *t = new Music;
+ Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
Push_property_iterator::constructor_cxx_function);
t->set_mus_property ("symbols", scm_string_to_symbol ($4));
t->set_mus_property ("grob-property", $6);
t->set_mus_property ("grob-value", $8);
- Context_specced_music *csm = new Context_specced_music (t);
+ Context_specced_music *csm = new Context_specced_music (SCM_EOL);
+ csm->set_mus_property ("element", t->self_scm ());
+ scm_unprotect_object (t->self_scm ());
+
$$ = csm;
$$->set_spot (THIS->here_input ());
csm-> set_mus_property ("context-type", $2);
}
| PROPERTY STRING '.' STRING REVERT embedded_scm {
- Music *t = new Music;
+ Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
Pop_property_iterator::constructor_cxx_function);
t->set_mus_property ("symbols", scm_string_to_symbol ($4));
t->set_mus_property ("grob-property", $6);
- Context_specced_music *csm = new Context_specced_music (t);
+ Context_specced_music *csm = new Context_specced_music (SCM_EOL);
+ csm->set_mus_property ("element", t->self_scm ());
+ scm_unprotect_object (t->self_scm ());
+
$$ = csm;
$$->set_spot (THIS->here_input ());
command_element:
command_req {
- $$ = new Request_chord (gh_cons ($1->self_scm (), SCM_EOL));
+ $$ = new Request_chord (SCM_EOL);
+ $$->set_mus_property ("elements", gh_cons ($1->self_scm (), SCM_EOL));
$$-> set_spot (THIS->here_input ());
$1-> set_spot (THIS->here_input ());
}
| BAR STRING ';' {
- Music *t = new Music;
+ Music *t = new Music (SCM_EOL);
t->set_mus_property ("iterator-ctor",
Property_iterator::constructor_cxx_function);
t->set_mus_property ("symbol", ly_symbol2scm ("whichBar"));
t->set_mus_property ("value", $2);
- Context_specced_music *csm = new Context_specced_music (t);
+ Context_specced_music *csm = new Context_specced_music (SCM_EOL);
+ csm->set_mus_property ("element", t->self_scm ());
+ scm_unprotect_object (t->self_scm ());
+
$$ = csm;
$$->set_spot (THIS->here_input ());
csm->set_mus_property ("context-type", ly_str02scm ("Score"));
}
| PARTIAL duration_length ';' {
- Music * p = new Music;
+ Music * p = new Music (SCM_EOL);
p->set_mus_property ("symbol", ly_symbol2scm ( "measurePosition"));
p->set_mus_property ("iterator-ctor",
Property_iterator::constructor_cxx_function);
Moment m = - unsmob_duration($2)->length_mom ();
p->set_mus_property ("value", m.smobbed_copy ());
- Context_specced_music * sp = new Context_specced_music (p);
+ Context_specced_music * sp = new Context_specced_music (SCM_EOL);
+ sp->set_mus_property ("element", p->self_scm ());
+ scm_unprotect_object (p->self_scm ());
+
$$ =sp ;
sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
}
SCM l = SCM_EOL;
for (SCM s = result ; gh_pair_p (s); s = gh_cdr (s)) {
- Music * p = new Music;
+ Music * p = new Music (SCM_EOL);
set_music_properties(p, gh_car (s));
l = gh_cons (p->self_scm (), l);
scm_unprotect_object (p->self_scm ());
}
- Sequential_music * seq = new Sequential_music (l);
+ Sequential_music * seq = new Sequential_music (SCM_EOL);
+ seq->set_mus_property ("elements", l);
+
+ Context_specced_music * sp = new Context_specced_music (SCM_EOL);
+ sp->set_mus_property ("element", seq->self_scm ());
+ scm_unprotect_object (seq->self_scm ());
- Context_specced_music * sp = new Context_specced_music (seq);
$$ =sp ;
sp-> set_mus_property("context-type", ly_str02scm("Staff"));
}
| TIME_T bare_unsigned '/' bare_unsigned ';' {
- Music * p = new Music;
+ Music * p = new Music (SCM_EOL);
p->set_mus_property ("symbol",
ly_symbol2scm ( "timeSignatureFraction"));
p->set_mus_property ("iterator-ctor",
p->set_mus_property ("value", gh_cons (gh_int2scm ($2),
gh_int2scm ($4)));
- Context_specced_music * sp = new Context_specced_music (p);
- $$ =sp ;
+ Context_specced_music * sp = new Context_specced_music (SCM_EOL);
+ sp->set_mus_property ("element", p->self_scm ());
+ scm_unprotect_object (p->self_scm ());
+
+ $$ = sp;
sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
}
;
if ($2 % 2 || $3 % 2)
n->set_mus_property ("force-accidental", SCM_BOOL_T);
- Simultaneous_music*v = new Request_chord (gh_list (n->self_scm (), SCM_UNDEFINED));
+ Simultaneous_music*v = new Request_chord (SCM_EOL);
+ v->set_mus_property ("elements", gh_list (n->self_scm (), SCM_UNDEFINED));
/*
-FIXME
+FIXME: location is one off, since ptich & duration don't contain origin refs.
*/
v->set_spot (THIS->here_input ());
n->set_spot (THIS->here_input ());
rest_req_p->set_spot (THIS->here_input());
e = rest_req_p->self_scm ();
}
- Simultaneous_music* velt_p = new Request_chord (gh_list (e,SCM_UNDEFINED));
+ Simultaneous_music* velt_p = new Request_chord (SCM_EOL);
+ velt_p-> set_mus_property ("elements", gh_list (e,SCM_UNDEFINED));
velt_p->set_spot (THIS->here_input());
sp1->set_mus_property ("span-type", r);
sp2->set_mus_property ("span-type", r);
- Request_chord * rqc1 = new Request_chord (gh_list (sp1->self_scm (), SCM_UNDEFINED));
- Request_chord * rqc2 = new Request_chord (gh_list (sk->self_scm (), SCM_UNDEFINED));;
- Request_chord * rqc3 = new Request_chord(gh_list (sp2->self_scm (), SCM_UNDEFINED));;
+ Request_chord * rqc1 = new Request_chord (SCM_EOL);
+ rqc1->set_mus_property ("elements", gh_list (sp1->self_scm (), SCM_UNDEFINED));
+ Request_chord * rqc2 = new Request_chord (SCM_EOL);
+ rqc2->set_mus_property ("elements", gh_list (sk->self_scm (), SCM_UNDEFINED));;
+ Request_chord * rqc3 = new Request_chord(SCM_EOL);
+ rqc2->set_mus_property ("elements", gh_list (sp2->self_scm (), SCM_UNDEFINED));;
SCM ms = gh_list (rqc1->self_scm (), rqc2->self_scm (), rqc3->self_scm (), SCM_UNDEFINED);
- $$ = new Sequential_music (ms);
+ $$ = new Sequential_music (SCM_EOL);
+ $$->set_mus_property ("elements", ms);
}
| STRING {
THIS->remember_spot ();
lreq_p->set_mus_property ("text", $1);
lreq_p->set_mus_property ("duration",$3);
lreq_p->set_spot (THIS->here_input());
- Simultaneous_music* velt_p = new Request_chord (gh_list (lreq_p->self_scm (), SCM_UNDEFINED));
+ Simultaneous_music* velt_p = new Request_chord (SCM_EOL);
+ velt_p->set_mus_property ("elements", gh_list (lreq_p->self_scm (), SCM_UNDEFINED));
$$= velt_p;
#include "part-combine-music-iterator.hh"
#include "pitch.hh"
-Part_combine_music::Part_combine_music (SCM what, Music * f, Music * s)
+Part_combine_music::Part_combine_music (SCM l)
+ : Music (l)
{
- assert (gh_string_p (what));
- set_mus_property ("what", what);
- set_mus_property ("one", f->self_scm ());
- set_mus_property ("two", s->self_scm ());
-
- scm_unprotect_object (f->self_scm());
- scm_unprotect_object (s->self_scm());
-
set_mus_property ("iterator-ctor",
Part_combine_music_iterator::constructor_cxx_function);
}
}
-Relative_octave_music::Relative_octave_music(Music*p,Pitch def)
- : Music_wrapper (p)
+Relative_octave_music::Relative_octave_music(SCM l)
+ : Music_wrapper (l)
{
- set_mus_property ("last-pitch", element ()->to_relative_octave (def).smobbed_copy ());
set_mus_property ("type", ly_symbol2scm ("relative-octave-music"));
}
return dynamic_cast<Music_sequence*> (unsmob_music (get_mus_property ("alternatives")));
}
-Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts)
+Repeated_music::Repeated_music(SCM l)
+ : Music (l)
{
- if (beg)
- {
- set_mus_property ("body", beg->self_scm ());
- scm_unprotect_object (beg->self_scm ());
- }
- set_mus_property ("repeat-count", gh_int2scm (times));
-
- if (alts)
- {
- alts->truncate (times);
- set_mus_property ("alternatives", alts->self_scm ());
- scm_unprotect_object (alts->self_scm ());
- }
set_mus_property ("type", ly_symbol2scm ("repeated-music"));
}
-Repeated_music::Repeated_music (Repeated_music const &s)
- : Music (s)
-{
-}
-
Pitch
Repeated_music::to_relative_octave (Pitch p)
Request::Request ()
+ : Music (SCM_EOL)
{
set_mus_property ("type", ly_symbol2scm ("request"));
}
priority queue. If we have a Tie_req, connect the notes that finish
just at this time, and note that start at this time.
- TODO: junk the pq.
- */
+ TODO: junk the pq; the PQ is overkill if we assume that no
+ different durations occur in parallel.
+*/
class Tie_engraver : public Engraver
{
- bool done_;
PQueue<CHead_melodic_tuple> past_notes_pq_;
Moment end_mom_;
Moment next_end_mom_;
}
}
+
void
Tie_engraver::create_grobs ()
{
- if (req_l_ && !done_)
- {
- Moment now = now_mom ();
- stopped_heads_.clear ();
- while (past_notes_pq_.size ()
- && past_notes_pq_.front ().end_ == now)
- stopped_heads_.push (past_notes_pq_.get ());
- done_ = true;
- return;
- }
-
if (req_l_)
{
now_heads_.sort (CHead_melodic_tuple::pitch_compare);
announce_grob (p, req_l_);
}
- if (!tie_p_arr_.size ())
- {
- req_l_->origin ()->warning (_ ("No ties were created!"));
- }
- else if (tie_p_arr_.size () > 1 && !tie_column_p_)
+ if (tie_p_arr_.size () > 1 && !tie_column_p_)
{
tie_column_p_ = new Spanner (get_property ("TieColumn"));
Tie_column::set_interface (tie_column_p_);
}
now_heads_.clear ();
+ if (req_l_ && !tie_p_arr_.size ())
+ {
+ req_l_->origin ()->warning (_ ("No ties were created!"));
+ }
+
for (int i=0; i< tie_p_arr_.size (); i++)
{
typeset_tie (tie_p_arr_[i]);
set_melisma (false);
}
req_l_ = 0;
- done_ = false;
Moment now = now_mom ();
while (past_notes_pq_.size () && past_notes_pq_.front ().end_ < now)
past_notes_pq_.delmin ();
+
+
+ stopped_heads_.clear ();
+ while (past_notes_pq_.size ()
+ && past_notes_pq_.front ().end_ == now)
+ stopped_heads_.push (past_notes_pq_.get ());
+
}
ADD_THIS_TRANSLATOR(Tie_engraver);
end_ = mom;
}
+/*
+ signed compare, should use pitch<?
+ */
int
CHead_melodic_tuple::pitch_compare (CHead_melodic_tuple const&h1,
CHead_melodic_tuple const &h2)
SCM p1 = h1.req_l_->get_mus_property ("pitch");
SCM p2 = h2.req_l_->get_mus_property ("pitch");
- return Pitch::equal_p (p1,p2) == SCM_BOOL_T;
+ return Pitch::compare (*unsmob_pitch (p1),
+ *unsmob_pitch (p2));
}
int
CHead_melodic_tuple::time_compare (CHead_melodic_tuple const&h1,
- CHead_melodic_tuple const &h2)
+ CHead_melodic_tuple const &h2)
{
return (h1.end_ - h2.end_ ).sign ();
}
#include "time-scaled-music.hh"
#include "time-scaled-music-iterator.hh"
-Time_scaled_music::Time_scaled_music (int n, int d,Music *mp)
- : Music_wrapper (mp)
+Time_scaled_music::Time_scaled_music (SCM l)
+ : Music_wrapper (l)
{
- set_mus_property ("numerator", gh_int2scm (n));
- set_mus_property ("denominator", gh_int2scm (d));
set_mus_property ("iterator-ctor",
Time_scaled_music_iterator::constructor_cxx_function);
- compress (Moment (n,d));
}
}
return ok;
}
+
+SCM
+ly_get_trans_property (SCM context, SCM name)
+{
+ Translator *t = unsmob_translator (context);
+ Translator_group* tr= dynamic_cast<Translator_group*> (t);
+ if (!t || !tr)
+ {
+ warning ("ly-get-trans-property: expecting a Translator_group argument");
+ return SCM_EOL;
+ }
+ return tr->get_property (name);
+
+}
+SCM
+ly_set_trans_property (SCM context, SCM name, SCM val)
+{
+
+ Translator *t = unsmob_translator (context);
+ Translator_group* tr= dynamic_cast<Translator_group*> (t);
+ if (tr)
+ {
+ tr->set_property (name, val);
+ }
+ return SCM_UNSPECIFIED;
+}
+
+
+
+
+void
+add_trans_scm_funcs ()
+{
+ scm_make_gsubr ("ly-get-trans-property", 2, 0, 0, (Scheme_function_unknown)ly_get_trans_property);
+ scm_make_gsubr ("ly-get-trans-property", 3, 0, 0, (Scheme_function_unknown)ly_get_trans_property);
+}
+
+ADD_SCM_INIT_FUNC(trans_scm, add_trans_scm_funcs);
#include "transposed-music.hh"
#include "debug.hh"
-Transposed_music::Transposed_music (Music *p, Pitch pit)
- : Music_wrapper (p)
+Transposed_music::Transposed_music (SCM l)
+ : Music_wrapper (l)
{
- p->transpose (pit);
set_mus_property ("type", ly_symbol2scm ("transposed-music"));
}
Begin3
Title: LilyPond
-Version: 1.3.114
-Entered-date: 01DEC00
+Version: 1.3.115
+Entered-date: 04DEC00
Description:
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 1000k lilypond-1.3.114.tar.gz
+ 1000k lilypond-1.3.115.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.114.tar.gz
+ 1000k lilypond-1.3.115.tar.gz
Copying-policy: GPL
End
%define info yes
Name: lilypond
-Version: 1.3.114
+Version: 1.3.115
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.114.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.115.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
SCRIPTS = configure aclocal.m4
README_FILES = DEDICATION COPYING NEWS CHANGES ROADMAP
-README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt
+README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt FAQ.txt
IN_FILES := $(wildcard *.in)
EXTRA_DIST_FILES = lilypond-font-lock.el lilypond-mode.el vimrc VERSION $(README_FILES) $(SCRIPTS) $(IN_FILES)
NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES)
(and (pair? x) (number? (car x)) (number? (cdr x))))
(define (boolean-or-symbol? x) (or boolean? x) (or symbol? x))
(define (number-or-string? x) (or (number? x) (string? x)))
+(define (list-or-string? x) (or (list? x) (string? x)))
(define markup?
(lambda (x) (or (string? x) (list? x))))
'Stem_engraver
(engraver-description
"Stem_engraver"
- "Create stems and single-stem tremolos"
+ "Create stems and single-stem tremolos. It also works together with
+the beam engraver for overriding beaming."
'(Stem StemTremolo)
- '(
- tremoloFlags
+ '(tremoloFlags
stemLeftBeamCount
stemRightBeamCount
)))
)))
(cons
- 'Auto_beam_engraver
+ 'Auto_beam_engraver
(engraver-description
"Auto_beam_engraver"
- "Generate beams based on measure characteristics and observed Stems.
-Uses beatLength, measureLength and measurePosition to decide when to start and stop a beam.
+ "Generate beams based on measure characteristics and observed
+Stems. Uses beatLength, measureLength and measurePosition to decide
+when to start and stop a beam. Overriding beaming is done through
+@ref{Stem_engraver} properties stemLeftBeamCount and
+stemRightBeamCount.
"
'(
Beam)
")
(translator-property-description 'graceAccidentalSpace number? "amount space to alot for an accidental")
(translator-property-description 'graceAlignPosition dir? "put the grace note before or after the main note?")
-(translator-property-description 'instr string? "see @code{instrument}")
-(translator-property-description 'instrument string? " If @code{Instrument_name_engraver}
+(translator-property-description 'instr list-or-string? "see @code{instrument}")
+(translator-property-description 'instrument list-or-string? " If @code{Instrument_name_engraver}
@cindex Instrument_name_engraver
is
added to the Staff translator, then the @code{instrument} property
#
# Barring now preserved between ABC and lilypond
# the default placement for text in abc is above the staff.
-# %%LY now supported.
+# %%LY now supported.
+# \breve and \longa supported.
# Limitations
#
state = UNDEF
voice_idx_dict = {}
header = {}
+header['footnotes'] = ''
lyrics = []
slyrics = []
voices = []
state_list = []
+repeat_state = [0] * 8
current_voice_idx = -1
current_lyric_idx = -1
lyric_idx = -1
def check_clef(s):
if not s:
return ''
- if re.match('^treble', s):
+ if re.match('-8va', s) or re.match('treble8', s):
+ # treble8 is used by abctab2ps; -8va is used by barfly,
+ # and by my patch to abc2ps. If there's ever a standard
+ # about this we'll support that.
+ s = s[4:]
+ state.base_octave = -1
+ voices_append("\\clef \"G_8\";\n")
+ elif re.match('^treble', s):
s = s[6:]
if re.match ('^-8', s):
s = s[2:]
else:
state.base_octave = 0
voices_append("\\clef treble;\n")
- elif re.match('^-8va', s):
- s = s[4:]
- state.base_octave = -1
- voices_append("\\clef \"G_8\";\n")
elif re.match('^alto', s):
s = s[4:]
state.base_octave = -1
outf.write ("\n}")
def dump_voices (outf):
+ global doing_alternative, in_repeat
ks = voice_idx_dict.keys()
ks.sort ()
for k in ks:
outf.write ("\nvoice%s = \\notes {" % k)
dump_default_bar(outf)
+ if repeat_state[voice_idx_dict[k]]:
+ outf.write("\n\\repeat volta 2 {")
outf.write ("\n" + voices [voice_idx_dict[k]])
+ if not using_old:
+ if doing_alternative[voice_idx_dict[k]]:
+ outf.write("}")
+ if in_repeat[voice_idx_dict[k]]:
+ outf.write("}")
outf.write ("\n}")
def dump_score (outf):
'm' : 'minor',
'min' : 'minor',
'maj' : 'major',
+ 'major' : 'major',
'phr' : 'phrygian',
'ion' : 'ionian',
'loc' : 'locrian',
'aeo' : 'aeolian',
'mix' : 'mixolydian',
+ 'mixolydian' : 'mixolydian',
'lyd' : 'lydian',
- 'dor' : 'dorian'
+ 'dor' : 'dorian',
+ 'dorian' : 'dorian'
}
def lily_key (k):
s = ''
if header.has_key (key):
s = header[key] + "\n"
- header [key] = s + a
+ header [key] = s + a
def wordwrap(a, v):
linelen = len (v) - string.rfind(v, '\n')
def voices_append(a):
if current_voice_idx < 0:
select_voice ('default', '')
-
stuff_append (voices, current_voice_idx, a)
+def repeat_prepend():
+ global repeat_state
+ if current_voice_idx < 0:
+ select_voice ('default', '')
+ if not using_old:
+ repeat_state[current_voice_idx] = 't'
+
+
def lyrics_append(a):
a = re.sub ( '#', '\\#', a) # latex does not like naked #'s
a = re.sub ( '"', '\\"', a) # latex does not like naked "'s
# break lyrics to words and put "'s around words containing numbers and '"'s
def fix_lyric(str):
ret = ''
-
while str != '':
m = re.match('[ \t]*([^ \t]*)[ \t]*(.*$)', str)
if m:
word = m.group(1)
str = m.group(2)
word = re.sub('"', '\\"', word) # escape "
- if re.match('.*[0-9"]', word):
+ if re.match('.*[0-9"\(]', word):
word = re.sub('_', ' ', word) # _ causes probs inside ""
ret = ret + '\"' + word + '\" '
else:
a = re.sub ( '~', '_', a) # ~ to space('_')
a = re.sub ( '\*', '_ ', a) # * to to space
a = re.sub ( '#', '\\#', a) # latex does not like naked #'s
- if re.match('.*[0-9"]', a): # put numbers and " into quoted string
+ if re.match('.*[0-9"\(]', a): # put numbers and " and ( into quoted string
a = fix_lyric(a)
a = re.sub ( '$', ' ', a) # insure space between lines
__main__.lyric_idx = lyric_idx + 1
else:
__main__.global_key = compute_key (a)# ugh.
voices_append ('\\key %s \\major;' % lily_key(a))
+ if g == 'N': # Notes
+ header ['footnotes'] = header['footnotes'] + '\\\\\\\\' + a
if g == 'O': # Origin
header ['origin'] = a
if g == 'X': # Reference Number
# (num / den) / defaultlen < 1/base
while base * multiply_tup[0] < multiply_tup[1]:
base = base * 2
- return '%d%s' % ( base, '.'* dots)
+ if base == 1:
+ if (multiply_tup[0] / multiply_tup[1]) == 2:
+ base = '\\breve'
+ if (multiply_tup[0] / multiply_tup[1]) == 4:
+ base = '\longa'
+ return '%s%s' % ( base, '.'* dots)
class Parser_state:
def __init__ (self):
}
def try_parse_articulation (str, state):
-
while str and artic_tbl.has_key(str[:1]):
state.next_articulation = state.next_articulation + artic_tbl[str[:1]]
if not artic_tbl[str[:1]]:
if str[:1] =='"':
str = str[1:]
gc = ''
+ if str[0] == '_' or (str[0] == '^'):
+ position = str[0]
+ str = str[1:]
+ else:
+ position = '^'
while str and str[0] != '"':
gc = gc + str[0]
str = str[1:]
if str:
str = str[1:]
gc = re.sub('#', '\\#', gc) # escape '#'s
- state.next_articulation = ("^\"%s\"" % gc) + state.next_articulation
+ state.next_articulation = ("%c\"%s\"" % (position ,gc)) + state.next_articulation
return str
def try_parse_escape (str):
# :: left-right repeat
# |1 volta 1
# |2 volta 2
-bar_dict = {
+old_bar_dict = {
'|]' : '|.',
'||' : '||',
'[|' : '||',
':|2' : ':|',
'|' : '|'
}
+bar_dict = {
+ '|]' : '\\bar "|.";',
+ '||' : '\\bar "||";',
+ '[|' : '\\bar "||";',
+ ':|' : '}',
+ '|:' : '\\repeat volta 2 {',
+ '::' : '} \\repeat volta 2 {',
+ '|1' : '} \\alternative{{',
+ '|2' : '} {',
+ ':|2' : '} {',
+ '|' : '\\bar "|";'
+ }
warn_about = ['|:', '::', ':|', '|1', ':|2', '|2']
+alternative_opener = ['|1', '|2', ':|2']
+repeat_ender = ['::', ':|']
+repeat_opener = ['::', '|:']
+in_repeat = [''] * 8
+doing_alternative = [''] * 8
+using_old = ''
def try_parse_bar (str,state):
+ global in_repeat, doing_alternative, using_old
+ do_curly = ''
bs = None
-
+ if current_voice_idx < 0:
+ select_voice ('default', '')
# first try the longer one
for trylen in [3,2,1]:
if str[:trylen] and bar_dict.has_key (str[:trylen]):
s = str[:trylen]
- bs = "\\bar \"%s\";" % bar_dict[s]
- if s in warn_about:
- sys.stderr.write('Warning kludging for barline `%s\'\n' % s)
+ if using_old:
+ bs = "\\bar \"%s\";" % old_bar_dict[s]
+ else:
+ bs = "%s" % bar_dict[s]
str = str[trylen:]
- break
+ if s in alternative_opener:
+ if not in_repeat[current_voice_idx]:
+ using_old = 't'
+ bs = "\\bar \"%s\";" % old_bar_dict[s]
+ else:
+ doing_alternative[current_voice_idx] = 't'
+ if s in repeat_ender:
+ if not in_repeat[current_voice_idx]:
+ sys.stderr.write("Warning: inserting repeat to beginning of notes.\n")
+ repeat_prepend()
+ in_repeat[current_voice_idx] = ''
+ else:
+ if doing_alternative[current_voice_idx]:
+ do_curly = 't'
+ if using_old:
+ bs = "\\bar \"%s\";" % old_bar_dict[s]
+ else:
+ bs = bar_dict[s]
+ doing_alternative[current_voice_idx] = ''
+ in_repeat[current_voice_idx] = ''
+ if s in repeat_opener:
+ in_repeat[current_voice_idx] = 't'
+ if using_old:
+ bs = "\\bar \"%s\";" % old_bar_dict[s]
+ else:
+ bs = bar_dict[s]
+ break
if str[:1] == '|':
state.next_bar = '|\n'
str = str[1:]
if bs <> None:
clear_bar_acc(state)
voices_append (bs)
-
+ if do_curly != '':
+ voices_append("} }")
+ do_curly = ''
return str
def try_parse_tie (str):
#non-western scales, it is necessary to be able to tell a translator that
#the barlines should not affect its interpretation of the pitch.
if (string.find(str,'nobarlines') > 0):
- #debugging
nobarlines = 1
elif str[0:3] == '%LY':
p = string.find(str, 'voices')
if (p > -1):
voices_append(str[p+7:])
voices_append("\n")
+ p = string.find(str, 'slyrics')
+ if (p > -1):
+ slyrics_append(str[p+8:])
+
#write other kinds of appending if we ever need them.
return str
def help ():
print r"""
-Convert ABC to Lilypond.
+Convert ABC to lilypond.
Usage: abc2ly [OPTIONS]... ABC-FILE
return str
- conversions.append (
- ((0,1,19), conv, 'deprecated \\octave; can\'t convert automatically'))
+ conversions.append ((
+ ((0,1,19), conv, 'deprecated \\octave; can\'t convert automatically')))
if 1: # need new a namespace
return str
- conversions.append (
- ((0,1,20), conv, 'deprecated \\textstyle, new \key syntax'))
+ conversions.append ((
+ ((0,1,20), conv, 'deprecated \\textstyle, new \key syntax')))
if 1:
return str
- conversions.append (
+ conversions.append ((
((0,1,21), conv, '\\musical_pitch -> \\musicalpitch, '+
- '\\meter -> \\time'))
+ '\\meter -> \\time')))
if 1:
def conv (str):
return str
- conversions.append (
- ((1,0,0), conv, '0.1.21 -> 1.0.0 '))
+ conversions.append ((
+ ((1,0,0), conv, '0.1.21 -> 1.0.0 ')))
if 1:
return str
- conversions.append (
+ conversions.append ((
((1,0,1), conv, '\\accidentals -> \\keysignature, ' +
- 'specialaccidentals -> keyoctaviation'))
+ 'specialaccidentals -> keyoctaviation')))
if 1:
def conv(str):
sys.stderr.write ('\nNot smart enough to convert to new \\header format')
return str
- conversions.append (((1,0,2), conv, '\\header { key = concat + with + operator }'))
+ conversions.append (((1,0,2), conv, '\\header { key = concat + with + operator }'))
if 1:
def conv(str):
return str
- conversions.append (((1,0,3), conv, '\\melodic -> \\notes'))
+ conversions.append (((1,0,3), conv, '\\melodic -> \\notes'))
if 1:
def conv(str):
return str
- conversions.append (((1,0,4), conv, 'default_{paper,midi}'))
+ conversions.append (((1,0,4), conv, 'default_{paper,midi}'))
if 1:
def conv(str):
return str
- conversions.append (((1,0,5), conv, 'ChoireStaff -> ChoirStaff'))
+ conversions.append (((1,0,5), conv, 'ChoireStaff -> ChoirStaff'))
if 1:
def conv(str):
raise FatalConversionError()
return str
- conversions.append (((1,0,6), conv, 'foo = \\translator {\\type .. } ->\\translator {\\type ..; foo; }'))
+ conversions.append (((1,0,6), conv, 'foo = \\translator {\\type .. } ->\\translator {\\type ..; foo; }'))
if 1:
return str
- conversions.append (((1,0,7), conv, '\\lyric -> \\lyrics'))
+ conversions.append (((1,0,7), conv, '\\lyric -> \\lyrics'))
if 1:
def conv(str):
str = re.sub ('\\]([0-9/]+)', '] }', str)
return str
- conversions.append (((1,0,10), conv, '[2/3 ]1/1 -> \\times 2/3 '))
+ conversions.append (((1,0,10), conv, '[2/3 ]1/1 -> \\times 2/3 '))
if 1:
def conv(str):
return str
- conversions.append (((1,0,12), conv, 'Chord syntax stuff'))
+ conversions.append (((1,0,12), conv, 'Chord syntax stuff'))
if 1:
return str
- conversions.append (((1,0,13), conv, '<a ~ b> c -> <a b> ~ c'))
+ conversions.append (((1,0,13), conv, '<a ~ b> c -> <a b> ~ c'))
if 1:
def conv(str):
return str
- conversions.append (((1,0,14), conv, '<[a b> <a b]>c -> [<a b> <a b>]'))
+ conversions.append (((1,0,14), conv, '<[a b> <a b]>c -> [<a b> <a b>]'))
if 1:
return str
- conversions.append (((1,0,16), conv, '\\type -> \\context, textstyle -> textStyle'))
+ conversions.append (((1,0,16), conv, '\\type -> \\context, textstyle -> textStyle'))
if 1:
raise FatalConversionError()
return str
- conversions.append (((1,0,18), conv,
+ conversions.append (((1,0,18), conv,
'\\repeat NUM Music Alternative -> \\repeat FOLDSTR Music Alternative'))
if 1:
return str
- conversions.append (((1,0,19), conv,
+ conversions.append (((1,0,19), conv,
'fontsize -> fontSize, midi_instrument -> midiInstrument, SkipBars -> skipBars'))
return str
- conversions.append (((1,0,20), conv,
+ conversions.append (((1,0,20), conv,
'{,tie,slur}ydirection -> {v,tieV,slurV}erticalDirection'))
return str
- conversions.append (((1,0,21), conv,
+ conversions.append (((1,0,21), conv,
'hshift -> horizontalNoteShift'))
return str
- conversions.append (((1,1,52), conv,
+ conversions.append (((1,1,52), conv,
'deprecate \\grouping'))
return str
- conversions.append (((1,1,55), conv,
+ conversions.append (((1,1,55), conv,
'\\wheel -> \\coda'))
if 1:
return str
- conversions.append (((1,1,65), conv,
+ conversions.append (((1,1,65), conv,
'slurdash -> slurDash, keyoctaviation -> keyOctaviation'))
if 1:
return str
- conversions.append (((1,1,66), conv,
+ conversions.append (((1,1,66), conv,
'semi -> volta'))
return str
- conversions.append (((1,1,67), conv,
+ conversions.append (((1,1,67), conv,
'beamAuto -> noAutoBeaming'))
if 1:
return str
- conversions.append (((1,2,0), conv,
+ conversions.append (((1,2,0), conv,
'automaticMelismas -> automaticMelismata'))
if 1:
return str
- conversions.append (((1,2,1), conv,
+ conversions.append (((1,2,1), conv,
'dynamicDir -> dynamicDirection'))
if 1:
return str
- conversions.append (((1,3,4), conv,
+ conversions.append (((1,3,4), conv,
'\\cadenza -> \cadenza{On|Off}'))
if 1:
str)
return str
- conversions.append (((1,3,5), conv, 'beamAuto moment properties'))
+ conversions.append (((1,3,5), conv, 'beamAuto moment properties'))
if 1:
def conv (str):
str)
return str
- conversions.append (((1,3,17), conv, 'stemStyle -> flagStyle'))
+ conversions.append (((1,3,17), conv, 'stemStyle -> flagStyle'))
if 1:
def conv (str):
str)
return str
- conversions.append (((1,3,18), conv, 'staffLineLeading -> staffSpace'))
+ conversions.append (((1,3,18), conv, 'staffLineLeading -> staffSpace'))
if 1:
def conv (str):
str)
return str
- conversions.append (((1,3,35), conv, 'textEmptyDimension -> textNonEmpty'))
+ conversions.append (((1,3,35), conv, 'textEmptyDimension -> textNonEmpty'))
if 1:
def conv (str):
sys.stderr.write ('\nNot smart enough to convert to new \\notenames format')
return str
- conversions.append (((1,3,38), conv, '\musicalpitch { a b c } -> #\'(a b c)'))
+ conversions.append (((1,3,38), conv, '\musicalpitch { a b c } -> #\'(a b c)'))
if 1:
def conv (str):
str = re.sub ("\\\\key ([^;]+);", replace, str)
return str
- conversions.append (((1,3,39), conv, '\\key A ; ->\\key a;'))
+ conversions.append (((1,3,39), conv, '\\key A ; ->\\key a;'))
if 1:
def conv (str):
sys.stderr.write ('\nNot smart enough to convert to new tremolo format')
return str
- conversions.append (((1,3,41), conv,
+ conversions.append (((1,3,41), conv,
'[:16 c4 d4 ] -> \\repeat "tremolo" 2 { c16 d16 }'))
if 1:
str = re.sub ('Staff_margin_engraver' , 'Instrument_name_engraver', str)
return str
- conversions.append (((1,3,42), conv,
+ conversions.append (((1,3,42), conv,
'Staff_margin_engraver deprecated, use Instrument_name_engraver'))
if 1:
str = re.sub ('note[hH]eadStyle\\s*=\\s*"?(\\w+)"?' , "noteHeadStyle = #'\\1", str)
return str
- conversions.append (((1,3,49), conv,
+ conversions.append (((1,3,49), conv,
'noteHeadStyle value: string -> symbol'))
if 1:
def conv (str):
str = re.sub (r"""\\key *([a-z]+) *;""", r"""\\key \1 \major;""",str);
return str
- conversions.append (((1,3,59), conv,
+ conversions.append (((1,3,59), conv,
'\key X ; -> \key X major; '))
if 1:
'latexheaders = "',
str)
return str
- conversions.append (((1,3,68), conv, 'latexheaders = "\\input global" -> latexheaders = "global"'))
+ conversions.append (((1,3,68), conv, 'latexheaders = "\\input global" -> latexheaders = "global"'))
str = re.sub ('basic([A-Za-z_]+)Properties', '\\1', str)
return str
- conversions.append (((1,3,92), conv, 'basicXXXProperties -> XXX'))
+ conversions.append (((1,3,92), conv, 'basicXXXProperties -> XXX'))
if 1:
def conv (str):
return str
- conversions.append (((1,3,93), conv,
+ conversions.append (((1,3,93), conv,
'property definiton case (eg. onevoice -> oneVoice)'))
return str
- conversions.append (((1,3,97), conv, 'ChordName -> ChordNames'))
+ conversions.append (((1,3,97), conv, 'ChordName -> ChordNames'))
if 1:
def conv (str):
return str
- conversions.append (((1,3,102), conv, 'beamAutoEnd -> autoBeamSettings \\push (end * * * *)'))
+ conversions.append (((1,3,102), conv, 'beamAutoEnd -> autoBeamSettings \\push (end * * * *)'))
if 1:
return str
- conversions.append (((1,3,110), conv, '\\push -> \\override, \\pop -> \\revert'))
+ conversions.append (((1,3,110), conv, '\\push -> \\override, \\pop -> \\revert'))
if 1:
def conv (str):
str = re.sub ('LyricVoice', 'LyricsVoice', str)
- % old fix
+ # old fix
str = re.sub ('ChordNames*.ChordNames*', 'Chordnames.Chordname', str)
return str
- conversions.append (((1,3,113), conv, 'LyricVoice -> LyricsVoice'))
+ conversions.append (((1,3,113), conv, 'LyricVoice -> LyricsVoice'))
############################