2 #include <score/model/IdentifiedObject.hpp>
3 #include <score/selection/Selectable.hpp>
9 using midi_size_t = uint8_t;
13 NoteData(
double s,
double d, midi_size_t p, midi_size_t v)
21 double start()
const {
return m_start; }
22 double duration()
const {
return m_duration; }
23 double end()
const {
return m_start + m_duration; }
25 midi_size_t pitch()
const {
return m_pitch; }
26 midi_size_t velocity()
const {
return m_velocity; }
28 void setStart(
double s) { m_start = s; }
29 void setDuration(
double s) { m_duration = s; }
30 void setPitch(midi_size_t s) { m_pitch = s; }
31 void setVelocity(midi_size_t s) { m_velocity = s; }
36 midi_size_t m_pitch{};
37 midi_size_t m_velocity{};
44 return lhs.m_start < rhs.m_start;
46 bool operator()(
const NoteData& lhs,
double rhs)
const {
return lhs.m_start < rhs; }
61 SCORE_SERIALIZE_FRIENDS
69 template <IsDeserializer DeserializerVisitor>
70 Note(DeserializerVisitor&& vis, QObject* parent)
78 double start()
const noexcept {
return m_start; }
80 double duration()
const noexcept {
return m_duration; }
82 double end()
const noexcept {
return m_start + m_duration; }
84 midi_size_t pitch()
const noexcept {
return m_pitch; }
86 midi_size_t velocity()
const noexcept {
return m_velocity; }
88 void scale(
double s) noexcept;
90 void setStart(
double s) noexcept;
92 void setDuration(
double s) noexcept;
94 void setPitch(midi_size_t s) noexcept;
96 void setVelocity(midi_size_t s) noexcept;
103 void noteChanged() W_SIGNAL(noteChanged);
109 midi_size_t m_pitch{};
110 midi_size_t m_velocity{64};
The IdentifiedObject class.
Definition: IdentifiedObject.hpp:19
The Note class.
Definition: MidiNote.hpp:59
The Selectable class.
Definition: Selectable.hpp:14
The id_base_t class.
Definition: Identifier.hpp:57
Definition: MidiNote.hpp:41
Definition: MidiNote.hpp:11