BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
gsloscillator.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 __GSL_OSCILLATOR_H__
3 #define __GSL_OSCILLATOR_H__
4 
5 #include <bse/gsldefs.hh>
6 #include <bse/gslosctable.hh>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif /* __cplusplus */
11 
12 
13 /* --- structures --- */
14 typedef struct
15 {
16  GslOscTable *table;
17  guint exponential_fm : 1;
18  gfloat fm_strength; /* linear: 0..1, exponential: n_octaves */
19  gfloat self_fm_strength; /* 0..1 */
20  gfloat phase; /* -0.5..+0.5 */
21  gfloat cfreq; /* for ifreq == NULL */
22  gfloat pulse_width; /* 0..1 */
23  gfloat pulse_mod_strength; /* 0..0.5 */
24  double transpose_factor; /* -132..0..+132 */
25  gint fine_tune; /* -100..+100 */
26 } GslOscConfig;
27 typedef struct
28 {
29  GslOscConfig config;
30  guint last_mode;
31  guint32 cur_pos, last_pos;
32  gfloat last_sync_level;
33  gdouble last_freq_level;
34  gfloat last_pwm_level;
35  GslOscWave wave;
36  /* pwm */
37  guint32 pwm_offset;
38  gfloat pwm_max, pwm_center;
39 } GslOscData;
40 
41 
42 /* --- Oscillator --- */
43 void gsl_osc_config (GslOscData *osc,
44  GslOscConfig *config);
45 void gsl_osc_reset (GslOscData *osc);
46 void gsl_osc_process (GslOscData *osc,
47  guint n_values,
48  const gfloat *ifreq,
49  const gfloat *imod,
50  const gfloat *isync,
51  gfloat *mono_out,
52  gfloat *sync_out);
53 void gsl_osc_process_pulse (GslOscData *osc,
54  guint n_values,
55  const gfloat *ifreq,
56  const gfloat *imod,
57  const gfloat *isync,
58  const gfloat *ipwm,
59  gfloat *mono_out,
60  gfloat *sync_out);
61 
62 
63 
64 
65 #ifdef __cplusplus
66 }
67 #endif /* __cplusplus */
68 
69 #endif /* __GSL_OSCILLATOR_H__ */
Definition: gslosctable.hh:33
Definition: gsloscillator.hh:27
Definition: gsloscillator.hh:14
Definition: gslosctable.hh:26