25class QuantizeOptions final
28 static constexpr auto MAX_SNAP_POINTS = 120096;
29 using NoteLength = utils::NoteLength;
33 QuantizeOptions () =
default;
34 QuantizeOptions (NoteLength note_length) { init (note_length); }
36 void init (NoteLength note_length);
43 float get_swing ()
const;
45 float get_amount ()
const;
47 float get_randomization ()
const;
49 void set_swing (
float swing);
51 void set_amount (
float amount);
53 void set_randomization (
float randomization);
59 to_string (NoteLength note_length, NoteType note_type);
72 std::pair<units::precise_tick_t, double>
76 static constexpr auto kNoteLengthKey =
"noteLength"sv;
77 static constexpr auto kNoteTypeKey =
"noteType"sv;
78 static constexpr auto kAdjustStartKey =
"adjustStart"sv;
79 static constexpr auto kAdjustEndKey =
"adjustEnd"sv;
80 static constexpr auto kAmountKey =
"amount"sv;
81 static constexpr auto kSwingKey =
"swing"sv;
82 static constexpr auto kRandomizationTicksKey =
"randTicks"sv;
83 friend void to_json (nlohmann::json &j,
const QuantizeOptions &p)
95 friend void from_json (
const nlohmann::json &j, QuantizeOptions &p)
97 j.at (kNoteLengthKey).get_to (p.note_length_);
98 j.at (kNoteTypeKey).get_to (p.note_type_);
99 j.at (kAdjustStartKey).get_to (p.adjust_start_);
100 j.at (kAdjustEndKey).get_to (p.adjust_end_);
101 j.at (kAmountKey).get_to (p.amount_);
102 j.at (kSwingKey).get_to (p.swing_);
103 j.at (kRandomizationTicksKey).get_to (p.randomization_ticks_);
106 units::precise_tick_t get_prev_point (units::precise_tick_t pos)
const;
107 units::precise_tick_t get_next_point (units::precise_tick_t pos)
const;