Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::CVPort Class Referencefinal

Control Voltage port. More...

#include <src/dsp/cv_port.h>

Inheritance diagram for zrythm::dsp::CVPort:
Collaboration diagram for zrythm::dsp::CVPort:

Public Member Functions

 CVPort (utils::Utf8String label, PortFlow flow)
void process_block (EngineProcessTimeInfo time_nfo, const dsp::ITransport &transport) noexcept override
void clear_buffer (std::size_t offset, std::size_t nframes) override
 Clears the port buffer.
void prepare_for_processing (const graph::GraphNode *node, units::sample_rate_t sample_rate, nframes_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().
Public Member Functions inherited from zrythm::dsp::Port
void set_full_designation_provider (FullDesignationProvider provider)
void set_full_designation_provider (const auto *owner)
 Convenience helper for providers that contain a get_full_designation_for_port() method.
bool is_input () const
bool is_output () const
bool is_midi () const
bool is_cv () const
bool is_audio () const
utils::Utf8String get_label () const
auto get_symbol () const
void set_symbol (const utils::Utf8String &sym)
utils::Utf8String get_node_name () const override
 Returns a human friendly name of the node.
nframes_t get_single_playback_latency () const override
 Ports have no latency.
utils::Utf8String get_full_designation () const
 Gets a full designation of the port in the format "Track/Port" or "Track/Plugin/Port".
bool has_label () const
PortType type () const
PortFlow flow () const
Public Member Functions inherited from zrythm::utils::UuidIdentifiableObject< Port >
UuidIdentifiableObject & operator= (const UuidIdentifiableObject &other)=default
auto get_uuid () const
Public Member Functions inherited from zrythm::dsp::PortConnectionsCacheMixin< CVPort >
auto & port_sources () const
void set_port_sources (this auto &self, RangeOf< CVPort * > auto source_ports)

Data Fields

std::vector< float > buf_
 Audio-like data buffer.
std::unique_ptr< RingBuffer< float > > cv_ring_
 Ring buffer for saving the contents of the audio buffer to be used in the UI instead of directly accessing the buffer.
Data Fields inherited from zrythm::dsp::RingBufferOwningPortMixin
std::atomic< int > num_ring_buffer_readers_ { 0 }
 Number of entities that want ring buffers to be written.

Friends

void init_from (CVPort &obj, const CVPort &other, utils::ObjectCloneType clone_type)
void to_json (nlohmann::json &j, const CVPort &p)
void from_json (const nlohmann::json &j, CVPort &p)

Additional Inherited Members

Public Types inherited from zrythm::dsp::Port
using FullDesignationProvider
Protected Member Functions inherited from zrythm::dsp::Port
 Port (utils::Utf8String label, PortType type={}, PortFlow flow={})

Detailed Description

Control Voltage port.

This port provides sample-accurante signals (similar to audio) and can be used to modulate parameters.

The range is assumed to be 0 to 1.

Definition at line 21 of file cv_port.h.

Member Function Documentation

◆ clear_buffer()

void zrythm::dsp::CVPort::clear_buffer ( std::size_t offset,
std::size_t nframes )
overridevirtual

Clears the port buffer.

Implements zrythm::dsp::Port.

◆ prepare_for_processing()

void zrythm::dsp::CVPort::prepare_for_processing ( const graph::GraphNode * node,
units::sample_rate_t sample_rate,
nframes_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::CVPort::process_block ( EngineProcessTimeInfo time_nfo,
const dsp::ITransport & transport )
overridevirtualnoexcept

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

◆ release_resources()

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

Called to release resources allocated by prepare_for_processing().

This may be called multiple times.

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

◆ from_json

void from_json ( const nlohmann::json & j,
CVPort & p )
friend

Definition at line 55 of file cv_port.h.

◆ to_json

void to_json ( nlohmann::json & j,
const CVPort & p )
friend

Definition at line 51 of file cv_port.h.

Field Documentation

◆ buf_

std::vector<float> zrythm::dsp::CVPort::buf_

Audio-like data buffer.

Definition at line 64 of file cv_port.h.

◆ cv_ring_

std::unique_ptr<RingBuffer<float> > zrythm::dsp::CVPort::cv_ring_

Ring buffer for saving the contents of the audio buffer to be used in the UI instead of directly accessing the buffer.

This should contain blocks of block_length samples and should maintain at least 10 cycles' worth of buffers.

This is also used for CV.

Definition at line 75 of file cv_port.h.


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