~ubuntu-branches/ubuntu/raring/muse/raring-proposed

« back to all changes in this revision

Viewing changes to synti/stklib/Object.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-02-07 15:18:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040207151822-es27xxkzbcxkebjm
Tags: 0.6.3-1
* New upstream version.
* Added patches:
  + [10_alsa_init_fix] New, from upstream CVS.
    Initialize direction variable when setting Alsa parameters.
  + [10_canvas_translation_fix] New, from upstream CVS.
    Do not translate tooltips twice in canvas popup.
  + [10_checkbox_fix] New, from upstream CVS.
    Use proper set/test methods on metronome checkboxes.
  + [10_html_doc_cleanup] New.
    Fix links and HTML errors in documentation.
  + [20_allow_system_timer] New.
    The new upstream version fails by default if the real-time clock
    could not be accessed (usually the case when not running suid-root).
    This patch reverts the old behaviour of falling back to the more
    inaccurate system timer.
* Updated patches:
  + [11_PIC_fixes_fixup] Rediffed.
* Removed patches:
  + [20_no_atomic_asm] Merged upstream.
* debian/compat: Splice out debhelper compatibility level from rules file.
* debian/control: Build-depend on latest jack release by default.
  Closes: #228788
* debian/control: Bump standards version.
* debian/control: Use auto-generated debconf dependency via misc:Depends.
* debian/control: Minor tweaks to the long description.
* debian/control: Tighten fluidsynth build dependency to sane version.
* debian/muse.doc-base: New. Register HTML documentation with doc-base.
* debian/templates: Tiny rewording, and typo fix.
* debian/templates, debian/po/*: Switch to po-debconf for translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*********************************************/
2
 
/*  Object Class, by Perry R. Cook, 1995-99  */
3
 
/*                                           */
4
 
/*  This is mostly here for compatibility    */
5
 
/*  with Objective C.  We'll also stick      */
6
 
/*  global defines here, so everyone will    */
7
 
/*  see them.                                */
8
 
/*********************************************/
9
 
 
10
 
#if !defined(__Object_h)
11
 
#define __Object_h
12
 
 
13
 
#include <stdio.h>
14
 
#include <stdlib.h>
15
 
#include <string.h>
16
 
#include <math.h>
17
 
 
18
 
class Object
19
 
{
20
 
 public:
21
 
 protected:
22
 
  Object();
23
 
  virtual ~Object();
24
 
};
25
 
 
26
 
/* The OS type definitions are made in the Makefile */
27
 
 
28
 
#if defined(__OS_NeXT_)    /* For NeXTStep - Black or White Hardware */
29
 
  #define RANDLIMIT 2147483647
30
 
#elif defined(__OS_IRIX_)  /* For SGI */
31
 
  #define __STK_REALTIME_
32
 
  #define RANDLIMIT 2147483647
33
 
#elif defined(__OS_Linux_) /* For Linux */
34
 
  #define __STK_REALTIME_
35
 
  #define __OSS_API_       /* Use OSS API */
36
 
//  #define __MIDIATOR_      /* Use special MIDIator support */
37
 
//  #define __ALSA_API_      /* Use ALSA API */
38
 
  #define __LITTLE_ENDIAN__
39
 
  #define RANDLIMIT 2147483647
40
 
#elif defined(__OS_Win_)   /* For WindowsXX or NT */
41
 
  #define __STK_REALTIME_
42
 
  #define __LITTLE_ENDIAN__
43
 
  #define RANDLIMIT 32767
44
 
#endif
45
 
 
46
 
/*
47
 
   Real-time audio input and output buffer size.  If clicks
48
 
   are occuring in the input or output sound stream, a
49
 
   larger buffer size may help.  Larger buffer sizes, however,
50
 
   produce more latency between input and output.
51
 
*/
52
 
#define RT_BUFFER_SIZE 256
53
 
 
54
 
