lib/score.rb
def measure_format
        i = 1
        arr = []
        measure = []
        self.chords.each do |chord|
            measure << chord.value
            if measure.count == self.beats_per_measure.to_i
                arr << "  #{i}. / #{measure.join(" , ")} /"
                measure = []
                i +=1
            end
            if chord == self.chords.last && measure.count != 0
                until measure.count == self.beats_per_measure.to_i
                    measure << " "
                end
                arr << "  #{i}. / #{measure.join(" , ")} /"
            end
        end
        arr
    end
#Returns an array of chords in measure format
Returns an array of chords in measure format
Returns an array of chords in measure format
def measure_format
        i = 1
        arr = []
        measure = []
        self.chords.each do |chord|
            measure << chord.value
            if measure.count == self.beats_per_measure.to_i
                arr << "  #{i}. / #{measure.join(" , ")} /"
                measure = []
                i +=1
            end
            if chord == self.chords.last && measure.count != 0
                until measure.count == self.beats_per_measure.to_i
                    measure << " "
                end
                arr << "  #{i}. / #{measure.join(" , ")} /"
            end
        end
        arr
    end
def measure_format i = 1 arr = [ ] measure = [ ] self . chords . each do | chord | measure << chord . value if measure . count == self . beats_per_measure . to_i arr << "  #{i}. / #{measure.join(" , ")} /" measure = [ ] i += 1 end if chord == self . chords . last && measure . count != 0 until measure . count == self . beats_per_measure . to_i measure << " " end arr << "  #{i}. / #{measure.join(" , ")} /" end end arr end
Returns an array of chords in measure format
Returns an array of chords in measure format