Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
piano_roll.h File Reference

Piano roll backend. More...

#include <stdbool.h>
#include "gui/backend/editor_settings.h"
#include <cyaml/cyaml.h>
Include dependency graph for piano_roll.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MidiNoteDescriptor
 A descriptor for a MidiNote, used by the piano roll. More...
 
struct  PianoRoll
 Piano roll serializable backend. More...
 

Macros

#define PIANO_ROLL_SCHEMA_VERSION   1
 
#define PIANO_ROLL   (CLIP_EDITOR->piano_roll)
 
#define DRUM_LABELS
 
#define piano_roll_is_next_key_black(x)   piano_roll_is_key_black (x + 1)
 
#define piano_roll_is_prev_key_black(x)   piano_roll_is_key_black (x - 1)
 

Enumerations

enum  MidiModifier { MIDI_MODIFIER_VELOCITY , MIDI_MODIFIER_PITCH_WHEEL , MIDI_MODIFIER_MOD_WHEEL , MIDI_MODIFIER_AFTERTOUCH }
 A MIDI modifier to use to display data for. More...
 
enum  PianoRollHighlighting { PR_HIGHLIGHT_NONE , PR_HIGHLIGHT_CHORD , PR_HIGHLIGHT_SCALE , PR_HIGHLIGHT_BOTH }
 Highlighting for the piano roll. More...
 
enum  PianoRollNoteNotation { PIANO_ROLL_NOTE_NOTATION_MUSICAL , PIANO_ROLL_NOTE_NOTATION_PITCH }
 

Functions

MidiNoteDescriptormidi_note_descriptor_new (void)
 
void midi_note_descriptor_free (MidiNoteDescriptor *self)
 
int piano_roll_is_key_black (int note)
 Returns if the key is black.
 
void piano_roll_add_current_note (PianoRoll *self, int note)
 Adds the note if it doesn't exist in the array.
 
void piano_roll_remove_current_note (PianoRoll *self, int note)
 Removes the note if it exists in the array.
 
int piano_roll_contains_current_note (PianoRoll *self, int note)
 Returns 1 if it contains the given note, 0 otherwise.
 
Trackpiano_roll_get_current_track (const PianoRoll *self)
 Returns the current track whose regions are being shown in the piano roll.
 
void piano_roll_set_notes_zoom (PianoRoll *self, float notes_zoom, int fire_events)
 
void piano_roll_init_loaded (PianoRoll *self)
 Inits the PianoRoll after a Project has been loaded.
 
const MidiNoteDescriptorpiano_roll_find_midi_note_descriptor_by_val (PianoRoll *self, bool drum_mode, const uint8_t val)
 Returns the MidiNoteDescriptor matching the value (0-127).
 
void midi_note_descriptor_set_custom_name (MidiNoteDescriptor *descr, char *str)
 
void piano_roll_set_highlighting (PianoRoll *self, PianoRollHighlighting highlighting)
 Updates the highlighting and notifies the UI.
 
void piano_roll_set_midi_modifier (PianoRoll *self, MidiModifier modifier)
 Sets the MIDI modifier.
 
void piano_roll_init (PianoRoll *self)
 Initializes the PianoRoll.
 
PianoRollpiano_roll_clone (const PianoRoll *src)
 Only clones what is needed for serialization.
 
PianoRollpiano_roll_new (void)
 
void piano_roll_free (PianoRoll *self)
 

Detailed Description

Piano roll backend.

Definition in file piano_roll.h.