attern`).value;
        const chordDuration = parseInt(document.getElementById('chordLength').value);
        
        // Create the base pattern using the rhythm pattern
        let strudelPattern = `note(\`<`;
        
        // Add the pattern
        strudelPattern += `[${notes[0].note}](${pattern})`;
        
        // Add rests to fill the chord duration
        strudelPattern += ` [~@${chordDuration - 1}]`;
        
        strudelPattern += `>\`)`;
        
        // Add sound based on line type
