12#ifndef __GUI_BACKEND_PIANO_ROLL_H__
13#define __GUI_BACKEND_PIANO_ROLL_H__
25#define PIANO_ROLL_SCHEMA_VERSION 1
27#define PIANO_ROLL (CLIP_EDITOR->piano_roll)
30 static const char * drum_labels[47] = { \
31 "Acoustic Bass Drum", \
85 MIDI_MODIFIER_VELOCITY,
86 MIDI_MODIFIER_PITCH_WHEEL,
87 MIDI_MODIFIER_MOD_WHEEL,
88 MIDI_MODIFIER_AFTERTOUCH,
102enum class PianoRollNoteNotation
104 PIANO_ROLL_NOTE_NOTATION_MUSICAL,
105 PIANO_ROLL_NOTE_NOTATION_PITCH,
153midi_note_descriptor_new (
void);
173 int num_current_notes;
208#define piano_roll_is_next_key_black(x) piano_roll_is_key_black (x + 1)
210#define piano_roll_is_prev_key_black(x) piano_roll_is_key_black (x - 1)
239piano_roll_set_notes_zoom (
PianoRoll * self,
float notes_zoom,
int fire_events);
285piano_roll_get_visible_notes (
294 for (
int i = 0; i < 128; i++)
327piano_roll_new (
void);
MidiModifier
A MIDI modifier to use to display data for.
Track * piano_roll_get_current_track(const PianoRoll *self)
Returns the current track whose regions are being shown in the piano roll.
PianoRoll * piano_roll_clone(const PianoRoll *src)
Only clones what is needed for serialization.
int piano_roll_is_key_black(int note)
Returns if the key is black.
void piano_roll_set_midi_modifier(PianoRoll *self, MidiModifier modifier)
Sets the MIDI modifier.
void piano_roll_add_current_note(PianoRoll *self, int note)
Adds the note if it doesn't exist in the array.
int piano_roll_contains_current_note(PianoRoll *self, int note)
Returns 1 if it contains the given note, 0 otherwise.
const MidiNoteDescriptor * piano_roll_find_midi_note_descriptor_by_val(PianoRoll *self, bool drum_mode, const uint8_t val)
Returns the MidiNoteDescriptor matching the value (0-127).
PianoRollHighlighting
Highlighting for the piano roll.
void piano_roll_remove_current_note(PianoRoll *self, int note)
Removes the note if it exists in the array.
void piano_roll_init_loaded(PianoRoll *self)
Inits the PianoRoll after a Project has been loaded.
void piano_roll_init(PianoRoll *self)
Initializes the PianoRoll.
void piano_roll_set_highlighting(PianoRoll *self, PianoRollHighlighting highlighting)
Updates the highlighting and notifies the UI.
A descriptor for a MidiNote, used by the piano roll.
int index
The index to display the note at.
char * note_name
Name of the note, from C-2 to B8.
int visible
Whether the note is visible or not.
int marked
Whether the note is highlighted/marked or not.
char * custom_name
Custom name, from midnam or GM MIDI specs, etc.
char * note_name_pango
Note name with extra formatting.
int value
The actual value (0-127).
Piano roll serializable backend.
MidiNoteDescriptor * drum_descriptors[128]
Drum mode descriptors.
int current_notes[128]
Currently pressed notes (used only at runtime).
float notes_zoom
Notes zoom level.
PianoRollHighlighting highlighting
Highlighting notes depending on the current chord or scale.
MidiModifier midi_modifier
Selected MidiModifier.
MidiNoteDescriptor * piano_descriptors[128]
Piano roll mode descriptors.
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.