Sha256: 2e62e70eee410ce701bc5d3e0c2f978ef2cf23f0b9c4c071f3d4be7709555f3d
Contents?: true
Size: 493 Bytes
Versions: 10
Compression:
Stored size: 493 Bytes
Contents
module HeadMusic::Style::Annotations end class HeadMusic::Style::Annotations::SingableRange < HeadMusic::Style::Annotation MAXIMUM_RANGE = 10 MESSAGE = 'Limit melodic range to a 10th.' def marks if overage > 0 HeadMusic::Style::Mark.for_each(extremes, fitness: HeadMusic::PENALTY_FACTOR**overage) end end private def overage notes.length > 0 ? [range.number - MAXIMUM_RANGE, 0].max : 0 end def extremes (highest_notes + lowest_notes).sort end end
Version data entries
10 entries across 10 versions & 1 rubygems