clear sounds + cps on pattern change
+ similar to shuffle
This commit is contained in:
parent
b03bf9ec3d
commit
cec8553fb5
1 changed files with 8 additions and 2 deletions
|
|
@ -247,9 +247,15 @@ export function Repl({ embedded = false }) {
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const handleUpdate = (newCode) => {
|
const handleUpdate = async (newCode, reset = false) => {
|
||||||
|
if (reset) {
|
||||||
|
clearCanvas();
|
||||||
|
resetLoadedSounds();
|
||||||
|
scheduler.setCps(1);
|
||||||
|
await prebake(); // declare default samples
|
||||||
|
}
|
||||||
(newCode || isDirty) && activateCode(newCode);
|
(newCode || isDirty) && activateCode(newCode);
|
||||||
logger('[repl] code updated! tip: you can also update the code by pressing ctrl+enter', 'highlight');
|
logger('[repl] code updated!');
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleShuffle = async () => {
|
const handleShuffle = async () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue