11import { Voice } from '@/core/voice' ;
22import SynthUtils from '@/core/synthUtils' ;
33import * as Tone from 'tone' ;
4- import { _state , noteValueToSeconds , _defaultSynth , _polySynth } from '@/singer' ;
4+ // import { _state, noteValueToSeconds, _defaultSynth, _polySynth } from '@/singer';
55import { setupSynthUtils } from '@/core/synthUtils' ;
66import { injected } from '@/index' ;
77
@@ -18,26 +18,27 @@ await (async () => {
1818 'audio.piano' : getAsset ( 'audio.piano' ) ! ,
1919 'audio.snare' : getAsset ( 'audio.snare' ) ! ,
2020 } ;
21-
2221} ) ( ) ;
2322
2423function _getSynth ( synthType : string ) {
25- switch ( synthType ) {
26- case 'polysynth' :
27- return _polySynth ;
28- }
29- return _defaultSynth ;
24+ synthType ;
25+
26+ // switch (synthType) {
27+ // case 'polysynth':
28+ // return _polySynth;
29+ // }
30+ // return _defaultSynth;
3031}
3132
3233async function playSynth ( synthType : string ) {
3334 await Tone . start ( ) ;
34- const synth = _getSynth ( synthType ) ;
35- _state . notesPlayed = 0 ;
35+ // const synth = _getSynth(synthType);
36+ // _state.notesPlayed = 0;
3637 console . log ( 'playing c4 using' , synthType ) ;
37- const now = Tone . now ( ) ;
38- let offset = noteValueToSeconds ( _state . notesPlayed ) ;
39- synth . triggerAttackRelease ( 'c4' , '4n' , now + offset ) ;
40- _state . notesPlayed += 4 ;
38+ // const now = Tone.now();
39+ // let offset = noteValueToSeconds(_state.notesPlayed);
40+ // synth.triggerAttackRelease('c4', '4n', now + offset);
41+ // _state.notesPlayed += 4;
4142}
4243
4344async function voice ( ) {
@@ -61,7 +62,6 @@ async function voice() {
6162 // }
6263 // }).toDestination();
6364
64-
6565 // _state.notesPlayed = 0;
6666 // const now = Tone.now();
6767 // let offset = noteValueToSeconds(_state.notesPlayed);
0 commit comments