~ubuntu-branches/ubuntu/feisty/muse/feisty

« back to all changes in this revision

Viewing changes to synti/stklib/SamplFlt.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************/
 
2
/*  Swept Filter SubClass of Sampling      */
 
3
/*  Synthesizer,  by Perry R. Cook, 1995-96*/ 
 
4
/*  This instrument inherits up to 5       */
 
5
/*  attack waves, 5 looped waves, an ADSR  */
 
6
/*  envelope, and adds a 4 pole swept      */
 
7
/*  filter.                                */
 
8
/*******************************************/
 
9
 
 
10
#include "SamplFlt.h"
 
11
 
 
12
SamplFlt :: SamplFlt() : Sampler()
 
13
{
 
14
    MY_FLOAT tempCoeffs[2] = {(MY_FLOAT) 0.0,(MY_FLOAT) -1.0};
 
15
    twozeroes[0] = new TwoZero;    
 
16
    twozeroes[0]->setZeroCoeffs(tempCoeffs);
 
17
    twozeroes[0]->setGain((MY_FLOAT) 1.0);
 
18
    twozeroes[1] = new TwoZero;    
 
19
    twozeroes[1]->setZeroCoeffs(tempCoeffs);
 
20
    twozeroes[1]->setGain((MY_FLOAT) 1.0);
 
21
    filters[0] = new FormSwep;
 
22
    filters[0]->setTargets((MY_FLOAT) 0.0,(MY_FLOAT) 0.7,(MY_FLOAT) 0.5);
 
23
    filters[1] = new FormSwep;
 
24
    filters[1]->setTargets((MY_FLOAT) 0.0,(MY_FLOAT) 0.7,(MY_FLOAT) 0.5);
 
25
}  
 
26
 
 
27
SamplFlt :: ~SamplFlt()
 
28
{
 
29
    delete filters[0];
 
30
    delete filters[1];
 
31
    delete twozeroes[0];
 
32
    delete twozeroes[1];
 
33
}
 
34
 
 
35
MY_FLOAT SamplFlt :: tick()
 
36
{
 
37
    MY_FLOAT output;
 
38
    output = Sampler :: tick();
 
39
    output = twozeroes[0]->tick(output);
 
40
    output = filters[0]->tick(output);
 
41
    output = twozeroes[1]->tick(output);
 
42
    output = filters[1]->tick(output);
 
43
    return output;
 
44
}
 
45
 
 
46
void SamplFlt :: controlChange(int number, MY_FLOAT value)
 
47
{
 
48
}