https://github.com/alvaro-cuesta/lambda-musika
A JavaScript DAW that emphasizes functions as its core building block. In practice, a realtime audio scripting language and batteries-included DSP library, running on the web.
https://github.com/alvaro-cuesta/lambda-musika
audio daw functional-programming live-coding music
Last synced: about 2 months ago
JSON representation
A JavaScript DAW that emphasizes functions as its core building block. In practice, a realtime audio scripting language and batteries-included DSP library, running on the web.
- Host: GitHub
- URL: https://github.com/alvaro-cuesta/lambda-musika
- Owner: alvaro-cuesta
- License: gpl-3.0
- Created: 2016-11-29T22:41:35.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2025-09-14T12:14:38.000Z (6 months ago)
- Last Synced: 2025-10-25T08:54:49.296Z (5 months ago)
- Topics: audio, daw, functional-programming, live-coding, music
- Language: TypeScript
- Homepage: https://lambda.cuesta.dev
- Size: 760 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Lambda Musika, the functional DAW
A **JavaScript DAW** that emphasizes **functions as its core building block**. In practice, a realtime audio scripting language and batteries-included DSP library, running on the web. Live-coding ready!
Try it now on lambda.cuesta.dev!
> [!IMPORTANT]
> Keep in mind JavaScript is _not_ the best language for CPU-intensive tasks, so performance will be limited.
>
> On the other hand, it runs in your browser!
## Usage
A Musika script is just a regular JS script:
- interpreted client side
- that returns a function `t => [l, r]`
- where `t` is time
- and `l` and `r` are output samples for the left and right channels in `[-1, 1]` range
For now there is no static documentation available, just dive in the source code and learn form the [default song](examples/default.musika), other [examples](examples/), or just browse the [Musika library](src/lib/Musika/).
### Available defines:
- `sampleRate`, current audio device sample rate.
- `setLength(secs)`, sets the total length of the song in seconds.
- Used to seek using the time slider.
- When omitted the time slider is disabled and the sound is played endlessly (useful for drone or endless procedural music).
- `Musika`, the [Musika library](src/lib/Musika/)
### Empty script skeleton:
```js
const { Generator, Envelope, Filter, Operator, Music, Util } = Musika;
return (t) => [0, 0];
```
## Development
Install [Node.js](https://nodejs.org), clone this repository and run this in the root of the project to install the required dependencies:
```sh
npm install
```
### Local development
Just run this to start a local development server and follow the instructions:
```sh
npm run dev
```
### Lints
You should periodically run linters to ensure the code passes some basic checks:
```sh
npm run lint:tsc
npm run lint:eslint
npm run lint:prettier
# Or just let your IDE do the work with TypeScript/ESLint/Prettier integrations
npm run lint:knip
npm run lint:madge
```
These are automatically run as checks on GitHub Actions, but it's better if you keep lints up to date as you code!
### Things to do
- See [`TODO.md`](TODO.md) for outstanding general tasks.
- See [open issues](https://github.com/alvaro-cuesta/lambda-musika/issues).
- Do a global search for `@todo` in the code.
## Production build
Run this to serve the application in production mode:
```sh
npm run build
npm run preview
```