Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
pan.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2020 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __AUDIO_PAN_H__
11#define __AUDIO_PAN_H__
12
13#include <glib/gi18n.h>
14
16#define PAN_MINUS_3DB_AMP (-0.292054216f)
17
19#define PAN_MINUS_6DB_AMP (-0.498812766f)
20
29typedef enum PanLaw
30{
31 PAN_LAW_0DB,
32 PAN_LAW_MINUS_3DB,
33 PAN_LAW_MINUS_6DB
34} PanLaw;
35
36static const char * pan_law_str[] = {
37 /* TRANSLATORS: decibels */
38 N_ ("0dB"),
39 N_ ("-3dB"),
40 N_ ("-6dB"),
41};
42
43static inline const char *
44pan_law_to_string (PanLaw pan_law)
45{
46 return pan_law_str[pan_law];
47}
48
52typedef enum PanAlgorithm
53{
54 PAN_ALGORITHM_LINEAR,
55 PAN_ALGORITHM_SQUARE_ROOT,
56 PAN_ALGORITHM_SINE_LAW
58
59static const char * pan_algorithm_str[] = {
60 N_ ("Linear"),
61 N_ ("Square Root"),
62 N_ ("Sine"),
63};
64
65static inline const char *
66pan_algorithm_to_string (PanAlgorithm pan_algo)
67{
68 return pan_algorithm_str[pan_algo];
69}
70
71void
72pan_get_calc_lr (
73 PanLaw law,
74 PanAlgorithm algo,
75 float pan,
76 float * calc_l,
77 float * calc_r);
78
79#endif
PanAlgorithm
See https://www.harmonycentral.com/articles/the-truth-about-panning-laws.
Definition pan.h:53
PanLaw
These are only useful when changing mono to stereo.
Definition pan.h:30