Skip to content

Your First Project

This content is for v0.7. Switch to the latest version for up-to-date documentation.

So far you’ve been evaluating code line by line in VSCode. This is great for exploration and live coding, but when you want to save a piece, share it, or run it from the command line, you need a project.

Use resonon new to scaffold a project:

Terminal window
resonon new my_song

Output:

Created resonon.toml
Created src/
Created src/main.non
Created README.md
Created LICENSE
Initialized git repository
Project 'my_song' initialized.

This creates a my_song/ directory with everything you need.

my_song/
├── resonon.toml # Project manifest
├── src/
│ └── main.non # Entry point
├── README.md
├── LICENSE
└── .gitignore

The manifest describes your project:

[package]
name = "my_song"
version = "0.1.0"
authors = ["Your Name <email>"]
resonon = "0.7.0"
[dependencies]
# example = { source = "gh:user/repo", version = "v1.0" }
FieldDescription
nameProject name
versionYour project’s version
authorsList of authors
resononMinimum Resonon version required
[dependencies]External packages (empty by default)

The entry point. The scaffolded template looks like this:

// Entry point — run with `resonon run`
project_title("my_song");
project_bpm(120);
fn greet(name) {
PRINT f"Hello from {name}!";
}
greet("my_song");

project_title and project_bpm set metadata for the project. You’ll replace the template code with your own music.

From inside the project directory (or any subdirectory), run:

Terminal window
cd my_song
resonon run

Resonon finds resonon.toml by searching upward from the current directory, then executes src/main.non.

You can also run any .non file directly without a project:

Terminal window
resonon my_script.non

Replace the template in src/main.non with real music. Here’s a starting point using what you learned in the previous pages:

project_title("my_song");
project_bpm(120);
use "std/instruments" { Sampler, Kit };
// Drums
let drums = AudioTrack("drums");
drums.load_instrument(Sampler(Kit("cr78")));
drums << [bd _ sd _, ch ch ch ch];
// Bass (MIDI — route to your DAW or synth)
let bass = MidiTrack(2);
bass << [C2 _ C2 G2];
PLAY;

You can also open the project in VSCode and use select-and-execute to develop interactively. Once you’re happy with the result, save your code in src/main.non so it’s reproducible with resonon run.

resonon new accepts flags for different project types:

FlagDescription
--libLibrary project (src/lib.non instead of src/main.non)
--kitSample kit project (adds a kits/ directory)
--nativeNative Rust extension project (adds a native/ crate)
Terminal window
resonon new my_library --lib # Importable library
resonon new my_drums --kit # Sample kit with kits/ directory
resonon new my_plugin --native # Rust extension with native/ crate

You can also scaffold in the current directory with resonon init:

Terminal window
mkdir my_project && cd my_project
resonon init my_project

Continue the quickstart or jump to the reference docs:

  • Custom DSP — Write your own effects and synthesizers
  • MIDI I/O — MIDI output, input, and learn mapping
  • Pattern Basics — Deep dive into time division, pattern types, and looping
  • Samplers — Drum kits, melodic samplers, and sample manipulation
  • VSCode Extension — Full editor reference with shortcuts and features