make 0.5hz cps the default (#931)

* 0.5 default cps

* 1 -> 0.5 cps defaults

* start moving examples to 2Hz

* more 2Hz doc edits

* small tweaks

* format

* adapt cycles page

* adapt pitch page

* tonal page

* accumulation

* synth page

* adapt conditional-modifiers

* audio effects page

* adapt signals doc

* fix: errors for signals

* adapt signals page

* start time modifiers

* adapt time modifiers

* adapt factories

* hydra + pattern intro

* adapt mini notation page

* start recipes

* adapt recipes page

* use code_v1 table

* delete old dbdump + add new csv based tool

* fix: tests

* fix: cpm

* shuffle featured patterns

* fix: snapshot

---------

Co-authored-by: Felix Roos <flix91@gmail.com>
This commit is contained in:
Alex McLean 2024-01-22 19:02:34 +00:00 • committed by GitHub
parent 46c2c72637
commit 6422047cff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 3852 additions and 2386 deletions

View file

@ -30,7 +30,6 @@ import { getRandomTune, initCode, loadModules, shareCode, ReplContext } from './
import PlayCircleIcon from '@heroicons/react/20/solid/PlayCircleIcon';
import './Repl.css';
const { code: randomTune, name } = getRandomTune();
const { latestCode } = settingsMap.get();
let modulesLoading, presets, drawContext, clearCanvas, isIframe;
@ -98,7 +97,7 @@ export function Repl({ embedded = false }) {
// init settings
initCode().then((decoded) => {
initCode().then(async (decoded) => {
let msg;
if (decoded) {
editor.setCode(decoded);
@ -107,6 +106,7 @@ export function Repl({ embedded = false }) {
editor.setCode(latestCode);
msg = `Your last session has been loaded!`;
} else {
const { code: randomTune, name } = await getRandomTune();
editor.setCode(randomTune);
msg = `A random code snippet named "${name}" has been loaded!`;
}
@ -159,7 +159,7 @@ export function Repl({ embedded = false }) {
const resetEditor = async () => {
clearCanvas();
resetLoadedSounds();
editorRef.current.repl.setCps(1);
editorRef.current.repl.setCps(0.5);
await prebake(); // declare default samples
};
@ -176,7 +176,7 @@ export function Repl({ embedded = false }) {
editorRef.current.evaluate();
};
const handleShuffle = async () => {
const patternData = getRandomTune();
const patternData = await getRandomTune();
const code = patternData.code;
logger(`[repl] ✨ loading random tune "${patternData.id}"`);
setActivePattern(patternData.id);