a highly automated and intuitive digital audio workstation
No Matches
midi_note.h File Reference

API for MIDI notes in the PianoRoll. More...

#include <stdint.h>
#include "dsp/midi_region.h"
#include "dsp/position.h"
#include "dsp/velocity.h"
#include "gui/backend/arranger_object.h"
Include dependency graph for midi_note.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MidiNote
 A MIDI note inside a ZRegion shown in the piano roll. More...


#define MIDI_NOTE_MAGIC   3588791
#define IS_MIDI_NOTE(tr)
#define midi_note_is_selected(r)    arranger_object_is_selected ((ArrangerObject *) r)


typedef struct _MidiNoteWidget MidiNoteWidget
typedef enum PianoRollNoteNotation PianoRollNoteNotation


void midi_note_get_global_start_pos (MidiNote *self, Position *pos)
 Gets the global Position of the MidiNote's start_pos.
MidiNotemidi_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, ZRegion *region, int idx)
 Sets the region the MidiNote belongs to.
void midi_note_set_cache_val (MidiNote *self, const uint8_t val)
NONNULL PURE int midi_note_is_equal (MidiNote *src, MidiNote *dest)
 Returns 1 if the MidiNotes match, 0 if not.
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_listen (MidiNote *mn, bool listen)
 Listen to the given MidiNote.
void midi_note_shift_pitch (MidiNote *self, const int delta)
 Shifts MidiNote's position and/or value.
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.
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.
ZRegionmidi_note_get_region (MidiNote *self)

Detailed Description

API for MIDI notes in the PianoRoll.

Definition in file midi_note.h.

Typedef Documentation

◆ MidiNoteWidget

typedef struct _MidiNoteWidget MidiNoteWidget

Definition at line 20 of file midi_note.h.

◆ PianoRollNoteNotation

typedef enum PianoRollNoteNotation PianoRollNoteNotation

Definition at line 26 of file midi_note.h.