Nsound  0.9.4
Pluck.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: Pluck.h 874 2014-09-08 02:21:29Z weegreenblobbie $
4 //
5 // Copyright (c) 2004-2007 Nick Hilton
6 //
7 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
8 //
9 //-----------------------------------------------------------------------------
10 
11 //-----------------------------------------------------------------------------
12 //
13 // This program is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation; either version 2 of the License, or
16 // (at your option) any later version.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Library General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 //
27 //-----------------------------------------------------------------------------
28 
29 #ifndef _NSOUND_PLUCK_H_
30 #define _NSOUND_PLUCK_H_
31 
32 #include <Nsound/Generator.h>
33 
34 namespace Nsound
35 {
36 
37 class Buffer;
38 
39 //-----------------------------------------------------------------------------
41 //
42 class Pluck : public Generator
43 {
44  public:
45 
46  Pluck(const float64 & sample_rate, uint32 n_smooth_samples);
47 
48  virtual ~Pluck();
49 
51  Buffer
52  generate(const float64 & duration, const float64 & frequency);
53 
54  // These don't do anything yet.
55  float64 generate(const float64 & f){return 0.0;}
56  float64 generate2(const float64 & f, const float64 & p){return 0.0;}
57 
59  const float64 & d,
60  const float64 & f,
61  const float64 & p){return Buffer();}
62 
64  const float64 & d,
65  const Buffer & f){return Buffer();}
66 
68  const float64 & d,
69  const float64 & f,
70  const Buffer & p){return Buffer();}
71 
73  const float64 & d,
74  const Buffer & f,
75  const float64 & p){return Buffer();}
76 
78  const float64 & d,
79  const Buffer & f,
80  const Buffer & p){return Buffer();}
81 
82  protected:
83 
85 
86 };
87 
88 };
89 
90 // :mode=c++: jEdit modeline
91 
92 #endif
unsigned int uint32
Definition: Nsound.h:153
float64 generate2(const float64 &f, const float64 &p)
This is a real-time method for the wavetable oscillator.
Definition: Pluck.h:56
Implements a simple Karplus-Strong String Synthesis algorithim.
Definition: Pluck.h:42
uint32 n_smooth_samples_
Definition: Pluck.h:84
Buffer generate2(const float64 &d, const float64 &f, const float64 &p)
This method oscillates the waveform stored in this generator.
Definition: Pluck.h:58
Pluck(const float64 &sample_rate, uint32 n_smooth_samples)
Definition: Pluck.cc:43
double float64
Definition: Nsound.h:146
Buffer generate2(const float64 &d, const Buffer &f, const Buffer &p)
This method oscillates the waveform stored in this generator.
Definition: Pluck.h:77
Buffer generate2(const float64 &d, const Buffer &f, const float64 &p)
This method oscillates the waveform stored in this generator.
Definition: Pluck.h:72
float64 generate(const float64 &f)
This is a real-time method for the wavetable oscillator.
Definition: Pluck.h:55
Buffer generate(const float64 &d, const Buffer &f)
This method oscillates the waveform stored in this generator.
Definition: Pluck.h:63
Buffer generate2(const float64 &d, const float64 &f, const Buffer &p)
This method oscillates the waveform stored in this generator.
Definition: Pluck.h:67
A Buffer for storing audio samples.
Definition: Buffer.h:60
Buffer generate(const float64 &duration, const float64 &frequency)
Implements simple Karplus-Strong plucked string.
Definition: Pluck.cc:59
A class the provides draw utilities and a wavetable oscillator.
Definition: Generator.h:50
virtual ~Pluck()
Definition: Pluck.cc:53