Skip to content

NoahFreelove/flow-sharp

Repository files navigation

Flow Language (flow-lang)

A music production language.

AI Disclaimer

This entire repo was vibecoded with the help of the GSD Framework and Claude Opus. I did direct the features and testing so it was mainly supervised - but expect bugs to appear.

What is flow-lang?

Flow-lang is a statically moderately-strongly typed functional interpreted language. The goal of flow-lang is to make a tool for code-minded folk like myself to create music in a fun way. The goal is also to not prefer one genre over another. You should be able to make rock, pop, jazz, or a symphony, all in one place - and all in the same buffer.

Flow-lang prioritizes ergonomics over almost everything. This language is interpreted, its not fast, and its not trying to be fast (though it takes the easy wins where possible).

Many operations that would be errors in some languages are not in flow-lang because it always takes the most cheritable interpretation of your code. You could call this the JavaScript approach though I don't think we're as vulgar as JavaScript's type coercion. For example:

  Buffer wet = reverb(input, 5.0, 5.0, 5.0)      
  //                          ^    ^    ^ 
  //                       roomSize, damping, mix. flow-lang clamps all to [0, 1.0]

Flow-lang will silently fix this stuff for you. So you can use variables in position of arguments pretty freely without worrying about adjusting one variable means it being out of domain for some other function where you use it.

What ISN'T flow-lang?

Flow-lang is not AI generated music. Flow lang is just a way to generate music. You still have to place the notes and make the samples, just how you would in a standard DAW except you use code. This is completely different to how AI generated music is created.

You could use AI to create .flow files but this still isn't really AI generated music, its more vibecoded music I suppose. As much as I love claude, it cannot generate anything super pleasant sounding in flow-lang yet (sorry claude!).

Flow-lang is also not trying to do some crazy GPU accelerated parallel rendering pipeline stuff. I'm not trying to optimize the hell out of flow-lang.

I hope my direction on where I want flow-lang to go was clear. If it has to be one sentence: Flow-lang prioritizes the development experience and the artist regardless of the performance of the program.

Features

See FEATURES.md for a complete list of features.

Showcase

Two pieces shipped in v1.4 (2026-05-16), both rendered entirely from Flow source against the VSCO Community CE 1.1.0 SFZ library via the Phase 33 orchestral sampler. In Five Voices is a pensive ~60 s ABA symphony in D minor for 5 orchestral instruments (violin, cello, flute, horn, timpani). Stride & Stomp is an upbeat ~58 s solo-piano ragtime in F major. Same interpreter, same SFZ pipeline, opposite moods -- the genre-agnostic claim in one release.

Install (Linux x64)

Per-user install (no sudo), from a local checkout:

bash scripts/install.sh

System-wide install:

sudo bash scripts/install.sh --system

The script copies a self-contained flow binary (~38 MB) to either ~/.local/share/flow/ + symlink at ~/.local/bin/flow (per-user, default) or /usr/local/share/flow/ + symlink at /usr/local/bin/flow (system-wide). Re-running upgrades in place; scripts/uninstall.sh removes everything except your ~/.config/flow/config.toml.

CLI subcommands

Subcommand What it does
flow run script.flow Run a Flow script
flow eval "expr" Evaluate one expression
flow repl Interactive REPL (auto-imports @std @audio @collections)
flow watch script.flow Auto-reload on file change
flow play script.flow Render + play via PulseAudio
flow render script.flow -o out.wav Render to WAV
flow flow2midi script.flow -o out.mid Render to MIDI
flow midi2flow input.mid -o out.flow Convert MIDI → round-trippable Flow source
flow check script.flow Parse + type-check only
flow new piece-name Scaffold a new piece
flow version Print version

Config lives at ~/.config/flow/config.toml. Optional keys: default_tempo, default_timesig, default_audio_device, stdlib_search_path. See scripts/install.sh for the schema.

Bugs?

This tool is just for fun, not any serious professional work. Bug reports may or may not be addressed.

Editor support

Flow ships with a Language Server (flow-lsp):

VSCode / Cursor / VSCodium / Windsurf

Install the Flow Language extension which is bundled with this repo. Its not on the marketplace as of now.

Emacs, Neovim, and other LSP editors

The flow-lsp server speaks plain LSP 3.17 over stdio, so any editor with an LSP client can drive it. See docs/editor-setup/ for per-editor config snippets (Neovim nvim-lspconfig, Helix languages.toml, Emacs lsp-mode/eglot) and binary install guidance.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages