+pl 2.jcn3
+ - chords:
+ * Chord is item
+ * junked TeX hacking
+ * configurable with styled strings from scm
+ * fixes: dim, /no X, tonic != C
+
+pl 2.jcn2
+ - chords from scm
+
+
+pl 3.hwn2
+ - visibility-lambdas into default elt properties SCM.
+ - clef types in SCM
+ - verticalDirection properties now in SCM.
+
+pl 3.hwn1
+ - move position_i_ into Staff_symbol_referencer
+ - move dir_ into Directional_element baseclass
+
+****************
+
pl 2.hwn1
- bf: dynamic style.
- prepare to move dir_ into SCM.
@item @uref{http://www.cs.uu.nl/~hanwen/lilypond/} Han-Wen's site
has the development pages.
-@item @uref{http://sca.uwaterloo.ca/lilypond/} Eric's mirror
-@item @uref{http://home.austin.rr.com/jbr/jeff/lilypond/} Jeff's Windows NT Distribution site
@end itemize
@ignore
@unnumberedsec Download
@itemize @bullet
-@item @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/}
-@item @uref{http://sca.uwaterloo.ca/lilypond/}
- Eric Praetzel was kind enough to provide a mirror of both the website
- and the ftp site.
-@item @uref{ftp://ftp.lilypond.org/pub/LilyPond/}
- A mirror of the FTP site. Updated at 0:00 MET daily.
-@item @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/RPMS/} RedHat binary
-@item @uref{ftp://ftp.debian.org/pub/debian/dists/unstable/main/binary-i386/tex} Debian binary
-@item @uref{http://home.austin.rr.com/jbr/jeff/lilypond/} Windows NT binary
-@item @uref{http://linux.umbc.edu/software/lilypond/rpms/} i386 RPM.
-@item @uref{ftp://ftp.freshmeat.net/pub/rpms/lilypond/} i386 RPM.
-@end itemize
-
-@unnumberedsubsec Webmaster's Disclaimer
+@item
+ Download development releases at
+@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/}
-These pages were entirely created from the LilyPond package-sources.
-Sorry for poor look they have: we want to be hacking at LilyPond, and
-not at the webpages. If you want to volunteer for making shazzy
-webpages, then please mail us!
+@item Canadian mirror @uref{http://sca.uwaterloo.ca/lilypond/} and @uref{ftp://sca.uwaterloo.ca/pub/}
-Note: These pages are created from a @strong{development snapshots} of
-LilyPond, and it might even be created even from an unreleased
-development version. The version of this webpage is printed at the
-bottom.
+@item Another site in Europe @uref{ftp://ftp.lilypond.org/pub/LilyPond/}
+@item RedHat i386
+binary RPMs: @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/RPMS/}
+@item Debian binary @uref{ftp://ftp.debian.org/pub/debian/dists/unstable/main/binary-i386/tex}
+@item Windows NT: @uref{http://home.austin.rr.com/jbr/jeff/lilypond/}
+@item i386 RPM: @uref{http://linux.umbc.edu/software/lilypond/rpms/}
+@item i386 RPM: @uref{ftp://ftp.freshmeat.net/pub/rpms/lilypond/}
+@item Windows NT: @uref{http://home.austin.rr.com/jbr/jeff/lilypond/}
+@end itemize
+@unnumberedsubsec Webmaster's Disclaimer
+These pages were entirely created from a @strong{development snapshots}
+of the LilyPond package. The version of this webpage is printed at the
+bottom. If you want to volunteer for making more beautiful webpages,
+then please mail us!
@bye
-i-*-outline-layout:(2 (-1 -1 0 :) 0);outline-stylish-prefixes:nil -*-
+-*-outline-layout:(2 (-1 -1 0 :) 0);outline-stylish-prefixes:nil -*-
* GNU LilyPond TODO
Features you cannot find in the documentation as working, should be
.* TODO
. * make this file understandable for 3rd parties.
-. * use Rhythmic_head::position_i () for all Staff_referenced
+. * break align order from SCM list.
+. * time description should be put into SCM
+. * context in embedded SCM errors.
+
. * eradicate all VIRTUAL_COPY_CONS () macros ; use indexed creation,
eg.
ctor_dict["Score_element"]->create_func ();
. * acc at tied note after linebreak.
+. * fix font-naming and selecting
+. * fix naming: \interline Context.staffLineLeading, staff_line_leading (),
+staff_position staff_space
+. * chord tonic: placement of accidental C#, Cb (from scm and C++)
. * note head on stem err msg in dutch.
-. * why need to run -C mf twice?
+. * why need to run -C mf twice?
. * setting indent to 0 with \shape fails
. * here's no difference at all in output. When either is jacked up to 7.0,
everything works and matches up; when either is set just a bit above the
. * hara kiri _8 clef.
. * junk -M ?
. * mudela-book doco
-. * rerun profile
. * fix or replace feta-accordion.mf
. * script engraver
. * bracket pdf hack
- for one of my test scores containing a modern edition of an early
17'th century composition I have a leading measure containing the
orginal clefs and note values of the original composition. I use the
-"harmonic" and "diamond" note head styles for that measure and would
+a"harmonic" and "diamond" note head styles for that measure and would
like to have the stems of these notes _centered_ on the notehead as in
the mensural music notation.
bar line fully drawn across the staves and after that keep to the
ChoirStaff bar line types in the rest of the scores
-- autoBeamMelisma: if I explicitly beam notes in a staff with auto
-beaming disabled I would like to have these beams also to be
-melismatic.
-
. * make all Feta (including dynamics) available to the user in
textual scripts. Examples: "D.S. al \coda", "\mf espress.".
-. * Write scritp that uses --find-old-relative to do auto relativization.
+. * Write script that uses --find-old-relative to do auto relativization.
. * Junk shared cruft (duration, moment) in lib/
. * Key_engraver, Local_key_item
. * Think of comprehensive solution for "if (grace_b == self_grace_b_)"
. * String[String.length] doesn't trap.
-. * Beam
-. * Stem
. * Rhythmic_column and interaction stem/rhythmic_column/note_head/dots.
. * Duration
. * clef engraver
. * junk Music_iterator::first_b_
. * Bezier
-.* BUGS
-. * [c8. c16 c16 c16] in 6/8 timesig.
+.* Beams
+. * [c8. c16 c16 c16] in 6/8 timesig.
+. * Rewrite Stem, Beam (hairy)
+. * general shaving on Beam and Stem
+. * use plet grouping
+. * beams over bars
+. * Rests and beams don't work too well together. Example:
+ [ r8 g''16 des'] [r8 c16 a]
+. * autoBeamMelisma: if I explicitly beam notes in a staff with auto
+beaming disabled I would like to have these beams also to be
+melismatic.
+. * The stemLength property should affect also beamed stems.
. * staffside spanner (crescendo!) along with staffswitch.
+. * * auto melismaBusy for beams.
. *
> \context Staff <
.* STUFF
. * We need feta-din*.mf files for more sizes than 10.
-- Rests and beams don't work too well together. Example:
- [ r8 g''16 des'] [r8 c16 a]
-
-- The stemLength property should affect also beamed stems.
-
. * align left edge of broken tuplet-spanner (have a test case?)
. * fix dynamics decently, ie. use kerning & ligatures.
. * key restorations & repeats
. * paperXX.ly \quartwidth, font setting not up to date. (Should read from AFM?)
-. * * auto melismaBusy for beams.
. *In Caro Mio Ben, bar 8, there's a syllable that starts on a note, and
ends on a pair of grace notes. Standard practice is to mark this with
a slur starting on the main note and ending on the grace note, so a
. * do --safe for PS output?
. * msgfmt -o check?
. * collision of lyrics with span_bars. See star-spangled.
-. * Auto_beam debugging output (waarom/wanneer heb jij die weggehaald?)
. * It is impossible to typeset two textual scripts that are stacked
on top of eachother and avoids note collisions and at the same
time are typeset with different textStyle. I tried to move around
. * german
. * dutch
. * swedish
- .. ?
. * chords
. * guitar chords (fret diagrams)
. * input converters
. * NIFF?
-. * ABC?
-. * SMDL?
+. * musedata
. * add to MIDI output:
. * sharp / flat on trills (in MIDI ??)
. * account for rhythmic position in measure
. * etc.
-
. * Output class, handles : (smallish)
. * help text /(c) notice?
. * version line
. * PS lines to .eps files
. * write custom prolog
-. * SGML input
-
-. * Documentation
-. * internal documentation
-
. * more spanners (smallish)
. * Glissando
. * trill
-. * Rewrite Stem, Beam (hairy)
-. * general shaving on Beam and Stem
-. * use plet grouping
-. * beams over bars
-
-. * lines:
-. * Ledger lines, should be separate item: Ledger_lines
-. * beam stem showthrough, inter beam sizes (french vs german style)
-
. * Collisions
. * left/right note balls should be handled by Collision:
< \multi 2; { \stem 1; <b c> } { <f as b> } >
. * input property
. * Figure out semicolons.
. * <c f a>4 ?
-. * Viola mode?
-
- @c c g e g
- for
- c g es g,
-
- @A c g e g
- for
- cis gis e gis
. * configure pitch_byte
. * rest name configurable
. * write Dynamic_line (to group dynamics horizontally)
-. * use Real for all y positions.
-
. * half-sharps, half-flats
. * adaptive accidental spacing.
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=3
+PATCH_LEVEL=4
MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
#endif
/// copy a bare (C-)array from #src# to #dest# sized #count#
-template<class T> void arrcpy (T*dest, T*src, int count);
+template<class T> void arrcpy (T*dest, T const*src, int count);
/**
Scaleable array/stack template, for a type T with default constructor.
set_size (size_ + src.size_);
arrcpy (array_p_+s,src.array_p_, src.size_);
}
- Array<T> slice (int lower, int upper) ;
+ Array<T> slice (int lower, int upper) const;
void reverse();
};
*/
template<class T> INLINE void
-arrcpy (T*dest, T*src, int count)
+arrcpy (T*dest, T const* src, int count)
{
for (int i_shadows_local=0; i_shadows_local < count ; i_shadows_local++)
#ifdef __powerpc__
template<class T> INLINE
Array<T>
-Array<T>::slice (int lower, int upper)
+Array<T>::slice (int lower, int upper) const
{
assert (lower >= 0 && lower <=upper&& upper <= size_);
Array<T> r;
--- /dev/null
+\version "1.3.2";
+
+\header{
+enteredby = "jcn";
+copyright = "public domain";
+TestedFeatures = "Banter named chords";
+}
+
+% test German (Banter) naming
+% for more conventional naming, comment scm stuff out
+
+% {
+#(set! pitch-names-alist
+ (append
+ '(
+ ; use these for German naming
+ ((6 . 0) . ("H" ""))
+ ((6 . -1) . ("B" ("feta-1" . "\12")))
+ )
+ pitch-names-alist))
+
+#(set! chord-names-alist
+ (append
+ '(
+ (((0 . 0) (2 . -1) (4 . -1)) . ("m" . ("script" . "5-")))
+ ; Co iso Cm5-7-
+ ; urg, niet te pruimen
+ ; (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("feta-1" . ".")))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("script" . "o")))
+ )))
+% }
+
+chord = \notes\transpose c''\chords{
+ % dim modifier means: lower all implicit additions
+ c:dim9
+ c:dim
+ c:dim7
+ % explicit additions are taken as entered:
+ c:m5-.7-
+ % note that 7 is a special case: it's always lowered by 1...
+ c:dim7-.9
+ c:dim9-.11
+
+ % test German names
+ b:dim7
+ bes:m5-
+
+ \break
+
+ c:sus2 %?
+ c:sus4
+ c^3
+ c^3.5
+ c:2.6^5
+ c:dim^5-
+ c:dim7^5-
+ cis:m5-
+}
+
+\score{
+ <
+ \context ChordNames \chord
+ \context Staff \chord
+ >
+}
+
-\version "1.2.0";
+\version "1.3.2";
%{
Would this be acceptable/good enough/convenient for entry?
Cb ces
Cm; Cmin c:3-; c:m; c:min
Caug c:5+; c:aug;
- Cdim c:3-:5-; c:dim
+ Cdim c:3-.5-; c:dim
Cmaj7 c:7+; c:maj
C7 c:7
Csus; Csus4 c:4; c:sus
\notes \relative c'' \context GrandStaff <
\context Staff = up { c4 c4 }
\context Staff = down { \property Staff. staffLineLeading = #5.5 c4
- <c8 d f g>
+ [<c8 d f g>
+ e]
+ [f c']
}
>
}
axis_ = Y_AXIS;
type_ = "barNumber";
visibility_lambda_
- = ly_ch_C_eval_scm ("postbreak_only_visibility");
+ = ly_ch_C_eval_scm ("postbreak-only-visibility");
}
void
text_p_ =0;
hang_on_clef_b_ = false;
visibility_lambda_
- = ly_ch_C_eval_scm ("non_postbreak_visibility");
+ = ly_ch_C_eval_scm ("non-postbreak-visibility");
}
void
{
staff_side_p_
->set_elt_property ("padding",
- gh_double2scm(paper_l ()->get_realvar (gh_symbol2scm("interline"))));
+ gh_double2scm(paper_l ()->get_var ("interline")));
}
staff_side_p_->set_elt_property ("visibility-lambda",
{
spanbar_p_ = get_span_bar_p();
spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
- String visnam = String(name()) + "_visibility";
+ String visnam = String(name()) + "-visibility";
spanbar_p_->set_elt_property ("visibility-lambda",
ly_ch_C_eval_scm (visnam.ch_C()));
void
Beam::set_direction (Direction d)
{
- set_direction ( d);
+ Directional_spanner::set_direction (d);
for (int i=0; i <stems_.size (); i++)
{
Stem *s = stems_[i];
if(breathing_sign_req_l_) {
breathing_sign_p_ = new Breathing_sign;
- SCM prop = get_property ("verticalDirection", 0);
- if(isdir_b(prop))
- breathing_sign_p_->set_vertical_position(to_dir (prop));
-
announce_element (Score_element_info (breathing_sign_p_, breathing_sign_req_l_));
}
}
{
set_direction (UP);
set_elt_property ("breakable", SCM_BOOL_T);
- set_elt_property ("visibility-lambda",
- ly_ch_C_eval_scm ("non_postbreak_visibility"));
}
-void
-Breathing_sign::set_vertical_position (Direction updown)
-{
- assert(updown >= -1 && updown <= +1);
- if(updown != 0)
- set_direction (updown);
-}
Molecule*
Breathing_sign::do_brew_molecule_p () const
Chord_name_engraver::Chord_name_engraver ()
{
+ chord_p_ = 0;
tonic_req_ = 0;
inversion_req_ = 0;
bass_req_ = 0;
void
Chord_name_engraver::do_process_requests ()
{
- if (text_p_arr_.size ())
+ if (chord_p_)
return;
if (!pitch_arr_.size ())
return;
if (gh_boolean_p (chord_inversion))
find_inversion_b = gh_scm2bool (chord_inversion);
- Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_,
- find_inversion_b);
+ chord_p_ = new Chord (to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_, find_inversion_b));
- Text_item* item_p = new Text_item;
-
- /*
- TODO:
- - switch on property, add american (?) chordNameStyle:
- Chord::american_str (...)
-
- SCM chordNameStyle = get_property ("chordNameStyle", 0);
- if (chordNameStyle == "Banter")
- item_p->text_str_ = chord.banter_str (inversion);
- */
-
- item_p->text_str_ = chord.banter_str ();
-
- text_p_arr_.push (item_p);
- announce_element (Score_element_info (item_p, 0));
+ announce_element (Score_element_info (chord_p_, 0));
}
void
Chord_name_engraver::do_pre_move_processing ()
{
- for (int i=0; i < text_p_arr_.size (); i++)
+ if (chord_p_)
{
- typeset_element (text_p_arr_[i]);
+ typeset_element (chord_p_);
}
- text_p_arr_.clear ();
pitch_arr_.clear ();
+ chord_p_ = 0;
tonic_req_ = 0;
inversion_req_ = 0;
bass_req_ = 0;
#include "chord.hh"
#include "musical-request.hh"
#include "warn.hh"
+#include "debug.hh"
+#include "molecule.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+SCM
+pitch2scm (Musical_pitch p)
+{
+ return gh_cons (gh_int2scm (p.notename_i_), gh_int2scm (p.accidental_i_));
+}
/*
construct from parser output
Chord
to_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p, Musical_pitch* inversion_p, Musical_pitch* bass_p)
{
- // urg: catch dim modifier: 5th and 7th should be lowered
+ // urg: catch dim modifier: 3rd, 5th, 7th, .. should be lowered
bool dim_b = false;
for (int i=0; i < add_arr_p->size (); i++)
{
dim_b = true;
}
}
- Chord::rebuild_transpose (add_arr_p, tonic);
- Chord::rebuild_transpose (sub_arr_p, tonic);
+ Chord::rebuild_transpose (add_arr_p, tonic, true);
+ Chord::rebuild_transpose (sub_arr_p, tonic, true);
- Musical_pitch fifth = tonic;
- fifth.transpose (Musical_pitch (2));
- fifth.transpose (Musical_pitch (2, -1));
+ Musical_pitch fifth = Chord::base_arr (tonic).top ();
/*
remove double adds (urg: sus4)
if (highest_step < 5)
missing_arr.push (fifth);
+ /*
+ if dim modifier is given: lower all missing
+ */
if (dim_b)
{
for (int i=0; i < missing_arr.size (); i++)
{
- missing_arr[i].accidental_i_--;
+ missing_arr[i].accidental_i_--;
}
}
/*
if additions include some 3, don't add third
*/
- Musical_pitch third = tonic;
- third.transpose (Musical_pitch (2));
+ Musical_pitch third = Chord::base_arr (tonic)[1];
if (Chord::find_notename_i (add_arr_p, third) != -1)
{
int i = Chord::find_pitch_i (&missing_arr, third);
}
Chord::Chord (Chord const& chord)
+ : Item (chord)
{
pitch_arr_ = chord.pitch_arr_;
inversion_p_ = chord.inversion_p_ ? new Musical_pitch (*chord.inversion_p_) : 0;
{
delete inversion_p_;
delete bass_p_;
+ // AAARGH, why doesn't Score_elt do this?
+ unsmobify_self ();
+}
+
+Array<Musical_pitch>
+Chord::base_arr (Musical_pitch p)
+{
+ Array<Musical_pitch> base;
+ base.push (p);
+ p.transpose (Musical_pitch (2));
+ base.push (p);
+ p.transpose (Musical_pitch (2, -1));
+ base.push (p);
+ return base;
}
void
-Chord::rebuild_transpose (Array<Musical_pitch>* pitch_arr_p, Musical_pitch tonic)
+Chord::rebuild_transpose (Array<Musical_pitch>* pitch_arr_p, Musical_pitch tonic, bool fix7_b)
{
for (int i = 0; i < pitch_arr_p->size (); i++)
{
Musical_pitch p = tonic;
Musical_pitch q = (*pitch_arr_p)[i];
- // duh, c7 should mean <c bes>
- if (q.notename_i_ == 6)
- q.accidental_i_--;
p.transpose (q);
+ // duh, c7 should mean <c bes>
+ if (fix7_b && (step_i (tonic, p) == 7))
+ p.accidental_i_--;
(*pitch_arr_p)[i] = p;
}
pitch_arr_p->sort (Musical_pitch::compare);
}
void
-Chord::find_additions_and_subtractions (Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const
+Chord::find_additions_and_subtractions (Array<Musical_pitch> pitch_arr, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const
{
- Musical_pitch tonic = pitch_arr_[0];
+ Musical_pitch tonic = pitch_arr[0];
/*
construct an array of thirds for a normal chord
*/
Array<Musical_pitch> all_arr;
all_arr.push (tonic);
- all_arr.push (pitch_arr_.top ());
+ if (step_i (tonic, pitch_arr.top ()) >= 5)
+ all_arr.push (pitch_arr.top ());
+ else
+ all_arr.push (base_arr (tonic).top ());
all_arr.concat (missing_thirds_pitch_arr (&all_arr));
all_arr.sort (Musical_pitch::compare);
int i = 0;
int j = 0;
- while ((i < all_arr.size ()) || (j < pitch_arr_.size ()))
+ Musical_pitch last_extra = tonic;
+ while ((i < all_arr.size ()) || (j < pitch_arr.size ()))
{
Musical_pitch a = all_arr [i <? all_arr.size () - 1];
- Musical_pitch p = pitch_arr_ [j <? pitch_arr_.size () - 1];
+ Musical_pitch p = pitch_arr[j <? pitch_arr.size () - 1];
/*
this pitch is present: do nothing, check next
*/
{
i++;
j++;
+ last_extra = tonic;
}
/*
found an extra pitch: chord addition
else if ((p < a) || (p.notename_i_ == a.notename_i_))
{
add_arr_p->push (p);
- (j < pitch_arr_.size ()) ? j++ : i++;
+ last_extra = p;
+ (j < pitch_arr.size ()) ? j++ : i++;
}
/*
a third is missing: chord subtraction
*/
else
{
- sub_arr_p->push (a);
+ if (last_extra.notename_i_ != a.notename_i_)
+ sub_arr_p->push (a);
(i < all_arr.size ()) ? i++ : j++;
+ last_extra = tonic;
}
}
+ /* add missing basic steps */
+ if (step_i (tonic, pitch_arr.top ()) < 3)
+ sub_arr_p->push (base_arr (tonic)[1]);
+ if (step_i (tonic, pitch_arr.top ()) < 5)
+ sub_arr_p->push (base_arr (tonic).top ());
+
/*
- add highest addition, because it names chord
- (1, 3 and) 5 not an addition: part of normal chord
+ add highest addition, because it names chord, if greater than 5
+ or non-standard
+ (1, 3 and) 5 not additions: part of normal chord
*/
- if (step_i (tonic, pitch_arr_.top () > 5))
- add_arr_p->push (pitch_arr_.top ());
+ if ((step_i (tonic, pitch_arr.top ()) > 5)
+ || pitch_arr.top ().accidental_i_)
+ add_arr_p->push (pitch_arr.top ());
}
+
/*
- TODO:
- reduce guess work: dim chord
- other naming conventions `American'?
- don't use TeX constructs
- user defined chords-names for specific chords:
- tonic, additions, subtractions, inversion, bass -> "my-chord-name"
+ word is roman text or styled text:
+ "text"
+ ("style" . "text")
*/
-String
-Chord::banter_str () const
+Molecule
+Chord::ly_word2molecule (SCM scm) const
{
- Musical_pitch tonic = pitch_arr_[0];
+ String style;
+ if (gh_pair_p (scm))
+ {
+ style = ly_scm2string (gh_car (scm));
+ scm = gh_cdr (scm);
+ }
+ String text = ly_scm2string (scm);
+ return lookup_l ()->text (style, text, paper_l ());
+}
+
+/*
+ scm is word or list of words:
+ word
+ (word word)
+ */
+Molecule
+Chord::ly_text2molecule (SCM scm) const
+{
+ Molecule mol;
+ if (gh_list_p (scm))
+ {
+ while (gh_cdr (scm) != SCM_EOL)
+ {
+ mol.add_at_edge (X_AXIS, RIGHT,
+ ly_word2molecule (gh_car (scm)), 0);
+ scm = gh_cdr (scm);
+ }
+ scm = gh_car (scm);
+ }
+ mol.add_at_edge (X_AXIS, RIGHT,
+ ly_word2molecule (scm), 0);
+ return mol;
+}
+
+Molecule
+Chord::pitch2molecule (Musical_pitch p) const
+{
+ SCM name = scm_eval (gh_list (gh_symbol2scm ("user-pitch-name"), ly_quote_scm (pitch2scm (p)), SCM_UNDEFINED));
- //urg, should do translation in scheme.
- char const *acc[] = {"\\textflat\\textflat ", "\\textflat ", "", "\\textsharp " , "\\textsharp\\textsharp "};
- String tonic_str = tonic.str ();
- tonic_str = tonic_str.left_str (1).upper_str ()
- + acc[tonic.accidental_i_ + 2];
+ if (name != SCM_UNSPECIFIED)
+ {
+ return ly_text2molecule (name);
+ }
+
+ Molecule mol = lookup_l ()->text ("", p.str ().left_str (1).upper_str (), paper_l ());
+ if (p.accidental_i_)
+ // urg, how to select the feta-1 font?
+ mol.add_at_edge (X_AXIS, RIGHT,
+ lookup_l ()->accidental (p.accidental_i_, 0), 0);
+ return mol;
+}
+
+Musical_pitch
+diff_pitch (Musical_pitch tonic, Musical_pitch p)
+{
+ Musical_pitch diff (p.notename_i_ - tonic.notename_i_,
+ p.accidental_i_ - tonic.accidental_i_,
+ p.octave_i_ - tonic.octave_i_);
+
+ while (diff.notename_i_ >= 7)
+ {
+ diff.notename_i_ -= 7;
+ diff.octave_i_ ++;
+ }
+ while (diff.notename_i_ < 0)
+ {
+ diff.notename_i_ += 7;
+ diff.octave_i_ --;
+ }
+
+ diff.accidental_i_ -= (tonic.semitone_pitch () + diff.semitone_pitch ())
+ - p.semitone_pitch ();
+
+ return diff;
+}
+bool
+Chord::user_chord_name (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const
+{
+ SCM chord = SCM_EOL;
+ Array<Musical_pitch> chord_type = pitch_arr;
+ rebuild_transpose (&chord_type, diff_pitch (pitch_arr[0], Musical_pitch (0)), false);
+
+ for (int i= chord_type.size (); i--; )
+ chord = gh_cons (pitch2scm (chord_type[i]), chord);
+
+ SCM name = scm_eval (gh_list (gh_symbol2scm ("user-chord-name"), ly_quote_scm (chord), SCM_UNDEFINED));
+ if (name != SCM_UNSPECIFIED)
+ {
+ name_p->modifier_mol = ly_text2molecule (gh_car (name));
+ name_p->addition_mol = ly_text2molecule (gh_cdr (name));
+ return true;
+ }
+ return false;
+}
+
+void
+Chord::banter (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const
+{
Array<Musical_pitch> add_arr;
Array<Musical_pitch> sub_arr;
- find_additions_and_subtractions (&add_arr, &sub_arr);
+ find_additions_and_subtractions (pitch_arr, &add_arr, &sub_arr);
-
Array<Musical_pitch> scale;
for (int i=0; i < 7; i++)
scale.push (Musical_pitch (i));
- // 7 always means 7-...
- // scale.push (Musical_pitch (6, -1)); // b
-
- rebuild_transpose (&scale, tonic);
+ Musical_pitch tonic = pitch_arr[0];
+ rebuild_transpose (&scale, tonic, true);
- bool has3m_b = false;
- bool has4_b = false;
- bool has5m_b = false;
- String str;
- String minor_str;
+ /*
+ Does chord include this step? -1 if flat
+ */
+ int has[16];
+ for (int i=0; i<16; i++)
+ has[i] = 0;
+
+ String mod_str;
+ String add_str;
String sep_str;
for (int i = 0; i < add_arr.size (); i++)
{
Musical_pitch p = add_arr[i];
int step = step_i (tonic, p);
- if (step == 4)
- has4_b = true;
int accidental = p.accidental_i_ - scale[(step - 1) % 7].accidental_i_;
+ if ((step < 16) && (has[step] != -1))
+ has[step] = accidental == -1 ? -1 : 1;
if ((step == 3) && (accidental == -1))
{
- minor_str = "m";
- has3m_b = true;
+ mod_str = "m";
}
/*
- have Cdim rather than Cm5-, even if it's a prefix
+ urg.
+ This routine gets a lot simpler, if we don't try to be catch
+ the 'dim' chords. However, we'll have to list every exceptional
+ 'dim' chord in scm: otherwise we'll get stuff like Cdim7-, iso
+ Cdim7, etc
*/
- else if ((step == 5) && (accidental == -1) && has3m_b)
+#ifdef SMART_DIM
+ else if ((step == 5) && (accidental == -1) && (has[3] == -1))
{
- minor_str = "dim";
- has5m_b = true;
+ mod_str = "dim";
}
+#endif
else if (accidental
- || (!(step % 2) || ((i + 1 == add_arr.size ()) && (step > 5))))
+ || (!(step % 2)
+ || ((i == add_arr.size () - 1) && (step > 5))))
{
- str += sep_str;
+ add_str += sep_str;
sep_str = "/";
if ((step == 7) && (accidental == 1))
{
- str += "maj7";
+ add_str += "maj7";
}
else
- {
- /*
- if has3m_b and has5m_b, assume dim
- don't mention dim-addition, except for chord-namer
- */
- if (((step/2) && (accidental == -1))
- && has3m_b && has5m_b)
- {
- if (i == add_arr.size () - 1)
- str += to_str (step);
- else
+#ifdef SMART_DIM
+ {
+ if ((step % 2) && (accidental == -1)
+ && (has[3] == -1) && (has[5] == -1))
+ {
+ if (i != add_arr.size () - 1)
sep_str = "";
+ else
+ add_str += to_str (step);
}
else
+#endif
{
- str += to_str (step);
- if (accidental)
- str += accidental < 0 ? "-" : "+";
+ add_str += to_str (step);
+ if (accidental)
+ add_str += accidental < 0 ? "-" : "+";
}
- }
+#ifdef SMART_DIM
+ }
+#endif
}
}
Musical_pitch p = sub_arr[i];
int step = step_i (tonic, p);
/*
- if chord has 3-, assume minor and don't display 'no3'
- if additions include 4, assume sus4 and don't display 'no3'
- if has3m_b and has5m_b, assume 'dim' chord
+ if additions include 2 or 4, assume sus2/4 and don't display 'no3'
*/
- if (!((step == 3) && (has3m_b || has4_b))
- && !((step/2) && (step !=3) && (step !=7 ) && (p.accidental_i_ == 0) && has3m_b && has5m_b)
- && !((step == 7) && (p.accidental_i_ == -1) && has3m_b && has5m_b))
+ if (!((step == 3) && (has[2] || has[4])))
{
- str += sep_str + "no" + to_str (step);
+ add_str += sep_str + "no" + to_str (step);
sep_str = "/";
}
}
- /*
- have Co rather than Cdim7
- */
- if (minor_str + str == "dim7")
- {
- minor_str = "";
- str = "o";
- }
-
-
- String inversion_str;
- if (inversion_p_)
+ if (mod_str.length_i ())
+ name_p->modifier_mol.add_at_edge (X_AXIS, RIGHT,
+ lookup_l ()->text ("roman", mod_str, paper_l ()), 0);
+ if (add_str.length_i ())
{
- inversion_str = inversion_p_->str ();
- inversion_str = "/" + inversion_str.left_str (1).upper_str ()
- + acc[inversion_p_->accidental_i_ + 2];
+ if (!name_p->addition_mol.empty_b ())
+ add_str = "/" + add_str;
+ name_p->addition_mol.add_at_edge (X_AXIS, RIGHT,
+ lookup_l ()->text ("script", add_str, paper_l ()), 0);
}
-
- String bass_str;
- if (bass_p_)
- {
- bass_str = bass_p_->str ();
- bass_str = "/" + bass_str.left_str (1).upper_str ()
- + acc[bass_p_->accidental_i_ + 2];
-
- }
-
- return tonic_str + minor_str + "$^{" + str + "}$" + inversion_str + bass_str;
}
+
int
Chord::find_tonic_i (Array<Musical_pitch> const* pitch_arr_p)
{
bass.octave_i_--;
pitch_arr_p->insert (bass, 0);
}
+
+Molecule*
+Chord::do_brew_molecule_p () const
+{
+ Musical_pitch tonic = pitch_arr_[0];
+
+ Chord_name name;
+ name.tonic_mol = pitch2molecule (tonic);
+
+ /*
+ if user has explicitely listed chord name, use that
+
+ TODO
+ urg
+ maybe we should check all sub-lists of pitches, not
+ just full list and base triad?
+ */
+ if (!user_chord_name (pitch_arr_, &name))
+ {
+ /*
+ else, check if user has listed base triad
+ use user base name and add banter for remaining part
+ */
+ if ((pitch_arr_.size () > 2)
+ && user_chord_name (pitch_arr_.slice (0, 3), &name))
+ {
+ Array<Musical_pitch> base = base_arr (tonic);
+ base.concat (pitch_arr_.slice (3, pitch_arr_.size ()));
+ banter (base, &name);
+ }
+ /*
+ else, use pure banter
+ */
+ else
+ {
+ banter (pitch_arr_, &name);
+ }
+ }
+
+ if (inversion_p_)
+ {
+ name.inversion_mol = lookup_l ()->text ("", "/", paper_l ());
+ // zucht const&
+ Molecule mol = pitch2molecule (*inversion_p_);
+ name.inversion_mol.add_at_edge (X_AXIS, RIGHT, mol, 0);
+ }
+
+ if (bass_p_)
+ {
+ name.bass_mol = lookup_l ()->text ("", "/", paper_l ());
+ Molecule mol = pitch2molecule (*bass_p_);
+ name.bass_mol.add_at_edge (X_AXIS, RIGHT, mol, 0);
+ }
+
+ // urg, howto get a good superscript_y?
+ Real super_y = lookup_l ()->text ("", "x", paper_l ()).dim_.y ().length ()/2;
+ if (!name.addition_mol.empty_b ())
+ name.addition_mol.translate (Offset (0, super_y));
+
+ Molecule* mol_p = new Molecule;
+ mol_p->add_at_edge (X_AXIS, RIGHT, name.tonic_mol, 0);
+ // huh?
+ if (!name.modifier_mol.empty_b ())
+ mol_p->add_at_edge (X_AXIS, RIGHT, name.modifier_mol, 0);
+ if (!name.addition_mol.empty_b ())
+ mol_p->add_at_edge (X_AXIS, RIGHT, name.addition_mol, 0);
+ if (!name.inversion_mol.empty_b ())
+ mol_p->add_at_edge (X_AXIS, RIGHT, name.inversion_mol, 0);
+ if (!name.bass_mol.empty_b ())
+ mol_p->add_at_edge (X_AXIS, RIGHT, name.bass_mol, 0);
+ return mol_p;
+}
+
+void
+Chord::do_print () const
+{
+#ifndef NPRINT
+ //DEBUG_OUT << "chord = " ...
+#endif
+}
Mats Bengtsson <matsb@s3.kth.se>
*/
+/*
+ CLEAN ME UP.
+ */
#include <ctype.h>
#include "bar.hh"
#include "clef-engraver.hh"
create_default_b_ = true;
}
-/*
- PUT THIS IN GUILE!
- */
-struct Clef_settings {
- char const *name;
- char const *cleftype;
- int position;
-} clef_settings[] = {
- {"treble", "treble", -2},
- {"violin", "treble", -2},
- {"G", "treble", -2},
- {"G2", "treble", -2},
- {"french", "treble",-4 },
- {"soprano", "alto",-4 },
- {"mezzosoprano", "alto",-2 },
- {"alto", "alto",0 },
- {"tenor", "alto",2 },
- {"baritone", "alto",4 },
- {"varbaritone", "bass",0 },
- {"bass" , "bass",2 },
- {"F", "bass", 2},
- {"subbass", "bass",4},
- {0,0,0}
-};
-
bool
Clef_engraver::set_type (String s)
{
else
octave_dir_ = CENTER;
- bool found = 0;
- for (Clef_settings *c = clef_settings; !found && c->name; c++)
+ bool found = false;
+ SCM c = get_property ("supportedClefTypes",0);
+ for (; gh_pair_p(c); c = gh_cdr (c))
{
- if (c->name == s)
- {
- clef_type_str_ = c->cleftype;
- clef_position_i_ = c->position;
- found = 1;
- }
- }
+ SCM entry = gh_car (c);
+ SCM name = gh_car (entry);
+ if (ly_scm2string (name) != s)
+ continue;
+
+ SCM glyph = gh_cadr (entry);
+ SCM pos = gh_caddr (entry);
+
+ clef_type_str_ = ly_scm2string (glyph);
+ clef_position_i_ = gh_scm2int (pos);
+ found = true;
+ break;
+ }
+
if (!found)
{
switch(toupper (s[0]))
if (dynamic_cast<Bar*>(info.elem_l_)
&& clef_type_str_.length_i())
{
- bool def = !clef_p_;
+ bool default_clef = !clef_p_;
create_clef();
- if(def)
+ if(!default_clef)
clef_p_->set_elt_property("visibility-lambda",
- ly_ch_C_eval_scm ("postbreak_only_visibility"));
+ ly_ch_C_eval_scm ("all-visibility"));
}
/* ugh; should make Clef_referenced baseclass */
{
if (Note_head * h = dynamic_cast<Note_head*>(it_l))
{
- // h->position_i_ += c0_position_i_;
- h->position_i_ += c0_position_i_;
+ h->set_position (int (h->position_f ()) + c0_position_i_);
}
else if (Local_key_item *i = dynamic_cast<Local_key_item*> (it_l))
{
}
clef_p_->symbol_ = clef_type_str_;
- clef_p_->y_position_i_ = clef_position_i_;
+ clef_p_->set_position(clef_position_i_);
if (octave_dir_)
{
clef_p_->set_elt_property ("octave-dir", gh_int2scm (octave_dir_));
else
set_type ( "treble");
create_clef ();
- create_default_b_ =0;
+ create_default_b_ = false;
}
}
void
Clef_item::do_pre_processing()
{
- translate_axis (y_position_i_ * staff_line_leading_f () / 2.0, Y_AXIS);
+ Staff_symbol_referencer::do_pre_processing();
SCM style_sym =get_elt_property ("style");
String style;
if (style_sym != SCM_UNDEFINED)
set_elt_property ("breakable", SCM_BOOL_T);
symbol_ = "treble";
- y_position_i_ = -2;
+ set_position(-2);
}
void
--- /dev/null
+/*
+ directional-element.cc -- implement Directional_element
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "directional-element.hh"
+#include "property-inspect.hh"
+
+Directional_element::Directional_element ()
+{
+}
+
+Direction
+Directional_element::get_direction () const
+{
+ // return dir_;
+ SCM d= get_elt_property ("direction");
+ if (!isdir_b(d))
+ return CENTER;
+
+ return to_dir (d);
+}
+
+void
+Directional_element::set_direction (Direction d)
+{
+ set_elt_property ("direction", gh_int2scm (d));
+}
set_direction (get_default_dir());
}
-Directional_spanner::Directional_spanner()
-{
- set_direction (CENTER);
-}
Offset
Directional_spanner::center () const
int
Dot_column::compare (Dots * const &d1, Dots * const &d2)
{
- return d1->position_i_ - d2->position_i_;
+ return int (d1->position_f () - d2->position_f ());
}
void
for (int i=0; i < dot_l_arr_.size (); i++)
{
for (int j=0; j < taken_posns.size (); j++)
- if (taken_posns[j] == dot_l_arr_[i]->position_i_)
+ if (taken_posns[j] == (int) dot_l_arr_[i]->position_f ())
conflicts++;
- taken_posns.push (dot_l_arr_[i]->position_i_);
- s.unite (Slice (dot_l_arr_[i]->position_i_,dot_l_arr_[i]->position_i_));
+ taken_posns.push ((int)dot_l_arr_[i]->position_f ());
+ s.unite (Slice ((int)dot_l_arr_[i]->position_f (),
+ (int)dot_l_arr_[i]->position_f ()));
}
if (!conflicts)
for (int i=0; i <dot_l_arr_.size (); pos += 2, i++)
{
- dot_l_arr_[i]->position_i_ = pos;
+ dot_l_arr_[i]->set_position(pos);
}
}
Dots::Dots ()
{
dots_i_ =0;
- position_i_ =0;
resolve_dir_ =CENTER;
}
{
Molecule *out = new Molecule;
Molecule fill = lookup_l ()->fill (Box (Interval (0,0),
- Interval (0,0)));
+ Interval (0,0)));
out->add_molecule (fill);
Molecule d = lookup_l ()->dots ();
#include "item.hh"
#include "staff-symbol-referencer.hh"
#include "parray.hh"
+#include "directional-element.hh"
-class Breathing_sign : public Item, public Staff_symbol_referencer {
+class Breathing_sign : public Item,
+ public Staff_symbol_referencer,
+ public Directional_element
+{
public:
VIRTUAL_COPY_CONS(Score_element);
Breathing_sign ();
void set_vertical_position (Direction);
- void set_direction (Direction d ) { dir_ = d; }
- Direction get_direction () const { return dir_; }
protected:
virtual void do_post_processing ();
virtual Molecule* do_brew_molecule_p () const;
-
-private:
- Direction dir_;
};
+
+
#endif // BREATHING_SIGN_HH
private:
Array<Musical_pitch> pitch_arr_;
- Link_array<Item> text_p_arr_;
- Array<Musical_pitch> rebuild_pitch_arr (int tonic_i) const;
+ Chord* chord_p_;
Tonic_req* tonic_req_;
Inversion_req* inversion_req_;
Bass_req* bass_req_;
#include "array.hh"
#include "musical-pitch.hh"
#include "lily-proto.hh"
+#include "item.hh"
+#include "molecule.hh"
-class Chord
+class Chord_name
{
public:
+ Molecule tonic_mol;
+ Molecule modifier_mol;
+ Molecule addition_mol;
+ Molecule inversion_mol;
+ Molecule bass_mol;
+};
+
+class Chord : public Item
+{
+public:
+ VIRTUAL_COPY_CONS (Score_element);
+ static Array<Musical_pitch> base_arr (Musical_pitch p);
static int find_tonic_i (Array<Musical_pitch> const*);
static int find_pitch_i (Array<Musical_pitch> const*, Musical_pitch p);
static int find_notename_i (Array<Musical_pitch> const*, Musical_pitch p);
static Array<Musical_pitch> missing_thirds_pitch_arr (Array<Musical_pitch> const* pitch_arr_p);
static void rebuild_from_base (Array<Musical_pitch>*, int base_i);
static void rebuild_insert_inversion (Array<Musical_pitch>*, int tonic_i);
- static void rebuild_transpose (Array<Musical_pitch>*, Musical_pitch tonic);
+ static void rebuild_transpose (Array<Musical_pitch>*, Musical_pitch tonic, bool fix7_b);
static void rebuild_with_bass (Array<Musical_pitch>*, int bass_i);
static int step_i (Musical_pitch tonic, Musical_pitch p);
Chord (Array<Musical_pitch> pitch_arr, Musical_pitch* inversion_p, Musical_pitch* bass_p);
- Chord (Chord const& chord);
- ~Chord ();
+ Chord (Chord const&);
+ virtual ~Chord ();
Array<Musical_pitch> to_pitch_arr () const;
- String banter_str () const;
- void find_additions_and_subtractions(Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const;
+ void find_additions_and_subtractions(Array<Musical_pitch> pitch_arr, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const;
+
+ Molecule ly_word2molecule (SCM scm) const;
+ Molecule ly_text2molecule (SCM scm) const;
+ Molecule pitch2molecule (Musical_pitch p) const;
+ bool user_chord_name (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const;
+ void banter (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const;
Array<Musical_pitch> pitch_arr_;
Musical_pitch* inversion_p_;
Musical_pitch* bass_p_;
+
+protected:
+ virtual Molecule* do_brew_molecule_p () const;
+ virtual void do_print () const;
};
Chord to_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p, Musical_pitch* inversion_p, Musical_pitch* bass_p);
public:
String symbol_;
- int y_position_i_;
VIRTUAL_COPY_CONS(Score_element);
Clef_item();
--- /dev/null
+/*
+ directional-element.hh -- declare Directional_element
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef DIRECTIONAL_ELEMENT_HH
+#define DIRECTIONAL_ELEMENT_HH
+
+#include "score-element.hh"
+
+struct Directional_element : public virtual Score_element
+{
+ void set_direction (Direction d);
+ Direction get_direction () const;
+
+ VIRTUAL_COPY_CONS(Score_element);
+ Directional_element ();
+};
+
+#endif /* DIRECTIONAL_ELEMENT_HH */
+
#define DIRECTIONALSPANNER_HH
#include "spanner.hh"
+#include "directional-element.hh"
/** a spanner which can be pointing "up" or "down".
JUNKME?
*/
-class Directional_spanner : public Spanner{
- /// -1 below heads, +1 above heads.
- Direction dir_;
-
+class Directional_spanner : public Spanner, public Directional_element {
public:
- Directional_spanner();
-
- void set_direction (Direction d ) { dir_ = d; }
- Direction get_direction () const { return dir_; }
/// offset of "center" relative to left-column/0-pos of staff
virtual Offset center() const;
virtual void do_post_processing ();
public:
int dots_i_;
- int position_i_;
Direction resolve_dir_;
Dots ();
virtual ~Paper_def ();
Array<Interval> shape_int_a_;
+ /*
+ JUNKME
+ */
Real get_realvar (SCM symbol) const;
Real get_var (String id) const;
class Rest : public Rhythmic_head
{
public:
- Rest ();
void add_dots (Dots*);
protected:
virtual void do_add_processing ();
public:
Stem * stem_l_;
int balltype_i_;
- int position_i_;
Dots * dots_l_;
Rhythmic_head ();
int dots_i ()const;
- virtual Real position_f () const;
protected:
virtual void do_post_processing ();
- virtual void do_pre_processing ();
+
virtual void do_print () const;
virtual void do_substitute_element_pointer (Score_element*,Score_element*);
};
A bar that is on a staff.
Ugh. Entita non multiplicandum ...
*/
-class Staff_bar : public Bar , public Staff_symbol_referencer
+class Staff_bar : public Bar, public Staff_symbol_referencer
{
public:
+ virtual void do_pre_processing ();
VIRTUAL_COPY_CONS(Score_element);
virtual Real get_bar_size () const;
};
#include "spanner.hh"
#include "item.hh"
#include "staff-symbol-referencer.hh"
+#include "directional-element.hh"
/**
Position myself next to a set of elements. Configurable in axis
Amount of extra space to add.
*/
-class Staff_side_element : public Staff_symbol_referencer
+class Staff_side_element : public Staff_symbol_referencer,
+ public Directional_element
{
void position_self ();
- Direction dir_;
+
public:
Score_element * to_position_l_;
- void set_direction (Direction d ) { dir_ = d; }
- Direction get_direction () const { return dir_; }
-
Link_array<Score_element> support_l_arr_;
Axis axis_;
{
protected:
Staff_symbol * staff_sym_l_;
-
+ int position_i_;
public:
Staff_symbol_referencer ();
+ void set_position (int);
+
void set_staff_symbol (Staff_symbol*);
/**
Leading are the lead strips between the sticks (lines) of
Staff_symbol * staff_symbol_l () const;
int lines_i () const;
virtual void do_substitute_element_pointer (Score_element*,Score_element*);
-
+ virtual void do_pre_processing ();
virtual Real position_f () const;
};
#include "moment.hh"
#include "molecule.hh"
#include "staff-symbol-referencer.hh"
+#include "directional-element.hh"
/**the rule attached to the ball.
takes care of:
*/
// todo: remove baseclass Staff_symbol_referencer, since stem
// can be across a staff.
-class Stem : public Item, public Staff_symbol_referencer {
+class Stem : public Item, public Staff_symbol_referencer,
+ public Directional_element
+{
/**extent of the stem (positions).
fractional, since Beam has to adapt them.
*/
Drul_array<Real> yextent_drul_;
- /// direction stem (that's me)
- Direction dir_;
-
public:
- void set_direction (Direction d);
- Direction get_direction () const { return dir_; }
Link_array<Note_head> head_l_arr_;
Link_array<Rest> rest_l_arr_;
{
bool def = (!item_p_);
create_key ();
- if (def)
+ if (!def)
{
item_p_->set_elt_property ("visibility-lambda",
- ly_ch_C_eval_scm ("postbreak_only_visibility"));
+ ly_ch_C_eval_scm ("all-visibility"));
}
}
return SCM_BOOL_T;
}
+SCM
+ly_isdir_p (SCM s)
+{
+ if (gh_number_p (s))
+ {
+ int i = gh_scm2int (s);
+ return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F;
+ }
+ return SCM_BOOL_F;
+}
+
+
void
init_functions ()
{
scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning);
scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file);
+ scm_make_gsubr ("dir?", 1,0, 0, (SCM(*)(...))ly_isdir_p);
}
ADD_SCM_INIT_FUNC(funcs, init_functions);
if (balltype_i_ > 2)
balltype_i_ = 2;
if (dots_l_) // move into Rhythmic_head?
- dots_l_->position_i_ = int (position_f ());
+ dots_l_->set_position(int (position_f ()));
}
String type;
- SCM style =get_elt_property ("style");
+ SCM style = get_elt_property ("style");
if (style != SCM_UNDEFINED)
{
type = ly_scm2string (style);
announce_element (Score_element_info (d,0));
dot_p_arr_.push (d);
}
- note_p->position_i_ = note_req_l->pitch_.steps ();
+ note_p->set_position(note_req_l->pitch_.steps ());
/*
TODO: transparent note heads.
if (a_off.length () > 100 CM)
{
- warning (_f ("improbable offset for object type: `%s'", nm));
+ programming_error ("improbable offset for object");
Axis a =X_AXIS;
while (a < NO_AXES)
{
- if (abs(a_off[a]) > 50 CM)
- a_off[a] = 50 CM;
+ if (abs(a_off[a]) > 30 CM)
+ a_off[a] = 30 CM;
incr (a);
}
}
void
Paper_outputter::start_line (Real height)
{
+ if (height > 50 CM)
+ {
+ programming_error ("Improbable system height");
+ height = 50 CM;
+ }
SCM scm = gh_list (ly_symbol ("start-line"),
gh_double2scm (height),
SCM_UNDEFINED);
{
if (Note_head *nh = dynamic_cast<Note_head *> (i.elem_l_))
{
- nh->position_i_ =0;
+ nh->set_position(0);
}
}
{
if (gh_number_p (s))
{
- int i = gh_int2scm (s);
+ int i = gh_scm2int (s);
return i>= -1 && i <= 1;
}
return false;
Rest::do_add_processing ()
{
if (balltype_i_ == 0)
- position_i_ += 2;
+ position_i_ += 2; // guh.
Rhythmic_head::do_add_processing ();
}
Rest::do_post_processing ()
{
Rhythmic_head::do_post_processing ();
- if (dots_l_ && balltype_i_ > 4)
+ if (dots_l_
+ && balltype_i_ > 4) // UGH.
{
- dots_l_->position_i_ += 3;
+ /*
+ UGH.
+ */
if (balltype_i_ == 7)
- dots_l_->position_i_++;
+ dots_l_->set_position (4);
+ else
+ dots_l_->set_position (3);
}
}
-Rest::Rest ()
-{
- position_i_ =0;
-}
Molecule *
Rest::do_brew_molecule_p () const
if (balltype_i_ == 0 || balltype_i_ == 1)
ledger_b = abs(position_f () - (2* balltype_i_ - 1)) > lines_i ();
-
String style;
{
if (dots_l_)
{
- dots_l_->position_i_ = int (position_f ());
+ dots_l_->set_position(int (position_f ()));
}
}
-void
-Rhythmic_head::do_pre_processing ()
-{
- translate_axis (position_i_ * staff_line_leading_f () /2.0, Y_AXIS);
- position_i_ = 0;
-}
-
-Real
-Rhythmic_head::position_f () const
-{
- return position_i_ + Staff_symbol_referencer::position_f ();
-}
-
void
Rhythmic_head::add_dots (Dots *dot_l)
dots_l_ =0;
balltype_i_ =0;
stem_l_ =0;
- position_i_ =0;
}
void
void
Slur_engraver::do_pre_move_processing()
{
- SCM dir (get_property ("slurVerticalDirection", 0));
- SCM dir2 (get_property ("verticalDirection", 0));
-
- Direction slurdir = CENTER;
- if (gh_number_p(dir))
- slurdir = to_dir (dir);
- else if (gh_number_p (dir2))
- slurdir = to_dir (dir2);
-
for (int i = 0; i < end_slur_l_arr_.size(); i++)
{
- end_slur_l_arr_[i]->set_direction (slurdir);
typeset_element (end_slur_l_arr_[i]);
}
end_slur_l_arr_.clear();
bool err = false;
Real correction = 0.0;
- Real ssc = paper_l ()->get_realvar(ly_symbol ("stemSpacingCorrection"));
+ Real ssc = paper_l ()->get_var("stemSpacingCorrection");
if (d1 && d2)
return (lines_i () -1) * staff_line_leading_f ();
}
+void
+Staff_bar::do_pre_processing ()
+{
+ Bar::do_pre_processing ();
+ Staff_symbol_referencer::do_pre_processing ();
+}
{
axis_ = X_AXIS;
type_ = "margin";
- visibility_lambda_ = ly_ch_C_eval_scm ("postbreak_only_visibility");
+ visibility_lambda_ = ly_ch_C_eval_scm ("postbreak-only-visibility");
}
Staff_side_element::Staff_side_element ()
{
- set_direction (CENTER);
to_position_l_ = 0;
set_elt_property ("transparent", SCM_BOOL_T);
axis_ = Y_AXIS;
Staff_symbol_referencer::Staff_symbol_referencer ()
{
staff_sym_l_ =0;
+ position_i_ =0;
}
void
Real
Staff_symbol_referencer::position_f () const
{
- if (!staff_sym_l_ )
- return 0;
+ Real p = position_i_;
+ if (staff_sym_l_ )
+ {
+ Graphical_element * c = common_refpoint (staff_sym_l_, Y_AXIS);
+ Real y = relative_coordinate (c, Y_AXIS) - staff_sym_l_->relative_coordinate (c, Y_AXIS);
+
+ p += 2.0 * y / staff_line_leading_f ();
+ }
+ return p;
+}
+
- Graphical_element * c = common_refpoint (staff_sym_l_, Y_AXIS);
- Real y = relative_coordinate (c, Y_AXIS) - staff_sym_l_->relative_coordinate (c, Y_AXIS);
- return 2.0 * y / staff_line_leading_f ();
+void
+Staff_symbol_referencer::do_pre_processing ()
+{
+ translate_axis (position_i_ * staff_line_leading_f () /2.0, Y_AXIS);
+ position_i_ =0;
}
+
+void
+Staff_symbol_referencer::set_position (int p)
+{
+ /*
+ UGH. Use position_f() as well.
+ */
+ position_i_ = p;
+
+}
if (stem_p_)
{
- SCM prop = get_property ("verticalDirection", 0);
- if (gh_number_p(prop))
- {
- stem_p_->set_direction (to_dir (prop));
- stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T);
- }
-
Translator_group* which;
- prop = get_property ("stemLeftBeamCount", &which);
+ SCM prop = get_property ("stemLeftBeamCount", &which);
if (gh_number_p(prop))
{
stem_p_->beams_i_drul_[LEFT] = gh_scm2int (prop);
stem_p_->beams_i_drul_[RIGHT] = gh_scm2int (prop);
((Translator_group*)which)->set_property ("stemRightBeamCount", SCM_UNDEFINED);
}
+
+ // UGH. Should mark non-forced instead.
+ SCM dir = stem_p_->get_elt_property ("direction");
+ if (gh_number_p (dir) && gh_int2scm (dir))
+ {
+ stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T);
+ }
+
+
typeset_element(stem_p_);
stem_p_ = 0;
}
#include "beam.hh"
#include "rest.hh"
-void
-Stem::set_direction (Direction d)
-{
- if (!get_direction ())
- warning (_ ("stem direction set already!"));
-
- dir_ = d;
-
- /*
- todo
- */
-}
-
Stem::Stem ()
{
beams_i_drul_[LEFT] = beams_i_drul_[RIGHT] = -1;
yextent_drul_[DOWN] = yextent_drul_[UP] = 0;
flag_i_ = 2;
- set_direction (CENTER);
beam_l_ = 0;
}
}
now_heads_.clear ();
- SCM dir (get_property ("tieVerticalDirection", 0));
- SCM dir2 (get_property ("verticalDirection", 0));
-
- Direction tie_dir = CENTER;
- if (gh_number_p(dir))
- tie_dir = to_dir (dir);
- else if (isdir_b (dir2))
- tie_dir = to_dir (dir2);
-
for (int i=0; i< tie_p_arr_.size (); i++)
{
- tie_p_arr_[i]->set_direction (tie_dir);
typeset_element (tie_p_arr_[i]);
}
tie_p_arr_.clear ();
chord modifiers
%}
+#(eval-string (ly-gulp-file "chord-names.scm"))
+
\chordmodifiers {
m = \musicalpitch { 0 2 -1 }
min = \musicalpitch { 0 2 -1 }
% Bar_engraver must be first so default bars aren't overwritten
% with empty ones.
\consists "Repeat_engraver";
+
+
+ % name, glyph id, c0 position
+ supportedClefTypes = #'(
+ ("treble" "treble" -2)
+ ("violin" "treble" -2)
+ ("G" "treble" -2)
+ ("G2" "treble" -2)
+ ("french" "treble" -4 )
+ ("soprano" "alto" -4 )
+ ("mezzosoprano" "alto" -2 )
+ ("alto" "alto" 0 )
+ ("tenor" "alto" 2 )
+ ("baritone" "alto" 4 )
+ ("varbaritone" "bass" 0)
+ ("bass" "bass" 2 )
+ ("F" "bass" 2)
+ ("subbass" "bass" 4)
+ )
+
\consists "Clef_engraver";
\consists "Key_engraver";
\consists "Time_signature_engraver";
font_large = 8.;
font_Large = 6.;
font_normal = 5.;
+ font_script = 4.;
font_finger = 4.;
font_volta = 4.;
font_dynamic = 10.;
font_mark = 6.;
magnification_dynamic = -4.0;
+
-1=\font "feta11"
-2=\font "feta11"
0=\font "feta11"
+ "font_feta-2" = 11.;
+ "font_feta-1" = 11.;
+ "font_feta" = 11.;
+
\include "params.ly";
}
font_large = 8.;
font_Large = 6.;
font_normal = 5.;
+ font_script = 4.;
font_finger = 4.;
font_volta = 4.;
0=\font "feta13"
-1=\font "feta11"
+
+ "font_feta-2" = 11.;
+ "font_feta-1" = 11.;
+ "font_feta" = 13.;
\include "params.ly";
}
font_large = 12.;
font_Large = 10.;
font_normal = 8.;
+ font_script = 7.;
+
magnification_dynamic = 1.0;
font_finger = 4.;
font_volta = 5.;
-1 = \font "feta13"
-2 = \font "feta11"
+ "font_feta-2" = 11.;
+ "font_feta-1" = 13.;
+ "font_feta" = 16.;
+
\include "params.ly";
}
font_large = 12.;
font_Large = 12.;
font_normal = 10.;
+ font_script = 8.;
font_finger = 5.;
font_volta = 8.;
-1 = \font "feta16"
0 = \font "feta20"
+ "font_feta-2" = 13.;
+ "font_feta-1" = 16.;
+ "font_feta" = 20.;
+
\include "params.ly";
}
font_large = 12.;
font_Large = 12.;
font_normal = 10.;
+ font_script = 8.;
font_finger = 5.;
font_volta = 8.;
-1 = \font "feta20"
0 = \font "feta23"
+ "font_feta-2" = 16.;
+ "font_feta-1" = 20.;
+ "font_feta" = 23.;
+
\include "params.ly";
}
font_large = 14.;
font_Large = 17.;
font_normal = 12.;
+ font_script = 10.;
+
font_dynamic = 10.;
% Ugh
magnification_dynamic = 4.;
0=\font "feta26"
-1 = \font "feta23"
-2 = \font "feta20"
+
+ "font_feta-2" = 20.;
+ "font_feta-1" = 23.;
+ "font_feta" = 26.;
+
\include "params.ly";
}
#'beam-dir-algorithm = #'majority %urg.
+#'Clef_item::visibility-lambda = #postbreak-only-visibility
+#'Key_item::visibility-lambda = #postbreak-only-visibility
+#'Breathing_sign::visibility-lambda = #non-postbreak-visibility
+
+
%{
dit(code(beam_dir_algorithm)) Specify algorithm for determining
whether beams go up or down. It is real valued. If set to 2.0 then
%hmm, (these) abbrevs suck, imo
% i guess they're meant as some form of doco
% that's what i use them for...
+
stemup = \property Voice.verticalDirection = \up
stemboth= \property Voice.verticalDirection = \center
stemdown = \property Voice.verticalDirection = \down
Begin3
Title: LilyPond
-Version: 1.3.3
-Entered-date: 03NOV99
+Version: 1.3.4
+Entered-date: 08NOV99
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.3.tar.gz
+ 1000k lilypond-1.3.4.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.3.tar.gz
+ 1000k lilypond-1.3.4.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.3
+Version: 1.3.4
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.3.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.4.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl>
--- /dev/null
+;; pitch: (notename . accidental)
+;; list: (list-of-pitches . (modifier-string . addition-subtraction-string))
+
+;; if a complete chord is found, use name
+;; if a chord's base triad is found (c e g), use name
+
+(define pitch-names-alist '())
+(set! pitch-names-alist
+ (append
+ '(
+ ; use these for German naming
+ ;((6 . 0) . ("H" ""))
+ ;((6 . -1) . ("B" ("feta-1" . "\12")))
+
+ ; urg, temp hack for accidental size: can't set from Chord::
+ ((0 . 1) . ("C" ("feta-1" . "\10")))
+ ((1 . 1) . ("D" ("feta-1" . "\10")))
+ ((2 . 1) . ("E" ("feta-1" . "\10")))
+ ((3 . 1) . ("F" ("feta-1" . "\10")))
+ ((4 . 1) . ("G" ("feta-1" . "\10")))
+ ((5 . 1) . ("A" ("feta-1" . "\10")))
+ ((6 . 1) . ("B" ("feta-1" . "\10")))
+
+ ((0 . -1) . ("C" ("feta-1" . "\12")))
+ ((1 . -1) . ("D" ("feta-1" . "\12")))
+ ((2 . -1) . ("E" ("feta-1" . "\12")))
+ ((3 . -1) . ("F" ("feta-1" . "\12")))
+ ((4 . -1) . ("G" ("feta-1" . "\12")))
+ ((5 . -1) . ("A" ("feta-1" . "\12")))
+ ((6 . -1) . ("B" ("feta-1" . "\12")))
+ )
+ pitch-names-alist))
+
+(define (user-pitch-name pitch)
+ (let ((entry (assoc pitch pitch-names-alist)))
+ (if entry
+ (cdr entry))))
+
+(define chord-names-alist '())
+(set! chord-names-alist
+ (append
+ '(
+ ; C iso C.no3.no5
+ (((0 . 0)) . ("" . ""))
+ ; C iso C.no5
+ (((0 . 0) (2 . 0)) . ("" . ""))
+ ; Cm iso Cm.no5
+ (((0 . 0) (2 . -1)) . ("m" . ""))
+ ; Cdim iso Cm5-
+ (((0 . 0) (2 . -1) (4 . -1)) . ("dim" . ""))
+ ; Co iso Cm5-7-
+ ; urg
+ ; (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("feta-1" . ".")))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("script" . "o")))
+ ; Cdim9
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1)) . ("dim" . ("script" . "9")))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1) (3 . -1)) . ("dim" . ("script" . "11")))
+ )
+ chord-names-alist))
+
+(define (user-chord-name chord)
+ ;(display chord)
+ ;(newline)
+ (let ((entry (assoc chord chord-names-alist)))
+ (if entry
+ (cdr entry))))
+
(define generic-stem-properties
(cons "Stem"
(list
+ (list 'stemVerticalDirection dir? 'direction)
+ (list 'verticalDirection dir? 'direction)
(list 'stemLength number? 'length)
(list 'stemStyle string? 'style)
(list 'noStemExtend boolean? 'no-stem-extend)
(define generic-breathing-sign-properties
(cons "Breathing_sign"
(list
+ (list 'breathingSignVerticalDirection dir? 'direction)
+ (list 'verticalDirection dir? 'direction)
(list 'breathingSignBreakPriority number? 'break-priority
))))
(define generic-rest-properties
(cons "Rest" (list (list 'restStyle string? 'reststyle))))
+(define generic-tie-properties
+ (cons "Tie" (list
+ (list 'tieVerticalDirection dir? 'direction)
+ (list 'verticalDirection dir? 'direction)
+ )))
+
+
(define generic-note-column-properties
(cons "Note_column"
(list
(define generic-slur-properties
(cons "Slur"
(list
+ (list 'slurVerticalDirection dir? 'direction)
+ (list 'verticalDirection dir? 'direction)
(list 'slurDash number? 'dashed))))
(define generic-timesig-properties
;; See documentation of Item::visibility_lambda_
-(define (postbreak_only_visibility d) (if (= d 1) '(#f . #f) '(#t . #t)))
-(define (spanbar_non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
-
-(define (non_postbreak_visibility d) (if (= d 1) '(#t . #t) '(#f . #f)))
-(define (non_prebreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
+(define (postbreak-only-visibility d) (if (= d 1) '(#f . #f) '(#t . #t)))
+(define (spanbar-non-postbreak-visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
+(define (all-visibility d) '(#f . #f))
+(define (non-postbreak-visibility d) (if (= d 1) '(#t . #t) '(#f . #f)))
+(define (non-prebreak-visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
;; Score_span_bars are only visible at start of line
;; i.e. if break_dir == RIGHT == 1
-(define Span_bar_engraver_visibility non_postbreak_visibility)
-(define mark-visibility non_prebreak_visibility)
-(define Span_score_bar_engraver_visibility postbreak_only_visibility)
-(define Piano_bar_engraver_visibility postbreak_only_visibility)
-(define Staff_group_bar_engraver_visibility postbreak_only_visibility)
+(define Span_bar_engraver-visibility non-postbreak-visibility)
+(define mark-visibility non-prebreak-visibility)
+(define Span_score_bar_engraver-visibility postbreak-only-visibility)
+(define Piano_bar_engraver-visibility postbreak-only-visibility)
+(define Staff_group_bar_engraver-visibility postbreak-only-visibility)
;; Spacing constants for prefatory matter.
;;
;;;;;;;; TeX
+;; this is silly, can't we use something like
+;; roman-0, roman-1 roman+1 ?
(define cmr-alist
'(("bold" . "cmbx")
("dynamic" . "feta-din")
+ ("feta" . "feta")
+ ("feta-1" . "feta")
+ ("feta-2" . "feta")
("finger" . "feta-nummer")
("typewriter" . "cmtt")
("italic" . "cmti")
("roman" . "cmr")
+ ("script" . "cmr")
("large" . "cmbx")
("Large" . "cmbx")
("mark" . "feta-nummer")
((string? exp) (string-append "\"" exp "\""))
))
-(define (test-scm->string)
-(list (scmlist->string '(a))
-(scmlist->string '(a b))
-(scmlist->string '(a b . c))
-
-
-(scm->string '(a))
-(scm->string '(a b ))
-(scm->string '(a b . c))
-(scm->string '(a b (c . d)))
-(scm->string '(a "bla" (c . 1.5)))
-)
-)