From: fred Date: Wed, 27 Mar 2002 01:20:32 +0000 (+0000) Subject: lilypond-1.5.2 X-Git-Tag: release/1.5.59~596 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5c34e39dd01233b148e94214107fdf299845861f;p=lilypond.git lilypond-1.5.2 --- diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index a75fb37c1a..1b26344f9e 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -7,7 +7,10 @@ @html

-[logo] + +[picture of lily-cello-girl] + @end html diff --git a/input/GNUmakefile b/input/GNUmakefile index 3f3951d288..9cf5f1fd68 100644 --- a/input/GNUmakefile +++ b/input/GNUmakefile @@ -1,6 +1,6 @@ depth = .. -SUBDIRS=bugs test regression tutorial no-notation ascii-art +SUBDIRS=bugs test regression tutorial no-notation ascii-art template # nereides is tweaked a lot, can't do (read webpage) examples=trip star-spangled-banner paddy twinkle #nereides diff --git a/input/ascii-art/GNUmakefile b/input/ascii-art/GNUmakefile index 9c2b9f48fe..516974621f 100644 --- a/input/ascii-art/GNUmakefile +++ b/input/ascii-art/GNUmakefile @@ -1,8 +1,5 @@ -# input/bugs/Makefile - depth = ../.. LOCALSTEPMAKE_TEMPLATES=ly mutopia include $(depth)/make/stepmake.make - diff --git a/input/template/GNUmakefile b/input/template/GNUmakefile new file mode 100644 index 0000000000..cba7839f6d --- /dev/null +++ b/input/template/GNUmakefile @@ -0,0 +1,7 @@ +depth = ../.. + +LOCALSTEPMAKE_TEMPLATES=ly mutopia +EXTRA_DIST_FILES=README + +include $(depth)/make/stepmake.make + diff --git a/input/template/README b/input/template/README new file mode 100644 index 0000000000..b3c24f9b3f --- /dev/null +++ b/input/template/README @@ -0,0 +1,57 @@ + +* Mention this somewhere in documentation (Tutorial) + +* Better comment-out most header entries, or + move to template/title.ly altogether? + +* Naming conventions for voices/staffs + (think: \autochange, \partcombine)? + +* Add (commented-out) stuff like \time 3/4 + \property Staff.TimeSignature \set #'style = #xxx? + +* Handy emacs shortcuts to (these) templates? + +* Mutopia headers? + +* Another approach would be to not include any music in the templates, + and standardise the naming of the music, so that you'd do: + + title = 'Piano piece' + upper = \notes { ... } + lower = \notes { ... } + + \include "template/piano.ly" + + In this case, we'd also need one simple music example file per + template. This approach can be even easier to use, but is not very + flexible, it only works for simple and uniform pieces. + +* Possibly some of you already have created something like this? I was + thinking of having templates for: + + single melody = melody.ly + melody with lyrics = melody-lyrics.ly + melody with lyrics and chords = melody-lyrics-chords.ly + piano = piano.ly + piano with several voices = piano-4-voices.ly + piano with lyrics (between staffs) = piano-lyrics.ly + piano with melody and lyrics = piano-melody-lyrics.ly + +TODO (Choral templates, anyone?) + piano with lyrics and chords + (string) duet + (string) duet parts + string quartet + string quintet parts + orchestral score + orchestral parts + choral score + choral score with piano reduction (i.e., the piano staves have the + same notes as the choral parts) + choral score with piano accompaniment + choral parts + + + + diff --git a/input/template/melody-lyrics-chords.ly b/input/template/melody-lyrics-chords.ly new file mode 100644 index 0000000000..80dcd6c70d --- /dev/null +++ b/input/template/melody-lyrics-chords.ly @@ -0,0 +1,45 @@ +\version "1.5.1" + +\header { + dedication = "dedication" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + opus = "Opus 0" + piece = "Piece I" + instrument = "Instrument" + arranger = "Arranger" + poet = "Poet" + texttranslator = "Translator" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" +} + +melody = \notes \relative c' { + a b c d +} + +text = \lyrics { + Aaa Bee Cee Dee +} + +accompaniment = \chords { + a2: c2 +} + +\score { + < + \context ChordNames \accompaniment + \addlyrics + \context Staff = one { + \property Staff.noAutoBeaming = ##t + \property Staff.automaticMelismata = ##t + \melody + } + \context Lyrics \text + > + \paper { } + \midi { } +} diff --git a/input/template/melody-lyrics.ly b/input/template/melody-lyrics.ly new file mode 100644 index 0000000000..613fa72474 --- /dev/null +++ b/input/template/melody-lyrics.ly @@ -0,0 +1,40 @@ +\version "1.5.1" + +\header { + dedication = "dedication" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + opus = "Opus 0" + piece = "Piece I" + instrument = "Instrument" + arranger = "Arranger" + poet = "Poet" + texttranslator = "Translator" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" +} + +melody = \notes \relative c'' { + a b c d +} + +text = \lyrics { + Aaa Bee Cee Dee +} + +\score { + < + \addlyrics + \context Staff = one { + \property Staff.noAutoBeaming = ##t + \property Staff.automaticMelismata = ##t + \melody + } + \context Lyrics \text + > + \paper { } + \midi { } +} diff --git a/input/template/melody.ly b/input/template/melody.ly new file mode 100644 index 0000000000..80739411c6 --- /dev/null +++ b/input/template/melody.ly @@ -0,0 +1,28 @@ +\version "1.5.1" + +\header { + dedication = "dedication" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + opus = "Opus 0" + piece = "Piece I" + instrument = "Instrument" + arranger = "Arranger" + poet = "Poet" + texttranslator = "Translator" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" +} + +melody = \notes \relative c' { + a b c d +} + +\score { + \context Staff \melody + \paper { } + \midi { } +} diff --git a/input/template/piano-4-voices.ly b/input/template/piano-4-voices.ly new file mode 100644 index 0000000000..a5bfe1ee6c --- /dev/null +++ b/input/template/piano-4-voices.ly @@ -0,0 +1,55 @@ +\version "1.5.1" + +\header { + dedication = "dedication" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + opus = "Opus 0" + piece = "Piece I" + instrument = "Instrument" + arranger = "Arranger" + poet = "Poet" + texttranslator = "Translator" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" +} + +upperOne = \notes\relative c'' { + \voiceOne + a b c d +} + +upperTwo = \notes\relative c' { + \voiceTwo + a2 c +} + +lowerOne = \notes\relative c { + \voiceOne + a2 c +} + +lowerTwo = \notes\relative c { + \voiceTwo + a1 +} + +\score { + \context PianoStaff < + %\time 4/4 + \context Staff = upper < + \context Voice = one \upperOne + \context Voice = two \upperTwo + > + \context Staff = lower < + \clef bass + \context Voice = one \lowerOne + \context Voice = two \lowerTwo + > + > + \paper { } + \midi { } +} \ No newline at end of file diff --git a/input/template/piano-lyrics.ly b/input/template/piano-lyrics.ly new file mode 100644 index 0000000000..1d519ed4dd --- /dev/null +++ b/input/template/piano-lyrics.ly @@ -0,0 +1,54 @@ +\version "1.5.1" + +\header { + dedication = "dedication" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + opus = "Opus 0" + piece = "Piece I" + instrument = "Instrument" + arranger = "Arranger" + poet = "Poet" + texttranslator = "Translator" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" +} + +upper = \notes\relative c'' { + a b c d +} + +lower = \notes\relative c { + a2 c +} + +text = \lyrics { + Aaa Bee Cee Dee +} + +\score { + \context GrandStaff < + \addlyrics + \context Staff = upper \upper + \context Lyrics \text + \context Staff = lower < + \clef bass + \lower + > + > + \paper { + \translator { + \GrandStaffContext + \accepts "Lyrics" + } + \translator { + %\LyricsVoiceContext + \LyricsContext + \consists "Bar_engraver" + } + } + \midi { } +} \ No newline at end of file diff --git a/input/template/piano-melody-lyrics.ly b/input/template/piano-melody-lyrics.ly new file mode 100644 index 0000000000..a1c2c3ecc9 --- /dev/null +++ b/input/template/piano-melody-lyrics.ly @@ -0,0 +1,58 @@ +\version "1.5.1" + +\header { + dedication = "dedication" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + opus = "Opus 0" + piece = "Piece I" + instrument = "Instrument" + arranger = "Arranger" + poet = "Poet" + texttranslator = "Translator" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" +} + +melody = \notes \relative c'' { + a b c d +} + +text = \lyrics { + Aaa Bee Cee Dee +} + +upper = \notes\relative c'' { + a b c d +} + +lower = \notes\relative c { + a2 c +} + +\score { + < + \addlyrics + \context Staff = mel { + \property Staff.noAutoBeaming = ##t + \property Staff.automaticMelismata = ##t + \melody + } + \context Lyrics \text + + \context PianoStaff < + \context Staff = upper \upper + \context Staff = lower < + \clef bass + \lower + > + > + > + \paper { + \translator { \HaraKiriStaffContext } + } + \midi { } +} \ No newline at end of file diff --git a/input/template/piano.ly b/input/template/piano.ly new file mode 100644 index 0000000000..497c8c2e4e --- /dev/null +++ b/input/template/piano.ly @@ -0,0 +1,39 @@ +\version "1.5.1" + +\header { + dedication = "dedication" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + opus = "Opus 0" + piece = "Piece I" + instrument = "Instrument" + arranger = "Arranger" + poet = "Poet" + texttranslator = "Translator" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" +} + +upper = \notes\relative c'' { + a b c d +} + +lower = \notes\relative c { + a2 c +} + +\score { + \context PianoStaff < + %\time 4/4 + \context Staff = upper \upper + \context Staff = lower < + \clef bass + \lower + > + > + \paper { } + \midi { } +} \ No newline at end of file diff --git a/input/test/chord-banter.ly b/input/test/chord-banter.ly new file mode 100644 index 0000000000..74327da615 --- /dev/null +++ b/input/test/chord-banter.ly @@ -0,0 +1,54 @@ +\version "1.3.146" +\header{ +filename = "chord-table.ly" +copyright = "public domain" +enteredby = "jcn" +} + +tab = \notes\transpose c'''\chords{ + c1 c:m c:4 c:m4 c:5+ \break + c:5- c:dim c:5-.5+ c:6 c:m6\break + c:4.6 c:7 c:m7 c:4.7 c:m4.7\break + c:5+.7 c:5-.7 c:m5-.7 c:maj c:m.maj\break + c:4.maj c:m4.maj c:5+.maj c:m4+.maj c:5-.maj\break + c1:m5-.maj c:dim7 c:5-.5+.7 c:6.maj c:m6.maj\break + c:4.6.maj c:9 c:m9 c:4.9 c:m.4.9\break +} + +\score{ +% \context StaffGroup < + < + \context Staff=c \notes\transpose c\tab + \context ChordNames=c \notes\transpose c\tab +%{ + \context Staff=cis \notes\transpose cis\tab + \context ChordNames=cis \notes\transpose cis\tab + \context Staff=des \notes\transpose des\tab + \context ChordNames=des \notes\transpose des\tab + \context Staff=d \notes\transpose d\tab + \context ChordNames=d \notes\transpose d\tab + \context Staff=es \notes\transpose es\tab + \context ChordNames=es \notes\transpose es\tab + \context Staff=e \notes\transpose e\tab + \context ChordNames=e \notes\transpose e\tab + \context Staff=fis \notes\transpose fis\tab + \context ChordNames=fis \notes\transpose fis\tab + \context Staff=g \notes\transpose g\tab + \context ChordNames=g \notes\transpose g\tab + \context Staff=as \notes\transpose as\tab + \context ChordNames=as \notes\transpose as\tab + \context Staff=a \notes\transpose a\tab + \context ChordNames=a \notes\transpose a\tab + \context Staff=bes \notes\transpose bes,\tab + \context ChordNames=bes \notes\transpose bes,\tab + \context Staff=b \notes\transpose b,\tab + \context ChordNames=b \notes\transpose b,\tab +%} + > + \paper{ + textheight = \vsize - 4.0 * \staffheight + } + +} + + diff --git a/input/test/title.ly b/input/test/title.ly index 176829a4c5..9ef39c0dc5 100644 --- a/input/test/title.ly +++ b/input/test/title.ly @@ -6,6 +6,7 @@ subtitle = "Subtitle" subsubtitle = "Subsubtitle" composer = "Composer (xxxx-yyyy)" + instrument = "Instrument" arranger = "Arranger" poet = "Poet" % ugr: warning: Identifier name is a keyword: `translator' @@ -14,7 +15,6 @@ copyright = "public domain" enteredby = "jcn" source = "urtext" - instrument = "Instrument" } \score { diff --git a/lily/chord.cc b/lily/chord.cc index dd20c964ee..233c5722d2 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -298,6 +298,10 @@ Chord::tonic_add_sub_to_pitches (SCM tonic, SCM add, SCM sub) for (SCM i = add; gh_pair_p (i); i = gh_cdr (i)) { Pitch* p = unsmob_pitch (gh_car (i)); + /* Ugr + This chord modifier stuff should really be fixed + Cmaj7 yields C 7/7- + */ if (p->octave_i () == -100) { p->octave_i_ = 0; @@ -322,7 +326,10 @@ Chord::tonic_add_sub_to_pitches (SCM tonic, SCM add, SCM sub) if (highest_step < 5) tmp = ly_snoc (fifth, tmp); else if (dim_b) - add = lower_step (tonic, add, gh_int2scm (5)); + { + add = lower_step (tonic, add, gh_int2scm (5)); + add = lower_step (tonic, add, gh_int2scm (7)); + } /* find missing thirds */ SCM missing = missing_thirds (tmp); @@ -392,7 +399,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) n->set_mus_property ("duration", dur); n->set_mus_property ("inversion", SCM_BOOL_T); list = gh_cons (n->self_scm (), list); - scm_unprotect_object (n->self_scm ()); + scm_gc_unprotect_object (n->self_scm ()); } else warning (_f ("invalid inversion pitch: not part of chord: %s", @@ -407,7 +414,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) n->set_mus_property ("duration", dur); n->set_mus_property ("bass", SCM_BOOL_T); list = gh_cons (n->self_scm (), list); - scm_unprotect_object (n->self_scm ()); + scm_gc_unprotect_object (n->self_scm ()); } for (SCM i = pitches; gh_pair_p (i); i = gh_cdr (i)) @@ -416,7 +423,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) n->set_mus_property ("pitch", gh_car (i)); n->set_mus_property ("duration", dur); list = gh_cons (n->self_scm (), list); - scm_unprotect_object (n->self_scm ()); + scm_gc_unprotect_object (n->self_scm ()); } Simultaneous_music*v = new Request_chord (SCM_EOL); diff --git a/lily/parser.yy b/lily/parser.yy index 46db204f92..4f4747ab5a 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -336,7 +336,7 @@ toplevel_expression: } | lilypond_header { if (global_header_p) - scm_unprotect_object (global_header_p->self_scm ()); + scm_gc_unprotect_object (global_header_p->self_scm ()); global_header_p = $1; } | score_block { @@ -440,22 +440,22 @@ all objects can be unprotected as soon as they're here. identifier_init: score_block { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | output_def { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | translator_spec_block { $$ = $1; } | Music { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | post_request { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | explicit_duration { $$ = $1; @@ -555,7 +555,7 @@ score_body: $$->set_spot (THIS->here_input ()); SCM m = $1->self_scm (); - scm_unprotect_object (m); + scm_gc_unprotect_object (m); $$->music_ = m; } | SCORE_IDENTIFIER { @@ -563,7 +563,7 @@ score_body: $$->set_spot (THIS->here_input ()); } | score_body lilypond_header { - scm_unprotect_object ($2->self_scm ()); + scm_gc_unprotect_object ($2->self_scm ()); $$->header_p_ = $2; } | score_body output_def { @@ -659,7 +659,7 @@ Music_list: /* empty */ { | Music_list Music { SCM s = $$; SCM c = gh_cons ($2->self_scm (), SCM_EOL); - scm_unprotect_object ($2->self_scm ()); /* UGH */ + scm_gc_unprotect_object ($2->self_scm ()); /* UGH */ if (gh_pair_p (gh_cdr (s))) gh_set_cdr_x (gh_cdr (s), c); /* append */ else @@ -703,7 +703,7 @@ Repeated_music: if (beg) { r-> set_mus_property ("body", beg->self_scm ()); - scm_unprotect_object (beg->self_scm ()); + scm_gc_unprotect_object (beg->self_scm ()); } r->set_mus_property ("repeat-count", gh_int2scm (times >? 1)); @@ -711,9 +711,9 @@ Repeated_music: { alts->truncate (times); r-> set_mus_property ("alternatives", alts->self_scm ()); - scm_unprotect_object (alts->self_scm ()); + scm_gc_unprotect_object (alts->self_scm ()); } - SCM func = scm_eval2 (ly_symbol2scm ("repeat-name-to-ctor"), SCM_EOL); + SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor")); SCM result = gh_call1 (func, $2); set_music_properties (r, result); @@ -787,7 +787,7 @@ Composite_music: CONTEXT STRING Music { Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", $3->self_scm ()); - scm_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($3->self_scm ()); csm->set_mus_property ("context-type",$2); csm->set_mus_property ("context-id", ly_str02scm ("")); @@ -799,7 +799,7 @@ Composite_music: chm->set_mus_property ("element", $3->self_scm ()); chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_cxx_function); - scm_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($3->self_scm ()); chm->set_mus_property ("what", $2); $$ = chm; @@ -821,14 +821,14 @@ Composite_music: if (stopm) { stopm = stopm->clone (); ms = gh_cons (stopm->self_scm (), ms); - scm_unprotect_object (stopm->self_scm ()); + scm_gc_unprotect_object (stopm->self_scm ()); } ms = gh_cons ($2->self_scm (), ms); - scm_unprotect_object ($2->self_scm()); + scm_gc_unprotect_object ($2->self_scm()); if (startm) { startm = startm->clone (); ms = gh_cons (startm->self_scm () , ms); - scm_unprotect_object (startm->self_scm ()); + scm_gc_unprotect_object (startm->self_scm ()); } Music* seq = new Sequential_music (SCM_EOL); @@ -836,11 +836,11 @@ Composite_music: $$ = new Grace_music (SCM_EOL); $$->set_mus_property ("element", seq->self_scm ()); - scm_unprotect_object (seq->self_scm ()); + scm_gc_unprotect_object (seq->self_scm ()); #else $$ = new Grace_music (SCM_EOL); $$->set_mus_property ("element", $2->self_scm ()); - scm_unprotect_object ($2->self_scm ()); + scm_gc_unprotect_object ($2->self_scm ()); #endif @@ -848,7 +848,7 @@ Composite_music: | CONTEXT string '=' string Music { Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", $5->self_scm ()); - scm_unprotect_object ($5->self_scm ()); + scm_gc_unprotect_object ($5->self_scm ()); csm->set_mus_property ("context-type", $2); csm->set_mus_property ("context-id", $4); @@ -869,7 +869,7 @@ Composite_music: $$->set_mus_property ("element", mp->self_scm ()); - scm_unprotect_object (mp->self_scm ()); + scm_gc_unprotect_object (mp->self_scm ()); $$->set_mus_property ("numerator", gh_int2scm (n)); $$->set_mus_property ("denominator", gh_int2scm (d)); $$->compress (Moment (n,d)); @@ -885,7 +885,7 @@ Composite_music: p->transpose (pit); $$->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); } | TRANSPOSE steno_tonic_pitch Music { $$ = new Transposed_music (SCM_EOL); @@ -894,7 +894,7 @@ Composite_music: p->transpose (pit); $$->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); } | APPLY embedded_scm Music { @@ -941,7 +941,7 @@ relative_music: $$ = new Relative_octave_music (SCM_EOL); $$->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); $$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ()); @@ -953,8 +953,8 @@ re_rhythmed_music: 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 ()); + scm_gc_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($2->self_scm ()); $$ = l; } ; @@ -967,8 +967,8 @@ part_combined_music: 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 ()); + scm_gc_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($4->self_scm ()); $$ = p; @@ -995,7 +995,7 @@ property_def: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1011,7 +1011,7 @@ property_def: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1028,7 +1028,7 @@ property_def: t->set_mus_property ("grob-value", $8); Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1043,7 +1043,7 @@ property_def: t->set_mus_property ("grob-value", $8); Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1059,7 +1059,7 @@ property_def: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1104,7 +1104,7 @@ command_element: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1117,13 +1117,13 @@ command_element: Context_specced_music * sp = new Context_specced_music (SCM_EOL); sp->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); $$ =sp ; sp-> set_mus_property ("context-type", ly_str02scm ( "Score")); } | CLEF STRING { - SCM func = scm_eval2 (ly_symbol2scm ("clef-name-to-properties"), SCM_EOL); + SCM func = scm_primitive_eval (ly_symbol2scm ("clef-name-to-properties")); SCM result = gh_call1 (func, $2); SCM l = SCM_EOL; @@ -1131,14 +1131,14 @@ command_element: 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 ()); + scm_gc_unprotect_object (p->self_scm ()); } 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 ()); + scm_gc_unprotect_object (seq->self_scm ()); $$ =sp ; sp-> set_mus_property ("context-type", ly_str02scm ("Staff")); @@ -1166,10 +1166,10 @@ command_element: - scm_unprotect_object (p3->self_scm ()); - scm_unprotect_object (p2->self_scm ()); - scm_unprotect_object (p1->self_scm ()); - scm_unprotect_object (seq->self_scm ()); + scm_gc_unprotect_object (p3->self_scm ()); + scm_gc_unprotect_object (p2->self_scm ()); + scm_gc_unprotect_object (p1->self_scm ()); + scm_gc_unprotect_object (seq->self_scm ()); $$ = sp; @@ -1825,10 +1825,11 @@ chord_step: $$ = gh_cons ($1, SCM_EOL); } | CHORDMODIFIER_PITCH { - $$ = gh_cons ($1, SCM_EOL); + $$ = gh_cons (unsmob_pitch ($1)->smobbed_copy (), SCM_EOL); } | CHORDMODIFIER_PITCH chord_note { /* Ugh. */ - $$ = gh_list ($1, $2, SCM_UNDEFINED); + $$ = gh_list (unsmob_pitch ($1)->smobbed_copy (), + $2, SCM_UNDEFINED); } ; @@ -1959,7 +1960,7 @@ string: $$ = $1; } | string '+' string { - $$ = scm_string_append (scm_listify ($1, $3, SCM_UNDEFINED)); + $$ = scm_string_append (scm_list_n ($1, $3, SCM_UNDEFINED)); } ; diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 98a9270875..004aededa2 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -52,7 +52,11 @@ (((0 . 0) (3 . 0) (4 . 0)) . ("" (super "4") " " )) ;; Cdim iso Cm5- (((0 . 0) (2 . -1) (4 . -1)) . ("dim")) - ; Co iso Cm5-7- + ; URG: Simply C:m5-/maj7 iso Cdim maj7 + (((0 . 0) (2 . -1) (4 . -1) (6 . 0)) . ("m" (super "5-/maj7" " "))) + ; URG: Simply C:m5-/7 iso Cdim7 + (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . ("m" (super "5-/7" " "))) + ; Co iso C:m5-/7- (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" (super "o") " ")) ; Cdim9 (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1)) . ("dim" (super "9") " ")) @@ -218,7 +222,6 @@ * TODO: any uneven step that's lower than an uneven step which is chromatically altered " - (write-me "adds: " (let ((evens (filter-list (lambda (x) (!= 0 (modulo (cadr x) 2))) steps)) (altered-unevens (filter-list (lambda (x) @@ -236,13 +239,13 @@ '())))) ;; Hmm, what if we have a step twice, can we ignore that? (uniq-list (sort (apply append evens altered-unevens highest) - pitch::<))))) + pitch::<)))) ;; FIXME: unLOOP, see ::additions ;; find the pitches that are missing from `normal' chord (define (chord::subtractions chord-pitches) - (write-me "subs: " (let ((tonic (car chord-pitches))) + (let ((tonic (car chord-pitches))) (let loop ((step 1) (pitches chord-pitches) (subtractions '())) (if (pair? pitches) (let* ((pitch (car pitches)) @@ -265,7 +268,7 @@ (if (= p-step step) (loop (+ step 2) (cdr pitches) subtractions) (loop step (cdr pitches) subtractions))))) - (reverse subtractions)))))) + (reverse subtractions))))) (define (chord::additions->text-banter additions subtractions) (if (pair? additions) @@ -309,18 +312,19 @@ ;; additions, subtractions and bass or inversion into chord name (define (chord::inner-name-banter tonic exception-part additions subtractions bass-and-inversion steps) - (let ((tonic-text (pitch->chord-name-text-banter tonic steps)) - (except-text exception-part) - (sep-text (if (and (string-match "super" (format "~s" exception-part)) + (let* ((tonic-text (pitch->chord-name-text-banter tonic steps)) + (except-text exception-part) + (sep-text (if (and (string-match "super" (format "~s" except-text)) (or (pair? additions) (pair? subtractions))) (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))) + (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))) (text-append - tonic-text except-text sep-text - (list (list simple-super) adds-text subs-text) + tonic-text except-text " " sep-text + ;;(list (list simple-super) adds-text subs-text) + (list (list '((raise . 1) (font-relative-size . -1))) adds-text subs-text) b+i-text))) (define (chord::name-banter tonic exception-part unmatched-steps @@ -344,7 +348,7 @@ bass-and-inversion steps))) (define (chord::restyle name style) - (ly-eval (string->symbol + (primitive-eval (string->symbol (string-append (symbol->string name) (symbol->string style))))) @@ -376,7 +380,7 @@ ;; return (MATCHED-EXCEPTION . BASE-CHORD-WITH-UNMATCHED-STEPS) ;; BASE-CHORD-WITH-UNMATCHED-STEPS always includes (tonic 3 5) (define (chord::exceptions-lookup style steps) - (write-me "xl: " (let* ((result (chord::exceptions-lookup-helper + (let* ((result (chord::exceptions-lookup-helper (chord::restyle 'chord::names-alist- style) steps '() #f)) (exception-part (car result)) @@ -391,7 +395,7 @@ ((= i 0) base) ()) unmatched-steps))) - (list exception-part unmatched-with-1-3-5)))) + (list exception-part unmatched-with-1-3-5))) (define (chord::name->text style tonic steps bass-and-inversion) diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index e4efd1652a..e70fe1037f 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -401,7 +401,9 @@ output_dict= { @end tex @html

- + +[picture of music] + @end html """, } diff --git a/stepmake/bin/text2html.py b/stepmake/bin/text2html.py index b7f9c922c2..c2424deeba 100644 --- a/stepmake/bin/text2html.py +++ b/stepmake/bin/text2html.py @@ -1,8 +1,24 @@ #@PYTHON@ import os +import re import string import sys + +entities = { + "&" : 'amp', + "`" : 'apos', + '>' : 'gt', + '<' : 'lt', + '"' : 'quot', + } + +def txt2html (s): + for i in entities.keys (): + s = re.sub (i, '\001' + entities[i] + ';', s); + s = re.sub ('\001', '&', s); + return s + for a in sys.argv[1:]: # hmm, we need: text2html out/foe.txt -> out/foe.html, # -o is a bit overkill? @@ -18,7 +34,7 @@ for a in sys.argv[1:]:

 %s
 
-""" % open (a).read () +""" % txt2html (open (a).read ()) open (outfile, 'w').write (s)