10#ifndef __AUDIO_MIDI_NOTE_H__
11#define __AUDIO_MIDI_NOTE_H__
20typedef struct _MidiNoteWidget MidiNoteWidget;
26enum class PianoRollNoteNotation;
34#define MIDI_NOTE_SCHEMA_VERSION 1
36#define MIDI_NOTE_MAGIC 3588791
37#define IS_MIDI_NOTE(tr) \
38 ((MidiNote *) tr && ((MidiNote *) tr)->magic == MIDI_NOTE_MAGIC)
40#define midi_note_is_selected(r) \
41 arranger_object_is_selected ((ArrangerObject *) r)
109midi_note_set_cache_val (
MidiNote * self,
const uint8_t val);
127 PianoRollNoteNotation notation,
128 const int use_markup);
182midi_note_get_region (
MidiNote * self);
Macros for arranger object backends.
Velocities for MidiNote's.
void midi_note_listen(MidiNote *mn, bool listen)
Listen to the given MidiNote.
int midi_note_hit(MidiNote *self, const signed_frame_t gframes)
Returns if the MIDI note is hit at given pos (in the timeline).
void midi_note_notes_to_events(MidiNote **midi_notes, int num_notes, Position *pos, MidiEvents *events)
Converts an array of MIDI notes to MidiEvents.
NONNULL int midi_note_is_equal(MidiNote *src, MidiNote *dest)
Returns 1 if the MidiNotes match, 0 if not.
void midi_note_shift_pitch(MidiNote *self, const int delta)
Shifts MidiNote's position and/or value.
MidiNote * midi_note_new(RegionIdentifier *region_id, Position *start_pos, Position *end_pos, uint8_t val, uint8_t vel)
Creates a new MidiNote.
void midi_note_set_region_and_index(MidiNote *self, Region *region, int idx)
Sets the region the MidiNote belongs to.
void midi_note_get_val_as_string(const MidiNote *self, char *buf, PianoRollNoteNotation notation, const int use_markup)
Gets the MIDI note's value as a string (eg "C#4").
void midi_note_print(MidiNote *mn)
For debugging.
void midi_note_get_global_start_pos(MidiNote *self, Position *pos)
Gets the global Position of the MidiNote's start_pos.
void midi_note_set_val(MidiNote *midi_note, const uint8_t val)
Sends a note off if currently playing and sets the pitch of the MidiNote.
int_fast64_t signed_frame_t
Signed type for frame index.
API for Region's specific to instrument Track's.
Base struct for arranger objects.
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information rel...
Container for passing midi events through ports.
A MIDI note inside a Region shown in the piano roll.
uint8_t last_listened_val
The note/pitch that is currently playing, if MidiNote::currently_listened is true.
uint8_t cache_val
Cached note, for live operations.
uint8_t val
The note/pitch, (0-127).
PangoLayout * layout
Cache layout for drawing the name.
int pos
Index in the parent region.
ArrangerObject base
Base struct.
int currently_listened
Whether or not this note is currently listened to.
A Position is made up of bars.beats.sixteenths.ticks.
Index/identifier for a Region, so we can get Region objects quickly with it without searching by name...
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Track to be inserted into the Project's Tracklist.