Nsound  0.9.4
ReverberationRoom.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: ReverberationRoom.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) 2008 to Present Nick Hilton
11 //
12 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
13 //
14 // Based on Freeverb by Jezar at Dreampoint
15 //
16 //-----------------------------------------------------------------------------
17 
18 //-----------------------------------------------------------------------------
19 //
20 // This program is free software; you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation; either version 2 of the License, or
23 // (at your option) any later version.
24 //
25 // This program is distributed in the hope that it will be useful,
26 // but WITHOUT ANY WARRANTY; without even the implied warranty of
27 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 // GNU Library General Public License for more details.
29 //
30 // You should have received a copy of the GNU General Public License
31 // along with this program; if not, write to the Free Software
32 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 //
34 //-----------------------------------------------------------------------------
35 #ifndef _NSOUND_REVERBERATION_ROOM_H_
36 #define _NSOUND_REVERBERATION_ROOM_H_
37 
38 #include <Nsound/Nsound.h>
39 
40 namespace Nsound
41 {
42 
43 class AudioStream;
44 class Buffer;
45 class FilterAllPass;
46 class FilterCombLowPassFeedback;
47 
48 //-----------------------------------------------------------------------------
50 {
51  public:
52 
54  //
61  //
63  const float64 & sample_rate,
64  const float64 & room_feedback,
65  const float64 & wet_percent = 0.5,
66  const float64 & dry_percent = 1.0,
67  const float64 & low_pass_frequency_Hz = 7644.9,
68  const float64 & stereo_spread_seconds = 0.0005215);
69 
71 
72  virtual ~ReverberationRoom();
73 
75  filter(const AudioStream & x);
76 
78  filter(const Buffer & x);
79 
80  void
81  filter(
82  float64 & out_left,
83  float64 & out_right,
84  const float64 & in_left,
85  const float64 & in_right);
86 
87  float64
88  getSampleRate() const { return sample_rate_; };
89 
91  operator=(const ReverberationRoom & rhs);
92 
93  void
94  reset();
95 
96  protected:
97 
99 
102 
105 
108 
109  static const float64 ROOM_FEEDBACK_SCALE_; // = 0.28;
110  static const float64 ROOM_FEEDBACK_OFFSET_; // = 0.7;
111 
112  static const uint32 N_COMB_FILTERS_ = 8;
113  static const uint32 N_ALL_PASS_FILTERS_ = 4;
114 
116 
118 
119 };
120 
121 } // namespace
122 
123 // :mode=c++: jEdit modeline
124 #endif
unsigned int uint32
Definition: Nsound.h:153
FilterCombLowPassFeedback ** comb_left_
static const float64 ALL_PASS_DELAY_TIME_SECONDS_[N_ALL_PASS_FILTERS_]
FilterCombLowPassFeedback ** comb_right_
static const float64 ROOM_FEEDBACK_OFFSET_
ReverberationRoom(const float64 &sample_rate, const float64 &room_feedback, const float64 &wet_percent=0.5, const float64 &dry_percent=1.0, const float64 &low_pass_frequency_Hz=7644.9, const float64 &stereo_spread_seconds=0.0005215)
Default Constructor.
double float64
Definition: Nsound.h:146
float64 getSampleRate() const
static const float64 ROOM_FEEDBACK_SCALE_
AudioStream filter(const AudioStream &x)
static const float64 COMB_DELAY_TIME_SECONDS_[N_COMB_FILTERS_]
static const uint32 N_COMB_FILTERS_
A class for filtering audio in the frequecy domain.
A Buffer for storing audio samples.
Definition: Buffer.h:60
ReverberationRoom & operator=(const ReverberationRoom &rhs)
FilterAllPass ** allpass_left_
static const uint32 N_ALL_PASS_FILTERS_
FilterAllPass ** allpass_right_