Expand description
Everything you’ll need to use nice-plug. Import this with use nice_plug::prelude::*;.
Re-exports§
pub use crate::wrapper::standalone::nice_export_standalone;pub use crate::wrapper::standalone::nice_export_standalone_with_args;pub use crate::wrapper::clap::features::ClapFeature;pub use crate::wrapper::clap::ClapPlugin;pub use crate::wrapper::clap::PolyModulationConfig;pub use crate::wrapper::vst3::Vst3Plugin;pub use crate::wrapper::vst3::subcategories::Vst3SubCategory;
Modules§
- control_
change - Constants to represent controller change types.
- formatters
- Convenience functions for formatting and parsing parameter values in various common formats.
- util
- General conversion functions and utilities.
Macros§
- nice_
dbg - Analogues to the
dbg!()macro, but respecting theNICE_LOGenvironment variable and with all of the same logging features as the othernice_*!()macros. Like thenice_debug_assert*!()macros, this is only shown when compiling in debug mode, but the macro will still return the value in non-debug modes. - nice_
debug_ assert - A
debug_assert!()analogue that prints the error with line number information instead of panicking. During tests this is upgraded to a regular panickingdebug_assert!(). - nice_
debug_ assert_ eq - A
debug_assert_eq!()analogue that prints the error with line number information instead of panicking. Seenice_debug_assert!()for more information. - nice_
debug_ assert_ failure - An unconditional debug assertion failure, for if the condition has already been checked
elsewhere. See
nice_debug_assert!()for more information. - nice_
debug_ assert_ ne - A
debug_assert_ne!()analogue that prints the error with line number information instead of panicking. Seenice_debug_assert!()for more information. - nice_
error - Similar to
nice_log!(), but more scream-y. Used for printing fatal errors. - nice_
export_ clap - Export one or more CLAP plugins from this library using the provided plugin types.
- nice_
export_ vst3 - Export one or more VST3 plugins from this library using the provided plugin types. The first plugin’s vendor information is used for the factory’s information.
- nice_
log - Write something to the logger. This defaults to STDERR unless the user is running Windows and a
debugger has been attached, in which case
OutputDebugString()will be used instead. - nice_
trace - The same as
nice_log!(), but with source and thread information. Like thenice_debug_assert*!()macros, this is only shown when compiling in debug mode. - nice_
warn - Similar to
nice_log!(), but less subtle. Used for printing warnings.
Structs§
- Async
Executor - An way to run background tasks from the plugin’s GUI, equivalent to the
ProcessContext::execute_background()andProcessContext::execute_gui()functions. This is passed directly toPlugin::editor()so the plugin can move it into its editor and use it later. - Atomic
F32 - A floating point type which can be safely shared between threads.
- AudioIO
Layout - A description of a plugin’s audio IO configuration. The
Plugindefines a list of supported audio IO configs, with the first one acting as the default layout. Depending on the plugin API, the host may pick a different configuration from the list and use that instead. The final chosen configuration is passed as an argument to thePlugin::initialize()function so the plugin can allocate its data structures based on the number of audio channels it needs to process. - Auxiliary
Buffers - Contains auxiliary (sidechain) input and output buffers for a process call.
- Bool
Param - A simple boolean parameter.
- Buffer
- The audio buffers used during processing. This contains the output audio output buffers with the inputs already copied to the outputs. You can either use the iterator adapters to conveniently and efficiently iterate over the samples, or you can do your own thing using the raw audio buffers.
- Buffer
Config - Configuration for (the host’s) audio buffers.
- Enum
Param - An
IntParam-backed categorical parameter that allows convenient conversion to and from a simple enum. This enum must derive the re-exported Enum trait. Check the trait’s documentation for more information on how this works. - Float
Param - A floating point parameter that’s stored unnormalized. The range is used for the normalization process.
- IntParam
- A discrete integer parameter that’s stored unnormalized. The range is used for the normalization process.
- Modifiers
- Modifier keys held while a keyboard event was generated, as
reported by
Editor::on_virtual_key_from_host. Use the standardbitflagsAPI (contains,intersects,is_empty, etc.) to query individual modifiers. - Param
Flags - Flags for controlling a parameter’s behavior.
- Param
Setter - A convenience helper for setting parameter values. Any changes made here will be broadcasted to
the host and reflected in the plugin’s
Paramsobject. These functions should only be called from the main thread. - Plugin
State - A plugin’s state so it can be restored at a later point. This object can be serialized and deserialized using serde.
- Port
Names - Contains names for the ports defined in an
AudioIOLayout. Setting these is optional, but it makes working with multi-output plugins much more convenient. - Smoother
- A smoother, providing a smoothed value for each sample.
- Transport
- Information about the plugin’s transport. Depending on the plugin API and the host not all fields may be available.
Enums§
- Float
Range - A distribution for a floating point parameter’s range. All range endpoints are inclusive.
- IntRange
- A distribution for an integer parameter’s range. All range endpoints are inclusive. Only linear ranges are supported for integers since hosts expect discrete parameters to have a fixed step size.
- Midi
Config - Determines which note events a plugin can send and receive.
- Note
Event - Event for (incoming) notes. The set of supported note events depends on the value of
[
Plugin::MIDI_INPUT. Also check out theutilmodule for convenient conversion functions. - Param
Ptr - Internal pointers to parameters. This is an implementation detail used by the wrappers for type erasure.
- Parent
Window Handle - A raw window handle for platform and GUI framework agnostic editors. This implements
HasRawWindowHandleso it can be used directly with GUI libraries that use the sameraw_window_handleversion. If the library links against a different version ofraw_window_handle, then you’ll need to wrap around this type and implement the trait yourself. - Plugin
Api - The currently active plugin API. This may be useful to display in an about screen in the plugin’s GUI for debugging purposes.
- Process
Mode - The plugin’s current processing mode. Exposed through
BufferConfig::process_mode. The host will reinitialize the plugin whenever this changes. - Process
Status - Indicates the current situation after the plugin has processed audio.
- Smoothing
Style - Controls if and how parameters gets smoothed.
- Virtual
KeyCode - A non-character key delivered to
Editor::on_virtual_key_from_host. Variant names mirror standard keyboard nomenclature; printable ASCII characters never appear here because they flow through the plugin window’s native keyboard path instead.
Traits§
- Editor
- An editor for a
Plugin. - Enum
- An enum usable with
EnumParam. This trait can be derived. Variants are identified either by a stable id (see below), or if those are not set then they are identifier by their declaration order. If you don’t provide IDs then you can freely rename the variant names, but reordering them will break compatibility with existing presets. The variant’s name is used as the display name by default. If you want to override this, for instance, because it needs to contain spaces, then you can use the#[name = "..."]attribute: - GuiContext
- Callbacks the plugin can make when the user interacts with its GUI such as updating parameter
values. This is passed to the plugin during
Editor::spawn(). All of these functions assume they’re being called from the main GUI thread. - Init
Context - Callbacks the plugin can make while it is being initialized. This is passed to the plugin during
Plugin::initialize(). - Param
- Describes a single parameter of any type. Most parameter implementations also have a field
called
valuethat and a field calledsmoothed. The former stores the latest unsmoothed value, and the latter can be used to access the smoother. These two fields should be used in DSP code to either get the parameter’s current (smoothed) value. In UI code the getters from this trait should be used instead. - Params
- Describes a struct containing parameters and other persistent fields.
- Plugin
- The main plugin trait covering functionality common across most plugin formats. Most formats also have another trait with more specific data and functionality that needs to be implemented before the plugin can be exported to that format. The wrappers will use this to expose the plugin in a particular plugin format.
- Process
Context - Contains both context data and callbacks the plugin can use during processing. Most notably this
is how a plugin sends and receives note events, gets transport information, and accesses
sidechain inputs and auxiliary outputs. This is passed to the plugin during as part of
Plugin::process(). - Remote
Controls Context - A context for defining plugin-specific remote pages for CLAP plugins.
- Remote
Controls Page - A page containing references to up to eight parameters. If the number of slots used exceeds
eight, then the page is split automatically. In that case the split page will have indices
appended to it. For example, the
Lengty Params Pagedefining 16 parameters will becomeLengty Params Page 1andLengthy Params Page 2. - Remote
Controls Section - A section or group of parameter pages. Empty sections will not be visible when using the plugin.
- Smoothable
- A type that can be smoothed. This exists just to avoid duplicate explicit implementations for the smoothers.
- SysEx
Message - A type that can be converted to and from byte buffers containing MIDI SysEx messages.
Functions§
- new_
nonzero_ u32 - Construct a
NonZeroU32value at compile time. Equivalent toNonZeroU32::new(n).unwrap().
Type Aliases§
- NonZero
U32 - A
u32that is known not to equal zero. - Plugin
Note Event - A plugin-specific note event type.
- Task
Executor - A function that can execute a plugin’s
BackgroundTasks. A plugin can dispatch these tasks from theinitialize()function, theprocess()function, or the GUI, so they can be deferred for later to avoid blocking realtime contexts.