Nsound
0.9.4
Main Page
Namespaces
Classes
Files
File List
File Members
Nsound
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
51
class
Granulator
52
{
53
public
:
54
55
enum
EnvelopeType_e
56
{
57
CUSTOM
,
58
GAUSSIAN
,
59
GAUSSIAN_90
,
60
GAUSSIAN_70
,
61
GAUSSIAN_50
,
62
GAUSSIAN_30
,
63
GAUSSIAN_10
,
64
DECAY
,
65
REVERSE_DECAY
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
95
Nsound::Buffer
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
107
Nsound::Buffer
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
117
Nsound::Granulator
&
118
operator=
(
const
Nsound::Granulator
& rhs);
119
120
protected
:
121
Granulator
();
122
123
float64
sample_rate_
;
124
125
Generator
*
envelope_generator_
;
126
127
};
//Granulators
128
129
};
// Nsound
130
131
// :mode=c++:
132
#endif
Nsound::Granulator::envelope_generator_
Generator * envelope_generator_
Definition:
Granulator.h:125
Nsound::Granulator::GAUSSIAN_70
Definition:
Granulator.h:60
Nsound::Granulator::GAUSSIAN_10
Definition:
Granulator.h:63
Nsound::Granulator
Definition:
Granulator.h:51
Nsound::Granulator::generate
Nsound::Buffer generate(const float64 &duration, const float64 &grain_frequency, const float64 &waves_per_grain, const float64 &grains_per_second)
Definition:
Granulator.cc:193
Nsound::Granulator::sample_rate_
float64 sample_rate_
Definition:
Granulator.h:123
Nsound::Granulator::REVERSE_DECAY
Definition:
Granulator.h:65
Nsound::Granulator::~Granulator
virtual ~Granulator()
Definition:
Granulator.cc:186
Nsound::Granulator::DECAY
Definition:
Granulator.h:64
Nsound.h
Nsound::float64
double float64
Definition:
Nsound.h:146
Nsound::Granulator::Granulator
Granulator()
Nsound::Granulator::GAUSSIAN_30
Definition:
Granulator.h:62
Nsound::Granulator::GAUSSIAN
Definition:
Granulator.h:58
Nsound::Granulator::GAUSSIAN_50
Definition:
Granulator.h:61
Nsound::Granulator::CUSTOM
Definition:
Granulator.h:57
Nsound::Granulator::GAUSSIAN_90
Definition:
Granulator.h:59
Nsound::Buffer
A Buffer for storing audio samples.
Definition:
Buffer.h:60
Nsound::Generator
A class the provides draw utilities and a wavetable oscillator.
Definition:
Generator.h:50
Nsound::Granulator::operator=
Nsound::Granulator & operator=(const Nsound::Granulator &rhs)
Assignment operator.
Definition:
Granulator.cc:287
Nsound::Granulator::EnvelopeType_e
EnvelopeType_e
Definition:
Granulator.h:55
Generated on Sun Aug 23 2015 11:51:50 for Nsound by
1.8.6