Small API. Real sound chips.
The SDK creates and plays music locally. The HTTP API publishes it. You do not need an account or a server to make sound.
npm i chipvoicePlay your project
import { ProjectPlayer } from 'chipvoice';
const player = new ProjectPlayer();
await player.load(project);
playButton.onclick = () => player.play();
player.pause();
player.seek(12); // Seconds, using the audible clock
player.restart();
await player.update({ chip: 'snes', tempoScale: 1.1 });
player.dispose(); // Closes only contexts it ownsLoading prepares audio in a cancellable worker. A failed or superseded update keeps the current music. Updates apply when ready and preserve the musical position.
Import, validate and render
import { importMidi, projectFromPerformance, validateProject,
renderProject, toWav } from 'chipvoice';
const project = projectFromPerformance(importMidi(bytes), 'snes');
// Explicitly permit reported hardware voice omissions:
project.settings.allowLoss = true;
console.log(validateProject(project));
const { audio, plan } = renderProject(project); // Node or worker
console.log(plan?.losses, plan?.mix);
const wav = toWav(audio);Performance sources retain notes, timing, expression and instruments. Legacy scores retain their authored mix. Native captures keep their original commands until you adapt them.
Publish and remix
POST /api/v1/projects
Authorization: Bearer YOUR_API_KEY
Idempotency-Key: a-unique-request-id
Content-Type: application/json
{ "project": { ... }, "visibility": "public" }
GET /api/v1/projects?q=orbit&chip=snes
GET /api/v1/projects/PROJECT_ID
// Publish a remix: add "parentId": "PROJECT_ID"
// Immutable preview / complete render jobs:
POST /api/v1/projects/PROJECT_ID/render
{ "kind": "preview" }
GET /api/v1/jobs/JOB_IDPublish with a browser session or API key. Use public, unlisted or private visibility. Reuse the same request key only to retry the same publication. New revisions get new IDs.
Previews contain up to 30 seconds. Complete server exports are bounded to 40 MB and 240 seconds of processing; longer jobs fail explicitly. Export locally when needed.
OpenAPI contract ↗Musical controls and limits
Choose a console, tempo, transposition and per-part instruments, trim and importance. Hardware limits remain real: omitted notes and approximate sounds are reported, not hidden.
The SDK accepts up to ten minutes per performance. Public projects support up to 4 MB of data. Published audio is pinned to its renderer; a new engine requires a new publication.
For game sound effects and custom sequencing, Chip, APU and the individual chip cores remain available.
Full SDK reference ↗