Skip to content

Commit

Permalink
Remove piano library
Browse files Browse the repository at this point in the history
  • Loading branch information
wrenhawth committed Jul 11, 2024
1 parent e38b5db commit 60b94e2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
11 changes: 1 addition & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tonal": "^6.0.1",
"tone": "^15.0.4",
"tonejs-instrument-piano-mp3": "^1.1.2"
"tone": "^15.0.4"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AllSteps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const AllSteps = () => {
</main>
{step === WorkflowStep.CHORDS && <p>
<span onClick={() => setChordPreset(ChordSynthPreset.DEFAULT)}>🖥️</span>
<span onClick={() => setChordPreset(ChordSynthPreset.PIANO)}>🎹</span>
{/* <span onClick={() => setChordPreset(ChordSynthPreset.PIANO)}>🎹</span> */}
<span onClick={() => setChordPreset(ChordSynthPreset.KALIMBA)}>🔔</span>
</p>}
<SlTabGroup
Expand Down
5 changes: 0 additions & 5 deletions src/hooks/useChordSynth.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import React from "react"
// @ts-expect-error no types
import PianoMp3 from 'tonejs-instrument-piano-mp3';

import { FMSynth, PolySynth, Synth } from "tone"
import { KALIMBA } from "../utils/synthPresets";

export enum ChordSynthPreset {
DEFAULT = "default",
PIANO = "piano",
KALIMBA = "kalimba"
}

Expand All @@ -18,8 +15,6 @@ export const useChordSynth = (isStarted: boolean, preset: ChordSynthPreset) => {
chordSynth.current?.disconnect()
if (preset === ChordSynthPreset.DEFAULT) {
chordSynth.current = new PolySynth(Synth, { volume: -10 }).toDestination()
} else if (preset === ChordSynthPreset.PIANO) {
chordSynth.current = new PianoMp3({ minify: true }).toDestination()
} else if (preset === ChordSynthPreset.KALIMBA) {
chordSynth.current = new PolySynth({
maxPolyphony: 100,
Expand Down

0 comments on commit 60b94e2

Please sign in to comment.