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