MuseScore  3.4
Music composition and notation
asection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 
19 
20 #ifndef __ASECTION_H
21 #define __ASECTION_H
22 
23 #include "global.h"
24 
25 using namespace Ms;
26 
27 #define PERIOD 64
28 #define MIXLEN 64
29 #define NCHANN 4
30 #define NRANKS 32
31 
32 //---------------------------------------------------------
33 // Diffuser
34 //---------------------------------------------------------
35 
36 class Diffuser {
37  float *_data;
38  int _size;
39  int _i;
40  float _c;
41 
42  public:
43  void init(int size, float c);
44  void fini();
45  int size() { return _size; }
46  float process(float x) {
47  float w = x - _c * _data [_i];
48  x = _data [_i] + _c * w;
49  _data [_i] = w;
50  if (++_i == _size)
51  _i = 0;
52  return x;
53  }
54  };
55 
56 //---------------------------------------------------------
57 // Asection
58 //---------------------------------------------------------
59 
60 class Asection {
61  enum { AZIMUTH, STWIDTH, DIRECT, REFLECT, REVERB };
62 
63  int _offs0;
64  int _offs [16];
65  float _fsam;
66  float *_base;
67  float _sw;
68  float _sx;
69  float _sy;
74  SyntiParameter _apar [5];
75 
76  public:
77  Asection (float fsam);
78  ~Asection ();
79 
80  float *get_wptr () { return _base + _offs0; }
81  SyntiParameter *get_apar () { return _apar; }
82  void set_size (float size);
83  void process (float vol, float *W, float *X, float *Y, float *R);
84 
85  static float _refl [16];
86  };
87 
88 #endif
89 
int _i
Definition: asection.h:39
float process(float x)
Definition: asection.h:46
Definition: asection.h:60
int _offs0
Definition: asection.h:63
Definition: asection.h:61
float * _data
Definition: asection.h:37
Diffuser _dif1
Definition: asection.h:71
float * _base
Definition: asection.h:66
Definition: asection.h:36
int size()
Definition: asection.h:45
float _fsam
Definition: asection.h:65
Definition: aeolus.cpp:26
Diffuser _dif2
Definition: asection.h:72
Diffuser _dif3
Definition: asection.h:73
Definition: sparm.h:42
int _size
Definition: asection.h:38
float * get_wptr()
Definition: asection.h:80
SyntiParameter * get_apar()
Definition: asection.h:81
float _c
Definition: asection.h:40
float _sx
Definition: asection.h:68
Diffuser _dif0
Definition: asection.h:70
float _sy
Definition: asection.h:69
float _sw
Definition: asection.h:67