Any documentation for creating custom modes?

In addition to REPL Mode, you might want to check out Tweak Mode for inspiration.

http://galsasson.com/tweakmode/

What you are describing is an interesting set of problems – there are a lot of limitations to consider even for fairly simple sketches.

One thing that comes to mind – to rewind the behavior of random() and noise(), they would need to be seeded, then returned to the seed and walked all the way forward to a specific step count. Alternately, you would need to copy the underlying random generator at snapshot steps. Maybe there are other ways?

Re: memory – one general approach to memory-limited histories is sparse snapshotting, in which snapshots get more and more sparse as you go further back in time (and / or are culled to stay under a limit once you reach a certain number of snapshots, with older timeframes culled more often).

2 Likes