builds successfully, still messy around module import. bandaid fix
This commit is contained in:
8
app.ts
8
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();
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user