00001 /*This file has been prepared for Doxygen automatic documentation generation.*/ 00021 /* Copyright (c) 2007, Atmel Corporation All rights reserved. 00022 * 00023 * Redistribution and use in source and binary forms, with or without 00024 * modification, are permitted provided that the following conditions are met: 00025 * 00026 * 1. Redistributions of source code must retain the above copyright notice, 00027 * this list of conditions and the following disclaimer. 00028 * 00029 * 2. Redistributions in binary form must reproduce the above copyright notice, 00030 * this list of conditions and the following disclaimer in the documentation 00031 * and/or other materials provided with the distribution. 00032 * 00033 * 3. The name of ATMEL may not be used to endorse or promote products derived 00034 * from this software without specific prior written permission. 00035 * 00036 * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED 00037 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00038 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 00039 * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 00040 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00041 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00042 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00043 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00044 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00045 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00046 */ 00047 00048 #include "sinus.h" 00049 00050 signed short sound_table[SINUS_SAMPLES] = { 00051 0, 00052 1715, 00053 3410, 00054 5069, 00055 6671, 00056 8201, 00057 9640, 00058 10973, 00059 12186, 00060 13265, 00061 14198, 00062 14976, 00063 15589, 00064 16031, 00065 16296, 00066 16383, 00067 16290, 00068 16018, 00069 15570, 00070 14950, 00071 14167, 00072 13228, 00073 12144, 00074 10927, 00075 9589, 00076 8146, 00077 6614, 00078 5009, 00079 3349, 00080 1652, 00081 -62, 00082 -1777, 00083 -3471, 00084 -5128, 00085 -6728, 00086 -8255, 00087 -9690, 00088 -11019, 00089 -12228, 00090 -13302, 00091 -14230, 00092 -15001, 00093 -15608, 00094 -16043, 00095 -16303, 00096 -16383, 00097 -16283, 00098 -16004, 00099 -15550, 00100 -14925, 00101 -14136, 00102 -13191, 00103 -12102, 00104 -10880, 00105 -9539, 00106 -8092, 00107 -6557, 00108 -4950, 00109 -3288, 00110 -1590, 00111 }; 00112 00119 short sin_table(long rad) 00120 { 00121 long index = rad; 00122 00123 if (index < 0) { 00124 index *= -1; 00125 } 00126 00127 return sound_table[index % SINUS_SAMPLES]; 00128 }
1.5.5