Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
velocity.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __AUDIO_VELOCITY_H__
11#define __AUDIO_VELOCITY_H__
12
13#include <stdint.h>
14
17
18typedef struct MidiNote MidiNote;
19typedef struct _VelocityWidget VelocityWidget;
20
27#define velocity_is_selected(r) \
28 arranger_object_is_selected ((ArrangerObject *) r)
29
33#define VELOCITY_DEFAULT 90
34
40typedef struct Velocity
41{
44
46 uint8_t vel;
47
50 uint8_t vel_at_start;
51
54} Velocity;
55
60velocity_new (MidiNote * midi_note, const uint8_t vel);
61
65void
66velocity_set_midi_note (Velocity * velocity, MidiNote * midi_note);
67
71int
73
78void
79velocity_shift (Velocity * self, const int delta);
80
87void
88velocity_set_val (Velocity * self, const int val);
89
94velocity_get_midi_note (const Velocity * const self);
95
96const char *
97velocity_setting_enum_to_str (guint index);
98
99guint
100velocity_setting_str_to_enum (const char * str);
101
106#endif
Macros for arranger object backends.
MidiNote * velocity_get_midi_note(const Velocity *const self)
Returns the owner MidiNote.
Velocity * velocity_new(MidiNote *midi_note, const uint8_t vel)
Creates a new Velocity with the given value.
void velocity_set_val(Velocity *self, const int val)
Sets the velocity to the given value.
int velocity_is_equal(Velocity *src, Velocity *dest)
Returns 1 if the Velocity's match, 0 if not.
void velocity_shift(Velocity *self, const int delta)
Changes the Velocity by the given amount of values (delta).
void velocity_set_midi_note(Velocity *velocity, MidiNote *midi_note)
Sets the MidiNote the Velocity belongs to.
Region identifier.
Base struct for arranger objects.
A MIDI note inside a ZRegion shown in the piano roll.
Definition midi_note.h:49
The MidiNote velocity.
Definition velocity.h:41
ArrangerObject base
Base struct.
Definition velocity.h:43
uint8_t vel_at_start
Velocity at drag begin - used for ramp actions only.
Definition velocity.h:50
MidiNote * midi_note
Pointer back to the MIDI note.
Definition velocity.h:53
uint8_t vel
Velocity value (0-127).
Definition velocity.h:46