Sha256: febae94986e4b698c85f5f953ba43f5839470d6b58c955fbe091e1befd2e2b0a
Contents?: true
Size: 580 Bytes
Versions: 9
Compression:
Stored size: 580 Bytes
Contents
# Octave equivalence is the functional equivalence of pitches with the same spelling separated by one or more octaves. class HeadMusic::Pitch::OctaveEquivalence def self.get(pitch) @octave_equivalences ||= {} @octave_equivalences[pitch.to_s] ||= new(pitch) end attr_reader :pitch def initialize(pitch) @pitch = pitch end def octave_equivalent?(other) other = HeadMusic::Pitch.get(other) pitch.spelling == other.spelling && pitch.register != other.register end alias_method :equivalent?, :octave_equivalent? private_class_method :new end
Version data entries
9 entries across 9 versions & 1 rubygems