mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-20 10:08:29 +00:00
clear sounds + cps on pattern change
+ similar to shuffle
This commit is contained in:
parent
b03bf9ec3d
commit
cec8553fb5
@ -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…
x
Reference in New Issue
Block a user