Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
AudioEngine Struct Reference

The audio engine. More...

#include <dsp/engine.h>

Collaboration diagram for AudioEngine:

Data Fields

uint_fast64_t cycle
 Cycle count to know which cycle we are in.
 
void * client
 
gint handled_jack_buffer_size_change
 Whether pending jack buffer change was handled (buffers reallocated).
 
AudioEngineJackTransportType transport_type
 Whether transport master/client or no connection with jack transport.
 
AudioBackend audio_backend
 Current audio backend.
 
MidiBackend midi_backend
 Current MIDI backend.
 
nframes_t block_length
 Audio buffer size (block length), per channel.
 
size_t midi_buf_size
 Size of MIDI port buffers in bytes.
 
sample_rate_t sample_rate
 Sample rate.
 
double frames_per_tick
 Number of frames/samples per tick.
 
double ticks_per_frame
 Reciprocal of AudioEngine::frames_per_tick.
 
int buf_size_set
 True iff buffer size callback fired.
 
Routerrouter
 The processing graph router.
 
HardwareProcessorhw_in_processor
 Input device processor.
 
HardwareProcessorhw_out_processor
 Output device processor.
 
Portmidi_clock_in
 MIDI Clock input TODO.
 
Portmidi_clock_out
 MIDI Clock output.
 
ControlRoomcontrol_room
 The ControlRoom.
 
AudioPoolpool
 Audio file pool.
 
StereoPortsdummy_input
 Used during tests to pass input data for recording.
 
StereoPortsmonitor_out
 Monitor - these should be the last ports in the signal chain.
 
int trigger_midi_activity
 Flag to tell the UI that this channel had MIDI activity.
 
Portmidi_editor_manual_press
 Manual note press events from the piano roll.
 
Portmidi_in
 Port used for receiving MIDI in messages for binding CC and other non-recording purposes.
 
nframes_t nframes
 Number of frames/samples in the current cycle, per channel.
 
ZixSem port_operation_lock
 Semaphore for blocking DSP while a plugin and its ports are deleted.
 
gint run
 Ok to process or not.
 
bool preparing_to_export
 To be set to true when preparing to export.
 
gint exporting
 1 if currently exporting.
 
gint panic
 Send note off MIDI everywhere.
 
void * playback_handle
 
void * seq_handle
 
void * hw_params
 
void * sw_params
 
float * alsa_out_buf
 ALSA audio buffer.
 
gint filled_stereo_out_bufs
 Flag used when processing in some backends.
 
gint preparing_for_process
 Flag used to check if we are inside engine_process_prepare().
 
void * pa_stream
 
float * pa_out_buf
 Port Audio output buffer.
 
void * mme_in_devs [1024]
 
int num_mme_in_devs
 
void * mme_out_devs [1024]
 
int num_mme_out_devs
 
uint32_t sdl_dev
 
void * rtaudio
 
void * pulse_mainloop
 
void * pulse_context
 
void * pulse_stream
 
gboolean pulse_notified_underflow
 
GThread * dummy_audio_thread
 Dummy audio DSP processing thread.
 
int stop_dummy_audio_thread
 Set to 1 to stop the dummy audio thread.
 
Transporttransport
 Timeline metadata like BPM, time signature, etc.
 
PanLaw pan_law
 Pan law.
 
PanAlgorithm pan_algo
 Pan algorithm.
 
gint64 last_time_taken
 Time taken to process in the last cycle.
 
gint64 max_time_taken
 Max time taken to process in the last few cycles.
 
gint64 timestamp_start
 Timestamp at the start of the current cycle.
 
gint64 timestamp_end
 Expected timestamp at the end of the current cycle.
 
gint64 last_timestamp_start
 Timestamp at start of previous cycle.
 
gint64 last_timestamp_end
 Timestamp at end of previous cycle.
 
nframes_t remaining_latency_preroll
 When first set, it is equal to the max playback latency of all initial trigger nodes.
 
