Nsound  0.9.4
Granulator.h
Go to the documentation of this file.
1 //
3 // $Id: Granulator.h 416 2009-12-03 05:56:54Z 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-2007 Nick Hilton
11 //
12 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
13 //
15 
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 //
33 #ifndef _NSOUND_GRANULATOR_H_
34 #define _NSOUND_GRANULATOR_H_
35 
36 #include <Nsound/Nsound.h>
37 
38 namespace Nsound
39 {
40 
41 // Forwared declarion of Nsound::Buffer
42 class Buffer;
43 class Generator;
44 class Sine;
45 
47 // Granulator Class
48 //
49 // DOXME
52 {
53  public:
54 
56  {
66  };
67 
69  // Constructor
70  //
72  //
74  Granulator(
75  const float64 & sample_rate,
76  EnvelopeType_e env_type,
77  const float64 & envelope_noise = 0.0,
78  const Buffer * custom_envelope = NULL);
79 
81  // DOXME
83  Granulator(const Nsound::Granulator & gran);
84 
86  // DOXME
88  virtual ~Granulator();
89 
91  // generate()
92  //
93  // DOXME
96  generate(
97  const float64 & duration,
98  const float64 & grain_frequency,
99  const float64 & waves_per_grain,
100  const float64 & grains_per_second);
101 
103  // generate()
104  //
105  // DOXME
108  generate(
109  const float64 & duration,
110  const Nsound::Buffer & grain_frequency,
111  const Nsound::Buffer & waves_per_grain,
112  const Nsound::Buffer & grains_per_second) const;
113 
118  operator=(const Nsound::Granulator & rhs);
119 
120  protected:
121  Granulator();
122 
124 
126 
127 };//Granulators
128 
129 }; // Nsound
130 
131 // :mode=c++:
132 #endif
Generator * envelope_generator_
Definition: Granulator.h:125
Nsound::Buffer generate(const float64 &duration, const float64 &grain_frequency, const float64 &waves_per_grain, const float64 &grains_per_second)
Definition: Granulator.cc:193
float64 sample_rate_
Definition: Granulator.h:123
virtual ~Granulator()
Definition: Granulator.cc:186
double float64
Definition: Nsound.h:146
A Buffer for storing audio samples.
Definition: Buffer.h:60
A class the provides draw utilities and a wavetable oscillator.
Definition: Generator.h:50
Nsound::Granulator & operator=(const Nsound::Granulator &rhs)
Assignment operator.
Definition: Granulator.cc:287