This is needed to enable sending and receiving SysEx #54. Because associated type defaults still are not stable, this requires every plugin that doesn't need this to set this to the unit type: ```rust type SysExMessage = (); ```
12 KiB
Breaking changes
Since there is no stable release yet, there is also no proper changelog yet. But since not everyone might want to dive through commit messages to find out what's new and what's changed, this document lists all breaking changes in reverse chronological order. If a new feature did not require any changes to existing code then it will not be listed here.
[2023-01-31]
-
NIH-plug has gained support MIDI SysEx in a simple, type-safe, and realtime-safe way. This sadly does mean that every
Plugininstance now needs to define aSysExMessagetype definition and constructor function as Rust does not yet support defaults for associated types (Rust issue #29661):type SysExMessage = ();
[2023-01-12]
- The Vizia dependency has been updated. This updated version uses a new text
rendering engine, so there are a couple breaking changes:
- The names for some of Vizia's fonts have changed. The constants and font
registration functions in
nih_plug_vizia::assetsandnih_plug_vizia::vizia_assetsstill have the same name, but all uses of thefontCSS property and.font()view modifier will have to be changed. - Metrics for rendered text have change slightly. Most notably the height and vertical positioning of text is slightly different, so you may have to adjust your layout slightly accordingly.
- The names for some of Vizia's fonts have changed. The constants and font
registration functions in
[2023-01-11]
Editor::param_values_changes()is no longer called from the audio thread and thus no longer needs to be realtime safe.- A new
Editor::param_value_changed(id, normalized_value)method has been added. This is used to notify the plugin of changes to individual parameters. - A similar new
Editor::param_modulation_changed(id, modulation_offset)is used to inform the plugin of a parameter's new monophonic modulation offset.
[2023-01-06]
- The threads used for the
.schedule_gui()and.schedule_background()methods are now shared between all instances of a plugin. This makes.schedule_gui()on Linux behave more like it does on Windows and macOS, and there is now only a single background thread instead of each instance spawning their own thread.
[2023-01-05]
Buffer::len()has been renamed toBuffer::samples()to make this less ambiguous.Block::len()has been renamed toBlock::samples().
[2022-11-17]
- The
Paramsderive macro now also properly supports persistent fields in#[nested]parameter structs. This takes#[nested(id_prefix = "...")]and#[nested(array)]into account to allow multiple copies of a persistent field. This may break existing usages as serialized field data without a matching preffix or suffix is no longer passed to the child object.
[2022-11-17]
- The order of
#[nested]parameters in the parameter list now always follows the declaration order instead of nested parameters being ordered below regular parameters.
[2022-11-08]
- The
Param::{next_previous}{_step,_normalized_step}()functions now take an additional boolean argument to indicate that the range must be finer. This is used for floating point parameters to chop the range up into smaller segments when using Shift+scroll.
[2022-11-07]
Param::plain_value()andParam::normalized_value()have been renamed toParam::modulated_plain_value()andParam::modulated_normalized_value(). These functions are only used when creating GUIs, so this shouldn't break any other plugin code. This change was made to make it extra clear that these values do include monophonic modulation, as it's very easy to mistakenly use the wrong value when handling user input in GUI widgets.
[2022-11-06]
nih_plug_vizia::create_vizia_editor_without_theme()has been removed, andnih_plug_vizia::create_vizia_editor()has gained a new argument to specify what amount of theming to apply. This can now also be used to completely disable all theming include Vizia's built-in theme.nih_plug_vizia::create_vizia_editor()no longer registers any fonts by default. Even when those fonts are not used, they will still be embedded in the binary, increasing its size by several megabytes. Instead, you can now register individual fonts by calling thenih_plug_vizia::assets::register_*()functions. This means that you must callnih_plug_vizia::assets::register_noto_sans_light()for the default theming to work. All of the plugins in this repo also usenih_plug_vizia::assets::register_noto_sans_thin()as a title font.- Additionally, the Vizia fork has been updated to not register any default
fonts for the same reason. If you previously relied on Vizia's default Roboto
font, then you must now call
nih_plug_vizia::vizia_assets::register_roboto()at the start of your process function.
[2022-10-23]
nih_plug_viziahas been updated. Widgets with custom drawing code will need to be updated because of changes in Vizia itself.
[2022-10-22]
-
The
Editortrait and theParentWindowHandlestruct have been moved fromnih_plug::pluginto a newnih_plug::editormodule. If you only use the prelude module then you won't need to change anything. -
The
nih_plug::contextmodule has been split up intonih_plug::context::init,nih_plug::context::process, andnih_plug::context::guito make it clearer which structs go with which context. You again don't have to change anything if you use the prelude. -
NIH-plug has gained support for asynchronously running background tasks in a simple, type-safe, and realtime-safe way. This sadly does mean that every
Plugininstance now needs to define aBackgroundTasktype definition and constructor function as Rust does not yet support defaults for associated types (Rust issue #29661):type BackgroundTask = (); -
The
&mut impl InitContextargument toPlugin::initialize()needs to be changed to&mut impl InitContext<Self>. -
The
&mut impl ProcessContextargument toPlugin::process()needs to be changed to&mut impl ProcessContext<Self>. -
The
Plugin::editor()method now also takes a_async_executor: AsyncExecutor<Self>parameter.
[2022-10-20]
- Some items have been moved out of
nih_plug::param::internals. The mainParamstrait is now located undernih_plug::param, and thePersistentTraittrait, implementations, and helper functions are now part of a newnih_plug::param::persistmodule. Code importing theParamstrait through the prelude module doesn't need to be changed. - The
nih_plug::parammodule has been renamed tonih_plug::params. Code that only uses the prelude module doesn't need to be changed. - The
create_egui_editor()function fromnih_plug_eguinow also takes a build closure to apply initialization logic to the egui context. Editorand the editor handle returned byEditor::spawnnow only requireSendand no longer needSync. This is not a breaking change, but it might be worth being aware of.- Similar to the above change,
Pluginalso no longer requiresSync.
[2022-10-13]
- The
#[nested]parameter attribute has gained super powers and has its syntax changed. It can now automatically handle many situations that previously required customParamsimplementations to have multiple almost identical copies of a parameter struct. The current version supports both fields with unique parameter ID prefixes, and arrays of parameter objects. See theParamstrait for more information on the new syntax.
[2022-09-22]
nih_plug_viziahas been updated. Custom widgets will need to be updated because of changes Vizia itself.nih_plug_eguihas been updated from egui 0.17 to egui 0.19.
[2022-09-06]
- Parameter values are now accessed using
param.value()instead ofparam.value, withparam.value()being an alias for the existingparam.plain_value()function. The old approach, while perfectly safe in practice, was technically unsound because it used mutable pointers to parameters that may also be simultaneously read from in an editor GUI. With this change the parameters now use actual relaxed atomic stores and loads to avoid mutable aliasing, which means the value fields are now no longer directly accessible.
[2022-09-04]
Smoother::next_block_mapped()andSmoother::next_block_exact_mapped()have been redesigned. They now take an index of the element being generated and the float representation of the smoothed value. This makes it easier to use them for modulation, and it makes it possible to smoothly modulate integers and other stepped parameters. Additionally, the mapping functions are now also called for every produced value, even if the smoother has already finished smoothing and is always producing the same value.
[2022-08-19]
- Standalones now use the plugin's default input and output channel counts instead of always defaulting to two inputs and two outputs.
Plugin::DEFAULT_NUM_INPUTSandPlugin::DEFAULT_NUM_OUTPUTShave been renamed toPlugin::DEFAULT_INPUT_CHANNELSandPlugin::DEFAULT_OUTPUT_CHANNELSrespectively to avoid confusion as these constants only affect the main input and output.
[2022-07-18]
IntRangeandFloatRangeno longer have min/max methods and instead have next/previous step methods. This is for better compatibility with the new reversed ranges.
[2022-07-06]
- There are new
NoteEvent::PolyModulationandNoteEvent::MonoAutomationevents as part of polyphonic modulation support for CLAP plugins. - The block smoothing API has been reworked. Instead of
Smoothers having their own built-in block buffer, you now need to provide your own mutable slice for the smoother to fill. This makes the API easier to understand, more flexible, and it allows cloning smoothers without worrying about allocations.In addition, the new implementation is much more efficient when the smoothing period has ended before or during the block.
[2022-07-05]
- The
ClapPlugin::CLAP_HARD_REALTIMEconstant was moved to the generalPlugintrait asPlugin::HARD_REALTIME_ONLY, and best-effort support for VST3 has been added.
[2022-07-04]
- The
CLAP_DESCRIPTION,CLAP_MANUAL_URL, andCLAP_SUPPORT_URLassociated constants from theClapPluginare now optional and have the typeOption<&'static str>instead of&'static str. - Most
NoteEventvariants now have an additionalvoice_idfield. - There is a new
NoteEvent::VoiceTerminatedevent a plugin can send to let the host know a voice has been terminated. This needs to be output by CLAP plugins that support polyphonic modulation. - There is a new
NoteEvent::Chokeevent the host can send to a plugin to let it know that it should immediately terminate all sound associated with a voice or a key.
[2022-07-02]
- The
Params::serialize_fields()andParams::deserialize_fields()methods and theStatestruct now useBTreeMaps instead ofHashMaps so the order is consistent the plugin's state to JSON multiple times. These things are part of NIH-plug's internals, so unless you're implementing theParamstrait by hand you will not notice any changes.
[2022-06-01]
- The
ClapPlugin::CLAP_FEATURESfield now uses an array ofClapFeaturevalues instead of&'static strs. CLAP 0.26 contains many new predefined features, and the existing ones now use dashes instead of underscores. Custom features are still possible usingClapFeature::Custom.
[2022-05-27]
Plugin::process()now takes a newaux: &mut AuxiliaryBuffersparameter. This was needed to allow auxiliary (sidechain) inputs and outputs.- The
Plugin::initialize()method now takes a&mut impl InitContextinstead of a&mut impl ProcessContext.
[2022-05-22]
- The current processing mode is now stored in
BufferConfig. Previously this could be fetched through a function on theProcessContext, but this makes more sense as it remains constant until a plugin is deactivated. TheBufferConfignow contains a field for the minimum buffer size that may or may not be set depending on the plugin API. - Previously calling
param.non_automatable()when constructing a parameter also made the parameter hidden. Hiding a parameter is now done throughparam.hide(), whileparam.non_automatable()simply makes it so that the parameter can only be changed manually and not through automation or modulation.
...
Who knows what happened at this point!