     
 }
 
-//
-// MARK: -
 // MARK: Chord
-//
 
 extension Note {
     

// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

import Foundation

//
// MARK: -
// MARK: Note
//

enum NoteName: String {
    

    
    var chordProgression: [Note] {
        
        let chordProgression: [Note]
        
        switch (name, sharp) {
            
        case (.C, false):
            chordProgression = [
                Note(name: .C, octave: octave, sharp: false),
                Note(name: .F, octave: octave, sharp: false),
                Note(name: .G, octave: octave, sharp: false)
            ]
            
        case (.C, true):
            chordProgression = [
                Note(name: .C, octave: octave, sharp: true),
                Note(name: .F, octave: octave, sharp: true),
                Note(name: .G, octave: octave, sharp: true)
            ]
            
        case (.D, false):
            chordProgression = [
                Note(name: .D, octave: octave, sharp: false),
                Note(name: .G, octave: octave, sharp: false),
                Note(name: .A, octave: octave, sharp: false)
            ]
            
        case (.D, true):
            chordProgression = [
                Note(name: .D, octave: octave, sharp: true),
                Note(name: .G, octave: octave, sharp: true),
                Note(name: .A, octave: octave, sharp: true)
            ]
            
        case (.E, _):
            chordProgression = [
                Note(name: .E, octave: octave, sharp: false),
                Note(name: .A, octave: octave, sharp: false),
                Note(name: .B, octave: octave, sharp: false)
            ]
            
        case (.F, false):
            chordProgression = [
                Note(name: .F, octave: octave, sharp: false),
                Note(name: .A, octave: octave, sharp: true),
                Note(name: .C, octave: octave + 1, sharp: false)
            ]
            
        case (.F, true):
            chordProgression = [
                Note(name: .F, octave: octave, sharp: true),
                Note(name: .B, octave: octave, sharp: false),
                Note(name: .C, octave: octave + 1, sharp: true)
            ]
            
        case (.G, false):
            chordProgression = [
                Note(name: .G, octave: octave, sharp: false),
                Note(name: .C, octave: octave + 1, sharp: false),
                Note(name: .D, octave: octave + 1, sharp: false)
            ]
            
        case (.G, true):
            chordProgression = [
                Note(name: .G, octave: octave, sharp: true),
                Note(name: .C, octave: octave + 1, sharp: true),
                Note(name: .D, octave: octave + 1, sharp: true)
            ]
            
        case (.A, false):
            chordProgression = [
                Note(name: .A, octave: octave, sharp: false),
                Note(name: .D, octave: octave + 1, sharp: false),
                Note(name: .E, octave: octave + 1, sharp: false)
            ]
            
        case (.A, true):
            chordProgression = [
                Note(name: .A, octave: octave, sharp: true),
                Note(name: .D, octave: octave + 1, sharp: true),
                Note(name: .F, octave: octave + 1, sharp: false)
            ]
    
        case (.B, _):
            chordProgression = [
                Note(name: .B, octave: octave, sharp: false),
                Note(name: .E, octave: octave + 1, sharp: false),
                Note(name: .F, octave: octave + 1, sharp: true)
            ]
            
        default:
            preconditionFailure()
            
        }
        
        return chordProgression
        
    }
    
}
