Skip to content

Upgrade Tone.js from v13 to v15 - #64

Merged
unkleho merged 2 commits into
mainfrom
upgrade-tonejs-v15
Aug 19, 2026
Merged

Upgrade Tone.js from v13 to v15#64
unkleho merged 2 commits into
mainfrom
upgrade-tonejs-v15

Conversation

@unkleho

@unkleho unkleho commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bumps tone from ^13.8.34 to ^15.5.36 (spans the v14 TypeScript rewrite and subsequent v15 releases)
  • Tone.js dropped its default export — switched to import * as Tone from 'tone'
  • Replaced deprecated globals: Tone.MasterTone.getDestination(), Tone.TransportTone.getTransport(), Tone.contextTone.start() where applicable
  • Dropped the startaudiocontext dependency in favour of Tone's built-in Tone.start()
  • Fixed PolySynth's constructor call — v14.3+ removed the leading polyphony positional argument in favour of a single options object ({ maxPolyphony, voice, options }); the old call form throws at runtime on the new version
  • Audited every other Tone constructor used in the codebase (Channel, Sampler, MembraneSynth, MetalSynth, NoiseSynth, PluckSynth, Sequence, and all effect types) against the v15 type declarations — all kept backwards-compatible positional signatures, no changes needed
  • Updated the Jest mock (src/__mocks__/tone.ts) to the new named-export shape and re-enabled 3 previously-skipped Effect tests, fixing stale/incorrect assertions along the way (wrong mock reference, missing dispose key)

Test plan

  • npm test — all 14 tests pass (0 skipped)
  • npm run lint — clean
  • npm run build — builds successfully
  • Manual audio smoke-test in a browser (not covered by unit tests — MetalSynth's default sonic parameters shifted somewhat between v13 and v15 even though the constructor call is unchanged)

🤖 Generated with Claude Code

Tone.js dropped its default export and removed several deprecated
globals (Master, Transport, context) in favour of getDestination(),
getTransport() and getContext(). PolySynth's constructor also dropped
the leading polyphony argument in favour of a single options object.

Also drops the startaudiocontext dependency, since Tone now ships its
own Tone.start() for resuming the audio context on a user gesture.
@unkleho
unkleho merged commit 9e10999 into main Aug 19, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant