0xfe/vexflow — pull request #237 by mscuthbert (2014-06-08 22:03:01+00:00)
Title: Calmer beams with new cost algorithm

This patch applies the (previously unused) slope_cost option in Vex.Flow.Beam to not penalize the slope itself but to penalize the difference between the test slope and a slope which examines the stem height of the first and last notes only and aims for a slope that is half the angle of their difference. This is the algorithm that a number of books on notation suggest aiming for. It still will chose other slopes in cases where intervening notes make getting this slope impossible. But the examples below (Left: new algorithm; Right: old algorithm) give much more gentle slopes than before and more often convey the overall angle from first to last note. Only some tests included, but all other tests leave the original beam slopes largely alone.

![vexflow_beam_improvements](https://cloud.githubusercontent.com/assets/3521479/3212364/12dcf64c-ef58-11e3-9425-03a5e9d034dd.jpg)