From cc5d7b9c62fedb88cd7f88b5d6dab1e79e7d4465 Mon Sep 17 00:00:00 2001 From: avisilber88 Date: Wed, 27 Dec 2023 15:09:22 -0500 Subject: [PATCH] chordsenseshapes updated it to be an === between the activeintervals and correct chord so that now they actually compare the array. Before it was just comparing what was inside the array regardless of order. --- Midi/MidiApp4lumatone.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Midi/MidiApp4lumatone.js b/Midi/MidiApp4lumatone.js index b1cc9a5..9470913 100644 --- a/Midi/MidiApp4lumatone.js +++ b/Midi/MidiApp4lumatone.js @@ -719,9 +719,10 @@ $('#sheetButton').click(function () { // console.warn("restchordfromsheetbutton"); // resetChord(); //specificActiveChord=[48, 52, 55]; - noteOnListener(60, 17); + noteOnListener(48, 17); noteOnListener(52, 17); noteOnListener(55, 17); + noteOnListener(59, 17); }); @@ -1798,10 +1799,12 @@ function noteOnListener(note, velocity) { for (var indices = 1; indices < specificActiveChord.length; indices++){ activeIntervals.push(specificActiveChord[indices]-specificActiveChord[indices-1]); } + console.log("Active Interval is " + activeIntervals.toString()); + console.log("Correct Interval is " + correctChord.toString()); // for (var index = 0; index < activeChord.length; index++) { //PRESTON MAYBE I SHOULD UNCOMMENT // if (correctChord.indexOf(activeChord[index]) < 0) { //PRESTON MAYBE I SHOULD UNCOMMENT for (var index = 0; index < activeIntervals.length; index++) { //PRESTON MAYBE I SHOULD UNCOMMENT - if (correctChord.indexOf(activeIntervals[index]) < 0) { //PRESTON MAYBE I SHOULD UNCOMMENT + if (!(JSON.stringify(activeIntervals) === JSON.stringify(correctChord))) { //PRESTON MAYBE I SHOULD UNCOMMENT document.getElementById("warning").innerHTML = document.getElementById("warning").innerHTML+"-Incorrect Chord, see notes below.
"; //(arrangeNote(specificActiveChord[0])); match = false; break;