home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Party 1994: Try This At Home
/
disk_image.bin
/
source
/
vexsrc
/
sin2048.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-29
|
6KB
|
108 lines
/*****************************************************************************
ATTENTION!
this source is VOTEWARE,
you may only use it to the conditions listed below:
-You may modify it, or use parts of it in your own source as long as
this header stays on top of all files containing this source.
-You must give proper credit to the author, Niklas Beisert / pascal.
-You may not use it in commercial productions without the written
permission of the author.
-AND MOST IMPORTANT: you have to buy an Assembly '94 CD-ROM
by Sound Solutions (if you don't have it already) and vote for VEX-InTrO
in the PC-64k-Intro-Compo! (if you have already sent your voting card,
buy another one and fill it out CORRECTLY!!!)
*****************************************************************************/
// a 16 bit fixed point, 2048 values sine table
static unsigned int sintab[512]=
{ 0, 201, 402, 603, 804, 1005, 1206, 1407,
1608, 1809, 2010, 2211, 2412, 2613, 2814, 3014,
3215, 3416, 3617, 3818, 4018, 4219, 4420, 4620,
4821, 5021, 5222, 5422, 5622, 5823, 6023, 6223,
6423, 6623, 6823, 7023, 7223, 7423, 7623, 7822,
8022, 8221, 8421, 8620, 8819, 9019, 9218, 9417,
9616, 9814, 10013, 10212, 10410, 10609, 10807, 11006,
11204, 11402, 11600, 11797, 11995, 12193, 12390, 12588,
12785, 12982, 13179, 13376, 13573, 13769, 13966, 14162,
14359, 14555, 14751, 14946, 15142, 15338, 15533, 15728,
15923, 16118, 16313, 16508, 16702, 16897, 17091, 17285,
17479, 17672, 17866, 18059, 18253, 18446, 18638, 18831,
19024, 19216, 19408, 19600, 19792, 19983, 20175, 20366,
20557, 20748, 20938, 21129, 21319, 21509, 21699, 21889,
22078, 22267, 22456, 22645, 22833, 23022, 23210, 23398,
23586, 23773, 23960, 24147, 24334, 24521, 24707, 24893,
25079, 25265, 25450, 25635, 25820, 26005, 26189, 26373,
26557, 26741, 26925, 27108, 27291, 27473, 27656, 27838,
28020, 28201, 28383, 28564, 28745, 28925, 29105, 29285,
29465, 29645, 29824, 30003, 30181, 30360, 30538, 30715,
30893, 31070, 31247, 31424, 31600, 31776, 31952, 32127,
32302, 32477, 32651, 32826, 32999, 33173, 33346, 33519,
33692, 33864, 34036, 34208, 34379, 34550, 34721, 34891,
35061, 35231, 35400, 35569, 35738, 35906, 36074, 36242,
36409, 36576, 36743, 36909, 37075, 37241, 37406, 37571,
37736, 37900, 38064, 38227, 38390, 38553, 38716, 38878,
39039, 39201, 39362, 39522, 39682, 39842, 40002, 40161,
40319, 40478, 40636, 40793, 40950, 41107, 41263, 41419,
41575, 41730, 41885, 42040, 42194, 42347, 42501, 42653,
42806, 42958, 43110, 43261, 43412, 43562, 43712, 43862,
44011, 44160, 44308, 44456, 44603, 44750, 44897, 45043,
45189, 45335, 45480, 45624, 45768, 45912, 46055, 46198,
46340, 46482, 46624, 46765, 46906, 47046, 47186, 47325,
47464, 47602, 47740, 47878, 48015, 48151, 48288, 48423,
48558, 48693, 48828, 48961, 49095, 49228, 49360, 49492,
49624, 49755, 49886, 50016, 50146, 50275, 50403, 50532,
50660, 50787, 50914, 51040, 51166, 51291, 51416, 51541,
51665, 51788, 51911, 52033, 52155, 52277, 52398, 52518,
52639, 52758, 52877, 52996, 53114, 53231, 53348, 53465,
53581, 53696, 53811, 53926, 54040, 54153, 54266, 54379,
54491, 54602, 54713, 54823, 54933, 55043, 55152, 55260,
55368, 55475, 55582, 55688, 55794, 55899, 56004, 56108,
56212, 56315, 56417, 56519, 56621, 56722, 56822, 56922,
57022, 57120, 57219, 57316, 57414, 57510, 57606, 57702,
57797, 57892, 57986, 58079, 58172, 58264, 58356, 58447,
58538, 58628, 58718, 58807, 58895, 58983, 59070, 59157,
59243, 59329, 59414, 59499, 59583, 59666, 59749, 59831,
59913, 59994, 60075, 60155, 60235, 60313, 60392, 60470,
60547, 60624, 60700, 60775, 60850, 60924, 60998, 61071,
61144, 61216, 61288, 61359, 61429, 61499, 61568, 61637,
61705, 61772, 61839, 61905, 61971, 62036, 62100, 62164,
62228, 62291, 62353, 62414, 62475, 62536, 62596, 62655,
62714, 62772, 62829, 62886, 62942, 62998, 63053, 63108,
63162, 63215, 63268, 63320, 63371, 63422, 63473, 63522,
63571, 63620, 63668, 63715, 63762, 63808, 63854, 63899,
63943, 63987, 64030, 64073, 64115, 64156, 64197, 64237,
64276, 64315, 64353, 64391, 64428, 64465, 64501, 64536,
64571, 64605, 64638, 64671, 64703, 64735, 64766, 64796,
64826, 64855, 64884, 64912, 64939, 64966, 64992, 65018,
65043, 65067, 65091, 65114, 65136, 65158, 65179, 65200,
65220, 65239, 65258, 65276, 65294, 65311, 65327, 65343,
65358, 65372, 65386, 65400, 65412, 65424, 65436, 65446,
65457, 65466, 65475, 65483, 65491, 65498, 65505, 65511,
65516, 65520, 65524, 65528, 65531, 65533, 65534, 65535};
long* SinTab;
static void InstallSinTab()
{
SinTab=new long[2048];
for (int i=0; i<512; i++)
SinTab[i]=sintab[i];
for (i=1; i<512; i++)
SinTab[1024-i]=SinTab[i];
SinTab[512]=65536;
for (i=0; i<1024; i++)
SinTab[i+1024]=-SinTab[i];
}
static void FreeSinTab()
{
delete SinTab;
}
#pragma startup InstallSinTab
#pragma exit FreeSinTab