From d3c62d61b82f4d4b71dece9063994dd4139a9f7b Mon Sep 17 00:00:00 2001
From: Mikayla Dobson <93477693+innocuous-symmetry@users.noreply.github.com>
Date: Tue, 10 May 2022 11:14:47 -0500
Subject: [PATCH] can not push to undefined array
---
app.ts | 10 +++-----
index.html | 5 ++--
src/audioUtils.ts | 34 +++++++++++++++++++++++++
src/harmonyUtil.ts | 27 +++++++++++++++++---
src/toneGeneration.ts | 59 ++++++++++++++++++-------------------------
5 files changed, 87 insertions(+), 48 deletions(-)
create mode 100644 src/audioUtils.ts
diff --git a/app.ts b/app.ts
index 1e8a9e7..7e2856f 100644
--- a/app.ts
+++ b/app.ts
@@ -1,10 +1,6 @@
import * as Tone from 'tone';
-import {
- sopranoTones, altoTones, tenorTones, bassTones,
- extractPitchset,
-} from "./src/toneGeneration.js";
-
-const pitchsets: string[][] = [sopranoTones, altoTones, tenorTones, bassTones];
+import { pitchsets } from "./src/toneGeneration.js";
+import { extractPitchset } from './src/harmonyUtil.js';
// initialize four synth voices
const soprano = new Tone.Synth().toDestination();
@@ -31,7 +27,7 @@ export const soundChord = (pitches: string[]) => {
// initial test: generate a single, random chord
export const fullRandomChord = () => {
- let pitches: string[];
+ let pitches: string[] = [];
for (let voice of pitchsets) {
// finds a random index, excluding any which may already exist in the array
let index: number;
diff --git a/index.html b/index.html
index 5562843..c99b8c0 100644
--- a/index.html
+++ b/index.html
@@ -118,9 +118,10 @@
-
+
+
+
-