Nsound  0.9.4
Functions | Variables
test_mesh.cc File Reference
#include <Nsound/NsoundAll.h>
#include "Test.h"
#include <cmath>
#include <iostream>
#include <sstream>
Include dependency graph for test_mesh.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Variables

static const char * THIS_FILE = "test_mesh.cc"
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 46 of file test_mesh.cc.

References Nsound::Buffer::normalize(), and Nsound::Mesh2D::strike().

47 {
48 //~ for(int x = 3; x <= 19; x += 4)
49 //~ {
50 //~ for(float64 leak = 0.87; leak <= 0.99; leak += 0.06)
51 //~ {
52 //~ for(float64 tau = 0.005; tau <= 0.16; tau *= 2.0)
53 //~ {
54 //~ char buffer[1024];
55 //~
56 //~ sprintf(buffer, "mesh_x%02d_y19_leak%4.2f_tau%5.3f.wav",
57 //~ x,
58 //~ leak,
59 //~ tau);
60 //~
61 //~ cout << "writing " << buffer;
62 //~
63 //~ Mesh2D mesh(44100.0, x, 19, leak, tau);
64 //~
65 //~ Buffer hit = mesh.strike(0.25, 0.25, 1.0);
66 //~
67 //~ Buffer output;
68 //~
69 //~ output << hit << hit << hit;
70 //~ output.normalize();
71 //~
72 //~ output *= 0.8;
73 //~
74 //~ output >> buffer;
75 //~
76 //~ cout << endl;
77 //~
78 //~ }
79 //~ }
80 //~ }
81 
82  // sr x y leak tau
83  Mesh2D mesh(44100.0, 11, 19, 0.88, 0.010);
84 
85  Buffer output;
86 
87  output << mesh.strike(0.333, 0.333, 3.0);
88 
89  output.normalize();
90 
91  output >> "mesh.wav";
92 
93  return 0;
94 }
void normalize()
Multiplies the Buffer by a constant gain so the peak sample has magnitude 1.0.
Definition: Buffer.cc:1064
A Buffer for storing audio samples.
Definition: Buffer.h:60

Variable Documentation

const char* THIS_FILE = "test_mesh.cc"
static

Definition at line 44 of file test_mesh.cc.