  }
    };

    // Add MIDI note to note name conversion
    function midiToNoteName(midiNote) {
        const notes = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"];
        const note = notes[midiNote % 12];
        const octave = Math.floor(midiNote / 12) - 1;
        return note + octave;
    }

    // Add function to update chord names display
    function updateChordNames() {
        const chordSequence = document.getElementById('chordSequence').value;
        const chordNamesDiv = 