Custom sequencer

Yet another take

I should simply rewrite Orca and add some cool midi IN and a multiplayer mode. Sounds like a reasonable Rusty project for a few weekends.

New branch of ideas - interconnectivity

Image a drum sequencer in which you never directly program patterns. Instead, you get a few "basic" rhytms and compose complex patterns by relationships between other patterns - addition, subtraction, xor, negation, etc. This approach could also be applied to parameter modulation and then used for breathing more life into melodies.

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