SampleProcessorsample_processor
 
int capture_cc
 To be set to 1 when the CC from the Midi in port should be captured.
 
midi_byte_t last_cc [3]
 Last MIDI CC captured.
 
gint64 last_xrun_notification
 Last time an XRUN notification was shown.
 
bool denormal_prevention_val_positive
 Whether the denormal prevention value (1e-12 ~ 1e-20) is positive.
 
float denormal_prevention_val
 
gint64 zrythm_start_time
 Time at start to keep track if trial limit is reached.
 
int limit_reached
 Flag to keep track of the first time the limit is reached.
 
BounceMode bounce_mode
 If this is on, only tracks/regions marked as "for bounce" will be allowed to make sound.
 
BounceStep bounce_step
 Bounce step cache.
 
bool bounce_with_parents
 Whether currently bouncing with parents (cache).
 
Metronomemetronome
 The metronome.
 
MPMCQueueev_queue
 Event queue.
 
ObjectPoolev_pool
 Object pool of event structs to avoid allocation.
 
guint process_source_id
 ID of the event processing source func.
 
int processing_events
 Whether currently processing events.
 
gint64 last_events_process_started
 Time last event processing started.
 
gint64 last_events_processed
 Time last event processing completed.
 
gint cycle_running
 Whether the cycle is currently running.
 
bool pre_setup
 Whether the engine is already pre-set up.
 
bool setup
 Whether the engine is already set up.
 
bool activated
 Whether the engine is currently activated.
 
Projectproject
 Pointer to owner project, if any.
 
bool updating_frames_per_tick
 True while updating frames per tick.
 
AudioEnginePositionInfo pos_nfo_before
 Position info at the end of the previous cycle before moving the transport.
 
AudioEnginePositionInfo pos_nfo_current
 Position info at the start of the current cycle.
 
AudioEnginePositionInfo pos_nfo_at_end
 Expected position info at the end of the current cycle.
 

Detailed Description

The audio engine.

Definition at line 360 of file engine.h.

Field Documentation

◆ activated

bool AudioEngine::activated

Whether the engine is currently activated.

Definition at line 772 of file engine.h.

◆ alsa_out_buf

float* AudioEngine::alsa_out_buf

ALSA audio buffer.

Definition at line 558 of file engine.h.

◆ audio_backend

AudioBackend AudioEngine::audio_backend

Current audio backend.

Definition at line 392 of file engine.h.

◆ block_length

nframes_t AudioEngine::block_length

Audio buffer size (block length), per channel.

Definition at line 398 of file engine.h.

◆ bounce_mode

BounceMode AudioEngine::bounce_mode

If this is on, only tracks/regions marked as "for bounce" will be allowed to make sound.

Automation and everything else will work as normal.

Definition at line 715 of file engine.h.

◆ bounce_step

BounceStep AudioEngine::bounce_step

Bounce step cache.

Definition at line 718 of file engine.h.

◆ bounce_with_parents

bool AudioEngine::bounce_with_parents

Whether currently bouncing with parents (cache).

Definition at line 722 of file engine.h.

◆ buf_size_set

int AudioEngine::buf_size_set

True iff buffer size callback fired.

Definition at line 416 of file engine.h.

◆ capture_cc

int AudioEngine::capture_cc

To be set to 1 when the CC from the Midi in port should be captured.

Definition at line 669 of file engine.h.

◆ client

void* AudioEngine::client

Definition at line 373 of file engine.h.

◆ control_room

ControlRoom* AudioEngine::control_room

The ControlRoom.

Definition at line 442 of file engine.h.

◆ cycle

uint_fast64_t AudioEngine::cycle

Cycle count to know which cycle we are in.

Useful for debugging.

Definition at line 367 of file engine.h.

◆ cycle_running

gint AudioEngine::cycle_running

Whether the cycle is currently running.

Definition at line 763 of file engine.h.

