BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
00001 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html 00002 #ifndef __BSE_CONST_VALUES_H__ 00003 #define __BSE_CONST_VALUES_H__ 00004 00005 #include <bse/bsedefs.hh> 00006 00007 G_BEGIN_DECLS 00008 00009 /* --- frequencies --- */ 00010 /* kammer frequency, frequency of the note A of the standard piano 00011 * octave.slightly different values are used in different countries, 00012 * however, 440Hz is the official value for germany and much of europe. 00013 */ 00014 #define BSE_KAMMER_FREQUENCY (440.0) 00015 00016 /* maximum (audible) frequency represented in synthesis signals. 00017 * this value shouldn't be changed, to maintain frequency 00018 * representation in signals. 00019 */ 00020 #define BSE_MAX_FREQUENCY (24000.0) 00021 00022 /* minimum (needs to be > 0) and maximum audible frequencies supported 00023 * by oscillators (outer limits for user supplied frequency values) 00024 */ 00025 #define BSE_MAX_OSC_FREQUENCY (20000.0) 00026 #define BSE_MIN_OSC_FREQUENCY (1.0 / BSE_MAX_OSC_FREQUENCY) 00027 00028 /* epsilon used to compare audible frequencies and check for equality */ 00029 #define BSE_FREQUENCY_EPSILON (0.001) 00030 00031 00032 /* --- transpose / fine tune --- */ 00033 #define BSE_MIN_TRANSPOSE (-72) 00034 #define BSE_MAX_TRANSPOSE (+72) 00035 #define BSE_TRANSPOSE_IS_VALID(n) ((n) >= BSE_MIN_TRANSPOSE && (n) <= BSE_MAX_TRANSPOSE) 00036 /* fine tune in cents of a semitone */ 00037 #define BSE_MIN_FINE_TUNE (-BSE_MAX_FINE_TUNE) 00038 #define BSE_MAX_FINE_TUNE (+100) 00039 #define BSE_FINE_TUNE_IS_VALID(n) ((n) >= BSE_MIN_FINE_TUNE && (n) <= BSE_MAX_FINE_TUNE) 00040 00041 00042 /* --- signal ranges --- */ 00043 /* min..max sample value: -1.0 .. 1.0 00044 * notes<->sample value: 0 .. 127 (BSE_VALUE_FROM_NOTE) 00045 * freq<->sample value: 0 .. 24000 (BSE_FREQ_FROM_VALUE) 00046 */ 00047 #define BSE_FREQ_FROM_VALUE(value) (BSE_MAX_FREQUENCY * (value)) 00048 #define BSE_VALUE_FROM_FREQ(freq) ((1.0 / BSE_MAX_FREQUENCY) * (freq)) 00049 #define BSE_FREQUENCY_EPSILON (0.001) 00050 00051 00052 /* --- volume --- */ 00053 #define BSE_MIN_VOLUME_dB (-144) /* theoretically: -96.3 */ 00054 #define BSE_MAX_VOLUME_dB (+24) 00055 00056 00057 /* --- balance (left/right volume) --- */ 00058 #define BSE_MIN_BALANCE (-100.0) 00059 #define BSE_MAX_BALANCE (+100.0) 00060 00061 /* --- bpm --- */ 00062 #define BSE_MIN_BPM (1) 00063 #define BSE_MAX_BPM (1024) 00064 00065 00066 /* --- time (unix seconds) --- */ 00067 #define BSE_MIN_TIME (631148400) /* 1990-01-01 00:00:00 */ 00068 #define BSE_MAX_TIME (2147483647) /* 2038-01-19 04:14:07 */ 00069 00070 00071 /* --- BseSource limits --- */ 00072 #define BSE_MAX_N_ICHANNELS (32) 00073 #define BSE_MAX_N_OCHANNELS (32) 00074 00075 00076 /* --- miscellaneous --- */ 00077 #define BSE_MAGIC (('B' << 24) | ('S' << 16) | \ 00078 /* 1112753441 0x42534521 */ ('E' << 8) | ('!' << 0)) 00079 /* driver rating */ 00080 #define BSE_RATING_PREFERRED (100) 00081 #define BSE_RATING_DEFAULT (50) 00082 #define BSE_RATING_FALLBACK (1) 00083 #define BSE_RATING_NO_AUTO (-1) 00084 00085 G_END_DECLS 00086 00087 #endif /* __BSE_CONST_VALUES_H__ */