A more example centric Topos
This commit is contained in:
@ -69,7 +69,7 @@ export const template_universe = {
|
||||
};
|
||||
|
||||
export const template_universes = {
|
||||
Default: {
|
||||
Welcome: {
|
||||
global: { candidate: "", committed: "", evaluations: 0 },
|
||||
locals: {
|
||||
1: { candidate: "", committed: "", evaluations: 0 },
|
||||
@ -83,7 +83,7 @@ export const template_universes = {
|
||||
9: { candidate: "", committed: "", evaluations: 0 },
|
||||
},
|
||||
init: { candidate: "", committed: "", evaluations: 0 },
|
||||
notes: { candidate: "// NOTES" },
|
||||
notes: { candidate: "" },
|
||||
},
|
||||
Help: tutorial_universe,
|
||||
};
|
||||
|
||||
@ -443,7 +443,8 @@ mod(.5)::snd(div(2) ? 'kick' : 'hat').out()
|
||||
|
||||
${makeExample(
|
||||
"div is great for pretty much everything",
|
||||
`div([1, .5].beat()) :: mod(.25) :: sound('shaker').out();
|
||||
`
|
||||
div([1, .5].beat()) :: mod(.25) :: sound('shaker').out();
|
||||
div([4, .5].beat()) :: mod(.25) :: sound('shaker').speed(2).out();
|
||||
div([1, 2].beat()) :: mod(1.75) :: sound('snare').out();
|
||||
div(4) :: mod(.5) :: sound('tom').out()
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
export const examples = [
|
||||
`
|
||||
// Crazy arpeggios - Bubobubobubo
|
||||
bpm(110)
|
||||
mod(0.125) && sound('sawtooth')
|
||||
.note([60, 62, 63, 67, 70].div(.125) +
|
||||
@ -12,6 +13,7 @@ mod(1) && snd('kick').out();
|
||||
mod(2) && snd('snare').out();
|
||||
mod(.5) && snd('hat').out();
|
||||
`, `
|
||||
// Obscure Shenanigans - Bubobubobubo
|
||||
mod([1/4,1/8,1/16].div(8)):: sound('sine')
|
||||
.freq([100,50].div(16) + 50 * ($(1)%10))
|
||||
.gain(0.5).room(0.9).size(0.9)
|
||||
@ -21,6 +23,7 @@ mod(2) :: sound('dr').n(5).out()
|
||||
div(3) :: mod([.25,.5].div(.5)) :: sound('dr')
|
||||
.n([8,9].pick()).gain([.8,.5,.25,.1,.0].div(.25)).out()
|
||||
`, `
|
||||
// Resonance bliss - Bubobubobubo
|
||||
mod(.25)::snd('arpy')
|
||||
.note(30 + [0,3,7,10].beat())
|
||||
.cutoff(usine(.5) * 5000).resonance(10).gain(0.3)
|
||||
|
||||
@ -3,6 +3,7 @@ import {
|
||||
colors,
|
||||
animals,
|
||||
} from "unique-names-generator";
|
||||
import { examples } from "./examples/excerpts";
|
||||
import { EditorState, Compartment } from "@codemirror/state";
|
||||
import { ViewUpdate, lineNumbers, keymap } from "@codemirror/view";
|
||||
import { javascript } from "@codemirror/lang-javascript";
|
||||
@ -184,9 +185,12 @@ export class Editor {
|
||||
// Loading the universe from local storage
|
||||
// ================================================================================
|
||||
|
||||
this.selected_universe = this.settings.selected_universe;
|
||||
this.universe_viewer.innerHTML = `Topos: ${this.selected_universe}`;
|
||||
this.universes = { ...template_universes, ...this.settings.universes };
|
||||
this.selected_universe = "Welcome";
|
||||
this.universe_viewer.innerHTML = `Topos: ${this.selected_universe}`;
|
||||
let random_example = examples[Math.floor(Math.random() * examples.length)];
|
||||
this.universes[this.selected_universe].global.committed = random_example;
|
||||
this.universes[this.selected_universe].global.candidate = random_example;
|
||||
|
||||
// ================================================================================
|
||||
// Audio context and clock
|
||||
|
||||
Reference in New Issue
Block a user