Skip to content

Commit

Permalink
hack(singer): disable erroneous lines
Browse files Browse the repository at this point in the history
  • Loading branch information
meganindya committed Mar 20, 2024
1 parent 9e633e5 commit 12d2b23
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions modules/singer/playground/pages/Voice.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Voice } from '@/core/voice';
import SynthUtils from '@/core/synthUtils';
import * as Tone from 'tone';
import { _state, noteValueToSeconds, _defaultSynth, _polySynth } from '@/singer';
// import { _state, noteValueToSeconds, _defaultSynth, _polySynth } from '@/singer';
import { setupSynthUtils } from '@/core/synthUtils';
import { injected } from '@/index';

Expand All @@ -18,26 +18,27 @@ await (async () => {
'audio.piano': getAsset('audio.piano')!,
'audio.snare': getAsset('audio.snare')!,
};

})();

function _getSynth(synthType: string) {
switch (synthType) {
case 'polysynth':
return _polySynth;
}
return _defaultSynth;
synthType;

// switch (synthType) {
// case 'polysynth':
// return _polySynth;
// }
// return _defaultSynth;
}

async function playSynth(synthType: string) {
await Tone.start();
const synth = _getSynth(synthType);
_state.notesPlayed = 0;
// const synth = _getSynth(synthType);
// _state.notesPlayed = 0;
console.log('playing c4 using', synthType);
const now = Tone.now();
let offset = noteValueToSeconds(_state.notesPlayed);
synth.triggerAttackRelease('c4', '4n', now + offset);
_state.notesPlayed += 4;
// const now = Tone.now();
// let offset = noteValueToSeconds(_state.notesPlayed);
// synth.triggerAttackRelease('c4', '4n', now + offset);
// _state.notesPlayed += 4;
}

async function voice() {
Expand All @@ -61,7 +62,6 @@ async function voice() {
// }
// }).toDestination();


// _state.notesPlayed = 0;
// const now = Tone.now();
// let offset = noteValueToSeconds(_state.notesPlayed);
Expand Down

0 comments on commit 12d2b23

Please sign in to comment.