Custom sequencer

Unordered dump of ideas for a custom sequencer

Basic assumptions about the "language"

A language which can move arbitrary lists around..?

Idea: All "song code" should share a common variable namespace, which could be mutated at any point (in a synchronous manner). Edit: this is cool but what if I want to reuse a function? Maybe there should be a stack-based scope for the namespace?

The code defines when to tick (with something like a generator or an async/await syntax) and a runtime makes sure that it will tick at the right time.

Each function can be hot-swapped without having to reinitialise variables, as variables are global. Sounds kinda crazy but this could actually be done very easily with an embedded python interpreter.

Define short operators for doing basic sound manipulation such as shifting by an octave, doubling in length (LilyPond syntax to the rescue?).

I'll need to figure out some way to do smooth parameter automation though.

Embedded scripting language?

Crafting Interpreters

Rust has Rhai, I'm kinda eager to try it :)

Figuring a custom langauge could be a funny adventure, I could start from some very limited Lisp implementation.

Prototyping with snippets

Cool ligatures

|> -> => \/ ->> =>> ~> 

PRINT

seq kick 1 # Optional: set a default MIDI channel
pattern_select -> @2.73 # Define a midi listener. Channel 2 message 73
pattern = [ 'C3! C3! C? C G G! ]  # Define a seq-scoped variable
step = 0

rhytm:
pattern [step]  # Expression returning a value sends it via midi
step += 1
step %= 1
> 1 rhytm  # Await a single step and jump to rhytm:

Crazy ideas dump