diff --git a/app.js b/app.js
index 75cf0c8..aab2115 100644
--- a/app.js
+++ b/app.js
@@ -1,10 +1,3 @@
-import {
- sopranoTones, altoTones, tenorTones, bassTones,
- extractPitchset,
-} from "./js/toneGeneration.js";
-
-const pitchsets = [sopranoTones, altoTones, tenorTones, bassTones];
-
// initialize four synth voices
const soprano = new Tone.Synth().toDestination();
const alto = new Tone.Synth().toDestination();
@@ -20,47 +13,18 @@ export const audioTest = () => {
}
// allows a chord to be generated with input from another function
-export const soundChord = (pitches) => {
- const [s,a,t,b] = pitches;
+// pitchNames: array of strings
+export const soundChord = (pitchNames) => {
+ const [s,a,t,b] = pitchNames;
soprano.triggerAttackRelease(s, "8n");
alto.triggerAttackRelease(a, "8n");
tenor.triggerAttackRelease(t, "8n");
bass.triggerAttackRelease(b, "8n");
}
-// initial test: generate a single, random chord
-export const fullRandomChord = () => {
- let pitches = [];
- for (let voice of pitchsets) {
- // finds a random index, excluding any which may already exist in the array
- let index;
-
- do {
- index = Math.floor(Math.random() * 100) % voice.length;
- } while (pitches.includes(voice[index]));
-
- pitches.push(voice[index]);
- console.log(voice[index]);
- }
-
- for (let i = 0; i < pitches.length; i++) {
- if (pitches[i] === pitches[i+1]) {
- console.log("CAUGHT");
- }
- }
-
- soundChord(pitches);
- extractPitchset(pitches);
-}
-
// set up transport
-let clock = 0;
-let slowClock = 0;
-
const transportStart = document.getElementById('transport-start');
-let transport;
-
const loop = new Tone.Loop((time) => {
audioTest();
}, "8n").start(0);
@@ -70,4 +34,3 @@ loop.probability = 0.8;
transportStart.onclick = () => {
Tone.Transport.start();
}
-
diff --git a/index.html b/index.html
index bb9cd11..09e22de 100644
--- a/index.html
+++ b/index.html
@@ -112,15 +112,17 @@
+
-
-
-
-
+
+
+
+
+