/*
55
 
   The following definition is concatenated to the beginning
56
 
   of all references to rawwave files in the various STK core
57
 
   classes (ex. Clarinet.cpp).  If you wish to move the
58
 
   rawwaves directory to a different location in your file
59
 
   system, you will need to set this path definition
60
 
   appropriately.  The current definition is a relative reference
61
 
   that will work "out of the box" for the STK distribution.
62
 
*/
63
 
#define RAWWAVE_PATH getenv("RAWWAVE_PATH")
64
 
 
65
 
/* Sampling Rate */
66
 
#define SRATE (MY_FLOAT) 44100.0
67
 
 
68
 
/* Other SRATE derived defines  */
69
 
#define SRATE_OVER_TWO (MY_FLOAT) (SRATE / 2)
70
 
#define ONE_OVER_SRATE (MY_FLOAT) (1 / SRATE)
71
 
#define TWO_PI_OVER_SRATE (MY_FLOAT) (2 * PI / SRATE)
72
 
 
73
 
/* Yer Basic Trigonometric constants  */
74
 
#if !defined(PI)
75
 
  #define PI (MY_FLOAT) 3.14159265359
76
 
#endif
77
 
#define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI)
78
 
#define ONE_OVER_TWO_PI (MY_FLOAT) (1.0 / PI)
79
 
#define SQRT_TWO 1.414213562
80
 
 
81
 
/* Useful random number generator values */
82
 
#define ONE_OVER_RANDLIMIT (1.0/RANDLIMIT)
83
 
#define RANDLIMIT_OVER_TWO (int)(RANDLIMIT/2)
84
 
 
85
 
/* FPU Underflow Limit
86
 
 * The IEEE specification doesn't call for automatic
87
 
 * zeroing of floating-point values when they reach
88
 
 * their numerical limits.  Instead, most processors
89
 
 * switch to a much more computation-intensive mode
90
 
 * when a FPU underflow occurs.  We set a lower limit
91
 
 * here for our own (not so efficient) checks.  Here's
92
 
 * a useful macro for limiting MY_FLOATs.  At this time,
93
 
 * no FPU underflow checks are being performed.
94
 
 */
95
 
#define FPU_UFLOW_LIMIT 0.0000000001
96
 
#define LIMIT_MY_FLOAT(j) ((((j)<(MY_FLOAT)FPU_UFLOW_LIMIT)&&((j)>(MY_FLOAT)-FPU_UFLOW_LIMIT))?(MY_FLOAT)0.0:(j))
97
 
 
98
 
/* States for Envelopes, etc. */
99
 
#define ATTACK 0
100
 
#define DECAY 1
101
 
#define SUSTAIN 2
102
 
#define RELEASE 3
103
 
 
104
 
/* Machine dependent stuff, possibly useful for optimization.
105
 
 * For example, changing double to float here increases
106
 
 * performance (speed) by a whopping 4-6% on 486-flavor machines.
107
 
 * BUT!! a change from float to double here increases speed by
108
 
 * 30% or so on SGI machines.
109
 
*/
110
 
#define MY_FLOAT      double
111
 
//#define MY_FLOAT      float
112
 
 
113
 
/* MY_MULTI is just a pointer to MY_FLOAT.  This type is used
114
 
 * to pass multichannel data back and forth within STK.
115
 
*/
116
 
typedef MY_FLOAT *MY_MULTI;
117
 
 
118
 
/* INT16 is just that ... a 16-bit signed integer. */
119
 
typedef signed short INT16;
120
 
 
121
 
/* INT32 is just that ... a 32-bit signed integer. */
122
 
typedef int INT32;
123
 
 
124
 
/* Boolean values */
125
 
#define FALSE 0
126
 
#define TRUE 1
127
 
 
128
 
/* Debugging define, causes massive printf's to come out.
129
 
 * Also enables timing calculations in WaveOut class, other stuff.
130
 
 * Uncomment to enable.
131
 
 */
132
 
//#define _debug_ 1
133
 
 
134
 
/* MIDI definitions  */
135
 
#define NORM_7 (MY_FLOAT) 0.0078125 /* this is 1/128 */
136
 
                
137
 
#endif