On this pageImports by task

Audio SDK

The typed boundary shared by module graphs, browser audio, and native hosts.

The Audio SDK is the maruaudio package's library side. Install it in a project with npm i maruaudio; a project created with maru init already depends on it. Most authors work in the module declaration, src/index.ts, using maruaudio/audio/define for the product definition and maruaudio/audio/graph for graph nodes.

ts
import { defineEffect } from "maruaudio/audio/define"
import { nodes } from "maruaudio/audio/graph"

export default defineEffect(
  {
    id: "com.example.level",
    name: "Level",
    schema: {
      params: [
        {
          path: "level",
          label: "Level",
          group: "Main",
          type: "float",
          min: 0,
          max: 1,
          default: 0.8,
        },
      ],
    },
  },
  ({ input, output, connect, expose }) => {
    const gain = nodes.gain("gain", { gain: 0.8 })
    connect(input.output, gain.audioInput)
    connect(gain.audioOutput, output.input)
    expose("level", gain.params.gain)
  }
)

The graph is the source of truth for audio and MIDI connections. The parameter schema is the source of truth for the workbench, UI bindings, host automation, saved state, and generated plugin tables.

For reusable filters, effects, synthesis, and analysis leaves, see the DSP library. The DSP reference covers filters/EQ, dynamics and de-essing, drive and triode shaping, record crackle/dust/hum, delays and reverse buffers, modulation and rotary, pitch/microshift, algorithmic hall/spring reverbs, and stereo utilities. Its effect API table identifies focused imports, controls, storage requirements, and model limits.

Multifx's effect-chain contract supplies its stable algorithm IDs and macro metadata; the signal-processing implementations remain in the maruaudio/dsp/... leaves. Declare ports and parameters with the Audio SDK, compose only the leaves your Processor needs, and qualify that composition for its intended targets. An available leaf does not imply external DAW sidechain routing, tempo synchronization, or a released plugin in every format.

For a module face and host-bound controls, see Module UI and the UI kit catalog.

Imports by task

Each maruaudio/... entry covers one task and loads only what that task needs. Importing a declaration does not start an audio engine, open devices, load a compiler or load UI code.

ImportUse it for
maruaudio/audio/defineDeclaring an effect, instrument, generator or MIDI tool
maruaudio/audio/graphGraph nodes and their composition
maruaudio/contractsShared types, such as the face props a module face receives
maruaudio/dsp/...Signal-processing leaves for a Processor; see the DSP library
maruaudio/ui/...Face controls and parameter bindings; see Module UI
maruaudio/apiHosted Maru services from your own code

The CLI overview covers the maru command that ships in the same package.

Hosted services

For a step-by-step integration, read Add generative audio to your app. It shows how Maru's AI toolkit connects a Generate action to a hosted job and brings generation into an instrument through its host capability.

maruaudio/api calls Maru's hosted services from a site, server, Worker or script: running generation jobs and reading or writing your banks and projects. It uses only fetch, so it runs in browsers, Node, Workers and Deno, and the maru CLI and maru mcp use the same client.

ts
import { createMaruClient } from "maruaudio/api"

const maru = createMaruClient({ auth: { apiKey: process.env.MARU_API_KEY } })

const job = await maru.audio.generate({ prompt: "dry wooden hit", seconds: 2, seeds: [7] })
for await (const event of job.events()) {
  // progress, results and completion
}
const bank = await maru.banks.create({ title: "Sketches" })

On a server, authenticate with a personal token from your account tokens page; do not ship one to a browser. An application that already signs users in can pass their tokens instead.

The workbench and product shells activate the appropriate engine transport for you. Low-level createAudioBackend() APIs exist for host integration, but normal module UI code should use the generated project bindings rather than construct a runtime by hand.

For the authoring workflow, read How it works, Project structure, and the Development workbench.