Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::ProcessorParameter Class Reference

Processor parameter that accepts automation and modulation sources and integrates with QML and the DSP graph. More...

#include <src/dsp/parameter.h>

Inheritance diagram for zrythm::dsp::ProcessorParameter:
Collaboration diagram for zrythm::dsp::ProcessorParameter:

Data Structures

struct  UniqueId

Public Types

using Resolver
using AutomationValueProvider
 Provides the automation value for a given sample position.
Public Types inherited from zrythm::utils::UuidIdentifiableObject< ProcessorParameter >
using uuid_base_type
 Exposes the CRTP parameter for concept checking.

Public Member Functions

 ProcessorParameter (utils::IObjectRegistry &registry, UniqueId unique_id, ParameterRange range, utils::Utf8String label, QObject *parent=nullptr)
QString label () const
QString description () const
bool automatable () const
const auto & range () const
float baseValue () const
void setBaseValue (float newValue)
Q_INVOKABLE void resetBaseValueToDefault ()
Q_SIGNAL void baseValueChanged (float value)
Q_INVOKABLE float currentValue () const
 Returns the current (normalized) value after any automation and modulation has been applied.
Q_INVOKABLE float valueAfterAutomationApplied () const
 Returns the value after automation, but before modulation has been applied.
Q_INVOKABLE void beginUserGesture ()
Q_INVOKABLE void endUserGesture ()
Q_SIGNAL void userGestureStarted ()
Q_SIGNAL void userGestureFinished ()
utils::Utf8String get_node_name () const override
 Returns a human friendly name of the node.
void process_block (dsp::graph::ProcessBlockInfo time_nfo, const dsp::ITransport &transport, const dsp::TempoMap &tempo_map) noexcept override
 Processes automation and modulation.
void prepare_for_processing (const graph::GraphNode *node, units::sample_rate_t sample_rate, units::sample_u32_t max_block_length) override
 Called to allocate resources required for processing.
void release_resources () override
 Called to release resources allocated by prepare_for_processing().
void set_automation_provider (AutomationValueProvider provider)
void unset_automation_provider ()
PortUuidReference get_modulation_input_port_ref () const
void set_description (utils::Utf8String descr)
void set_automatable (bool automatable)
bool hidden () const
const auto & get_unique_id () const
Public Member Functions inherited from zrythm::utils::UuidIdentifiableObject< ProcessorParameter >
 UuidIdentifiableObject (QObject *parent=nullptr)
auto get_uuid () const
Public Member Functions inherited from zrythm::utils::UuidIdentifiableBase
 UuidIdentifiableBase (QObject *parent=nullptr)
 UuidIdentifiableBase (const QUuid &id, QObject *parent=nullptr)
QUuid raw_uuid () const
Public Member Functions inherited from zrythm::dsp::graph::IProcessable
virtual units::sample_u32_t get_single_playback_latency () const
 Returns the latency of only the given processable, without adding the previous/next latencies (zero latency by default).

Properties

float baseValue
QString label
QString description
zrythm::dsp::ParameterRange range
bool automatable

Friends

void to_json (nlohmann::json &j, const ProcessorParameter &p)
void from_json (const nlohmann::json &j, ProcessorParameter &p)

Additional Inherited Members

Protected Member Functions inherited from zrythm::utils::UuidIdentifiableBase
void set_raw_uuid (const QUuid &id)

Detailed Description

Processor parameter that accepts automation and modulation sources and integrates with QML and the DSP graph.

While ProcessorParameter inherits from IProcessable, it is not part of the DSP graph and is expected to be processed manually by its processor.

Definition at line 252 of file parameter.h.

Member Typedef Documentation

◆ AutomationValueProvider

Initial value:
std::function<std::optional<float> (units::sample_t sample_position)>

Provides the automation value for a given sample position.

Parameters
sample_positionThe sample position in the timeline to get the automation value for.

This allows for flexibility in how automation is obtained (e.g. call once to get the automation value for the entire cycle for efficiency, or call for each sample position for sample-accurate automation), or every few samples.

Returns
The normalized automation value (0.0-1.0) at the given sample position, or std::nullopt if no automation is available.

Definition at line 304 of file parameter.h.

◆ Resolver

using zrythm::dsp::ProcessorParameter::Resolver
Initial value:
std::function<QPointer<ProcessorParameter> (const UniqueId &unique_id)>

Definition at line 281 of file parameter.h.

Member Function Documentation

◆ automatable()

bool zrythm::dsp::ProcessorParameter::automatable ( ) const
inline

Definition at line 313 of file parameter.h.

◆ baseValue()

float zrythm::dsp::ProcessorParameter::baseValue ( ) const
inline

Definition at line 317 of file parameter.h.

◆ beginUserGesture()

Q_INVOKABLE void zrythm::dsp::ProcessorParameter::beginUserGesture ( )
inline

