diff --git a/README.md b/README.md index 58f5168..5b36a35 100644 --- a/README.md +++ b/README.md @@ -55,26 +55,29 @@ To build a standalone browser application using [Tauri](https://tauri.app/), you - run `yarn tauri build` - run `yarn tauri dev` -# Roadmap to Topos v1.0 +# Roadmap to Topos v1.0 (first release) ## Application User Interface -- [ ] Give more information the local context of execution of every script - - print/display the internal iterator used in each script - - animate code to show which line is currently being executed -- [ ] More rhythmic generators -- [ ] Rendering static files (MIDI, MOD, etc...) +- [ ] Visual feedback for script execution + - [ ] add blinking dots in the upper-right corner of the editor + - [ ] visual warning when an error is detected (blinking red?) + - [ ] more variety in visual signals when evaluating code +- [ ] Code animation for rhythmic functions on certain lines (show that a statement is true) +- [ ] More/Better rhythmic generators + - [ ] Ability to write simple musical sequences + - [ ] Ability to create musical structures easily +- [ ] Rendering static files (MIDI, MOD, etc...) +- [ ] Add a way to save the current universe as a file. +- [ ] Add a way to load a universe from a file. +- [ ] Add a way to share the universe using a link. ## Scheduler - [ ] Stable / robust clock and script/event scheduler. - - [x] Add a way to set the clock's tempo. - - [x] Add a way to set the clock's time signature. + - [ ] There is still a tiny bit of imprecision left. - [ ] Add a way to set the clock's swing. - [ ] MIDI Clock In/Out support. - - [x] Performance optimisations and metrics. -- [ ] Add a way to save the current universe as a file. -- [ ] Add a way to load a universe from a file. ## User Interface diff --git a/src/API.ts b/src/API.ts index c76640a..85e553d 100644 --- a/src/API.ts +++ b/src/API.ts @@ -1,9 +1,10 @@ -import { Editor } from "./main"; -import { scale } from "./Scales"; -import { tryEvaluate } from "./Evaluator"; -import { MidiConnection } from "./IO/MidiConnection"; -import { DrunkWalk } from "./Utils/Drunk"; import { Pitch, Chord, Rest, Event, Start, cachedStart, pattern } from "zifferjs"; +import { MidiConnection } from "./IO/MidiConnection"; +import { tryEvaluate } from "./Evaluator"; +import { DrunkWalk } from "./Utils/Drunk"; +import { LRUCache } from 'lru-cache'; +import { scale } from "./Scales"; +import { Editor } from "./main"; import { superdough, samples, @@ -11,7 +12,9 @@ import { registerSynthSounds, // @ts-ignore } from "superdough"; -import { LRUCache } from 'lru-cache'; + +// This is an LRU cache used for storing persistent patterns +const cache = new LRUCache({max: 1000, ttl: 1000 * 60 * 5}); interface Pattern { pattern: any[]; @@ -20,11 +23,9 @@ interface Pattern { }; } -const cache = new LRUCache({max: 1000, ttl: 1000 * 60 * 5}); /** - * We are overriding the includes method which is rather - * useful to check the position of an event on a specific beat. + * This is an override of the basic "includes" method. */ declare global { interface Array { @@ -35,6 +36,7 @@ Array.prototype.in = function (this: T[], value: T): boolean { return this.includes(value); }; +// Loading the Strudel sampler Promise.all([ initAudioOnFirstClick(), samples("github:tidalcycles/Dirt-Samples/master"),