builds successfully, still messy around module import. bandaid fix

This commit is contained in:
Mikayla Dobson
2022-05-11 11:22:57 -05:00
parent 6fa7760d0f
commit e28b2176ee
6 changed files with 23 additions and 8 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

8
app.ts
View File

@@ -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();
}

View File

@@ -119,5 +119,12 @@
<script type="module" src="https://unpkg.com/tone@14.7.77/build/Tone.js"></script>
<!-- internal scripts -->
<script type="module" src="./built/app.js"></script>
<script type="module" src="./built/src/audioUtils.js"></script>
<script type="module" src="./built/src/harmonyUtil.js"></script>
<script type="module" src="./built/src/inputHandling.js"></script>
<script type="module" src="./built/src/styleUtils.js"></script>
<script type="module" src="./built/src/vector_logic/evaluateVector.js"></script>
<script type="module" src="./built/src/vector_logic/extractPitchset.js"></script>
<script type="module" src="./built/src/vector_logic/findVector.js"></script>
</body>
</html>

View File

@@ -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;

View File

@@ -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

View File

@@ -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"
]
}