Debian Codegraph @

lib-src/libnyquist/nyquist/nyqstk/include/Mandolin.h

raw
1 /***************************************************/
2 /*! \class Mandolin
3 \brief STK mandolin instrument model class.
4
5 This class inherits from PluckTwo and uses
6 "commuted synthesis" techniques to model a
7 mandolin instrument.
8
9 This is a digital waveguide model, making its
10 use possibly subject to patents held by
11 Stanford University, Yamaha, and others.
12 Commuted Synthesis, in particular, is covered
13 by patents, granted, pending, and/or
14 applied-for. All are assigned to the Board of
15 Trustees, Stanford University. For
16 information, contact the Office of Technology
17 Licensing, Stanford University.
18
19 Control Change Numbers:
20 - Body Size = 2
21 - Pluck Position = 4
22 - String Sustain = 11
23 - String Detuning = 1
24 - Microphone Position = 128
25
26 by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
27 */
28 /***************************************************/
29
30 #ifndef STK_MANDOLIN_H
31 #define STK_MANDOLIN_H
32
33 #include "PluckTwo.h"
34 #include "FileWvIn.h"
35
36 namespace Nyq
37 {
38
39 class Mandolin : public PluckTwo
40 {
41 public:
42 //! Class constructor, taking the lowest desired playing frequency.
43 Mandolin(StkFloat lowestFrequency);
44
45 //! Class destructor.
46 ~Mandolin();
47
48 //! Pluck the strings with the given amplitude (0.0 - 1.0) using the current frequency.
49 void pluck(StkFloat amplitude);
50
51 //! Pluck the strings with the given amplitude (0.0 - 1.0) and position (0.0 - 1.0).
52 void pluck(StkFloat amplitude,StkFloat position);
53
54 //! Start a note with the given frequency and amplitude (0.0 - 1.0).
55 void noteOn(StkFloat frequency, StkFloat amplitude);
56
57 //! Set the body size (a value of 1.0 produces the "default" size).
58 void setBodySize(StkFloat size);
59
60 //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
61 void controlChange(int number, StkFloat value);
62
63 protected:
64
65 StkFloat computeSample( void );
66
67 FileWvIn *soundfile_[12];
68 int mic_;
69 long dampTime_;
70 bool waveDone_;
71 };
72
73 } // namespace Nyq
74
75 #endif