Nsound  0.9.4
Instrument.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: Instrument.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) 2004, 2005 Nick Hilton
11 //
12 // weegreenblobbie_at_yahoo_com
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_INSTRUMENT_H_
35 #define _NSOUND_INSTRUMENT_H_
36 
37 #include <Nsound/Nsound.h>
38 
39 #include <string>
40 
41 namespace Nsound
42 {
43 
44 // Forward declarations
45 
46 class AudioStream;
47 
48 //-----------------------------------------------------------------------------
51 {
52  public:
53 
54  Instrument(const float64 & sample_rate):sample_rate_(sample_rate){};
55 
56  virtual
58 
60  virtual
62  play() = 0;
63 
65  virtual
67  play(const float64 & duration, const float64 & frequency) = 0;
68 
70  virtual
71  std::string
72  getInfo() = 0;
73 
74  protected:
75 
77 };
78 
79 };
80 
81 // :mode=c++: jEdit modeline
82 #endif
virtual AudioStream play()=0
Plays a demo for this instrument.
virtual std::string getInfo()=0
Returns information about who wrote this instrument and how to use it.
double float64
Definition: Nsound.h:146
The Nsound Instrument baseclass. All Nsound instruments extend this class.
Definition: Instrument.h:50
float64 sample_rate_
Definition: Instrument.h:76
virtual ~Instrument()
Definition: Instrument.h:57
Instrument(const float64 &sample_rate)
Definition: Instrument.h:54