◆ denormal_prevention_val

float AudioEngine::denormal_prevention_val

Definition at line 694 of file engine.h.

◆ denormal_prevention_val_positive

bool AudioEngine::denormal_prevention_val_positive

Whether the denormal prevention value (1e-12 ~ 1e-20) is positive.

This should be swapped often to avoid DC offset prevention algorithms removing it.

See https://www.earlevel.com/main/2019/04/19/floating-point-denormals/ for details.

Definition at line 693 of file engine.h.

◆ dummy_audio_thread

GThread* AudioEngine::dummy_audio_thread

Dummy audio DSP processing thread.

Definition at line 623 of file engine.h.

◆ dummy_input

StereoPorts* AudioEngine::dummy_input

Used during tests to pass input data for recording.

Will be ignored if NULL.

Definition at line 453 of file engine.h.

◆ ev_pool

ObjectPool* AudioEngine::ev_pool

Object pool of event structs to avoid allocation.

Definition at line 746 of file engine.h.

◆ ev_queue

MPMCQueue* AudioEngine::ev_queue

Event queue.

Events such as buffer size change request and sample size change request should be queued here.

The engine will skip processing while the queue still has events or is currently processing events.

Definition at line 740 of file engine.h.

◆ exporting

gint AudioEngine::exporting

1 if currently exporting.

Definition at line 522 of file engine.h.

◆ filled_stereo_out_bufs

gint AudioEngine::filled_stereo_out_bufs

Flag used when processing in some backends.

Definition at line 563 of file engine.h.

◆ frames_per_tick

double AudioEngine::frames_per_tick

Number of frames/samples per tick.

Definition at line 407 of file engine.h.

◆ handled_jack_buffer_size_change

gint AudioEngine::handled_jack_buffer_size_change

Whether pending jack buffer change was handled (buffers reallocated).

To be set to zero when a change starts and 1 when the change is fully processed.

Definition at line 383 of file engine.h.

◆ hw_in_processor

HardwareProcessor* AudioEngine::hw_in_processor

Input device processor.

Definition at line 422 of file engine.h.

◆ hw_out_processor

HardwareProcessor* AudioEngine::hw_out_processor

Output device processor.

Definition at line 425 of file engine.h.

◆ hw_params

void* AudioEngine::hw_params

Definition at line 553 of file engine.h.

◆ last_cc

midi_byte_t AudioEngine::last_cc[3]

Last MIDI CC captured.

Definition at line 672 of file engine.h.

◆ last_events_process_started

gint64 AudioEngine::last_events_process_started

Time last event processing started.

Definition at line 755 of file engine.h.

◆ last_events_processed

gint64 AudioEngine::last_events_processed

Time last event processing completed.

Definition at line 758 of file engine.h.

◆ last_time_taken

gint64 AudioEngine::last_time_taken

Time taken to process in the last cycle.

Definition at line 640 of file engine.h.

◆ last_timestamp_end

gint64 AudioEngine::last_timestamp_end

Timestamp at end of previous cycle.

Definition at line 658 of file engine.h.

◆ last_timestamp_start

gint64 AudioEngine::last_timestamp_start

Timestamp at start of previous cycle.

Definition at line 655 of file engine.h.

◆ last_xrun_notification

gint64 AudioEngine::last_xrun_notification

Last time an XRUN notification was shown.

This is to prevent multiple XRUN notifications being shown so quickly that Zrythm becomes unusable.

Definition at line 681 of file engine.h.

◆ limit_reached

int AudioEngine::limit_reached

Flag to keep track of the first time the limit is reached.

Definition at line 704 of file engine.h.

◆ max_time_taken

gint64 AudioEngine::max_time_taken

Max time taken to process in the last few cycles.

Definition at line 644 of file engine.h.

◆ metronome

Metronome* AudioEngine::metronome

The metronome.

Definition at line 725 of file engine.h.

◆ midi_backend

MidiBackend AudioEngine::midi_backend

