github ouestlabs/audio-ui @audio-ui/core@0.6.0

latest releases: @audio-ui/react@0.3.6, @audio-ui/core@0.7.0
5 hours ago

Minor Changes

  • c851819: New @audio-ui/core/device entry: an effect or an instrument as a set of named parameters, with no interface and no audio in it, so a panel, an engine and an agent share one description. defineDevice({ id, name, description, parameters }) takes a descriptor per parameter (a number with its range, step, scale and unit, a toggle, or a choice from a short list of options such as a waveform) and gives back the device's defaults, set, sanitize (a state loaded from a saved project, repaired), clampValue, normalize and denormalize along the parameter's scale, and format for a readout. describe() returns the device as JSON, and apply(state, changes) changes several parameters at once and says what happened to each: a value out of range is brought in and marked, and an unknown id or a value of the wrong type is refused by name instead of being replaced by a default. deviceTools(device) returns the tools that drive a device (<id>_set and <id>_reset) with a JSON Schema input, for any agent: they report in a sentence a model can read back and never throw on what it sends. The state is a plain object typed by the parameter ids, a choice holding the value of its option, and deviceTools gives a model the values it may send. A device that cannot work (a default outside its range, a log scale from zero, a duplicate id) throws a DeviceDefinitionError naming the parameter when it is defined. An instrument can describe the note it plays (note: a pitch in hertz, a filter cutoff, each with a range), and deviceTools then gives an agent a third tool, <id>_play, whose call returns the note to play and how long: values out of range are brought in, wrong ones refused by name, and a part left out takes its default. InstrumentBinding is what a host implements to play it (noteOn, noteOff next to update and dispose), and playNote(instrument, note, seconds) starts a note and lets it go when the time is up.

Don't miss a new audio-ui release

NewReleases is sending notifications on new releases.