Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
panning.h
1// SPDX-FileCopyrightText: © 2018-2020, 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef ZRYTHM_DSP_PAN_H
5#define ZRYTHM_DSP_PAN_H
6
7#include "utils/format.h"
8#include "utils/logger.h"
9
10#include <QtTranslation>
11
12namespace zrythm::dsp
13{
14
22enum class PanLaw
23{
24 ZerodB,
25 Minus3dB,
26 Minus6dB
27};
28
32enum class PanAlgorithm
33{
34 Linear,
35 SquareRoot,
36 SineLaw
37};
38
44enum class BalanceControlAlgorithm
45{
56 Linear,
57};
58
69[[nodiscard]] std::pair<float, float>
70calculate_panning (PanLaw law, PanAlgorithm algo, float pan);
71
86[[nodiscard]] std::pair<float, float>
87calculate_balance_control (
88 BalanceControlAlgorithm algorithm,
89 float balance_control_position);
90
91}; // namespace zrythm::dsp
92
93DEFINE_ENUM_FORMATTER (
94 zrythm::dsp::PanAlgorithm,
95 PanAlgorithm,
96 QT_TR_NOOP_UTF8 ("Linear"),
97 QT_TR_NOOP_UTF8 ("Square Root"),
98 QT_TR_NOOP_UTF8 ("Sine"));
99
100DEFINE_ENUM_FORMATTER (
101 zrythm::dsp::PanLaw,
102 PanLaw,
103 /* TRANSLATORS: decibels */
104 QT_TR_NOOP_UTF8 ("0dB"),
105 QT_TR_NOOP_UTF8 ("-3dB"),
106 QT_TR_NOOP_UTF8 ("-6dB"));
107
108DEFINE_ENUM_FORMATTER (
109 zrythm::dsp::BalanceControlAlgorithm,
110 BalanceControlAlgorithm,
111 QT_TR_NOOP_UTF8 ("Linear"));
112
113#endif