⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tables.c

📁 SDL_mixer 是一个基于 SDL 的混音器
💻 C
📖 第 1 页 / 共 5 页
字号:
/*    TiMidity -- Experimental MIDI to WAVE converter    Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program 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 General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    The 8-bit uLaw to 16-bit PCM and the 13-bit-PCM to 8-bit uLaw    tables were lifted from the rsynth-2.0 sources.  The README says: >   > This is a text to speech system produced by integrating various pieces > of code and tables of data, which are all (I believe) in the public domain. >    > The bulk of the intergration was done by myself, that is Nick Ing-Simmons. > I can be reached via my employer at nik@tiuk.ti.com. >*/#include <stdio.h>#include "config.h"#include "common.h"#include "tables.h"#include "instrum.h"int32 freq_table[128]={ 8176, 8662, 9177, 9723,  10301, 10913, 11562, 12250,  12978, 13750, 14568, 15434,  16352, 17324, 18354, 19445, 20602, 21827, 23125, 24500,  25957, 27500, 29135, 30868,  32703, 34648, 36708, 38891, 41203, 43654, 46249, 48999, 51913, 55000, 58270, 61735, 65406, 69296, 73416, 77782, 82407, 87307, 92499, 97999, 103826, 110000, 116541, 123471, 130813, 138591, 146832, 155563, 164814, 174614, 184997, 195998, 207652, 220000, 233082, 246942, 261626, 277183, 293665, 311127, 329628, 349228, 369994, 391995, 415305, 440000, 466164, 493883, 523251, 554365, 587330, 622254, 659255, 698456, 739989, 783991, 830609, 880000, 932328, 987767, 1046502, 1108731, 1174659, 1244508, 1318510, 1396913, 1479978, 1567982, 1661219, 1760000, 1864655, 1975533, 2093005, 2217461, 2349318, 2489016, 2637020, 2793826, 2959955, 3135963, 3322438, 3520000, 3729310, 3951066, 4186009, 4434922, 4698636, 4978032, 5274041, 5587652, 5919911, 6271927, 6644875, 7040000, 7458620, 7902133, 8372018, 8869844, 9397273, 9956063,  10548082, 11175303, 11839822, 12543854};/* v=2.^((x/127-1) * 6) */double vol_table[128] = { 0.015625, 0.016145143728351113, 0.016682602624583379, 0.017237953096759438, 0.017811790741104401, 0.01840473098076444, 0.019017409725829021, 0.019650484055324921, 0.020304632921913132, 0.020980557880044631, 0.021678983838355849, 0.02240065983711079, 0.023146359851523596, 0.023916883621822989, 0.024713057510949051, 0.025535735390801884, 0.026385799557992876, 0.027264161680080529, 0.028171763773305786, 0.029109579212875332, 0.030078613776876421, 0.031079906724942836, 0.032114531912828696, 0.033183598944085631, 0.034288254360078256, 0.035429682869614412, 0.036609108619508737, 0.037827796507442342, 0.039087053538526394, 0.040388230227024875, 0.041732722044739302, 0.043121970917609151, 0.044557466772132896, 0.046040749133268132, 0.047573408775524545, 0.049157089429020417, 0.050793489542332405, 0.05248436410402918, 0.054231526524842463, 0.056036850582493913, 0.057902272431264008, 0.059829792678457581, 0.061821478529993396, 0.063879466007418645, 0.066005962238725971, 0.068203247825430205, 0.070473679288442961, 0.072819691595368496, 0.075243800771931268, 0.077748606600335793, 0.080336795407452768, 0.083011142945821612, 0.085774517370559328, 0.088629882315368294, 0.091580300070941839, 0.094628934869176312, 0.097779056276712184, 0.10103404270144323, 0.1043973850157546, 0.1078726903003755, 0.11146368571286204, 0.11517422248485852, 0.11900828005242428, 0.12296997032385605, 0.12706354208958254, 0.13129338557886089, 0.13566403716816194, 0.14018018424629392, 0.14484667024148207, 0.14966849981579558, 0.15465084423249356, 0.15979904690204472, 0.16511862911277009, 0.17061529595225433, 0.17629494242587571, 0.18216365977901747, 0.18822774202974024, 0.19449369271892172, 0.20096823188510385, 0.20765830327152621, 0.21457108177307616, 0.22171398113114205, 0.2290946618846218, 0.23672103958561411, 0.2446012932886038, 0.25274387432224471, 0.26115751535314891, 0.26985123975140174, 0.27883437126784744, 0.28811654403352405, 0.29770771289197112, 0.30761816407549192, 0.31785852623682015, 0.32843978184802081, 0.33937327897885317, 0.3506707434672246, 0.36234429149478936, 0.37440644258117928, 0.38687013301080181, 0.39974872970660535, 0.41305604456569134, 0.42680634927214656, 0.44101439060298442, 0.45569540624360722, 0.47086514112975281, 0.48653986433345225, 0.50273638651110641, 0.51947207793239625, 0.53676488710936021, 0.55463336004561792, 0.57309666012638816, 0.59217458867062556, 0.61188760616732485, 0.63225685421876243, 0.65330417821421161, 0.67505215075844849, 0.69752409588017272, 0.72074411404630734, 0.74473710800900605, 0.76952880951308478, 0.79514580689252357, 0.82161557358563286, 0.84896649759946774, 0.87722791195508854, 0.90643012614631979, 0.93660445864574493, 0.96778327049280244, 1};/* v=2.^((x/127-1) * 4) */FLOAT_T expr_table[128] = {0.062500000000000000, 0.063879466007418617, 0.065289378838287213, 0.066730410498333517,0.068203247825430205, 0.069708592816961873, 0.071247162964417632, 0.072819691595368496,0.074426928222992794, 0.076069638903316056, 0.077748606600335793, 0.079464631559205010,0.081218531687652529, 0.083011142945821639, 0.084843319744713291, 0.086715935353423396,0.088629882315368322, 0.090586072873697340, 0.092585439406094330, 0.094628934869176312,0.096717533252700480, 0.098852230043796174, 0.101034042701443255, 0.103264011141422821,0.105543198231971461, 0.107872690300375454, 0.110253597650746091, 0.112687055093223104,0.115174222484858521, 0.117716285282438229, 0.120314455107505686, 0.122969970323856051,0.125684096627776631, 0.128458127651314785, 0.131293385578860888, 0.134191221777339997,0.137153017440313080, 0.140180184246293943, 0.143274165031597039, 0.146436434478035005,0.149668499815795553, 0.152971901541831212, 0.156348214154105547, 0.159799046902044661,0.163326044553552957, 0.166930888178957210, 0.170615295952254331, 0.174381023970043153,0.178229867088531585, 0.182163659779017467, 0.186184277002251486, 0.190293635102098180,0.194493692718921724, 0.198786451723130919, 0.203173958169329677, 0.207658303271526207,0.212241624399866963, 0.216926106099369798, 0.221713981131142046, 0.226607531536579865,0.231609089725056033, 0.236721039585614190, 0.241945817623200610, 0.247285914119973582,0.252743874322244710, 0.258322299653617804, 0.264023848954903828, 0.269851239751401739,0.275807249548151001, 0.281894717153771790, 0.288116544033524102, 0.294475695692230921,0.300975203087725074, 0.307618164075491973, 0.314407744885198681, 0.321347181629811129,0.328439781848020751, 0.335688926080714045, 0.343098069482237422, 0.350670743467224599,0.358410557393772644, 0.366321200283767356, 0.374406442581179333, 0.382670137949167655,0.391116225106848792, 0.399748729706605410, 0.408571766252830038, 0.417589540063018294,0.426806349272146446, 0.436226586881288292, 0.445854742851448105, 0.455695406243607215,0.465753267406005200, 0.476033120209697069, 0.486539864333452310, 0.497278507599085373,0.508254168358330150, 0.519472077932396359, 0.530937583105370092, 0.542656148672647887,0.554633360045617918, 0.566874925913830707, 0.579386680965928047, 0.592174588670625557,0.605244744119077360, 0.618603376929974136, 0.632256854218762432, 0.646211683632397893,0.660474516451080240, 0.675052150758448599, 0.689951534681746304, 0.705179769703502823,0.720744114046307338, 0.736651986132290215, 0.752910968118960744, 0.769528809513084777,0.786513430864326790, 0.803872927540415394, 0.821615573585632974, 0.839749825664467098,0.858284327092304622, 0.877227911955088646, 0.896589609319902503, 0.916378647538487301,0.936604458645744820, 0.957276682855321193, 0.978405173154415220, 1.000000000000000000};double bend_fine[256] = { 1, 1.0002256593050698, 1.0004513695322617, 1.0006771306930664,  1.0009029427989777, 1.0011288058614922, 1.0013547198921082, 1.0015806849023274, 1.0018067009036538, 1.002032767907594, 1.0022588859256572, 1.0024850549693551, 1.0027112750502025, 1.0029375461797159, 1.0031638683694153, 1.0033902416308227, 1.0036166659754628, 1.0038431414148634, 1.0040696679605541, 1.0042962456240678, 1.0045228744169397, 1.0047495543507072, 1.0049762854369111, 1.0052030676870944, 1.0054299011128027, 1.0056567857255843, 1.00588372153699, 1.006110708558573, 1.0063377468018897, 1.0065648362784985, 1.0067919769999607, 1.0070191689778405, 1.0072464122237039, 1.0074737067491204, 1.0077010525656616, 1.0079284496849015, 1.0081558981184175, 1.008383397877789, 1.008610948974598, 1.0088385514204294, 1.0090662052268706, 1.0092939104055114, 1.0095216669679448, 1.0097494749257656, 1.009977334290572, 1.0102052450739643, 1.0104332072875455, 1.0106612209429215,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -