Sha256: dd6195d1f4f15512cb9b8e99c44df3f16177113fe1d239b5ba979aa319327a7f
Contents?: true
Size: 532 Bytes
Versions: 8
Compression:
Stored size: 532 Bytes
Contents
module HeadMusic::Style::Annotations end class HeadMusic::Style::Annotations::PreferContraryMotion < HeadMusic::Style::Annotation MESSAGE = "Prefer contrary motion." def marks return nil if notes.length < 2 return nil if direct_motion_ratio <= 0.5 direct_motions.map { |motion| HeadMusic::Style::Mark.for_all(motion.notes) } end private def direct_motions motions.select(&:direct?) end def direct_motion_ratio return 0 if motions.empty? direct_motions.count / motions.count.to_f end end
Version data entries
8 entries across 8 versions & 1 rubygems