LMMS
Loading...
Searching...
No Matches
lmms_constants.h
Go to the documentation of this file.
1/*
2 * lmms_constants.h - defines system constants
3 *
4 * Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_CONSTANTS_H
26#define LMMS_CONSTANTS_H
27
28#include "lmmsconfig.h"
29#include "LmmsTypes.h"
30
31namespace lmms
32{
33// Prefer using `approximatelyEqual()` from lmms_math.h rather than
34// using this directly
35inline constexpr float F_EPSILON = 1.0e-10f; // 10^-10
36
37// Channel counts
38inline constexpr auto DEFAULT_CHANNELS = ch_cnt_t{2};
39inline constexpr auto MaxChannelsPerAudioBuffer = ch_cnt_t{128};
41
42// Microtuner
43inline constexpr unsigned MaxScaleCount = 10;
44inline constexpr unsigned MaxKeymapCount = 10;
45
46
47// Note: All constants below are used only in spectrum analyser
48// Frequency ranges (in Hz).
49// Arbitrary low limit for logarithmic frequency scale; >1 Hz.
50inline constexpr auto LOWEST_LOG_FREQ = 5;
51
52// Full range is defined by LOWEST_LOG_FREQ and current sample rate.
61
62inline constexpr auto FRANGE_AUDIBLE_START = 20;
63inline constexpr auto FRANGE_AUDIBLE_END = 20000;
64inline constexpr auto FRANGE_BASS_START = 20;
65inline constexpr auto FRANGE_BASS_END = 300;
66inline constexpr auto FRANGE_MIDS_START = 200;
67inline constexpr auto FRANGE_MIDS_END = 5000;
68inline constexpr auto FRANGE_HIGH_START = 4000;
69inline constexpr auto FRANGE_HIGH_END = 20000;
70
71// Amplitude ranges (in dBFS).
72// Reference: full scale sine wave (-1.0 to 1.0) is 0 dB.
73// Doubling or halving the amplitude produces 3 dB difference.
81
82inline constexpr auto ARANGE_EXTENDED_START = -80;
83inline constexpr auto ARANGE_EXTENDED_END = 20;
84inline constexpr auto ARANGE_AUDIBLE_START = -50;
85inline constexpr auto ARANGE_AUDIBLE_END = 0;
86inline constexpr auto ARANGE_LOUD_START = -30;
87inline constexpr auto ARANGE_LOUD_END = 0;
88inline constexpr auto ARANGE_SILENT_START = -60;
89inline constexpr auto ARANGE_SILENT_END = -10;
90
91
92// This macro is used to handle path separation properly in windows
93constexpr char LADSPA_PATH_SEPERATOR =
94#ifdef LMMS_BUILD_WIN32
95';';
96#else
97':';
98#endif
99
100} // namespace lmms
101
102#endif // LMMS_CONSTANTS_H
Definition AudioAlsa.cpp:35
constexpr auto ARANGE_SILENT_END
Definition lmms_constants.h:89
constexpr auto ARANGE_LOUD_START
Definition lmms_constants.h:86
AmplitudeRange
Definition lmms_constants.h:75
@ Silent
Definition lmms_constants.h:79
@ Loud
Definition lmms_constants.h:78
@ Extended
Definition lmms_constants.h:76
constexpr auto ARANGE_EXTENDED_END
Definition lmms_constants.h:83
std::uint8_t group_cnt_t
Definition LmmsTypes.h:48
constexpr unsigned MaxKeymapCount
number of keyboard mappings per project
Definition lmms_constants.h:44
std::uint16_t ch_cnt_t
Definition LmmsTypes.h:44
constexpr auto FRANGE_HIGH_END
Definition lmms_constants.h:69
constexpr auto ARANGE_EXTENDED_START
Definition lmms_constants.h:82
constexpr unsigned MaxScaleCount
number of scales per project
Definition lmms_constants.h:43
constexpr auto FRANGE_HIGH_START
Definition lmms_constants.h:68
constexpr char LADSPA_PATH_SEPERATOR
Definition lmms_constants.h:93
constexpr auto FRANGE_MIDS_END
Definition lmms_constants.h:67
constexpr auto DEFAULT_CHANNELS
Definition lmms_constants.h:38
constexpr auto ARANGE_LOUD_END
Definition lmms_constants.h:87
FrequencyRange
Definition lmms_constants.h:54
@ Mids
Definition lmms_constants.h:58
@ High
Definition lmms_constants.h:59
@ Audible
Definition lmms_constants.h:56
@ Full
Definition lmms_constants.h:55
@ Bass
Definition lmms_constants.h:57
constexpr auto FRANGE_AUDIBLE_END
Definition lmms_constants.h:63
constexpr auto MaxGroupsPerAudioBuffer
Definition lmms_constants.h:40
constexpr auto ARANGE_AUDIBLE_START
Definition lmms_constants.h:84
constexpr auto FRANGE_MIDS_START
Definition lmms_constants.h:66
constexpr auto ARANGE_AUDIBLE_END
Definition lmms_constants.h:85
constexpr auto FRANGE_BASS_END
Definition lmms_constants.h:65
constexpr auto FRANGE_BASS_START
Definition lmms_constants.h:64
constexpr auto LOWEST_LOG_FREQ
Definition lmms_constants.h:50
constexpr float F_EPSILON
Definition lmms_constants.h:35
constexpr auto ARANGE_SILENT_START
Definition lmms_constants.h:88
constexpr auto MaxChannelsPerAudioBuffer
Definition lmms_constants.h:39
constexpr auto FRANGE_AUDIBLE_START
Definition lmms_constants.h:62