Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::gui::old_dsp::QuantizeOptions Class Referencefinal
Collaboration diagram for zrythm::gui::old_dsp::QuantizeOptions:

Public Types

using NoteLength = utils::NoteLength
using NoteType = utils::NoteType

Public Member Functions

 QuantizeOptions (NoteLength note_length)
void init (NoteLength note_length)
void update_quantize_points (const zrythm::dsp::Transport &transport)
 Updates snap points.
float get_swing () const
float get_amount () const
float get_randomization () const
void set_swing (float swing)
void set_amount (float amount)
void set_randomization (float randomization)
std::pair< units::precise_tick_t, double > quantize_position (units::precise_tick_t pos)
 Quantizes the given Position using the given QuantizeOptions.

Static Public Member Functions

static utils::Utf8String to_string (NoteLength note_length, NoteType note_type)
 Returns the grid intensity as a human-readable string.

Data Fields

std::vector< units::precise_tick_t > q_points_
 Quantize points.
NoteLength note_length_ {}
 See SnapGrid.
NoteType note_type_ {}
 See SnapGrid.
float amount_ = 100.f
 Percentage to apply quantize (0-100).
bool adjust_start_ = true
 Adjust start position or not (only applies to objects with length.
bool adjust_end_ = false
 Adjust end position or not (only applies to objects with length.
float swing_ = 0.f
 Swing amount (0-100).
double randomization_ticks_ = 0.f
 Number of ticks for randomization.
PCGRand rand_

Static Public Attributes

static constexpr auto MAX_SNAP_POINTS = 120096

Friends

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

Detailed Description

Definition at line 25 of file quantize_options.h.

Member Typedef Documentation

◆ NoteLength

using zrythm::gui::old_dsp::QuantizeOptions::NoteLength = utils::NoteLength

Definition at line 29 of file quantize_options.h.

◆ NoteType

Constructor & Destructor Documentation

◆ QuantizeOptions()

zrythm::gui::old_dsp::QuantizeOptions::QuantizeOptions ( NoteLength note_length)
inline

Definition at line 34 of file quantize_options.h.

Member Function Documentation

◆ quantize_position()

std::pair< units::precise_tick_t, double > zrythm::gui::old_dsp::QuantizeOptions::quantize_position ( units::precise_tick_t pos)

Quantizes the given Position using the given QuantizeOptions.

This assumes that the start/end check has been done already and it ignores the adjust_start and adjust_end options.

Returns
The resulting position and amount of ticks moved (negative for backwards).

◆ from_json

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

Definition at line 95 of file quantize_options.h.

◆ to_json

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

Definition at line 83 of file quantize_options.h.

Field Documentation

◆ adjust_end_

bool zrythm::gui::old_dsp::QuantizeOptions::adjust_end_ = false

Adjust end position or not (only applies to objects with length.

Definition at line 133 of file quantize_options.h.

◆ adjust_start_

bool zrythm::gui::old_dsp::QuantizeOptions::adjust_start_ = true

Adjust start position or not (only applies to objects with length.

Definition at line 130 of file quantize_options.h.

◆ amount_

float zrythm::gui::old_dsp::QuantizeOptions::amount_ = 100.f

Percentage to apply quantize (0-100).

Definition at line 127 of file quantize_options.h.

◆ MAX_SNAP_POINTS

auto zrythm::gui::old_dsp::QuantizeOptions::MAX_SNAP_POINTS = 120096
staticconstexpr

Definition at line 28 of file quantize_options.h.

◆ note_length_

NoteLength zrythm::gui::old_dsp::QuantizeOptions::note_length_ {}

See SnapGrid.

Definition at line 121 of file quantize_options.h.

◆ note_type_

NoteType zrythm::gui::old_dsp::QuantizeOptions::note_type_ {}

See SnapGrid.

Definition at line 124 of file quantize_options.h.

◆ q_points_

std::vector<units::precise_tick_t> zrythm::gui::old_dsp::QuantizeOptions::q_points_

Quantize points.

These only take into account note_length, note_type and swing. They don't take into account the amount % or randomization ticks.

Not to be serialized.

Definition at line 118 of file quantize_options.h.

◆ rand_

PCGRand zrythm::gui::old_dsp::QuantizeOptions::rand_

Definition at line 141 of file quantize_options.h.

◆ randomization_ticks_

double zrythm::gui::old_dsp::QuantizeOptions::randomization_ticks_ = 0.f

Number of ticks for randomization.

Definition at line 139 of file quantize_options.h.

◆ swing_

float zrythm::gui::old_dsp::QuantizeOptions::swing_ = 0.f

Swing amount (0-100).

Definition at line 136 of file quantize_options.h.


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