The package should be considered "early alpha" and can change significantly between releases, even between minor version numbers.
nexus.stop() is faster.AudiotoolClient.createSyncedDocument changed it's signature: mode: "online" is no longer needed - the document is always
online and synced:
const client = ...
const nexus = await nexus.createSyncedDocument({project})
new function createOfflineDocument, allowing you to create offline documents without any network calls:
const nexus = createOfflineDocument()
Change README file shown on npm.
A few exports were moved around, otherwise no change.
We're now on npm! 🥳
Install the package with:
npm install @audiotool/nexus
This is a big update with lots of changes! Existing apps will sadly break, but we hope these updates will make writing nexus apps more fun and easy to use!
Here's a summary:
You must update your package to keep your app working, older versions won't work anymore.
The biggest changes in the API revision are:
DesktopPlacement message is gone. It's content (x/y position and display_name) is now directly inside the messages that DesktopPlacement used to point to: t.create("tonematrix", {positionX: 2, positionY: 3, displayName: "foo"})Stagebox message is gone - the MixerMaster (formerly: MixerOut) contains the stagebox's x/y positions directlyMixerMaster (formerly: MixerOut) anymore:
MixerStripCable renamed to MixerStripGrouping, and is used purely for grouping stripsThese changes address the issue where API users:
DesktopPlacement -> device not visible on the desktopStagebox -> stagebox not visible on the desktopMixerStripCable -> mixer strip not shown, nothing audibleNow you can forget all these things for good!
Further, the SDK itself got an update in documentation & package names:
api-types -> api, entity-types -> entitiesType suffix for entity names: TonematrixType -> TonematrixOther important changes:
PatternRegions on the timeline no longer have to have a pointer to the pattern device - the device is only referenced through the PatternTrack itself; the pattern index through the pattern_index field in the region.Beatbox8, Beatbox9, Machiniste: pattern step duration is set to an enum rather than tick durationCentroidChannels can now properly be ordered using order_among_channels, a float-based ordering similar to tracksRasselbock effects are ordered similarly: in an array of floatsWaveshaperAnchors can no longer generate an invalid waveshaper - 1 anchor point is always implicitly presentexpanded subscription capabilities for event manager, see NexusEventManager:
nexus.events.onCreate("*", ...) to subscribe to any entity being creatednexus.events.onRemove("*", ...) to subscribe to any entity being removednexus.events.onCreate("...", () => {
return () => console.debug("removed")
})
to subscribe to the removal of an entity that was just createdadded better "presets" API wrapper to more easily access presets. See Presets
Added default values & validity ranges to the documentation of fields in the "constructor types", the second argument e.g. for t.create("foo", {...}).
This means you can now hover the parameter to see it's validity range:

Document what pointer fields point to by linking to all locations. See e.g. DesktopAudioCable.fromSocket
Remove default from required pointers; confusing because required pointers' default values will result in a transaction error
Fix incorrect example in Core Concepts
Add documentation pages:
Ticks constants & conversion methods to more easily work with time unitsEntityQuery to Queries and Navigation docs, links to TransactionBuilder to Transaction Management docssetPAT & hasPAT from AudiotoolClient. Instead, pass the PAT directly to createAudiotoolClient. They relied on localStorage, making them harder to run on platforms other than the web. Users should manage the PAT themselves, and pass in when creating the client. For websites, you could use e.g. localStorage.nexus.createTransaction() before calling nexus.start()First release!