/[svn]/linuxsampler/trunk/src/engines/gig/Synthesizer.cpp
ViewVC logotype

Annotation of /linuxsampler/trunk/src/engines/gig/Synthesizer.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 770 - (hide annotations) (download)
Sun Sep 11 15:56:29 2005 UTC (18 years, 7 months ago) by schoenebeck
File size: 5490 byte(s)
* synthesis core optimizations

1 schoenebeck 320 /***************************************************************************
2     * *
3     * LinuxSampler - modular, streaming capable sampler *
4     * *
5     * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 schoenebeck 738 * Copyright (C) 2005 Christian Schoenebeck *
7 schoenebeck 320 * *
8     * This program is free software; you can redistribute it and/or modify *
9     * it under the terms of the GNU General Public License as published by *
10     * the Free Software Foundation; either version 2 of the License, or *
11     * (at your option) any later version. *
12     * *
13     * This program is distributed in the hope that it will be useful, *
14     * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16     * GNU General Public License for more details. *
17     * *
18     * You should have received a copy of the GNU General Public License *
19     * along with this program; if not, write to the Free Software *
20     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21     * MA 02111-1307 USA *
22     ***************************************************************************/
23    
24     #include <unistd.h>
25     #include <stdlib.h>
26     #include <stdio.h>
27    
28     #include "Synthesizer.h"
29    
30 schoenebeck 770 #define SYNTHESIZE(CHAN,LOOP,FILTER,INTERPOLATE) \
31     Synthesizer<CHAN,LOOP,FILTER,INTERPOLATE>::SynthesizeSubFragment( \
32     pFinalParam, pLoop)
33 schoenebeck 320
34     namespace LinuxSampler { namespace gig {
35    
36 schoenebeck 770 void SynthesizeFragment_mode00(SynthesisParam* pFinalParam, Loop* pLoop) {
37     SYNTHESIZE(MONO,0,0,0);
38 schoenebeck 738 }
39    
40 schoenebeck 770 void SynthesizeFragment_mode01(SynthesisParam* pFinalParam, Loop* pLoop) {
41     SYNTHESIZE(MONO,0,0,1);
42 schoenebeck 320 }
43    
44 schoenebeck 770 void SynthesizeFragment_mode02(SynthesisParam* pFinalParam, Loop* pLoop) {
45     SYNTHESIZE(MONO,0,1,0);
46 schoenebeck 320 }
47    
48 schoenebeck 770 void SynthesizeFragment_mode03(SynthesisParam* pFinalParam, Loop* pLoop) {
49     SYNTHESIZE(MONO,0,1,1);
50 schoenebeck 320 }
51    
52 schoenebeck 770 void SynthesizeFragment_mode04(SynthesisParam* pFinalParam, Loop* pLoop) {
53     SYNTHESIZE(MONO,1,0,0);
54 schoenebeck 320 }
55    
56 schoenebeck 770 void SynthesizeFragment_mode05(SynthesisParam* pFinalParam, Loop* pLoop) {
57     SYNTHESIZE(MONO,1,0,1);
58 schoenebeck 320 }
59    
60 schoenebeck 770 void SynthesizeFragment_mode06(SynthesisParam* pFinalParam, Loop* pLoop) {
61     SYNTHESIZE(MONO,1,1,0);
62 schoenebeck 320 }
63    
64 schoenebeck 770 void SynthesizeFragment_mode07(SynthesisParam* pFinalParam, Loop* pLoop) {
65     SYNTHESIZE(MONO,1,1,1);
66 schoenebeck 320 }
67    
68 schoenebeck 770 void SynthesizeFragment_mode08(SynthesisParam* pFinalParam, Loop* pLoop) {
69     SYNTHESIZE(STEREO,0,0,0);
70 schoenebeck 320 }
71    
72 schoenebeck 770 void SynthesizeFragment_mode09(SynthesisParam* pFinalParam, Loop* pLoop) {
73     SYNTHESIZE(STEREO,0,0,1);
74 schoenebeck 320 }
75    
76 schoenebeck 770 void SynthesizeFragment_mode0a(SynthesisParam* pFinalParam, Loop* pLoop) {
77     SYNTHESIZE(STEREO,0,1,0);
78 schoenebeck 320 }
79    
80 schoenebeck 770 void SynthesizeFragment_mode0b(SynthesisParam* pFinalParam, Loop* pLoop) {
81     SYNTHESIZE(STEREO,0,1,1);
82 schoenebeck 320 }
83    
84 schoenebeck 770 void SynthesizeFragment_mode0c(SynthesisParam* pFinalParam, Loop* pLoop) {
85     SYNTHESIZE(STEREO,1,0,0);
86 schoenebeck 320 }
87    
88 schoenebeck 770 void SynthesizeFragment_mode0d(SynthesisParam* pFinalParam, Loop* pLoop) {
89     SYNTHESIZE(STEREO,1,0,1);
90 schoenebeck 320 }
91    
92 schoenebeck 770 void SynthesizeFragment_mode0e(SynthesisParam* pFinalParam, Loop* pLoop) {
93     SYNTHESIZE(STEREO,1,1,0);
94 schoenebeck 320 }
95    
96 schoenebeck 770 void SynthesizeFragment_mode0f(SynthesisParam* pFinalParam, Loop* pLoop) {
97     SYNTHESIZE(STEREO,1,1,1);
98 schoenebeck 320 }
99    
100 schoenebeck 738 void* GetSynthesisFunction(int SynthesisMode) {
101 schoenebeck 770 // Mode Bits: CHAN,LOOP,FILT,INTERP
102 schoenebeck 320 switch (SynthesisMode) {
103 schoenebeck 738 case 0x00: return (void*) SynthesizeFragment_mode00;
104 senkov 325 case 0x01: return (void*) SynthesizeFragment_mode01;
105 schoenebeck 738 case 0x02: return (void*) SynthesizeFragment_mode02;
106 senkov 325 case 0x03: return (void*) SynthesizeFragment_mode03;
107     case 0x04: return (void*) SynthesizeFragment_mode04;
108     case 0x05: return (void*) SynthesizeFragment_mode05;
109     case 0x06: return (void*) SynthesizeFragment_mode06;
110     case 0x07: return (void*) SynthesizeFragment_mode07;
111 schoenebeck 738 case 0x08: return (void*) SynthesizeFragment_mode08;
112 senkov 325 case 0x09: return (void*) SynthesizeFragment_mode09;
113 schoenebeck 738 case 0x0a: return (void*) SynthesizeFragment_mode0a;
114 senkov 325 case 0x0b: return (void*) SynthesizeFragment_mode0b;
115     case 0x0c: return (void*) SynthesizeFragment_mode0c;
116     case 0x0d: return (void*) SynthesizeFragment_mode0d;
117     case 0x0e: return (void*) SynthesizeFragment_mode0e;
118     case 0x0f: return (void*) SynthesizeFragment_mode0f;
119 schoenebeck 320 default: {
120     printf("gig::Synthesizer: Invalid Synthesis Mode: %d\n", SynthesisMode);
121     exit(-1);
122     }
123     }
124     }
125    
126 schoenebeck 770 void RunSynthesisFunction(const int SynthesisMode, SynthesisParam* pFinalParam, Loop* pLoop) {
127     SynthesizeFragment_Fn* f = (SynthesizeFragment_Fn*) GetSynthesisFunction(SynthesisMode);
128     f(pFinalParam, pLoop);
129 senkov 325 }
130 schoenebeck 328
131 schoenebeck 320 }} // namespace LinuxSampler::gig

  ViewVC Help
Powered by ViewVC