diff --git a/index.html b/index.html index 936a992..a163d7b 100644 --- a/index.html +++ b/index.html @@ -236,8 +236,8 @@ - - + + diff --git a/src/AppSettings.ts b/src/AppSettings.ts index 0f2dd7f..0ddd270 100644 --- a/src/AppSettings.ts +++ b/src/AppSettings.ts @@ -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, }; diff --git a/src/Documentation.ts b/src/Documentation.ts index 2097e90..197b5af 100644 --- a/src/Documentation.ts +++ b/src/Documentation.ts @@ -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() diff --git a/src/examples/excerpts.ts b/src/examples/excerpts.ts index cd6d854..078a2f4 100644 --- a/src/examples/excerpts.ts +++ b/src/examples/excerpts.ts @@ -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) diff --git a/src/main.ts b/src/main.ts index b06cc24..f39fff9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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