Montre le code HTML et JS d'une application qui convertirai les notes ou accords notés de façon Anglaise ( style A , B , C , D , E , F , G )
en notation Française ( style DO , Ré , Mi , FA , SOL , LA , Si ) sans oublier d'inclure les dièses (#) et les bémols (b)
DO C
RE D
MI E
FA F
SOL G
LA A
SI B
Montre moi ce meme code juste en HTML et JS ( sans CSS) qui soit fonctionnel juste lorsque j'appuie sur un bouton "CONVERTIR"
>---->----->----->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Convertir les notes en notation française</title>
</head>
<body>
<h1 style="text-align: center;">🎵 <span style="color: #006600;">Convertisseur</span>
<span style="color: #666666;">de notes <br>
</span></h1>
<h1 style="text-align: center;"><span style="color: #666666;">en notation</span>
<span style="color: #ffcc33;">Française</span></h1>
<p style="text-align: right;"><i>( <span style="color: silver;">by</span> </i><a
href="https://sites.google.com/view/tartistik/" target="_blank"><span style="color: #006600;">t</span>-<span
style="color: #993399;">artisti</span>K</a><i> )</i></p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div style="text-align: center;"><label for="notes-anglais"><b style="color: #990000;">Notes</b>
en notation Anglaise (⚠ MAJ.➕ espace) 👉 </label><input id="notes-anglais" name="notes-anglais"
type="text"><b style="color: #33cc00;"><button type="button" onclick="convertir()"></button></b><b
style="color: #33cc00;"><button type="button" onclick="convertir()"><b style="color: #33cc00;">
</b>Convertir 🎵 </button></b></div>
<div id="notes-francais"></div>
<script>
function convertir() {
// Récupérer la valeur saisie par l'utilisateur
var notesAnglais = document.getElementById("notes-anglais").value;
// Appeler la fonction de conversion
var notesFrancais = convert_notes(notesAnglais.split(" "));
// Afficher le résultat
var notesFrancaisDiv = document.getElementById("notes-francais");
notesFrancaisDiv.innerHTML = "Notes en notation Française -> " + notesFrancais.join(" ");
}
function convert_notes(notesAnglais) {
var notesFrancais = [];
for (var i = 0; i < notesAnglais.length; i++) {
var note = notesAnglais[i];
if (note == "A") {
notesFrancais.push("LA");
} else if (note == "B") {
notesFrancais.push("SI");
} else if (note == "C") {
notesFrancais.push("DO");
} else if (note == "D") {
notesFrancais.push("RE");
} else if (note == "E") {
notesFrancais.push("MI");
} else if (note == "F") {
notesFrancais.push("FA");
} else if (note == "G") {
notesFrancais.push("SOL");
}
}
return notesFrancais;
}
</script>
</body>
</html>