build
This commit is contained in:
parent
0c8d4a9671
commit
69d802a060
3 changed files with 88 additions and 7 deletions
9
docs/dist/App.js
vendored
9
docs/dist/App.js
vendored
|
|
@ -48,11 +48,12 @@ function App() {
|
|||
const cycle = useCycle({
|
||||
onEvent: useCallback((time, event) => {
|
||||
try {
|
||||
if (typeof event.value === "string") {
|
||||
if (!isNote(event.value)) {
|
||||
throw new Error("not a note: " + event.value);
|
||||
if (!event.value?.onTrigger) {
|
||||
const note = event.value?.value || event.value;
|
||||
if (!isNote(note)) {
|
||||
throw new Error("not a note: " + note);
|
||||
}
|
||||
defaultSynth.triggerAttackRelease(event.value, event.duration, time);
|
||||
defaultSynth.triggerAttackRelease(note, event.duration, time);
|
||||
} else {
|
||||
const {onTrigger} = event.value;
|
||||
onTrigger(time, event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue