Install a Package
A package is a git repository with code (src/lib.non), sample kits (kits/), or both. It installs
into the project that uses it, and resonon.toml and resonon.lock record it, so the project gets
the same package on every machine. Every command is in the
CLI reference; every manifest key in
resonon.toml.
Install a package
Section titled “Install a package”In the project folder, name the repository with gh:user/repo:
resonon install gh:resonon/drum-kitsThe package is cloned into dependencies/drum-kits, and added to resonon.toml and resonon.lock.
Resonon prints what it found in it:
Installed 'drum-kits' [kits] to /Users/you/my-song/dependencies/drum-kits Kits: 808 — Sampler(Kit("drum-kits/808")) vinyl — Sampler(Kit("drum-kits/vinyl"))Updated resonon.toml and resonon.lock[code] means the package has a src/lib.non, [kits] a kits/ folder, [code+kits] both.
Outside a project, resonon install is an error: start one with resonon new first.
Pin a version
Section titled “Pin a version”Add a git tag after @:
resonon install gh:resonon/drum-kits@v1.0Or write it into resonon.toml and run resonon install:
[dependencies]drum-kits = { source = "gh:resonon/drum-kits", version = "v1.0" }Without a tag, the install takes the newest commit, and resonon.lock records which one.
Install a cloned project’s dependencies
Section titled “Install a cloned project’s dependencies”In a project you cloned or were sent, run it with no argument:
resonon installIt installs every dependency in resonon.toml at the commit in resonon.lock, not at the newest one,
so you get the same code as whoever committed the lock. A dependency that has moved away from the lock
is put back, and the line says so:
Restored 'drum-kits' [kits] to /Users/you/my-song/dependencies/drum-kits, at locked commit 4f3c1a9e02b7d5c8a1f6e3b9d0c2a7e4f8b1d6c3A version tag in resonon.toml wins over the lock.
If the project needs a version of resonon you do not have, resonon install stops before it fetches
anything, and names the command that installs that version.
Update or remove a package
Section titled “Update or remove a package”resonon update # every dependencyresonon update drum-kits # oneupdate fetches each dependency again, at its tag or at the newest commit, builds any native
extension, and writes a new resonon.lock. Commit the lock: it is what makes the next
resonon install reproducible.
resonon remove drum-kitsremove takes the package out of resonon.toml and resonon.lock, and deletes its folder.
Use a package’s code
Section titled “Use a package’s code”use the package by its name. It binds the name with hyphens turned into underscores:
use "studio-tools";
let pattern = studio_tools.swing(42, 0.6);Use a package’s kits
Section titled “Use a package’s kits”Name the kit with the package in front of it:
use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.set_instrument(Sampler(Kit("drum-kits/808")));Kit("808") works too. Write the package when two packages have a kit with the same name, or to show
where a sound comes from.
See what is installed
Section titled “See what is installed”resonon pkg list # every package, its type and its kitsresonon pkg inspect drum-kits # its description, exports and kitsRelated
Section titled “Related”- Publish a Package — make your own
- Modules — how
usefinds a package - Fix Install and Project Problems — a module that is not found, a package with nothing in it