File: bseconstvalues.h

package info (click to toggle)
beast 0.7.4-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 33,500 kB
  • sloc: ansic: 197,348; cpp: 59,114; sh: 11,030; perl: 2,523; makefile: 2,474; xml: 1,026; lisp: 549; awk: 270; sed: 8
file content (102 lines) | stat: -rw-r--r-- 3,365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* BSE - Better Sound Engine
 * Copyright (C) 1997-2004 Tim Janik
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * A copy of the GNU Lesser General Public License should ship along
 * with this library; if not, see http://www.gnu.org/copyleft/.
 */
#ifndef __BSE_CONST_VALUES_H__
#define __BSE_CONST_VALUES_H__

#include <bse/bsedefs.h>

G_BEGIN_DECLS

/* --- frequencies --- */
/* kammer frequency, frequency of the note A of the standard piano
 * octave.slightly different values are used in different countries,
 * however, 440Hz is the official value for germany and much of europe.
 */
#define	BSE_KAMMER_FREQUENCY		(440.0)

/* maximum (audible) frequency represented in synthesis signals.
 * this value shouldn't be changed, to maintain frequency
 * representation in signals.
 */
#define	BSE_MAX_FREQUENCY		(24000.0)

/* minimum (needs to be > 0) and maximum audible frequencies supported
 * by oscillators (outer limits for user supplied frequency values)
 */
#define	BSE_MAX_OSC_FREQUENCY		(20000.0)
#define	BSE_MIN_OSC_FREQUENCY		(1.0 / BSE_MAX_OSC_FREQUENCY)

/* epsilon used to compare audible frequencies and check for equality */
#define BSE_FREQUENCY_EPSILON		(0.001)


/* --- transpose / fine tune --- */
#define	BSE_MIN_TRANSPOSE		(-72)
#define	BSE_MAX_TRANSPOSE		(+72)
#define BSE_TRANSPOSE_IS_VALID(n)	((n) >= BSE_MIN_TRANSPOSE && (n) <= BSE_MAX_TRANSPOSE)
/* fine tune in cents of a semitone */
#define	BSE_MIN_FINE_TUNE		(-BSE_MAX_FINE_TUNE)
#define	BSE_MAX_FINE_TUNE		(+100)
#define BSE_FINE_TUNE_IS_VALID(n)	((n) >= BSE_MIN_FINE_TUNE && (n) <= BSE_MAX_FINE_TUNE)


/* --- signal ranges --- */
/* min..max sample value: -1.0 .. 1.0
 * notes<->sample value: 0 .. 127 (BSE_VALUE_FROM_NOTE)
 * freq<->sample value: 0 .. 24000 (BSE_FREQ_FROM_VALUE)
 */
#define	BSE_FREQ_FROM_VALUE(value)	 (BSE_MAX_FREQUENCY * (value))
#define	BSE_VALUE_FROM_FREQ(freq)	 ((1.0 / BSE_MAX_FREQUENCY) * (freq))
#define	BSE_FREQUENCY_EPSILON		 (0.001)


/* --- volume --- */
#define	BSE_MIN_VOLUME_dB		(-144) /* theoretically: -96.3 */
#define	BSE_MAX_VOLUME_dB		(+24)


/* --- balance (left/right volume) --- */
#define	BSE_MIN_BALANCE         	(-100.0)
#define	BSE_MAX_BALANCE 		(+100.0)

/* --- bpm --- */
#define	BSE_MIN_BPM			(1)
#define	BSE_MAX_BPM			(1024)


/* --- time (unix seconds) --- */
#define BSE_MIN_TIME			(631148400)	/* 1990-01-01 00:00:00 */
#define	BSE_MAX_TIME			(2147483647)	/* 2038-01-19 04:14:07 */


/* --- BseSource limits --- */
#define	BSE_MAX_N_ICHANNELS		(32)
#define	BSE_MAX_N_OCHANNELS		(32)


/* --- miscellaneous --- */
#define BSE_MAGIC                       (('B' << 24) | ('S' << 16) | \
	    /* 1112753441 0x42534521 */	 ('E' <<  8) | ('!' <<  0))
/* driver rating */
#define	BSE_RATING_PREFERRED		(100)
#define	BSE_RATING_DEFAULT		(50)
#define	BSE_RATING_FALLBACK		(1)
#define	BSE_RATING_NO_AUTO		(-1)

G_END_DECLS

#endif /* __BSE_CONST_VALUES_H__ */