# @suaveplan/audio-transport - Universal musical clock and transport: sample-accurate scheduling with PPQ, BPM automation, swing, time signatures, and loop regions. Zero browser or Node dependencies. Universal musical clock and transport: sample-accurate scheduling with PPQ, BPM automation, swing, time signatures, and loop regions. Zero browser or Node dependencies. ## Documentation tree - [error-codes](./src/error-codes/error-codes.md) — This module defines the canonical error codes, metadata, and error class for the `@suaveplan/audio-transport` package.… - [error-codes](./src/error-codes/error-codes.md) — This module defines the canonical error codes, metadata, and error class for the `@suaveplan/audio-transport` package.… - [scheduler](./src/scheduler/scheduler.md) — The `TransportScheduler` class drives the lookahead loop that polls the transport and fires scheduled callbacks. It bri… - [scheduler](./src/scheduler/scheduler.md) — The `TransportScheduler` class drives the lookahead loop that polls the transport and fires scheduled callbacks. It bri… - [scheduler.schemas](./src/scheduler/scheduler.schemas.md) — Zod boundary schema for `TransportScheduler` construction options. - [signal](./src/signal/signal.md) — The `Signal` class implements a piecewise automation curve for scalar parameters such as BPM. It stores automation poin… - [signal](./src/signal/signal.md) — The `Signal` class implements a piecewise automation curve for scalar parameters such as BPM. It stores automation poin… - [signal.schemas](./src/signal/signal.schemas.md) — Zod boundary schema for `Signal` construction options. - [tick-source](./src/tick-source/tick-source.md) — The `TickSource` class converts between audio time (seconds) and musical ticks, integrating tempo curves for sample-acc… - [tick-source](./src/tick-source/tick-source.md) — The `TickSource` class converts between audio time (seconds) and musical ticks, integrating tempo curves for sample-acc… - [tick-source.schemas](./src/tick-source/tick-source.schemas.md) — Zod boundary schema for `TickSource` construction options. - [time](./src/time/time.md) — This module parses musical time tokens and converts between ticks, seconds, and bars:beats:sixteenths notation. - [time](./src/time/time.md) — This module parses musical time tokens and converts between ticks, seconds, and bars:beats:sixteenths notation. - [time.schemas](./src/time/time.schemas.md) — Zod boundary schemas for time-related types. - [transport](./src/transport/transport.md) — The `Transport` class is the core musical clock and scheduler. It manages playback state, event scheduling, loop region… - [transport](./src/transport/transport.md) — The `Transport` class is the core musical clock and scheduler. It manages playback state, event scheduling, loop region… - [transport.schemas](./src/transport/transport.schemas.md) — Zod boundary schema for `Transport` construction options. ## Install ```bash bun add @suaveplan/audio-transport ``` ## Quick start ```ts import { Transport, TransportScheduler } from "@suaveplan/audio-transport"; const clock = () => Date.now() / 1000; const tr = new Transport({ clock, bpm: 120, ppq: 192 }); const scheduler = new TransportScheduler(tr, clock); tr.scheduleRepeat((time) => { console.log("beat at", time); }, "4n"); tr.start(); scheduler.start(); ``` ## Modules - [Transport](src/transport/transport.md) — musical clock and event scheduler - [TransportScheduler](src/scheduler/scheduler.md) — lookahead poll loop - [TickSource](src/tick-source/tick-source.md) — audio time to musical ticks - [Signal](src/signal/signal.md) — tempo automation curves - [Time](src/time/time.md) — musical time parsing and conversion - [Error Codes](src/error-codes.md) — structured error registry