
                'random': tuba
            };
            instrumentsLoaded = true;
            showLoading(false);
        }).catch(err => {
            console.error('Error loading instruments:', err);
            showLoading(false);
        });
    }

    // Function to update time and progression settings
    function updateTimeAndProgression() {
        if (!tm) return;
        
        const bpm = parseInt(document.getElementById('bpm').value);
        const beatsPerChord = parseInt(document.getEleme