From e28b2176eeb4918f71b801b4196e333120bb5f4e Mon Sep 17 00:00:00 2001 From: Mikayla Dobson <93477693+innocuous-symmetry@users.noreply.github.com> Date: Wed, 11 May 2022 11:22:57 -0500 Subject: [PATCH] builds successfully, still messy around module import. bandaid fix --- .DS_Store | Bin 0 -> 6148 bytes app.ts | 8 ++++++-- index.html | 7 +++++++ src/styleUtils.ts | 3 +-- src/vector_logic/extractPitchset.ts | 2 +- tsconfig.json | 11 ++++++++--- 6 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3e391de0f729d619dabea1aac629bcd83153700f GIT binary patch literal 6148 zcmeHKyG{c^3>-s>NTf(fxxc_4tfKG*`G8O)q6rrX6zZ$^EAYi)7o2gx1*ci{^@MX*7=m@2@Q-+V z-@Oi}^YEPaU%x5vab1>=e=-D3_9~cC+cUwb&*MdzgFN2OO6(D literal 0 HcmV?d00001 diff --git a/app.ts b/app.ts index 6bfcda9..4cd4655 100644 --- a/app.ts +++ b/app.ts @@ -1,9 +1,11 @@ -import * as Tone from 'tone'; - // initialize four synth voices +// @ts-expect-error: namespace, Tone, for all of the following "expect-error calls" const soprano = new Tone.Synth().toDestination(); +// @ts-expect-error const alto = new Tone.Synth().toDestination(); +// @ts-expect-error const tenor = new Tone.Synth().toDestination(); +// @ts-expect-error const bass = new Tone.Synth().toDestination(); // test function for audio is armed @@ -26,6 +28,7 @@ export const soundChord = (pitches: string[]) => { // set up transport const transportStart = document.getElementById('transport-start'); +// @ts-expect-error const loop = new Tone.Loop((time) => { audioTest(); }, "8n").start(0); @@ -33,5 +36,6 @@ const loop = new Tone.Loop((time) => { loop.probability = 0.8; transportStart.onclick = () => { + // @ts-expect-error Tone.Transport.start(); } diff --git a/index.html b/index.html index bdfb6df..7388fb8 100644 --- a/index.html +++ b/index.html @@ -119,5 +119,12 @@ + + + + + + + \ No newline at end of file diff --git a/src/styleUtils.ts b/src/styleUtils.ts index 8231e4c..7f47476 100644 --- a/src/styleUtils.ts +++ b/src/styleUtils.ts @@ -1,5 +1,3 @@ -import * as Tone from 'tone'; - export const startButton = document.getElementById("start-tone"); export const synthButton = document.getElementById("synth-button"); @@ -26,6 +24,7 @@ showMore.onclick = () => { } startButton.onclick = async () => { + // @ts-expect-error - namespace again, failed import from Tone await Tone.start() .then(() => { appReady = true; diff --git a/src/vector_logic/extractPitchset.ts b/src/vector_logic/extractPitchset.ts index 946a7e9..4c63b80 100644 --- a/src/vector_logic/extractPitchset.ts +++ b/src/vector_logic/extractPitchset.ts @@ -1,4 +1,4 @@ -import { musicalPitches } from "../harmonyUtil"; +import { musicalPitches } from "../harmonyUtil.js"; export const extractPitchset = (pitches: string[]) => { // 1) determine pitch set from given array of pitches diff --git a/tsconfig.json b/tsconfig.json index 494906a..0de2996 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,14 @@ "compilerOptions": { "outDir": "./built", "allowJs": true, - "target": "es2017", - "module": "CommonJS", + "target": "es2018", + "module": "ESNext", "moduleResolution": "node", }, - "include": ["./src/**/*", "./app"] + "include": [ + "./src/**/*", "./app" + ], + "exclude": [ + "/_tone" + ] } \ No newline at end of file