Current MIDI backend.

Definition at line 395 of file engine.h.

◆ midi_buf_size

size_t AudioEngine::midi_buf_size

Size of MIDI port buffers in bytes.

Definition at line 401 of file engine.h.

◆ midi_clock_in

Port* AudioEngine::midi_clock_in

MIDI Clock input TODO.

This port is exposed to the backend.

Definition at line 432 of file engine.h.

◆ midi_clock_out

Port* AudioEngine::midi_clock_out

MIDI Clock output.

This port is exposed to the backend.

Definition at line 439 of file engine.h.

◆ midi_editor_manual_press

Port* AudioEngine::midi_editor_manual_press

Manual note press events from the piano roll.

The events from here should be read by the corresponding track processor's MIDI in port (TrackProcessor.midi_in). To avoid having to recalculate the graph to reattach this port to the correct track processor, only connect this port to the initial processor in the routing graph and fetch the events manually when processing the corresponding track processor.

Definition at line 491 of file engine.h.

◆ midi_in

Port* AudioEngine::midi_in

Port used for receiving MIDI in messages for binding CC and other non-recording purposes.

This port is exposed to the backend.

Definition at line 499 of file engine.h.

◆ mme_in_devs

void* AudioEngine::mme_in_devs[1024]

Definition at line 591 of file engine.h.

◆ mme_out_devs

void* AudioEngine::mme_out_devs[1024]

Definition at line 593 of file engine.h.

◆ monitor_out

StereoPorts* AudioEngine::monitor_out

Monitor - these should be the last ports in the signal chain.

The L/R ports are exposed to the backend.

Definition at line 461 of file engine.h.

◆ nframes

nframes_t AudioEngine::nframes

Number of frames/samples in the current cycle, per channel.

Note
This is used by the engine internally.

Definition at line 507 of file engine.h.

◆ num_mme_in_devs

int AudioEngine::num_mme_in_devs

Definition at line 592 of file engine.h.

◆ num_mme_out_devs

int AudioEngine::num_mme_out_devs

Definition at line 594 of file engine.h.

◆ pa_out_buf

float* AudioEngine::pa_out_buf

Port Audio output buffer.

Unlike JACK, the audio goes directly here. FIXME this is not really needed, just do the calculations in pa_stream_cb.

Definition at line 582 of file engine.h.

◆ pa_stream

void* AudioEngine::pa_stream

Definition at line 572 of file engine.h.

◆ pan_algo

PanAlgorithm AudioEngine::pan_algo

Pan algorithm.

Definition at line 637 of file engine.h.

◆ pan_law

PanLaw AudioEngine::pan_law

Pan law.

Definition at line 635 of file engine.h.

◆ panic

gint AudioEngine::panic

Send note off MIDI everywhere.

Definition at line 525 of file engine.h.

◆ playback_handle

void* AudioEngine::playback_handle

Definition at line 551 of file engine.h.

◆ pool

AudioPool* AudioEngine::pool

Audio file pool.

Definition at line 445 of file engine.h.

◆ port_operation_lock

ZixSem AudioEngine::port_operation_lock

Semaphore for blocking DSP while a plugin and its ports are deleted.

Definition at line 513 of file engine.h.

◆ pos_nfo_at_end

AudioEnginePositionInfo AudioEngine::pos_nfo_at_end

Expected position info at the end of the current cycle.

Definition at line 798 of file engine.h.

◆ pos_nfo_before

AudioEnginePositionInfo AudioEngine::pos_nfo_before

Position info at the end of the previous cycle before moving the transport.

Definition at line 788 of file engine.h.

◆ pos_nfo_current

AudioEnginePositionInfo AudioEngine::pos_nfo_current

Position info at the start of the current cycle.

Definition at line 793 of file engine.h.

◆ pre_setup

bool AudioEngine::pre_setup

Whether the engine is already pre-set up.

Definition at line 766 of file engine.h.

