-1.3.77.mb1
+--- ../lilypond-1.3.77/CHANGES Tue Aug 8 16:14:36 2000
+++ b/CHANGES Wed Aug 9 23:30:23 2000
+@@ -1,3 +1,15 @@
+1.3.77.jcn1
+===========
+
+* `Fixed' chord notation, as per request of David Arnold, ie,
+ Added a chord-name-mode, that only displays chord names
+ when there's a change in the chord-name-scheme, Also, a chord
+ name should always be displayed after a line break. See
+
+ input/test/drarn-chords.ly
+
+* Reverted duration-iter change in midi2ly, moved printing of options.
+
+ 1.3.77
+ ======
+ 1.3.77.mb1
==========
* Minor documentation updates
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=77
-MY_PATCH_LEVEL=mb1
+MY_PATCH_LEVEL=jcn1
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
--- /dev/null
+\version "1.3.59";
+
+%{
+Would this be acceptable/good enough/convenient for entry?
+
+ Convention/Standard Lily
+
+ C# cis
+ Cb ces
+ Cm; Cmin c:3-; c:m; c:min
+ Caug c:5+; c:aug;
+ Cdim c:3-.5-; c:dim
+ Cmaj7 c:7+; c:maj
+ C7 c:7
+ Csus; Csus4 c:4; c:sus
+
+%}
+
+scales = \notes \transpose c'' \chords{
+ \property ChordNames.drarnChords=##t
+ %c1:m \break c1:m
+ c1:m c1:m
+}
+
+%\include "paper-as9.ly";
+\score{
+ <
+ \context ChordNames \scales
+ \context Staff \scales
+ >
+ \paper{
+% \paper_as_nine
+ \translator {
+ \ChordNameContext
+ }
+ }
+}
virtual bool do_try_music (Music* m);
private:
+ void create_chord_name ();
+
Array<Musical_pitch> pitch_arr_;
Item* chord_name_p_;
+ Chord* chord_p_;
+ Chord* last_chord_p_;
Tonic_req* tonic_req_;
Inversion_req* inversion_req_;
Bass_req* bass_req_;
tonic_req_ = 0;
inversion_req_ = 0;
bass_req_ = 0;
+ chord_p_ = 0;
+ last_chord_p_ = 0;
}
void
{
if (chord_name_p_)
return;
+
if (!pitch_arr_.size ())
return;
if (gh_boolean_p (chord_inversion))
find_inversion_b = gh_scm2bool (chord_inversion);
- chord_name_p_ = new Item (get_property ("basicChordNameProperties"));
- 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));
+
+ create_chord_name ();
+ announce_element (chord_name_p_, 0);
+ SCM s = get_property ("drarnChords"); //FIXME!
+ if (to_boolean (s) && last_chord_p_ && !compare (chord_p_, last_chord_p_))
+ chord_name_p_->set_elt_property ("begin-of-line-visible", SCM_BOOL_T);
+}
+void
+Chord_name_engraver::create_chord_name ()
+{
+ assert (chord_p_);
+ chord_name_p_ = new Item (get_property ("basicChordNameProperties"));
/*
Hmm, why not represent complete chord as list?
((tonic third fifth) (inversion bass))
*/
SCM plist = SCM_EOL;
- for (int i= chord.pitch_arr_.size (); i--; )
- plist = gh_cons (chord.pitch_arr_[i].to_scm (), plist);
+ for (int i= chord_p_->pitch_arr_.size (); i--; )
+ plist = gh_cons (chord_p_->pitch_arr_[i].to_scm (), plist);
chord_name_p_->set_elt_property ("pitches", plist);
- if (chord.inversion_b_)
+ if (chord_p_->inversion_b_)
chord_name_p_->set_elt_property ("inversion",
- chord.inversion_pitch_.to_scm ());
- if (chord.bass_b_)
- chord_name_p_->set_elt_property ("bass", chord.bass_pitch_.to_scm ());
-
- announce_element (chord_name_p_, 0);
+ chord_p_->inversion_pitch_.to_scm ());
+ if (chord_p_->bass_b_)
+ chord_name_p_->set_elt_property ("bass", chord_p_->bass_pitch_.to_scm ());
}
void
tonic_req_ = 0;
inversion_req_ = 0;
bass_req_ = 0;
+ delete last_chord_p_;
+ last_chord_p_ = chord_p_;
+ chord_p_ = 0;
}
#include "paper-def.hh"
#include "lookup.hh"
#include "score-element.hh"
+#include "paper-column.hh"
+#include "line-of-score.hh"
/*
TODO: move text lookup out of Chord_name
return mol;
}
-MAKE_SCHEME_CALLBACK(Chord_name,brew_molecule);
+MAKE_SCHEME_CALLBACK (Chord_name, after_line_breaking);
+SCM
+Chord_name::after_line_breaking (SCM smob)
+{
+ Item* me = dynamic_cast<Item*> (unsmob_element (smob));
+ assert (me);
+
+ SCM s = me->get_elt_property ("begin-of-line-visible");
+ if (to_boolean (s))
+ {
+ if (Paper_column::rank_i (me->column_l ()) -
+ /*
+ hmm, what's my column number in this line?
+ why doesn't this work?
+ me->line_l ()->rank_i_ > 2)
+ */
+ me->line_l ()->spanned_rank_iv ()[LEFT] > 1)
+ me->suicide ();
+ }
+ return SCM_UNSPECIFIED;
+}
+MAKE_SCHEME_CALLBACK (Chord_name, brew_molecule);
SCM
Chord_name::brew_molecule (SCM smob)
{
#include "paper-def.hh"
#include "lookup.hh"
+int
+compare (Chord* left, Chord* right)
+{
+ assert (left);
+ assert (right);
+
+ if (left->inversion_b_ == right->inversion_b_
+ && left->bass_b_ == right->bass_b_
+ && left->pitch_arr_.size () == right->pitch_arr_.size ())
+ {
+ for (int i = 0; i < left->pitch_arr_.size (); i++)
+ if (left->pitch_arr_[i] != right->pitch_arr_[i])
+ return 1;
+ return 0;
+ }
+
+ return 1;
+}
+
/*
FIXME: should use SCM iso. arrays and have-to-delete pointers.
static SCM brew_molecule (SCM);
static Molecule ly_word2molecule (Score_element*, SCM scm, Real* x) ;
static Molecule ly_text2molecule (Score_element*, SCM scm) ;
+ static SCM after_line_breaking (SCM);
};
#endif // CHORD_NAME_HH
Chord to_chord (Array<Musical_pitch> pitch_arr, Tonic_req* tonic_req, Inversion_req* inversion_req, Bass_req* bass_req, bool find_inversion_b);
+int compare (Chord*, Chord*);
+
#endif // CHORD_HH
basicChordNameProperties = #`(
(molecule-callback . ,Chord_name::brew_molecule)
(interfaces . (chord-name-interface))
+ (after-line-breaking-callback . ,Chord_name::after_line_breaking)
)
basicCollisionProperties = #`(
(axes 0 1)
dur_array_s.clear ();
Duration_iterator i;
- dur_array_s.push (i.dur ());
while (i.ok ())
dur_array_s.push (i.forward_dur ());
}
*/
assert (ok ());
+ Duration dur = this->dur ();
+
if (!cursor_dur_.dots_i_ && !cursor_dur_.plet_b ())
{
cursor_dur_.durlog_i_ += 1;
if (Duration_convert::no_tuplets_b_s
&& cursor_dur_.plet_b () && ok ())
- return forward_dur ();
+ forward_dur ();
if (Duration_convert::no_double_dots_b_s
&& (cursor_dur_.dots_i_ == 2) && ok ())
- return forward_dur ();
+ forward_dur ();
if (Duration_convert::no_smaller_than_i_s
&& (cursor_dur_.durlog_i_ > Duration_convert::no_smaller_than_i_s) && ok ())
- return forward_dur ();
+ forward_dur ();
if (Duration_convert::no_smaller_than_i_s
&& cursor_dur_.dots_i_
&& (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s)
&& ok ())
- return forward_dur ();
+ forward_dur ();
if (Duration_convert::no_smaller_than_i_s
&& (cursor_dur_.dots_i_ == 2)
&& (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s / 2)
&& ok ())
- return forward_dur ();
+ forward_dur ();
- return dur ();
+ return dur;
}
bool
cout << _f ("Report bugs to %s", "bug-gnu-music@gnu.org") << endl;
}
+void
+show_settings ()
+{
+ LOGOUT (VERBOSE_ver) << "\n";
+ LOGOUT (VERBOSE_ver) << _f ("no_double_dots: %d\n",
+ Duration_convert::no_double_dots_b_s);
+ LOGOUT (VERBOSE_ver) << _f ("no_rests: %d\n",
+ no_rests_b_g);
+ LOGOUT (VERBOSE_ver) << _f ("no_quantify_b_s: %d\n",
+ Duration_convert::no_quantify_b_s);
+ LOGOUT (VERBOSE_ver) << _f ("no_smaller_than: %d (1/%d)\n",
+ Duration_convert::no_smaller_than_i_s,
+ Duration_convert::type2_i (Duration_convert::no_smaller_than_i_s));
+ LOGOUT (VERBOSE_ver) << _f ("no_tuplets: %d\n",
+ Duration_convert::no_tuplets_b_s);
+}
+
int
main (int argc_i, char* argv_sz_a[])
{
source.set_binary (true);
source.set_path (&path);
- LOGOUT (NORMAL_ver) << "\n";
- LOGOUT (NORMAL_ver) << _f ("no_double_dots: %d\n",
- Duration_convert::no_double_dots_b_s);
- LOGOUT (NORMAL_ver) << _f ("no_rests: %d\n",
- no_rests_b_g);
- LOGOUT (NORMAL_ver) << _f ("no_quantify_b_s: %d\n",
- Duration_convert::no_quantify_b_s);
- LOGOUT (NORMAL_ver) << _f ("no_smaller_than: %d (1/%d)\n",
- Duration_convert::no_smaller_than_i_s,
- Duration_convert::type2_i (Duration_convert::no_smaller_than_i_s));
- LOGOUT (NORMAL_ver) << _f ("no_tuplets: %d\n",
- Duration_convert::no_tuplets_b_s);
-
char const* arg_sz = 0;
while ( (arg_sz = getopt_long.get_next_arg ()))
{
+ show_settings ();
filename_str_g = arg_sz;
Midi_score_parser midi_parser;
Mudela_score* score_p = midi_parser.parse (arg_sz, &source);
mudela_stream << "\\paper{}\n";
-#if 0
+#if 1
mudela_stream << "\\midi{\n";
// let's not use silly 0 track