#include <faust_processor.hpp>
Public Types | |
| enum class | MemoryPressure { Advisory , Critical } |
| Memory-pressure levels a host can surface to a plugin. More... | |
Public Member Functions | |
| FaustProcessor () | |
| format::PluginDescriptor | descriptor () const override |
| Return the plugin's metadata. Called once during initialization. | |
| void | define_parameters (state::StateStore &store) override |
| Register parameters with the state store. | |
| void | prepare (const format::PrepareContext &ctx) override |
| Prepare for processing. | |
| void | process (audio::BufferView< float > &output, const audio::BufferView< const float > &input, midi::MidiBuffer &, midi::MidiBuffer &, const format::ProcessContext &ctx) override |
| Process one buffer of audio. | |
| void | release () override |
| Release resources. | |
| bool | has_editor () const override |
| Editor support. | |
| const std::vector< DslParamDescriptor > & | dsl_params () const |
| const DslBusLayout & | bus_layout () const |
| const std::string & | dsl_name () const |
| EditorHostKind | editor_host_kind () const |
| Whether this processor runs inside a plug-in host or the Pulp standalone app. | |
| void | set_editor_host_kind (EditorHostKind kind) |
| virtual void | suspend () |
Pause processing for a heavy main-thread operation (preset load, convolution kernel reallocation, sample-rate change) that would otherwise need to either block in process() — fatal — or run in lock-step with process(), which is hard to get right. | |
| virtual void | resume () |
Resume processing after a prior suspend(). | |
| virtual std::vector< uint8_t > | serialize_plugin_state () const |
| Serialize plugin-owned state that is not part of StateStore. | |
| void | publish_plugin_state_snapshot (std::vector< uint8_t > bytes) |
| Publish an immutable custom-state snapshot from a non-audio thread. | |
| void | publish_plugin_state_snapshot (std::span< const uint8_t > bytes) |
| std::shared_ptr< const std::vector< uint8_t > > | published_plugin_state_snapshot () const |
| Returns null until the plugin opts into published snapshots. | |
| virtual bool | deserialize_plugin_state (std::span< const uint8_t >) |
| Restore plugin-owned state previously returned by serialize_plugin_state(). | |
| virtual void | on_memory_pressure (MemoryPressure) |
| Called on the main/UI thread when the host observes memory pressure. | |
| virtual int | latency_samples () const |
| Latency in samples introduced by this processor (default 0). | |
| virtual bool | is_bus_layout_supported (const BusesLayout &layout) const |
| Validate a proposed bus layout. | |
| void | flag_latency_changed () noexcept |
| Cross-adapter latency / tail change notifications. | |
| void | flag_tail_changed () noexcept |
| bool | consume_latency_changed_flag () noexcept |
| Adapter-side polling helper. | |
| bool | consume_tail_changed_flag () noexcept |
| bool | latency_change_pending () const noexcept |
| Non-mutating peek used by adapters that need to decide whether to ping the host for a main-thread callback without losing the pending edge (e.g. | |
| bool | tail_change_pending () const noexcept |
| void | flag_note_names_changed () noexcept |
| Note-name change notification, same shape as the latency / tail pair above. | |
| bool | consume_note_names_changed_flag () noexcept |
| bool | note_names_change_pending () const noexcept |
| void | flag_state_dirty () noexcept |
| Non-parameter state-change notification, same shape as the latency / tail / note-name flags above. | |
| bool | consume_state_dirty_flag () noexcept |
| bool | state_dirty_pending () const noexcept |
| virtual void | process (ProcessBuffers &audio, midi::MidiBuffer &midi_in, midi::MidiBuffer &midi_out, const ProcessContext &context) |
| Additive multi-bus process entry point. | |
| virtual std::pair< uint32_t, uint32_t > | editor_size () const |
| Preferred editor window size in logical pixels. | |
| virtual ViewSize | view_size () const |
| Return the full view size hints (preferred/min/max). | |
| virtual std::unique_ptr< view::View > | create_view () |
| Create a custom view for this processor. | |
| virtual void | on_view_opened (view::View &) |
| Called after a view has been constructed and attached. | |
| virtual void | on_view_closed (view::View &) |
| Called immediately before a view is destroyed. | |
| virtual void | on_view_resized (view::View &, uint32_t, uint32_t) |
| Called when the host resizes the editor window. | |
| bool | request_editor_resize (uint32_t width, uint32_t height) |
| Editor-INITIATED host-window resize (the plugin↔host direction that on_view_resized does not cover). | |
| virtual void | on_host_transport_changed (bool, double) |
| Called when the host's transport state transitions between playing and stopped, or jumps to a new position. | |
| virtual void | on_host_tempo_changed (double) |
| Called when the host's transport tempo changes. | |
| virtual std::unique_ptr< class AraDocumentController > | create_ara_document_controller () |
| Optional ARA 2.x document-controller factory. | |
| virtual view::ScriptedUiSession * | active_scripted_ui () |
| Return the active scripted UI session when a custom create_view() path owns one. | |
| virtual const view::ScriptedUiSession * | active_scripted_ui () const |
| virtual std::vector< SettingsSection > | settings_sections () |
| Settings tabs this plugin contributes, composed by the host alongside its own host-owned tabs (e.g. | |
| virtual PrepareResourceUsage | estimate_prepare_resources (const PrepareContext &) const |
| Estimate storage the next prepare() will allocate or reserve. | |
| virtual PrepareResourceLimit | check_prepare_resource_limits (const PrepareContext &context) const |
| Check the processor's estimate against the host-supplied prepare limits. | |
| virtual std::vector< std::byte > | serialize_dsp_state () const |
| Opt-in DSP-state carry across a hot-reload (reload lane, item 1.6). | |
| virtual bool | restore_dsp_state (const std::vector< std::byte > &) |
| virtual bool | supports_editor_reload () const |
| Editor live-reload support (live-swap 1.9). | |
| virtual std::uint64_t | editor_reload_generation () const |
| Monotonic counter that increments each time this processor's editor content should be rebuilt (after a successful logic hot-swap). | |
| void | prepare_f64_fallback_scratch (const PrepareContext &context) |
| Prepare scratch used by the default process_f64() fallback. | |
| void | prepare_f64_fallback_scratch (const PrepareContext &context, const BusesLayout &layout) |
| virtual void | process_f64 (audio::BufferView< double > &audio_output, const audio::BufferView< const double > &audio_input, midi::MidiBuffer &midi_in, midi::MidiBuffer &midi_out, const ProcessContext &context) |
| Native double-precision process entry point. | |
| virtual void | process_f64 (ProcessBuffers64 &audio, midi::MidiBuffer &midi_in, midi::MidiBuffer &midi_out, const ProcessContext &context) |
| Additive double-precision richer-surface process entry point. | |
| virtual void | on_non_realtime_tick () |
| Non-realtime maintenance tick. | |
| virtual bool | non_realtime_tick_pending () const |
| RT-safe query: "I have non-realtime work waiting". | |
| state::StateStore & | state () |
| Access the parameter state store. | |
| const state::StateStore & | state () const |
| const audio::BufferView< const float > * | sidechain_input () const |
| Access sidechain input buffer (set by format adapters before process). | |
| const midi::MpeBuffer * | mpe_input () const |
| Access the per-note MPE expression buffer for this block. | |
| const midi::UmpBuffer * | ump_input () const |
| Access the MIDI 2.0 UMP buffer for this block. | |
| const state::ParameterEventQueue * | param_events () const |
| Access sample-accurate parameter automation for this block. | |
| const state::ModulationEventQueue * | modulation_events () const |
| Timestamped host modulation events for the current block. | |
| bool | push_output_param_event (state::ParamID id, float value, std::uint32_t sample_offset) noexcept |
| Emit a sample-accurate parameter change to the host from process(). | |
| const state::ParameterEventQueue * | output_param_events () const |
| Access the output parameter-event queue, if the adapter wired one. | |
| void | set_state_store (state::StateStore *store) |
| void | set_sidechain (const audio::BufferView< const float > *sc) |
| void | set_mpe_input (const midi::MpeBuffer *mpe) |
| void | set_ump_input (const midi::UmpBuffer *ump) |
| void | set_param_events (const state::ParameterEventQueue *events) |
| void | set_modulation_events (const state::ModulationEventQueue *events) |
| void | set_output_param_events (state::ParameterEventQueue *events) |
| void | set_editor_resize_handler (std::function< bool(uint32_t, uint32_t)> handler) |
| void | set_editor_resize_handler (const void *editor_owner, std::function< bool(uint32_t, uint32_t)> handler, std::function< bool()> is_active={}) |
| virtual std::vector< NoteName > | note_names () const |
| Names for individual notes, shown by hosts in the piano roll and drum editors. | |
| virtual view::ValueChannelSet * | value_channels () |
| Named value channels this processor publishes for its UI — gain reduction, an envelope follower, a spectrum, or bounded trigger occurrences — i.e. | |
| virtual void | visit_value_channels (const std::function< void(view::ValueChannelSet *)> &visitor) |
| Synchronously visit the current value-channel set while the processor keeps it alive. | |
| virtual void | visit_active_scripted_ui (const std::function< void(view::ScriptedUiSession *)> &visitor) |
| Synchronously visit the active scripted-UI session while the processor keeps it alive. | |
| virtual void | visit_active_scripted_ui (const std::function< void(const view::ScriptedUiSession *)> &visitor) const |
| Const counterpart to visit_active_scripted_ui(). | |
| virtual bool | supports_in_place_scripted_ui_reload () const |
| Opt in when a processor-owned scripted editor must reload its existing session rather than rebuilding through create_view(). | |
| virtual bool | reload_active_scripted_ui_in_place (std::string *) |
| Reload a processor-owned scripted editor in place when the editor generation changes. | |
| virtual bool | process_block (ProcessBlock &) |
| Process the additive block contract directly. | |
| virtual std::optional< std::uint32_t > | editor_background () const |
| The editor's own background colour, as 0xRRGGBB. | |
| virtual EditorPrewarm | editor_prewarm () const |
| See EditorPrewarm above. | |
| virtual bool | wants_sample_accurate_parameters () const |
| Whether this processor reads sample-accurate parameter automation: param_events(), a state::ParamCursor, or for_each_subblock(). | |
| virtual bool | wants_au_scheduled_parameter_slices () const |
| AU v2 only, and only for a processor that wants sample-accurate parameters. | |
| virtual EditorFactory * | editor_factory () |
| The UI-agnostic editor factory for this processor, or null. | |
| virtual void | on_panic (PanicMode) |
| Panic hook: stop this plug-in's own voices. | |
| void | request_panic (PanicMode mode=PanicMode::immediate) |
| Ask the plug-in to silence itself and, where the host has MIDI output, end the notes it has sent. | |
| PanicCapabilities | panic_capabilities () const |
| What a panic request can do in the current host. Cheap; any thread. | |
| std::shared_ptr< PanicState > | panic_state () const |
| The request/state object adapters service. | |
Protected Attributes | |
| std::vector< DslParamDescriptor > | dsl_params_ |
| DslBusLayout | bus_layout_ |
| std::string | dsl_name_ |
|
stronginherited |
Memory-pressure levels a host can surface to a plugin.
Mirrors the broad shape of iOS didReceiveMemoryWarning + Windows low-memory notifications + Android TrimMemory.
|
inline |
|
inlinevirtualinherited |
Return the active scripted UI session when a custom create_view() path owns one.
The default framework editor path is tracked by ViewBridge directly; processor-owned sessions use this hook so format adapters can still select scripted/GPU hosting and poll the session.
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlinevirtualinherited |
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlineinherited |
|
inlinevirtualinherited |
Check the processor's estimate against the host-supplied prepare limits.
Returning None means the estimate fits every non-zero limit. Hosts that want fail-closed prepare behavior can call this before prepare(). Appended to preserve additive-only vtable ordering.
|
inlinenoexceptinherited |
Adapter-side polling helper.
Returns true exactly once per flag_*_changed() call. The adapter calls this on the host / main thread; on true it must get the latest latency_samples() / tail_samples to the host by that format's sanctioned route (see flag_latency_changed above — for CLAP that is a restart request, not a direct push).
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
virtualinherited |
Optional ARA 2.x document-controller factory.
Plugins that opt in to ARA return a new AraDocumentController from this method; the format-adapter companion factory (VST3 / AU / CLAP) owns the instance and tears it down with the plugin. Default returns nullptr — the plugin is not ARA-aware. Forward-declared so plugin TUs that don't implement ARA don't need to pull pulp/format/ara.hpp.
|
virtualinherited |
Create a custom view for this processor.
Default returns nullptr, which signals the framework to build the default editor (scripted UI if configured, otherwise AutoUi from registered parameters).
Override to return a fully custom view::View tree. The returned view is owned by the ViewBridge and destroyed when the editor closes. This method may be called multiple times during the lifetime of the processor (one per attached editor window).
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlineoverridevirtual |
Register parameters with the state store.
Called once during construction. Add all automatable parameters here.
Implements pulp::format::Processor.
|
inlineoverridevirtual |
Return the plugin's metadata. Called once during initialization.
Implements pulp::format::Processor.
|
inlinevirtualinherited |
Restore plugin-owned state previously returned by serialize_plugin_state().
An empty span means the host blob carried no plugin-owned payload (legacy state or a processor that saved only StateStore data). Plugins that override this hook should treat empty input as "reset persisted plugin-owned state to defaults". Return false to reject malformed or incompatible payloads.
Called on a host/main thread with the audio thread stopped.
Reimplemented in pulp::format::NativeCoreProcessor.
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
The editor's own background colour, as 0xRRGGBB.
A host-embedded editor returns its view before its document has drawn (view-first opening), so the host's first frames — and the native layer behind them — show nothing but this colour, as do the letterbox bars around a pinned design viewport. Return the colour the editor paints behind everything else (for a scripted UI, its page/root background) so the editor opens looking like itself instead of a framework default.
Called on the main thread each time an editor opens, so it may depend on state (an editor with user-selectable colour schemes returns the active scheme's background). std::nullopt uses the editor root's theme bg.primary, which is what a native or AutoUi editor paints. See ViewBridge::editor_background_rgb(). Appended to preserve additive-only vtable ordering (node_abi_gate).
|
virtualinherited |
The UI-agnostic editor factory for this processor, or null.
A non-null factory builds this processor's editors through the editor-host contract in pulp/format/editor_host.hpp: one EditorFactory creates an Editor per window and role, each bound to the processor through an EditorContext. The factory belongs to the processor and must outlive every editor it creates; the returned pointer is non-owning. Called on the host's main thread.
The default returns the factory of the UI package this plug-in's binary declares with pulp_add_plugin(... UI <package>) (see pulp/format/editor_package.hpp), so a plug-in gets its package's editor without overriding this. Each plug-in binary carries its own choice; every processor in that binary that does not override this shares it. An override wins over the package.
Null (no UI package, UI none, and no override) leaves the processor on the existing editor path (has_editor(), create_view() and the hooks around them), which format adapters keep using unchanged. A processor with no factory and has_editor() == false is headless.
Defined out of line (format.cpp) so a derived class's vtable names this exported member rather than the hidden image-local accessor: a hot-reload logic dylib resolves Processor's members from the plug-in that loads it, and could not resolve a hidden symbol.
Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlineinherited |
Whether this processor runs inside a plug-in host or the Pulp standalone app.
Every plug-in format adapter leaves the default, plugin; only StandaloneApp marks its processor standalone. Safe to call from create_view() and from any editor code on the main thread. The same answer reaches scripted editors as hostKind().
|
inlinevirtualinherited |
See EditorPrewarm above.
Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlinevirtualinherited |
Monotonic counter that increments each time this processor's editor content should be rebuilt (after a successful logic hot-swap).
The editor idle tick polls this; when it changes, the ViewBridge rebuilds the primary view from create_view(). Only meaningful when supports_editor_reload() is true. Must be safe to call from the UI thread. Appended to preserve additive-only vtable ordering.
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlinevirtualinherited |
Preferred editor window size in logical pixels.
|
inlinevirtualinherited |
Estimate storage the next prepare() will allocate or reserve.
Default is unknown/zero for source compatibility. Processors with large prepared resources should override this so hosts and tests can reject oversized configurations before allocation. Called on the host thread, never from process(). Appended to preserve additive-only vtable ordering.
|
inlinenoexceptinherited |
Cross-adapter latency / tail change notifications.
Called from process() on the audio thread when a plugin's latency or tail length changes mid-render (e.g. a linear-phase EQ flipping between FIR taps, a reverb extending its decay). The Processor sets an std::atomic<bool> pending-flag; the format adapter polls the flag on the host / main thread and republishes in whatever way that format sanctions. This is NOT the same call in each:
Audio-thread-safe. Never call a host API from process().
|
inlinenoexceptinherited |
Note-name change notification, same shape as the latency / tail pair above.
A sampler that loads a new kit, or an instrument that switches articulation maps, raises this so the adapter republishes note_names() and the host relabels its piano roll.
Audio-thread-safe, so a processor may raise it from process().
|
inlinenoexceptinherited |
Non-parameter state-change notification, same shape as the latency / tail / note-name flags above.
Parameter edits already reach the host through the parameter system, so a host knows the project changed. State that lives outside that system leaves no such trace: a loaded sample or impulse response, an imported wavetable, an editor-only setting carried in the plugin's own state payload. Without a signal the host has no reason to believe anything changed, and a user can close the project and lose that work without ever being offered a save prompt. A Processor raises this whenever such state changes.
The adapter republishes it by whatever route the format sanctions. VST3 is wired: IComponentHandler2::setDirty(true), delivered on the main thread. CLAP's equivalent is clap_host_state::mark_dirty; the other adapters do not consume the flag, so raising it is harmless but inert there.
Audio-thread-safe, so a processor may raise it from process(), though the usual caller is the editor or a file-load on the main thread.
|
inlinenoexceptinherited |
|
inlineoverridevirtual |
Editor support.
By default, all processors have an auto-generated editor built from their parameter definitions (using AutoUi). Override these to customize or disable the editor. Whether this processor has a GUI editor. Default true (AutoUi).
Reimplemented from pulp::format::Processor.
|
inlinevirtualinherited |
Validate a proposed bus layout.
Default acceptance policy:
Override for plugins that need a tighter contract (e.g. an instrument that only renders stereo out, a sidechain compressor that requires sidechain channels == main channels, surround processors that accept >2 channels). The format adapter MUST call this on the host thread — never from process().
Adapters fall back to the descriptor's declared bus count + the empty/mono/stereo policy when a plugin doesn't override this hook, which preserves the prior default-acceptance behavior exactly.
|
inlinenoexceptinherited |
Non-mutating peek used by adapters that need to decide whether to ping the host for a main-thread callback without losing the pending edge (e.g.
CLAP's request_callback). Does not clear the flag; the host-thread callback must still call consume_*_changed_flag() to drain it.
|
inlinevirtualinherited |
Latency in samples introduced by this processor (default 0).
Override for plugins that buffer or lookahead (e.g., compressors, linear-phase EQs). Hosts use this for delay compensation.
Reimplemented in pulp::format::NativeCoreProcessor, pulp::format::reload::ReloadableShell, pulp::format::SpectralFrameProcessor, pulp::host::BakedGraphProcessor, and pulp::sequence::SequenceProcessor.
|
inlineinherited |
Timestamped host modulation events for the current block.
CLAP PARAM_MOD events retain their sample offsets here; the StateStore modulation offset remains the compatibility snapshot for processors that only consume block-rate modulation.
|
inlineinherited |
Access the per-note MPE expression buffer for this block.
Returns nullptr unless the plugin declared MPE via PluginDescriptor legacy flags or node capabilities and the host/format adapter populated it.
|
inlinevirtualinherited |
RT-safe query: "I have non-realtime work waiting".
Default false.
Called from process() by adapters that can only reach the control thread by ASKING for it — CLAP (and therefore WebCLAP) delivers parameter changes as events inside process(), and the only way out is clap_host->request_callback() followed by on_main_thread(). The CLAP adapter peeks this flag each block, exactly as it already does for latency/tail changes, and requests the callback when it is set.
MUST be realtime-safe: no locks, no allocation. Read atomics and compare.
The WAM adapter also consults it once per block, so work a processor discovers for ITSELF (not just work a control write announced) still gets serviced there.
Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlinevirtualinherited |
Names for individual notes, shown by hosts in the piano roll and drum editors.
Default empty: the host labels notes with bare pitches, which is what every plug-in did before this hook existed.
Override for instruments whose keys mean something other than pitch — a drum kit ("Kick", "Snare", "Closed Hat"), a sampler's keyswitch range ("Legato", "Staccato"), a step trigger grid. Entries may use the -1 wildcard for port and channel to name a key across all of them.
Called on the host / main thread, never from process(). Raise flag_note_names_changed() when the list changes so the adapter republishes it.
Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlinenoexceptinherited |
|
inlinevirtualinherited |
Called when the host's transport tempo changes.
Default no-op. Override for plugins that care about tempo outside of a process() call — delay sync recomputation, tempo-synced LFO rate caches, UI BPM read-outs. Runs on the main/UI thread; the audio thread keeps reading the current tempo from ProcessContext as usual.
|
inlinevirtualinherited |
Called when the host's transport state transitions between playing and stopped, or jumps to a new position.
Default no-op.
|
inlinevirtualinherited |
Called on the main/UI thread when the host observes memory pressure.
Default is a no-op — plugins that cache decoded images, analysis buffers, or paged samples override this to drop caches. Implementations MUST NOT block the audio thread; use the existing host-thread rules guidance in docs/reference/host-thread-rules.md for cache invalidation.
Wiring: iOS — the platform layer receives didReceiveMemoryWarning; routing that signal into processors is host-owned. macOS — the platform layer observes DISPATCH_MEMORYPRESSURE; routing that signal into processors is host-owned. Android — the platform layer receives ComponentCallbacks2.onTrimMemory; routing that signal into processors is host-owned. Windows — the platform layer samples GlobalMemoryStatusEx(); routing that signal into processors is host-owned.
|
inlinevirtualinherited |
Non-realtime maintenance tick.
Default: no-op.
A processor whose control changes need work that process() must never do — decode, resample, FFT-plan, allocate — normally does it on its own background thread. Some hosts give it no thread to run on:
Those adapters call this hook from a NON-RENDER context after anything that could have dirtied the processor's derived state — a parameter write, a state restore, a re-prepare. A processor that has a real worker thread should do nothing here, or the worker and the host would race.
WHO ACTUALLY CALLS IT (the contract is narrower than "any host"):
It is NOT an audio-thread callback and is never called from inside process(). In a worklet-only host it does run on the same OS thread as the render callback (just not inside it), so a long tick can still make the next quantum late — keep the work bounded, and prefer work that is proportional to what actually changed.
Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlinevirtualinherited |
Panic hook: stop this plug-in's own voices.
Called on the audio thread by a host adapter that services panic requests (see pulp/format/panic.hpp), before process(), when request_panic() was raised. immediate means hard-stop (release tails cut, the MIDI CC 120 semantic); release means enter the normal release (CC 123). A processor that owns a midi::Synthesiser implements it as synth.panic(mode == PanicMode::immediate). Must be real-time safe. Default: no-op. Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlinevirtualinherited |
Called immediately before a view is destroyed.
Runs on the UI thread. Use to unregister listeners; do not assume the view is still usable for drawing after this returns.
|
inlinevirtualinherited |
Called after a view has been constructed and attached.
Runs on the host/UI thread. Safe to read state and register UI listeners.
|
inlinevirtualinherited |
Called when the host resizes the editor window.
Dimensions are in logical pixels. Runs on the UI thread.
|
inlineinherited |
Access the output parameter-event queue, if the adapter wired one.
|
inlineinherited |
What a panic request can do in the current host. Cheap; any thread.
|
inlineinherited |
The request/state object adapters service.
Created on first use, off the audio thread: fetch it once at prepare time and keep the pointer.
|
inlineinherited |
Access sample-accurate parameter automation for this block.
Returns nullptr when the current host path did not provide a parameter-event queue; an empty queue means the adapter participated but the block had no parameter events.
In VST3, AU v2 and CLAP the queue is always empty for a processor whose wants_sample_accurate_parameters() returns false. A read in that state is a mistake (the processor opted out of the points it is looking for), so it is recorded (one relaxed store, safe on the audio thread) in the adapter's ParamEventsOptOutMonitor, which logs it once, off the audio thread, naming the override.
|
inlineoverridevirtual |
Prepare for processing.
Allocate buffers, initialize filters. Called on the host thread with the audio thread stopped.
Implements pulp::format::Processor.
|
inherited |
Prepare scratch used by the default process_f64() fallback.
Format adapters call this after the plugin's prepare() while audio is stopped, so a plugin that opts into f64 before overriding process_f64() can still run without allocating on the audio thread.
|
inherited |
|
inlineoverridevirtual |
Process one buffer of audio.
Called on the real-time audio thread.
| audio_output | Output buffer to fill (main bus) |
| audio_input | Input buffer to read (main bus) |
| midi_in | Incoming MIDI events (sample-accurate) |
| midi_out | Outgoing MIDI events (for MIDI effects) |
| context | Transport state and timing |
For sidechain input, call sidechain_input() which returns nullptr if no sidechain is connected.
The input is read-only. A host or graph may hand the same input memory to several processors, or the host's own buffer, so writing through it (with a const_cast, or by passing it to an API that writes in place) is undefined behavior. A processor that needs to, such as a native core handing its buffers to a C interface as mutable, sets PluginDescriptor::node_capabilities.writes_input_buffers, and a graph then gives it private copies.
Implements pulp::format::Processor.
|
inlinevirtualinherited |
Additive multi-bus process entry point.
The default implementation preserves the existing plugin-author contract: it projects the active main output, optional main input, and optional sidechain input from ProcessBuffers, then calls the original main-in/main-out process() callback. Plugins that need direct access to auxes, multi-output instruments, or surround buses can override this method while older processors continue to work unchanged. Appended to preserve additive-only vtable ordering.
|
inlinevirtualinherited |
Process the additive block contract directly.
In-process graph nodes use this only when the descriptor opts into dense audio-rate modulation. Appended to preserve every existing virtual slot.
|
virtualinherited |
Native double-precision process entry point.
Default implementation preserves compatibility for plugins that opt into f64 before porting their DSP: it converts the double main input to the prepared f32 fallback scratch, calls the original f32 process(), then converts the f32 main output back to double. The fallback never allocates during process(); if the adapter did not prepare enough scratch, it emits silence rather than growing buffers on the audio thread.
|
virtualinherited |
Additive double-precision richer-surface process entry point.
The default routes simple main-bus blocks through process_f64() so processors that override the main-bus f64 virtual still run natively. For sidechain or aux blocks, it falls back through the f32 richer surface using prepared scratch so legacy sidechain/aux semantics are preserved without allocating on the audio thread.
|
inlineinherited |
|
inlineinherited |
Publish an immutable custom-state snapshot from a non-audio thread.
Once a snapshot has been published, host save callbacks copy it instead of invoking serialize_plugin_state(). This keeps large sampler, wavetable, and analysis payload serialization out of host-controlled save timing while preserving serialize_plugin_state() as a compatibility fallback for plugins that have not opted in.
|
inlineinherited |
Returns null until the plugin opts into published snapshots.
A non-null empty vector is meaningful: the plugin explicitly published no custom payload and serialize_plugin_state() must not be called.
|
inlinenoexceptinherited |
Emit a sample-accurate parameter change to the host from process().
Call this when the plugin itself changes a parameter mid-block (e.g. an LFO-driven macro, a modeled control) and you want the host to record the change at its exact sample offset rather than as a single coalesced value at block start. value is in the plain parameter domain; sample_offset is relative to the start of the current block. The host adapter drains these events after process() and clamps the offset to the block length. Returns false when no output queue is wired (the current format/host path does not carry sample-accurate output) or the per-block queue is full — in either case the adapter's end-of-block snapshot still reports the parameter's final value, so no change is lost.
Realtime-safe: pushes into a fixed-capacity queue, never allocates or locks. Only valid to call from within process().
|
inlineoverridevirtual |
Release resources.
Called on the host thread with audio stopped. Processors that own active voices or other note-lifecycle state must clear it here; format adapters separately reset their inbound MPE trackers immediately after this call. For an in-place host reset, clear the same state when ProcessContext::reset_requested is true. A transport jump alone does not clear adapter tracker identities and therefore must not clear voice ownership.
Reimplemented from pulp::format::Processor.
|
inlinevirtualinherited |
Reload a processor-owned scripted editor in place when the editor generation changes.
An override owns its locking protocol and promises that the session returned at open remains authoritative, retains the hosted root, and carries the current generation's script path. Returning false leaves the generation pending. Only called when supports_in_place_scripted_ui_reload() returns true. Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlineinherited |
Editor-INITIATED host-window resize (the plugin↔host direction that on_view_resized does not cover).
The editor calls this to ask the DAW/standalone host to resize the plugin window to (w × h) LOGICAL pixels AND to re-pin the design viewport + aspect ratio to the same size, so the content fills the new window with no letterbox / dark fill and no squish. Use it when the editor's own natural size changes at runtime — e.g. a chrome-hiding "player" mode that wants a smaller, differently-shaped window than its full authoring layout.
The format adapter installs the actual host call (CLAP clap_host_gui->request_resize, VST3 IPlugFrame::resizeView, AU preferredContentSize, standalone WindowHost::request_content_size) via set_editor_resize_handler() when the editor opens, and clears it on close. Returns true when a handler is installed AND the host accepted the request; false when no editor is open, multiple editor windows make the target ambiguous, the host exposes no resize path, or the host refused (the editor should keep its current size). Main-thread / UI-thread only.
The handlers live in a side table (detail::editor_resize_handlers), NOT a data member, so this capability adds nothing to sizeof(Processor) and stays ABI-compatible with prebuilt libraries.
|
inlineinherited |
Ask the plug-in to silence itself and, where the host has MIDI output, end the notes it has sent.
Safe from any non-real-time thread (a UI button, a script, a menu): it records the request and returns at once; the next audio block services it. Does nothing audible if the host adapter does not service panic requests; check panic_capabilities(). The state lives in a side table, so this adds nothing to sizeof(Processor).
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Resume processing after a prior suspend().
Default no-op; the symmetric counterpart of suspend() above.
Reimplemented in pulp::format::NativeCoreProcessor.
|
inlinevirtualinherited |
Opt-in DSP-state carry across a hot-reload (reload lane, item 1.6).
Documented in full next to latency_samples() above; DECLARED here (at the end of the vtable) so the Processor virtual order stays additive-only (node_abi_gate) after is_bus_layout_supported/process were frozen on main. serialize returns the OLD processor's opaque DSP-state blob (empty = nothing to carry); restore loads it into the NEW processor (false = cold start, always safe). Appended to preserve additive-only vtable ordering.
|
inlinevirtualinherited |
Serialize plugin-owned state that is not part of StateStore.
Use this for opaque state that must survive host/session recall but should not be exposed as flat automatable parameters. The returned bytes travel alongside StateStore through the format adapters' save/load paths.
Called on a host/main thread, never from process().
Reimplemented in pulp::format::NativeCoreProcessor.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Settings tabs this plugin contributes, composed by the host alongside its own host-owned tabs (e.g.
Audio/MIDI device selection in the standalone). This keeps device selection a host concern — correct in a DAW, where the host owns the audio device — while letting a plugin surface its own settings (e.g. a model picker) in one unified Settings panel. Called when the settings UI is built; may be called again if it is rebuilt. (Appended last to preserve additive-only vtable ordering.)
|
inlineinherited |
Access sidechain input buffer (set by format adapters before process).
Returns nullptr if no sidechain is connected or the bus is inactive.
|
inlineinherited |
Access the parameter state store.
Use state().get_value(id) to read parameter values in process().
The store belongs to the host, not to the Processor, and the Processor may reach it for its whole lifetime — including from its destructor, and from any worker thread that destructor is about to join. A host must therefore keep the store alive until the Processor is gone: declare the store before the unique_ptr<Processor>, since members are destroyed in reverse. Every host in this directory does; a host that gets it backwards hands a running thread a freed store, which crashes on plug-in close and nowhere else.
|
inlineinherited |
|
inlinenoexceptinherited |
|
inlinevirtualinherited |
Editor live-reload support (live-swap 1.9).
A processor whose editor should rebuild IN PLACE while it is open — e.g. a ReloadableShell whose logic hot-swaps its create_view() — returns true here. The ViewBridge then hosts the editor under a STABLE root container so its content can be replaced live (the host keeps referencing the same root View) without the DAW re-instantiating the plugin. Default false: normal plugins are unaffected — no wrapper, no polling cost. Appended to preserve additive-only vtable ordering.
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlinevirtualinherited |
Opt in when a processor-owned scripted editor must reload its existing session rather than rebuilding through create_view().
Kept separate from active_scripted_ui() so existing custom scripted processors retain the ordinary create_view() reload path. Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlinevirtualinherited |
Pause processing for a heavy main-thread operation (preset load, convolution kernel reallocation, sample-rate change) that would otherwise need to either block in process() — fatal — or run in lock-step with process(), which is hard to get right.
The host calls suspend() before the heavy op and resume() after; while suspended, process() is expected to output silence and skip the heavy state.
Default no-op so the contract is opt-in: plug-ins that don't need it pay nothing. Plug-ins that override suspend() should flush their voices / set an internal "suspended" flag, and override resume() to clear it; process() then early- returns or zero-fills while the flag is set.
Threading: both hooks run on the host / main thread, never from process(). Format adapters do not currently call these hooks automatically. Adapter integration stays additive once the canonical "suspend-then-load-preset" surface for each format is settled. Today the hooks exist so a plug-in can wire its own UI-thread "loading..." workflow against them.
Standard suspend/resume guard: while suspended a processor should stop touching shared real-time state so a host can safely reconfigure it.
Reimplemented in pulp::format::NativeCoreProcessor.
|
inlinenoexceptinherited |
|
inlineinherited |
Access the MIDI 2.0 UMP buffer for this block.
Returns nullptr unless the plugin declared UMP via PluginDescriptor legacy flags or node capabilities and the host/format adapter populated it.
|
inlinevirtualinherited |
Named value channels this processor publishes for its UI — gain reduction, an envelope follower, a spectrum, or bounded trigger occurrences — i.e.
UI data that is NOT a parameter. Returning nullptr (the default) means the processor declares none, and nothing in the framework runs on its behalf: the cost of not using this is structurally zero, not a per-block branch.
Own the set as a subclass member and declare its channels in your constructor, before audio starts. The returned pointer must outlive every view attached to this processor.
Threading: publish() on a channel is audio-thread safe. Reads happen on the FrameClock thread and nowhere else — the single-reader-thread contract is load-bearing, see value_source.hpp.
Appended to preserve additive-only vtable ordering (node_abi_gate).
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlinevirtualinherited |
Return the full view size hints (preferred/min/max).
Resolution order (first non-zero wins):
Override this method when a plugin needs runtime-computed bounds (e.g., a dynamically generated UI). Most imported-design plugins should use the CMake args instead — see import-design skill.
|
inlinevirtualinherited |
Const counterpart to visit_active_scripted_ui().
Appended to preserve additive-only vtable ordering (node_abi_gate).
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlinevirtualinherited |
Synchronously visit the active scripted-UI session while the processor keeps it alive.
Reloadable processors must retain their active-generation lease for the full callback instead of returning a reload-owned raw pointer to the caller.
The pointer is non-owning and is valid only for the callback. The callback must stay bounded and must not re-enter this processor.
Appended to preserve additive-only vtable ordering (node_abi_gate).
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlinevirtualinherited |
Synchronously visit the current value-channel set while the processor keeps it alive.
Callers that need to claim an attachment from a processor whose implementation can replace its backing instance must do so inside this callback rather than retaining the raw value_channels() result.
The callback must stay bounded and must not re-enter this processor. The pointer is non-owning and is valid only for the callback unless the concrete processor independently guarantees a longer lifetime.
Appended to preserve additive-only vtable ordering (node_abi_gate).
Reimplemented in pulp::format::reload::ReloadableShell.
|
inlinevirtualinherited |
AU v2 only, and only for a processor that wants sample-accurate parameters.
Default true: one process() call per slice between scheduled events, with the store at each slice's starting value and the slice's points in param_events() relative to the slice. Return false from a processor that reads automation only through param_events() (or a ParamCursor over it) to render the buffer in one call, as VST3 and CLAP do: every point at its buffer offset and the store at its end-of-buffer value. Other formats ignore it. Appended to preserve additive-only vtable ordering (node_abi_gate).
|
inlinevirtualinherited |
Whether this processor reads sample-accurate parameter automation: param_events(), a state::ParamCursor, or for_each_subblock().
Default true: the VST3, AU v2 and CLAP adapters deliver every automation point in param_events() with its sample offset, and the store holds each parameter's end-of-block value during process(). AU v2 renders one call per scheduled slice unless wants_au_scheduled_parameter_slices() returns false.
Return false from a processor that reads its parameters once per block (state().get_value()) and never looks at the queue. Those adapters then write each automated parameter's last value in the block to the store once, before process(), leave param_events() empty, and AU v2 renders the whole buffer in one call, so dense host automation costs nothing per point. Asked once, when the adapter creates the processor. Other hosting paths (AU v3, LV2, AAX, the standalone and headless hosts, graph nodes) deliver every point either way. Appended to preserve additive-only vtable ordering (node_abi_gate).
Reimplemented in pulp::format::NativeCoreProcessor.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |