23class QuantizeOptions final
26 static constexpr auto MAX_SNAP_POINTS = 120096;
27 using NoteLength = dsp::notes::NoteLength;
28 using NoteType = dsp::notes::NoteType;
31 QuantizeOptions () =
default;
32 QuantizeOptions (NoteLength note_length) { init (note_length); }
34 void init (NoteLength note_length);
41 float get_swing ()
const;
43 float get_amount ()
const;
45 float get_randomization ()
const;
47 void set_swing (
float swing);
49 void set_amount (
float amount);
51 void set_randomization (
float randomization);
57 to_string (NoteLength note_length, NoteType note_type);
70 std::pair<units::precise_tick_t, double>
74 static constexpr auto kNoteLengthKey =
"noteLength"sv;
75 static constexpr auto kNoteTypeKey =
"noteType"sv;
76 static constexpr auto kAdjustStartKey =
"adjustStart"sv;
77 static constexpr auto kAdjustEndKey =
"adjustEnd"sv;
78 static constexpr auto kAmountKey =
"amount"sv;
79 static constexpr auto kSwingKey =
"swing"sv;
80 static constexpr auto kRandomizationTicksKey =
"randTicks"sv;
81 friend void to_json (nlohmann::json &j,
const QuantizeOptions &p);
82 friend void from_json (
const nlohmann::json &j, QuantizeOptions &p);
84 units::precise_tick_t get_prev_point (units::precise_tick_t pos)
const;
85 units::precise_tick_t get_next_point (units::precise_tick_t pos)
const;