Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
midi_function.h
1// SPDX-FileCopyrightText: © 2020, 2023-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "dsp/curve.h"
7#include "structure/arrangement/arranger_object_span.h"
8
9namespace zrythm::structure::arrangement
10{
12{
13public:
14 enum class Type
15 {
16 Crescendo,
17 Flam,
18 FlipHorizontal,
19 FlipVertical,
20 Legato,
21 Portato,
22 Staccato,
23 Strum,
24 };
25
26 class Options
27 {
28 public:
29 midi_byte_t start_vel_ = 0;
30 midi_byte_t end_vel_ = 0;
31 midi_byte_t vel_ = 0;
32
33 bool ascending_ = true;
34 double time_ = 0;
35 double amount_ = 0;
36
37 dsp::CurveOptions::Algorithm curve_algo_{};
38 double curviness_{};
39 };
40
45
49 static auto string_id_to_type (const char * id) -> Type;
50
58 static void apply (ArrangerObjectSpan sel, Type type, Options opts);
59};
60}
Algorithm
The algorithm to use for curves.
Definition curve.h:33
Track span that offers helper methods on a range of tracks.
static utils::Utf8String type_to_string_id(Type type)
Returns a string identifier for the type.
static auto string_id_to_type(const char *id) -> Type
Returns a string identifier for the type.
static void apply(ArrangerObjectSpan sel, Type type, Options opts)
Applies the given action to the given selections.
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:37
std::uint8_t midi_byte_t
MIDI byte.
Definition midi.h:43