Nsound  0.9.4
GeneratorDecay.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: GeneratorDecay.h 874 2014-09-08 02:21:29Z weegreenblobbie $
4 //
5 // Nsound is a C++ library and Python module for audio synthesis featuring
6 // dynamic digital filters. Nsound lets you easily shape waveforms and write
7 // to disk or plot them. Nsound aims to be as powerful as Csound but easy to
8 // use.
9 //
10 // Copyright (c) 2005-Present Nick Hilton
11 //
12 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
13 //
14 //-----------------------------------------------------------------------------
15 
16 //-----------------------------------------------------------------------------
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 // This program is distributed in the hope that it will be useful,
24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 // GNU Library General Public License for more details.
27 //
28 // You should have received a copy of the GNU General Public License
29 // along with this program; if not, write to the Free Software
30 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 //
32 //-----------------------------------------------------------------------------
33 
34 #ifndef _NSOUND_GENERATOR_DECAY_H_
35 #define _NSOUND_GENERATOR_DECAY_H_
36 
37 #include <Nsound/Nsound.h>
38 #include <Nsound/Generator.h>
39 #include <Nsound/WindowType.h>
40 
41 namespace Nsound
42 {
43 
44 // Forwared declarion of Buffer
45 class Buffer;
46 class RandomNumberGeneratorDecay;
47 
48 //-----------------------------------------------------------------------------
49 // GeneratorDecay Class
51 class GeneratorDecay : public Generator
52 {
53  public:
54 
56  GeneratorDecay(const float64 & sample_rate);
57 
59  //
66  virtual
67  float64
68  generate(const float64 & frequency);
69 
71  //
76  virtual
77  float64
78  generate2(const float64 & frequency, const float64 & alpha);
79 
81  //
97  virtual
98  Buffer
99  generate2(
100  const float64 & duration,
101  const float64 & frequency,
102  const float64 & alpha);
103 
105  //
114  virtual
115  Buffer
116  generate2(
117  const float64 & duration,
118  const float64 & frequency,
119  const Buffer & alpha);
120 
122  //
131  virtual
132  Buffer
133  generate2(
134  const float64 & duration,
135  const Buffer & frequencies,
136  const float64 & alpha);
137 
139  //
144  virtual
145  Buffer
146  generate2(
147  const float64 & duration,
148  const Buffer & frequencies,
149  const Buffer & alpha);
150 
151  protected:
152 
154  GeneratorDecay();
155 
156 };
157 
158 }; // Nsound
159 
160 // :mode=c++: jEdit modeline
161 #endif
A class tha generates decay curves.
double float64
Definition: Nsound.h:146
A Buffer for storing audio samples.
Definition: Buffer.h:60
virtual float64 generate2(const float64 &frequency, const float64 &alpha)
This is a real-time method for the wavetable oscillator.
A class the provides draw utilities and a wavetable oscillator.
Definition: Generator.h:50
virtual float64 generate(const float64 &frequency)
This is a real-time method for the decay curve ossilator.