From 57225a395eaf74fb75339dd0ba7d5dfe8368e6f2 Mon Sep 17 00:00:00 2001
From: Pierre Ranwez <pierre.ranwez.etu@univ-lille.fr>
Date: Thu, 17 Feb 2022 10:21:12 +0100
Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20performance?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 content.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/content.js b/content.js
index 1e19a15..4c66f17 100644
--- a/content.js
+++ b/content.js
@@ -475,11 +475,11 @@ function audioEvent() {
                             volume = meter.volume * 1.4;
                             value = value.replace('[' + template.templateFull + ']', (meter.volume * 1.4 < 1 ? range(template, volume) : 0));
                         }
-                        if (template.eventType == 'onset' && template.eventName == noteStrings[note % 12]) {
+                        else if (template.eventType == 'onset' && template.eventName == noteStrings[note % 12]) {
                             eventIn = true;
                             value = value.replace('[' + template.templateFull + ']', range(template, 1));
                         }
-                        if (attack && template.eventType == 'attack') {
+                        else if (attack && template.eventType == 'attack') {
                             console.log('Attack');
                             eventIn = true;
                             value = value.replace('[' + template.templateFull + ']', '');
@@ -575,5 +575,6 @@ chrome.runtime.onMessage.addListener(onMessage);
 chrome.storage.sync.get(['activate'], function (result) {
     if (result.activate) {
         audioApi();
+        midiApi();
     }
 });
-- 
GitLab