24class QuantizeOptions final
27 static constexpr auto MAX_SNAP_POINTS = 120096;
28 using NoteLength = dsp::notes::NoteLength;
29 using NoteType = dsp::notes::NoteType;
32 QuantizeOptions () =
default;
33 QuantizeOptions (NoteLength note_length) { init (note_length); }
35 void init (NoteLength note_length);
42 float get_swing ()
const;
44 float get_amount ()
const;
46 float get_randomization ()
const;
48 void set_swing (
float swing);
50 void set_amount (
float amount);
52 void set_randomization (
float randomization);
58 to_string (NoteLength note_length, NoteType note_type);
71 std::pair<units::precise_tick_t, double>
75 static constexpr auto kNoteLengthKey =
"noteLength"sv;
76 static constexpr auto kNoteTypeKey =
"noteType"sv;
77 static constexpr auto kAdjustStartKey =
"adjustStart"sv;
78 static constexpr auto kAdjustEndKey =
"adjustEnd"sv;
79 static constexpr auto kAmountKey =
"amount"sv;
80 static constexpr auto kSwingKey =
"swing"sv;
81 static constexpr auto kRandomizationTicksKey =
"randTicks"sv;
82 friend void to_json (nlohmann::json &j,
const QuantizeOptions &p);
83 friend void from_json (
const nlohmann::json &j, QuantizeOptions &p);
85 units::precise_tick_t get_prev_point (units::precise_tick_t pos)
const;
86 units::precise_tick_t get_next_point (units::precise_tick_t pos)
const;