+pl 13.jcn2
+ - gaps on abbrev-beams
+ - bf: stem-info
+ - bf: last abbrev
+ - bf: stem: do_width
+ - bf: removed rest-column.hh
pl 13
- big Rest/notehead rewrite:
TOPLEVEL_PATCH_LEVEL = 13
# use to send patches, always empty for released version:
-TOPLEVEL_MY_PATCH_LEVEL = .jcn1
+TOPLEVEL_MY_PATCH_LEVEL = .jcn2
'a1
'a1:32
'c4:8 c' 'c4:16 c'
- [ 'c8:16 'c 'c 'c ] [ a a a a ]
- [ 'c 'f 'b e ]
- [ 'c16:32 'c 'c 'c ] [ a16:32 a a a ]
+% [ 'c8:16 'c 'c 'c ] [ a a a a ]
+% [ 'c 'f 'b e ]
+% [ 'c16:32 'c 'c 'c ] [ a16:32 a a a ]
%% % there's still some hairy beam bugfixing todo
%% [ c'8:16 g d 'a ]
%% [ c'16:32 g d 'a ]
%% [ 'c8:32 'f 'b e ]
- [:16 c4 e]
+ [:32 c16 e]
+ [:32 c16 e]
+ [:16 c8 e]
[:16 e4 g]
[:16 e2 g]
[:16 e1 g]
}
\paper{
+ gourlay_maxmeasures =5.;
}
% oeps
\midi{ }
\stemboth
[c'. d'32 c'] [b8 e'] [a d'] ~ [d'16 e' d' c'] |
[b8 g' cis' d'] [e' cis' d' e' ] |
- \stemdown a8 r8 r e [fis g] \stemboth[a. b32 a] |
+ \stemdown a8 r8 r e [fis g] \stemboth [a. b32 a] |
%% 20
- [g8 c' fis b] ~ [b16 c' b a] \stemdown [g fis e d] \stemboth|
+ [g8 c' fis b] ~ [b16 c' b a] \stemdown [g fis e d] \stemboth |
e4 \stemdown d ~ [d16 a g f!] [e g f! a] |
g4 ~ [g16 a bes8] c'4 [d'8 g] |
- \stembothg4. f8 ~ [f e] d4 |
+ \stemboth g4. f8 ~ [f e] d4 |
\stemdown e8 a4 g8 ~ [g8 f g a] |
%% 25
[bes8. c'32 b] [a8 d'] [g c'] ~ [c'16 d' c' bes] |
}
}
-
void
Abbreviation_beam_engraver::acknowledge_element (Score_elem_info i)
{
s->beams_left_i_ = s->flag_i_;
else
s->beams_right_i_ = s->flag_i_;
+
+ if (s->type_i () != 1) // no abbrev gaps on half note
+ s->beam_gap_i_ = s->flag_i_ - ((s->type_i () >? 2) - 2);
+
abeam_p_->add (s);
}
#include "proto.hh"
#include "dimen.hh"
#include "beam.hh"
+#include "abbreviation-beam.hh"
#include "misc.hh"
#include "debug.hh"
#include "symbol.hh"
s->beam_l_ = this;
if (!spanned_drul_[LEFT])
- set_bounds(LEFT,s);
+ set_bounds (LEFT,s);
else
- set_bounds(RIGHT,s);
+ set_bounds (RIGHT,s);
}
Molecule*
{
int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
- Real w = (here->hpos_f() - prev->hpos_f ())/4;
+ Real w = (here->hpos_f () - prev->hpos_f ())/4;
Symbol dummy;
Atom a (dummy);
if (lhalfs) // generates warnings if not
Real w = next->hpos_f() - here->hpos_f ();
Atom a = paper()->lookup_l ()->beam (sl, w + stemdx);
-
+
int j = 0;
+ Real gap_f = 0;
+ if (here->beam_gap_i_)
+ {
+ int nogap = rwholebeams - here->beam_gap_i_;
+ for (; j < nogap; j++)
+ {
+ Atom b (a);
+ b.translate (-dir_ * dy * j, Y_AXIS);
+ rightbeams.add (b);
+ }
+ // TODO: notehead widths differ for different types
+ gap_f = paper()->note_width () / 2;
+ w -= 2 * gap_f;
+ a = paper()->lookup_l ()->beam (sl, w + stemdx);
+ }
+
for (; j < rwholebeams; j++)
{
Atom b (a);
- b.translate (-dir_ * dy * j, Y_AXIS);
+ b.translate (Offset (gap_f, -dir_ * dy * j));
rightbeams.add (b);
}
SCORE_ELEM_CLONE(Beam);
protected:
- Interval do_width() const;
+ virtual Interval do_width() const;
Offset center() const;
void set_default_dir();
virtual void do_pre_processing();
Real stem_bottom_f_, stem_top_f_;
-
/// needed for determining direction/length
int staff_size_i_;
/// abbrev flag? + count
int abbrev_flag_i_;
+ /// how many abbrev beam don't reach stem?
+ int beam_gap_i_;
+
/// flagtype? 4 none, 8 8th flag, 0 = beam.
int flag_i_;
DECLARE_MY_RUNTIME_TYPEINFO;
Real hpos_f() const;
-
+
+ int type_i () const;
+
void do_print() const;
void set_stemend (Real);
Direction get_default_dir();
My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
{
Chord*v = new Request_chord;
- v->set_spot (here_input());
+ v->set_spot (here_input ());
v->add (rq);
assert (!duration_p->plet_b ());
duration_p->set_plet (1, 2);
}
+ if (default_abbrev_type_i_)
+ {
+ Abbreviation_req* a = new Abbreviation_req;
+ a->type_i_ = default_abbrev_type_i_;
+ v->add (a);
+ }
rq->set_duration (*duration_p);
- rq->set_spot (here_input());
+ rq->set_spot (here_input ());
delete duration_p ;
return v;
}
#include "rest-collision.hh"
#include "rest-collision-grav.hh"
#include "collision.hh"
-#include "rest-column.hh"
#include "note-column.hh"
#include "debug.hh"
#include "rest-collision.hh"
-#include "rest-column.hh"
#include "note-column.hh"
#include "stem.hh"
#include "note-head.hh"
{
x = s->hpos_f();
dir_ = s->dir_;
- beams_i_ = intlog2(s->flag_i_) - 2;
+ beams_i_ = 0 >? (abs (s->flag_i_) - 2);
/*
[todo]
staff_size_i_ = 8;
stem_xoffset_f_ =0;
+ beam_gap_i_ = 0;
}
int
stem_bottom_f_ = (dir_ < 0) ? se : min_head_i ();
}
+int
+Stem::type_i () const
+{
+ return head_l_arr_[0]->balltype_i_;
+}
+
void
Stem::add (Note_head *n)
{
set_default_stemlen ();
set_stemend ((dir_< 0) ?
- max_head_i ()-stem_length_f (): min_head_i () +stem_length_f ());
- if (dir_ > 0){
- stem_xoffset_f_ = paper ()->note_width ()-paper ()->rule_thickness ();
- }
+ max_head_i ()-stem_length_f (): min_head_i () + stem_length_f ());
+ // ugh, a whole ball is wider
+ if (head_l_arr_[0]->balltype_i_ <= 0)
+ stem_xoffset_f_ = paper ()->note_width () / 2;
+ else if (dir_ > 0)
+ stem_xoffset_f_ = paper ()->note_width () - paper ()->rule_thickness ();
else
stem_xoffset_f_ = 0;
}
flag_i_ = dir_ * abs (flag_i_);
transparent_b_ = invisible_b ();
empty_b_ = invisible_b ();
+
}
Interval
Stem::do_width () const
{
- if (beam_l_ || abs (flag_i_) <= 4)
- return Interval (0,0); // TODO!
- Paper_def*p= paper ();
- Interval r (p->lookup_l ()->flag (flag_i_).dim.x ());
- r+= stem_xoffset_f_;
+ Interval r (0, 0);
+ if (abbrev_flag_i_)
+ {
+ r = abbrev_mol ().extent ().x ();
+ }
+ else if (beam_l_ || abs (flag_i_) <= 4)
+ ; // TODO!
+ else
+ {
+ Paper_def*p= paper ();
+ r = p->lookup_l ()->flag (flag_i_).dim.x ();
+ r+= stem_xoffset_f_;
+ }
return r;
}
-
- Molecule
- Stem::abbrev_mol () const
- {
- Real dy = paper ()->interbeam_f ();
- Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim.x ().length ();
- Real beamdy = paper ()->interline_f () / 2;
-
- int beams_i = 0;
- Real slope = paper ()->internote_f () / 4;
-
- if (beam_l_) {
- // huh?
- slope = 2 * beam_l_->slope;
- // ugh, rather calc from Abbreviation_req
- beams_i = beams_right_i_ >? beams_left_i_;
- }
- paper ()->lookup_l ()->beam (slope, 20 PT);
- Molecule beams;
- Atom a (paper ()->lookup_l ()->beam (slope, w));
- a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope)));
- // ugh
- if (!beams_i)
- a.translate (dy + beamdy - dir_ * dy, Y_AXIS);
- else
- a.translate (2 * beamdy - dir_ * (beamdy - dy), Y_AXIS);
-
- for (int i = 0; i < abbrev_flag_i_; i++)
- {
- Atom b (a);
- b.translate (-dir_ * dy * (beams_i + i), Y_AXIS);
- beams.add (b);
- }
-
- return beams;
- }
+Molecule
+Stem::abbrev_mol () const
+{
+ Real dy = paper ()->interbeam_f ();
+ Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim.x ().length ();
+ Real beamdy = paper ()->interline_f () / 2;
+
+ int beams_i = 0;
+ Real slope = paper ()->internote_f () / 4;
+
+ if (beam_l_) {
+ // huh?
+ slope = 2 * beam_l_->slope;
+ // ugh, rather calc from Abbreviation_req
+ beams_i = beams_right_i_ >? beams_left_i_;
+ }
+ paper ()->lookup_l ()->beam (slope, 20 PT);
+
+ Molecule beams;
+ Atom a (paper ()->lookup_l ()->beam (slope, w));
+ a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope)));
+ // ugh
+ if (!beams_i)
+ a.translate (dy + beamdy - dir_ * dy, Y_AXIS);
+ else
+ a.translate (2 * beamdy - dir_ * (beamdy - dy), Y_AXIS);
+
+ for (int i = 0; i < abbrev_flag_i_; i++)
+ {
+ Atom b (a);
+ b.translate (-dir_ * dy * (beams_i + i), Y_AXIS);
+ beams.add (b);
+ }
+
+ return beams;
+}
Molecule*
Stem::brew_molecule_p () const