- /*
- Banter style chord names (almost).
- TODO:
- - don't print inclusive scale (i.e. no "9" in c 9/11)
- - handle c7 / cmaj7
- - use #,b iso -es -is on tonica
- - switch on property, add american (?) chordNameStyle
-
- Scalar chordNameStyle = get_property ("chordNameStyle");
- if (chordNameStyle == "Banner")
- chord = pitches_to_banner (pitch_arr_.size ());
-
- */
-
- Scalar style = get_property ("textstyle");
- Scalar alignment = get_property ("textalignment");
- Text_def* text_p = new Text_def;
- text_p->align_dir_ = LEFT;
- if (style.length_i ())
- text_p->style_str_ = style;
- if (alignment.isnum_b())
- text_p->align_dir_= (Direction)(int)alignment;
-
- Musical_pitch tonic = pitch_arr_[0];
-
- Array<Musical_pitch> scale;
- scale.push (Musical_pitch (0)); // c
- scale.push (Musical_pitch (1)); // d
- scale.push (Musical_pitch (2)); // e
- scale.push (Musical_pitch (3)); // f
- scale.push (Musical_pitch (4)); // g
- scale.push (Musical_pitch (5)); // a
- // 7 always means 7-...
- scale.push (Musical_pitch (6, -1)); // b
-
- for (int i = 0; i < scale.size (); i++)
- scale[i].transpose (tonic);
-
- //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];
-
- String add_str;
- String sep_str;
- for (int i=1; i < pitch_arr_.size (); i++)
+ SCM bass = SCM_EOL;
+ SCM inversion = SCM_EOL;
+ SCM pitches = SCM_EOL;
+
+ Stream_event *inversion_event = 0;
+ for (vsize i = 0; i < notes_.size (); i++)
+ {
+ Stream_event *n = notes_[i];
+ SCM p = n->get_property ("pitch");
+ if (!unsmob_pitch (p))
+ continue;
+
+ if (n->get_property ("inversion") == SCM_BOOL_T)
+ {
+ inversion_event = n;
+ inversion = p;
+ }
+ else if (n->get_property ("bass") == SCM_BOOL_T)
+ bass = p;
+ else
+ pitches = scm_cons (p, pitches);
+ }
+
+ if (inversion_event)