Newer
Older
music / app / src / main / java / com / lukas / music / song / chords / ChordProgression.kt
@lukas lukas on 16 Aug 2022 488 bytes add chord view
package com.lukas.music.song.chords

class ChordProgression {
    // TODO: special handler for increasing or decreasing measuresPerPhrase
    val measuresPerPhrase: Int = 4
    val phrases = mutableListOf<Phrase>(Phrase(), Phrase())

    private var position = 0
    fun step(): Chord {
        val phrase = phrases[position]
        return phrase.step(this)
    }

    operator fun inc(): ChordProgression {
        position++
        position %= phrases.size
        return this
    }
}