Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
A TrackProcessor is a processor that is used as the first entry point when processing a track. More...
#include <src/structure/tracks/track_processor.h>
Public Types | |
using | SixteenPortUuidArray |
Public Member Functions | |
TrackProcessor (ProcessableTrack &track, dsp::PortRegistry &port_registry, dsp::ProcessorParameterRegistry ¶m_registry, bool new_identity) | |
Creates a new track processor for the given track. | |
bool | is_audio () const |
bool | is_midi () const |
utils::Utf8String | get_full_designation_for_port (const dsp::Port &port) const |
dsp::PortConnectionsManager * | get_port_connections_manager () const |
ProcessableTrack * | get_track () const |
void | init_loaded (ProcessableTrack *track, dsp::PortRegistry &port_registry, dsp::ProcessorParameterRegistry ¶m_registry) |
Inits a TrackProcessor after a project is loaded. | |
void | clear_buffers (std::size_t block_length) |
Clears all buffers. | |
void | process (const EngineProcessTimeInfo &time_nfo) |
Process the TrackProcessor. | |
void | disconnect_from_prefader () |
Disconnect the TrackProcessor's stereo out ports from the prefader. | |
void | connect_to_prefader () |
Connects the TrackProcessor's stereo out ports to the Channel's prefader in ports. | |
void | disconnect_from_plugin (gui::old_dsp::plugins::Plugin &pl) |
Disconnect the TrackProcessor's out ports from the Plugin's input ports. | |
void | connect_to_plugin (gui::old_dsp::plugins::Plugin &pl) |
Connect the TrackProcessor's out ports to the Plugin's input ports. | |
void | append_ports (std::vector< dsp::Port * > &ports) |
std::pair< dsp::AudioPort &, dsp::AudioPort & > | get_stereo_in_ports () const |
std::pair< dsp::AudioPort &, dsp::AudioPort & > | get_stereo_out_ports () const |
dsp::ProcessorParameter & | get_mono_param () const |
dsp::ProcessorParameter & | get_input_gain_param () const |
dsp::ProcessorParameter & | get_output_gain_param () const |
dsp::ProcessorParameter & | get_monitor_audio_param () const |
dsp::MidiPort & | get_midi_in_port () const |
dsp::MidiPort & | get_midi_out_port () const |
dsp::MidiPort & | get_piano_roll_port () const |
dsp::ProcessorParameter & | get_midi_cc_param (int channel_index, int cc_index) const |
dsp::ProcessorParameter & | get_pitch_bend_param (int channel_index) const |
dsp::ProcessorParameter & | get_poly_key_pressure_param (int channel_index) const |
dsp::ProcessorParameter & | get_channel_pressure_param (int channel_index) const |
Data Fields | |
dsp::PortRegistry & | port_registry_ |
dsp::ProcessorParameterRegistry & | param_registry_ |
std::optional< dsp::PortUuidReference > | stereo_in_left_id_ |
L & R audio input ports, if audio. | |
std::optional< dsp::PortUuidReference > | stereo_in_right_id_ |
std::optional< dsp::ProcessorParameterUuidReference > | mono_id_ |
Mono toggle, if audio. | |
std::optional< dsp::ProcessorParameterUuidReference > | input_gain_id_ |
Input gain, if audio. | |
std::optional< dsp::ProcessorParameterUuidReference > | output_gain_id_ |
Output gain, if audio. | |
std::optional< dsp::PortUuidReference > | stereo_out_left_id_ |
L & R audio output ports, if audio. | |
std::optional< dsp::PortUuidReference > | stereo_out_right_id_ |
std::optional< dsp::PortUuidReference > | midi_in_id_ |
MIDI in Port. | |
std::optional< dsp::PortUuidReference > | midi_out_id_ |
MIDI out port, if MIDI. | |
std::optional< dsp::PortUuidReference > | piano_roll_id_ |
MIDI input for receiving MIDI signals from the piano roll (i.e., MIDI notes inside regions) or other sources. | |
std::optional< dsp::ProcessorParameterUuidReference > | monitor_audio_id_ |
Whether to monitor the audio output. | |
std::unique_ptr< engine::session::MidiMappings > | cc_mappings_ |
Mappings to each CC port. | |
std::unique_ptr< std::array< dsp::ProcessorParameterUuidReference, 16_zu *128 > > | midi_cc_ids_ |
MIDI CC control ports, 16 channels x 128 controls. | |
std::unique_ptr< SixteenPortUuidArray > | pitch_bend_ids_ |
Pitch bend x 16 channels. | |
std::unique_ptr< SixteenPortUuidArray > | poly_key_pressure_ids_ |
Polyphonic key pressure (aftertouch). | |
std::unique_ptr< SixteenPortUuidArray > | channel_pressure_ids_ |
Channel pressure (aftertouch). | |
float | l_port_db_ = 0.0f |
Current dBFS after processing each output port. | |
float | r_port_db_ = 0.0f |
ProcessableTrack * | track_ = nullptr |
Pointer to owner track, if any. | |
bool | pending_midi_panic_ = false |
To be set to true when a panic (all notes off) message should be sent during processing. | |
std::unique_ptr< MPMCQueue< dsp::ProcessorParameter * > > | updated_midi_automatable_ports_ |
A queue of MIDI CC ports whose values have been recently updated. |
Friends | |
void | init_from (TrackProcessor &obj, const TrackProcessor &other, utils::ObjectCloneType clone_type) |
void | to_json (nlohmann::json &j, const TrackProcessor &tp) |
void | from_json (const nlohmann::json &j, TrackProcessor &tp) |
A TrackProcessor is a processor that is used as the first entry point when processing a track.
Definition at line 22 of file track_processor.h.
using zrythm::structure::tracks::TrackProcessor::SixteenPortUuidArray |
Definition at line 347 of file track_processor.h.
void zrythm::structure::tracks::TrackProcessor::connect_to_prefader | ( | ) |
Connects the TrackProcessor's stereo out ports to the Channel's prefader in ports.
Used when deleting the only plugin left.
void zrythm::structure::tracks::TrackProcessor::disconnect_from_prefader | ( | ) |
Disconnect the TrackProcessor's stereo out ports from the prefader.
Used when there is no plugin in the channel.
|
inline |
Definition at line 191 of file track_processor.h.
|
inline |
Definition at line 148 of file track_processor.h.
|
inline |
Definition at line 173 of file track_processor.h.
|
inline |
Definition at line 160 of file track_processor.h.
|
inline |
Definition at line 164 of file track_processor.h.
|
inline |
Definition at line 156 of file track_processor.h.
|
inline |
Definition at line 144 of file track_processor.h.
|
inline |
Definition at line 152 of file track_processor.h.
|
inline |
Definition at line 168 of file track_processor.h.
|
inline |
Definition at line 179 of file track_processor.h.
|
inline |
Definition at line 185 of file track_processor.h.
|
inline |
Definition at line 123 of file track_processor.h.
|
inline |
Definition at line 133 of file track_processor.h.
|
inline |
Definition at line 45 of file track_processor.h.
void zrythm::structure::tracks::TrackProcessor::process | ( | const EngineProcessTimeInfo & | time_nfo | ) |
Process the TrackProcessor.
This function performs the following:
g_start_frames | The global start frames. |
local_offset | The local start frames. |
nframes | The number of frames to process. |
|
friend |
Definition at line 214 of file track_processor.h.
std::unique_ptr<engine::session::MidiMappings> zrythm::structure::tracks::TrackProcessor::cc_mappings_ |
Mappings to each CC port.
Definition at line 341 of file track_processor.h.
std::unique_ptr<SixteenPortUuidArray> zrythm::structure::tracks::TrackProcessor::channel_pressure_ids_ |
Channel pressure (aftertouch).
This message is different from polyphonic after-touch - sends the single greatest pressure value (of all the current depressed keys).
Definition at line 370 of file track_processor.h.
std::optional<dsp::ProcessorParameterUuidReference> zrythm::structure::tracks::TrackProcessor::input_gain_id_ |
Input gain, if audio.
Definition at line 288 of file track_processor.h.
float zrythm::structure::tracks::TrackProcessor::l_port_db_ = 0.0f |
Current dBFS after processing each output port.
Transient variables only used by the GUI.
Definition at line 378 of file track_processor.h.
std::unique_ptr<std::array<dsp::ProcessorParameterUuidReference, 16_zu * 128> > zrythm::structure::tracks::TrackProcessor::midi_cc_ids_ |
MIDI CC control ports, 16 channels x 128 controls.
Definition at line 345 of file track_processor.h.
std::optional<dsp::PortUuidReference> zrythm::structure::tracks::TrackProcessor::midi_in_id_ |
MIDI in Port.
This port is for receiving MIDI signals from an external MIDI source.
This is also where piano roll, midi in and midi manual press will be routed to and this will be the port used to pass midi to the plugins.
Definition at line 311 of file track_processor.h.
std::optional<dsp::PortUuidReference> zrythm::structure::tracks::TrackProcessor::midi_out_id_ |
MIDI out port, if MIDI.
Definition at line 316 of file track_processor.h.
std::optional<dsp::ProcessorParameterUuidReference> zrythm::structure::tracks::TrackProcessor::monitor_audio_id_ |
Whether to monitor the audio output.
This is only used on audio tracks. During recording, if on, the recorded audio will be passed to the output. If off, the recorded audio will not be passed to the output.
When not recording, this will only take effect when paused.
Definition at line 336 of file track_processor.h.
std::optional<dsp::ProcessorParameterUuidReference> zrythm::structure::tracks::TrackProcessor::mono_id_ |
Mono toggle, if audio.
Definition at line 285 of file track_processor.h.
std::optional<dsp::ProcessorParameterUuidReference> zrythm::structure::tracks::TrackProcessor::output_gain_id_ |
Output gain, if audio.
This is applied after regions are processed to stereo_out_.
Definition at line 295 of file track_processor.h.
dsp::ProcessorParameterRegistry& zrythm::structure::tracks::TrackProcessor::param_registry_ |
Definition at line 276 of file track_processor.h.
bool zrythm::structure::tracks::TrackProcessor::pending_midi_panic_ = false |
To be set to true when a panic (all notes off) message should be sent during processing.
Only applies to tracks that receive MIDI input.
Definition at line 390 of file track_processor.h.
std::optional<dsp::PortUuidReference> zrythm::structure::tracks::TrackProcessor::piano_roll_id_ |
MIDI input for receiving MIDI signals from the piano roll (i.e., MIDI notes inside regions) or other sources.
This will not be a separately exposed port during processing. It will be processed by the TrackProcessor internally.
Definition at line 325 of file track_processor.h.
std::unique_ptr<SixteenPortUuidArray> zrythm::structure::tracks::TrackProcessor::pitch_bend_ids_ |
Pitch bend x 16 channels.
Definition at line 351 of file track_processor.h.
std::unique_ptr<SixteenPortUuidArray> zrythm::structure::tracks::TrackProcessor::poly_key_pressure_ids_ |
Polyphonic key pressure (aftertouch).
This message is most often sent by pressing down on the key after it "bottoms out".
FIXME this is completely wrong. It's supposed to be per-key, so 128 x 16 ports.
Definition at line 362 of file track_processor.h.
dsp::PortRegistry& zrythm::structure::tracks::TrackProcessor::port_registry_ |
Definition at line 275 of file track_processor.h.
float zrythm::structure::tracks::TrackProcessor::r_port_db_ = 0.0f |
Definition at line 379 of file track_processor.h.
std::optional<dsp::PortUuidReference> zrythm::structure::tracks::TrackProcessor::stereo_in_left_id_ |
L & R audio input ports, if audio.
Definition at line 281 of file track_processor.h.
std::optional<dsp::PortUuidReference> zrythm::structure::tracks::TrackProcessor::stereo_in_right_id_ |
Definition at line 282 of file track_processor.h.
std::optional<dsp::PortUuidReference> zrythm::structure::tracks::TrackProcessor::stereo_out_left_id_ |
L & R audio output ports, if audio.
Definition at line 300 of file track_processor.h.
std::optional<dsp::PortUuidReference> zrythm::structure::tracks::TrackProcessor::stereo_out_right_id_ |
Definition at line 301 of file track_processor.h.
ProcessableTrack* zrythm::structure::tracks::TrackProcessor::track_ = nullptr |
Pointer to owner track, if any.
Definition at line 382 of file track_processor.h.
std::unique_ptr<MPMCQueue<dsp::ProcessorParameter *> > zrythm::structure::tracks::TrackProcessor::updated_midi_automatable_ports_ |
A queue of MIDI CC ports whose values have been recently updated.
This is used during processing to avoid checking every single MIDI CC port for changes.
Definition at line 399 of file track_processor.h.