◆ preparing_for_process

gint AudioEngine::preparing_for_process

Flag used to check if we are inside engine_process_prepare().

Definition at line 567 of file engine.h.

◆ preparing_to_export

bool AudioEngine::preparing_to_export

To be set to true when preparing to export.

Definition at line 519 of file engine.h.

◆ process_source_id

guint AudioEngine::process_source_id

ID of the event processing source func.

Definition at line 749 of file engine.h.

◆ processing_events

int AudioEngine::processing_events

Whether currently processing events.

Definition at line 752 of file engine.h.

◆ project

Project* AudioEngine::project

Pointer to owner project, if any.

Definition at line 775 of file engine.h.

◆ pulse_context

void* AudioEngine::pulse_context

Definition at line 615 of file engine.h.

◆ pulse_mainloop

void* AudioEngine::pulse_mainloop

Definition at line 614 of file engine.h.

◆ pulse_notified_underflow

gboolean AudioEngine::pulse_notified_underflow

Definition at line 618 of file engine.h.

◆ pulse_stream

void* AudioEngine::pulse_stream

Definition at line 616 of file engine.h.

◆ remaining_latency_preroll

nframes_t AudioEngine::remaining_latency_preroll

When first set, it is equal to the max playback latency of all initial trigger nodes.

Definition at line 663 of file engine.h.

◆ router

Router* AudioEngine::router

The processing graph router.

Definition at line 419 of file engine.h.

◆ rtaudio

void* AudioEngine::rtaudio

Definition at line 606 of file engine.h.

◆ run

gint AudioEngine::run

Ok to process or not.

Definition at line 516 of file engine.h.

◆ sample_processor

SampleProcessor* AudioEngine::sample_processor

Definition at line 665 of file engine.h.

◆ sample_rate

sample_rate_t AudioEngine::sample_rate

Sample rate.

Definition at line 404 of file engine.h.

◆ sdl_dev

uint32_t AudioEngine::sdl_dev

Definition at line 600 of file engine.h.

◆ seq_handle

void* AudioEngine::seq_handle

Definition at line 552 of file engine.h.

◆ setup

bool AudioEngine::setup

Whether the engine is already set up.

Definition at line 769 of file engine.h.

◆ stop_dummy_audio_thread

int AudioEngine::stop_dummy_audio_thread

Set to 1 to stop the dummy audio thread.

Definition at line 626 of file engine.h.

◆ sw_params

void* AudioEngine::sw_params

Definition at line 554 of file engine.h.

◆ ticks_per_frame

double AudioEngine::ticks_per_frame

Reciprocal of AudioEngine::frames_per_tick.

Definition at line 413 of file engine.h.

◆ timestamp_end

gint64 AudioEngine::timestamp_end

Expected timestamp at the end of the current cycle.

Definition at line 652 of file engine.h.

◆ timestamp_start

gint64 AudioEngine::timestamp_start

Timestamp at the start of the current cycle.

Definition at line 648 of file engine.h.

◆ transport

Transport* AudioEngine::transport

Timeline metadata like BPM, time signature, etc.

Definition at line 631 of file engine.h.

◆ transport_type

AudioEngineJackTransportType AudioEngine::transport_type

Whether transport master/client or no connection with jack transport.

Definition at line 389 of file engine.h.

◆ trigger_midi_activity

int AudioEngine::trigger_midi_activity

Flag to tell the UI that this channel had MIDI activity.

When processing this and setting it to 0, the UI should create a separate event using EVENTS_PUSH.

Definition at line 469 of file engine.h.

◆ updating_frames_per_tick

bool AudioEngine::updating_frames_per_tick

True while updating frames per tick.

See engine_update_frames_per_tick().

Definition at line 782 of file engine.h.

◆ zrythm_start_time

gint64 AudioEngine::zrythm_start_time

Time at start to keep track if trial limit is reached.

Definition at line 700 of file engine.h.


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