Skip to content

About

Rust/WASM generating procedural music in the web browser. Converts any type of data to MIDI files that can be played back or downloaded.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

147 Commits

Folders and files

Repository files navigation

Midi Machine

Setup

  • Install Node/npm
  • Install Rust

Install dependencies:

cd frontend
npm install

Building the Rust WASM code

cd musicgen
chmod +x build_wasm.sh
./build_wasm.sh

After building the Rust code, the musicgen/pkg/musicgen_bg.wasm file will need to be moved to frontend/public/ for changes to take effect. If you changed the function signature of the WASM function, then you will also need to move the musicgen/pkg/musicgen.js file to the same folder.

Running the web server locally

npm run dev

Generating test data

To prevent breaking changes to the default configurations, we can generate MIDI files to test the output against. It's somewhat of a mutation test.

Run this command to generate the midi files:

cargo run --bin generate_midi

Run this command to determine whether or not the output has changed:

cargo test

Contributions

Any contributions will be licensed under the MIT license, unless specified otherwise.

PRs with breaking changes to the default configurations will not be merged. If you want to push breaking changes, either create a new:

  • chord placement method
  • chord group
  • ChordType definition(s) under the custom chord group

About

Rust/WASM generating procedural music in the web browser. Converts any type of data to MIDI files that can be played back or downloaded.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages