BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
bseconstvalues.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BSE_CONST_VALUES_H__
3 #define __BSE_CONST_VALUES_H__
4 
5 #include <bse/bsedefs.hh>
6 
7 G_BEGIN_DECLS
8 
9 /* --- frequencies --- */
10 /* kammer frequency, frequency of the note A of the standard piano
11  * octave.slightly different values are used in different countries,
12  * however, 440Hz is the official value for germany and much of europe.
13  */
14 #define BSE_KAMMER_FREQUENCY (440.0)
15 
16 /* maximum (audible) frequency represented in synthesis signals.
17  * this value shouldn't be changed, to maintain frequency
18  * representation in signals.
19  */
20 #define BSE_MAX_FREQUENCY (24000.0)
21 
22 /* minimum (needs to be > 0) and maximum audible frequencies supported
23  * by oscillators (outer limits for user supplied frequency values)
24  */
25 #define BSE_MAX_OSC_FREQUENCY (20000.0)
26 #define BSE_MIN_OSC_FREQUENCY (1.0 / BSE_MAX_OSC_FREQUENCY)
27 
28 /* epsilon used to compare audible frequencies and check for equality */
29 #define BSE_FREQUENCY_EPSILON (0.001)
30 
31 
32 /* --- transpose / fine tune --- */
33 #define BSE_MIN_TRANSPOSE (-72)
34 #define BSE_MAX_TRANSPOSE (+72)
35 #define BSE_TRANSPOSE_IS_VALID(n) ((n) >= BSE_MIN_TRANSPOSE && (n) <= BSE_MAX_TRANSPOSE)
36 /* fine tune in cents of a semitone */
37 #define BSE_MIN_FINE_TUNE (-BSE_MAX_FINE_TUNE)
38 #define BSE_MAX_FINE_TUNE (+100)
39 #define BSE_FINE_TUNE_IS_VALID(n) ((n) >= BSE_MIN_FINE_TUNE && (n) <= BSE_MAX_FINE_TUNE)
40 
41 
42 /* --- signal ranges --- */
43 /* min..max sample value: -1.0 .. 1.0
44  * notes<->sample value: 0 .. 127 (BSE_VALUE_FROM_NOTE)
45  * freq<->sample value: 0 .. 24000 (BSE_FREQ_FROM_VALUE)
46  */
47 #define BSE_FREQ_FROM_VALUE(value) (BSE_MAX_FREQUENCY * (value))
48 #define BSE_VALUE_FROM_FREQ(freq) ((1.0 / BSE_MAX_FREQUENCY) * (freq))
49 #define BSE_FREQUENCY_EPSILON (0.001)
50 
51 
52 /* --- volume --- */
53 #define BSE_MIN_VOLUME_dB (-144) /* theoretically: -96.3 */
54 #define BSE_MAX_VOLUME_dB (+24)
55 
56 
57 /* --- balance (left/right volume) --- */
58 #define BSE_MIN_BALANCE (-100.0)
59 #define BSE_MAX_BALANCE (+100.0)
60 
61 /* --- bpm --- */
62 #define BSE_MIN_BPM (1)
63 #define BSE_MAX_BPM (1024)
64 
65 
66 /* --- time (unix seconds) --- */
67 #define BSE_MIN_TIME (631148400) /* 1990-01-01 00:00:00 */
68 #define BSE_MAX_TIME (2147483647) /* 2038-01-19 04:14:07 */
69 
70 
71 /* --- BseSource limits --- */
72 #define BSE_MAX_N_ICHANNELS (32)
73 #define BSE_MAX_N_OCHANNELS (32)
74 
75 
76 /* --- miscellaneous --- */
77 #define BSE_MAGIC (('B' << 24) | ('S' << 16) | \
78  /* 1112753441 0x42534521 */ ('E' << 8) | ('!' << 0))
79 /* driver rating */
80 #define BSE_RATING_PREFERRED (100)
81 #define BSE_RATING_DEFAULT (50)
82 #define BSE_RATING_FALLBACK (1)
83 #define BSE_RATING_NO_AUTO (-1)
84 
85 G_END_DECLS
86 
87 #endif /* __BSE_CONST_VALUES_H__ */