Nsound  0.9.4
MeshJunction.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: MeshJunction.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-Present Nick Hilton
11 //
12 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
13 //
14 // Based on Brook Eaton's Waveguide Mesh Drum project.
15 // http://www-ccrma.stanford.edu/~be/drum/drum.htm
16 //
17 //-----------------------------------------------------------------------------
18 
19 //-----------------------------------------------------------------------------
20 //
21 // This program is free software; you can redistribute it and/or modify
22 // it under the terms of the GNU General Public License as published by
23 // the Free Software Foundation; either version 2 of the License, or
24 // (at your option) any later version.
25 //
26 // This program is distributed in the hope that it will be useful,
27 // but WITHOUT ANY WARRANTY; without even the implied warranty of
28 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 // GNU Library General Public License for more details.
30 //
31 // You should have received a copy of the GNU General Public License
32 // along with this program; if not, write to the Free Software
33 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 //
35 //-----------------------------------------------------------------------------
36 #ifndef _NSOUND_MESH_JUNCTION_H_
37 #define _NSOUND_MESH_JUNCTION_H_
38 
39 #include <Nsound/Nsound.h>
40 
41 namespace Nsound
42 {
43 
44 //-----------------------------------------------------------------------------
48 {
49  public:
50 
53  const float64 & leak_gain,
54  const float64 & tau,
55  const float64 & delta,
56  const float64 & gamma);
57 
59  MeshJunction(const MeshJunction & copy);
60 
62  ~MeshJunction();
63 
65  void
66  clear();
67 
68  // DOXME
69  float64
70  getVelocity() const;
71 
73  MeshJunction &
74  operator=(const MeshJunction & rhs);
75 
76  // DOXME
77  void setNeighborNorth(MeshJunction * ptr);
78 
79  // DOXME
80  void setNeighborSouth(MeshJunction * ptr);
81 
82  // DOXME
83  void setNeighborEast(MeshJunction * ptr);
84 
85  // DOXME
86  void setNeighborWest(MeshJunction * ptr);
87 
89  void saveState();
90 
92  void strike(const float64 & velocity);
93 
95  void updateVelocity();
96 
97  private:
98 
99  void
100  updateBoundry();
101 
103 
105 
110 
116 
120 
125 
126 }; // class MeshJunction
127 
128 
129 } // namespace Nsound
130 
131 // :mode=c++: jEdit modeline
132 #endif
float64 velocity_south_
Velocity going north.
Definition: MeshJunction.h:107
float64 previous_velocity_south_
Definition: MeshJunction.h:113
void updateVelocity()
updates junction velocity.
MeshJunction(const float64 &leak_gain, const float64 &tau, const float64 &delta, const float64 &gamma)
Constructor.
Definition: MeshJunction.cc:41
float64 previous_velocity_east_
Definition: MeshJunction.h:114
void strike(const float64 &velocity)
Adds velocity to this junction.
float64 leak_gain_
updates junction velocity.
Definition: MeshJunction.h:102
MeshJunction * neighbor_west_
Definition: MeshJunction.h:124
MeshJunction * neighbor_south_
Definition: MeshJunction.h:122
void setNeighborNorth(MeshJunction *ptr)
float64 velocity_east_
Velocity going south.
Definition: MeshJunction.h:108
float64 velocity_
Leak gain.
Definition: MeshJunction.h:104
double float64
Definition: Nsound.h:146
void setNeighborEast(MeshJunction *ptr)
void setNeighborSouth(MeshJunction *ptr)
float64 velocity_west_
Velocity going east.
Definition: MeshJunction.h:109
MeshJunction & operator=(const MeshJunction &rhs)
This operator can not assign neighbor pointers.
MeshJunction * neighbor_east_
Definition: MeshJunction.h:123
float64 previous_velocity_west_
Definition: MeshJunction.h:115
void setNeighborWest(MeshJunction *ptr)
float64 getVelocity() const
float64 previous_velocity_north_
Definition: MeshJunction.h:112
float64 velocity_north_
This junction's velocity.
Definition: MeshJunction.h:106
void saveState()
Saves previous south and east velocities.
~MeshJunction()
Deconstructor.
void clear()
Clears all velicityes in the junctino.
float64 previous_velocity_
Velocity going west.
Definition: MeshJunction.h:111
MeshJunction * neighbor_north_
Definition: MeshJunction.h:121