MuseScore  3.4
Music composition and notation
division.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 __DIVISION_H
21 #define __DIVISION_H
22 
23 #include "asection.h"
24 #include "rankwave.h"
25 
26 //---------------------------------------------------------
27 // Division
28 //---------------------------------------------------------
29 
30 class Division
31  {
34  int _nrank;
35  int _dmask;
36  int _trem;
37  float _fsam;
38  float _swel;
39  float _gain;
40  float _w;
41  float _c;
42  float _s;
43  float _m;
44  float _buff [NCHANN * PERIOD];
45 
46  public:
47  Division (Asection *asect, float fsam);
48  ~Division ();
49 
50  void set_rank (int ind, Rankwave *W, int pan, int del);
51  void set_swell (float stat) { _swel = 0.2 + 0.8 * stat * stat; }
52  void set_tfreq (float freq) { _w = 6.283184f * PERIOD * freq / _fsam; }
53  void set_tmodd (float modd) { _m = modd; }
54  void set_div_mask (int bits);
55  void clr_div_mask (int bits);
56  void set_rank_mask (int ind, int bits);
57  void clr_rank_mask (int ind, int bits);
58  void trem_on() { _trem = 1; }
59  void trem_off() { _trem = 2; }
60 
61  void process();
62  void update(int note, int mask);
63  void update(unsigned char *keys);
64  };
65 
66 #endif
67 
void clr_rank_mask(int ind, int bits)
Definition: division.cpp:199
void set_rank_mask(int ind, int bits)
Definition: division.cpp:189
void clr_div_mask(int bits)
Definition: division.cpp:174
int _trem
Definition: division.h:36
Definition: asection.h:60
void trem_off()
Definition: division.h:59
float _s
Definition: division.h:42
Division(Asection *asect, float fsam)
Definition: division.cpp:26
Rankwave * _ranks[NRANKS]
Definition: division.h:33
float _fsam
Definition: division.h:37
void set_swell(float stat)
Definition: division.h:51
float _c
Definition: division.h:41
void set_tmodd(float modd)
Definition: division.h:53
void trem_on()
Definition: division.h:58
Definition: rankwave.h:88
int _dmask
Definition: division.h:35
~Division()
Definition: division.cpp:43
#define NCHANN
Definition: asection.h:29
Definition: division.h:30
void process()
Definition: division.cpp:51
int _nrank
Definition: division.h:34
float _buff[NCHANN *PERIOD]
Definition: division.h:44
Asection * _asect
Definition: division.h:32
#define NRANKS
Definition: asection.h:30
void set_rank(int ind, Rankwave *W, int pan, int del)
Definition: division.cpp:96
float _swel
Definition: division.h:38
void update(int note, int mask)
Definition: division.cpp:116
void set_tfreq(float freq)
Definition: division.h:52
void set_div_mask(int bits)
Definition: division.cpp:159
float _gain
Definition: division.h:39
float _m
Definition: division.h:43
float _w
Definition: division.h:40
#define PERIOD
Definition: asection.h:27