Definition at line 349 of file parameter.h.

◆ currentValue()

Q_INVOKABLE float zrythm::dsp::ProcessorParameter::currentValue ( ) const
inline

Returns the current (normalized) value after any automation and modulation has been applied.

Definition at line 336 of file parameter.h.

◆ description()

QString zrythm::dsp::ProcessorParameter::description ( ) const
inline

Definition at line 312 of file parameter.h.

◆ endUserGesture()

Q_INVOKABLE void zrythm::dsp::ProcessorParameter::endUserGesture ( )
inline

Definition at line 354 of file parameter.h.

◆ get_modulation_input_port_ref()

PortUuidReference zrythm::dsp::ProcessorParameter::get_modulation_input_port_ref ( ) const
inline

Definition at line 395 of file parameter.h.

◆ get_node_name()

utils::Utf8String zrythm::dsp::ProcessorParameter::get_node_name ( ) const
overridevirtual

Returns a human friendly name of the node.

Implements zrythm::dsp::graph::IProcessable.

◆ get_unique_id()

const auto & zrythm::dsp::ProcessorParameter::get_unique_id ( ) const
inline

Definition at line 409 of file parameter.h.

◆ hidden()

bool zrythm::dsp::ProcessorParameter::hidden ( ) const
inline

Definition at line 407 of file parameter.h.

◆ label()

QString zrythm::dsp::ProcessorParameter::label ( ) const
inline

Definition at line 311 of file parameter.h.

◆ prepare_for_processing()

void zrythm::dsp::ProcessorParameter::prepare_for_processing ( const graph::GraphNode * node,
units::sample_rate_t sample_rate,
units::sample_u32_t max_block_length )
overridevirtual

Called to allocate resources required for processing.

Parameters
nodeThe node in the processing graph. Null means we are processing outside of a graph context and must be handled gracefully.
sample_rate
max_block_length

Reimplemented from zrythm::dsp::graph::IProcessable.

◆ process_block()

void zrythm::dsp::ProcessorParameter::process_block ( dsp::graph::ProcessBlockInfo time_nfo,
const dsp::ITransport & transport,
const dsp::TempoMap & tempo_map )
overridevirtualnoexcept

Processes automation and modulation.

Since parameters are not part of the graph, this should be spinned manually by the owning processor.

Reimplemented from zrythm::dsp::graph::IProcessable.

◆ range()

const auto & zrythm::dsp::ProcessorParameter::range ( ) const
inline

Definition at line 315 of file parameter.h.

◆ release_resources()

void zrythm::dsp::ProcessorParameter::release_resources ( )
overridevirtual

Called to release resources allocated by prepare_for_processing().

This may be called multiple times.

Reimplemented from zrythm::dsp::graph::IProcessable.

◆ resetBaseValueToDefault()

Q_INVOKABLE void zrythm::dsp::ProcessorParameter::resetBaseValueToDefault ( )
inline

Definition at line 326 of file parameter.h.

◆ set_automatable()

void zrythm::dsp::ProcessorParameter::set_automatable ( bool automatable)
inline

Definition at line 405 of file parameter.h.

◆ set_automation_provider()

void zrythm::dsp::ProcessorParameter::set_automation_provider ( AutomationValueProvider provider)
inline

Definition at line 389 of file parameter.h.

◆ set_description()

void zrythm::dsp::ProcessorParameter::set_description ( utils::Utf8String descr)
inline

Definition at line 400 of file parameter.h.

◆ setBaseValue()

void zrythm::dsp::ProcessorParameter::setBaseValue ( float newValue)
inline

Definition at line 318 of file parameter.h.

◆ unset_automation_provider()

void zrythm::dsp::ProcessorParameter::unset_automation_provider ( )
inline

Definition at line 393 of file parameter.h.

◆ valueAfterAutomationApplied()

Q_INVOKABLE float zrythm::dsp::ProcessorParameter::valueAfterAutomationApplied ( ) const
inline

Returns the value after automation, but before modulation has been applied.

Intended to be used in the UI.

Definition at line 344 of file parameter.h.

Property Documentation

◆ automatable

bool zrythm::dsp::ProcessorParameter::automatable
read

Definition at line 261 of file parameter.h.

◆ baseValue

float zrythm::dsp::ProcessorParameter::baseValue
readwrite

Definition at line 257 of file parameter.h.

◆ description

QString zrythm::dsp::ProcessorParameter::description
read

Definition at line 259 of file parameter.h.

◆ label

QString zrythm::dsp::ProcessorParameter::label
read

Definition at line 258 of file parameter.h.

◆ range

zrythm::dsp::ParameterRange zrythm::dsp::ProcessorParameter::range
read

Definition at line 260 of file parameter.h.


The documentation for this class was generated from the following file: