20 PROGRAM_CHANGE = 0xC0,
30 RESET_ALL_CONTROLLERS = 121,
42 PROGRAM_CHANGE = 0xC0,
51 static_assert (AUDIO_BLOCK_MAX_RENDER_SIZE <= 4096);
77 MidiEvent (
const MidiEvent &other);
78 MidiEvent& operator= (
const MidiEvent &other);
84MidiEvent make_note_on (
uint16 chnl,
uint8 mkey,
float velo,
float tune = 0,
uint nid = 0xffffff);
85MidiEvent make_note_off (
uint16 chnl,
uint8 mkey,
float velo,
float tune = 0,
uint nid = 0xffffff);
86MidiEvent make_aftertouch (
uint16 chnl,
uint8 mkey,
float velo,
float tune = 0,
uint nid = 0xffffff);
87MidiEvent make_pressure (
uint16 chnl,
float velo);
88MidiEvent make_control (
uint16 chnl,
uint prm,
float val);
90MidiEvent make_program (
uint16 chnl,
uint prgrm);
91MidiEvent make_pitch_bend (
uint16 chnl,
float val);
92MidiEvent make_param_value (
uint param,
double pvalue);
100 const MidiEvent* begin ()
const noexcept {
return &*events_.begin(); }
101 const MidiEvent* end ()
const noexcept {
return &*events_.end(); }
102 size_t size ()
const noexcept {
return events_.size(); }
103 bool empty ()
const noexcept {
return events_.empty(); }
104 void clear ()
noexcept { events_.clear(); }
108 size_t capacity ()
const noexcept {
return events_.capacity(); }
109 void reserve (
size_t n) { events_.reserve (n); }
111 const&
vector () {
return events_; }
115template<
size_t MAXQUEUES>
120 using iterator =
typename Base::iterator;
122 size_t events_pending ()
const {
return this->count_pending(); }
123 iterator begin () {
return this->Base::begin(); }
124 iterator end () {
return this->Base::end(); }
130template<
size_t MAXQUEUES>
133 assign (midi_event_vector_array);
137QueueMultiplexer_priority (
const MidiEvent &e)
144 static constexpr const int NMIN = 0;
145 static constexpr const int NMAX = 131;
146 static constexpr const int NVOID = NMAX + 1;
147 static constexpr const int KAMMER_NOTE = 69;
148 static constexpr const int KAMMER_OCTAVE = +1;
A stream of writable MidiEvent structures.
bool append_unsorted(int16_t frame, const MidiEvent &event)
Dangerous! Append a MidiEvent while ignoring sort order, violates constraints.
void ensure_order()
Fix event order after append_unsorted() returned true.
int64_t last_frame() const ASE_PURE
Fetch the latest event stamp, can be used to enforce order.
void append(int16_t frame, const MidiEvent &event)
Append an MidiEvent with conscutive frame time stamp.
An in-order MidiEvent reader for multiple MidiEvent sources.
#define ASE_ISLIKELY(expr)
Compiler hint to optimize for expr evaluating to true.
#define ASE_CLASS_NON_COPYABLE(ClassName)
Delete copy ctor and assignment operator.
The Anklang C++ API namespace.
uint8_t uint8
An 8-bit unsigned integer.
const float *const semitone_tables_265[17]
Musical Tuning Tables, to be indexed by MusicalTuning
MidiMessage
Extended type information for MidiEvent.
uint16_t uint16
A 16-bit unsigned integer.
MidiEventType
Type of MIDI Events.
@ NOTE_OFF
Ase internal Parameter update.
@ CONTROL_CHANGE
Control Change.
@ AFTERTOUCH
Key Pressure, polyphonic aftertouch.
@ CHANNEL_PRESSURE
Channel Aftertouch.
uint32_t uint
Provide 'uint' as convenience type.
MusicalTuning
Musical tunings, see: http://en.wikipedia.org/wiki/Musical_tuning.
MidiEvent data structure.
MidiMessage message() const
Determine extended message type an MidiEvent.
MidiEventType type
MidiEvent type, one of the MidiEventType members.
uint frame
Offset into current block, delayed if negative.
uint channel
0…15 for standard events
Components of a MIDI note.
static float note_to_freq(MusicalTuning tuning, int note, float kammer_freq)
Convert MIDI note to Hertz for a MusicalTuning and kammer_freq.
Multiplexer to pop from multiple Queues, while preserving priorities.