Nsound  0.9.4
Functions
demo-delayline.cc File Reference
#include <Nsound/NsoundAll.h>
#include <iostream>
Include dependency graph for demo-delayline.cc:

Go to the source code of this file.

Functions

int main (void)
 

Function Documentation

int main ( void  )

Definition at line 18 of file demo-delayline.cc.

References Nsound::DelayLine::delay(), Nsound::Generator::drawLine(), Nsound::AudioStream::getDuration(), Nsound::AudioStream::getSampleRate(), Nsound::Buffer::normalize(), Nsound::Wavefile::setDefaultSampleRate(), Nsound::Generator::silence(), and sr.

19 {
20  AudioStream as1("california.wav");
21 
22  float64 sr = as1.getSampleRate();
23  float64 dur = as1.getDuration();
24 
25  Wavefile::setDefaultSampleRate(sr);
26 
27  Generator gen(sr);
28 
29  DelayLine dl(sr, dur);
30 
31  Buffer dt_line = gen.drawLine(dur, 0.01, 0.25);
32 
33  Buffer out = dl.delay(as1[0], dt_line);
34 
35  out += as1[0];
36 
37  out.normalize();
38  out *= 0.666;
39 
40  out << gen.silence(0.5);
41 
42  out >> "dt-cali.wav";
43 
44  return 0;
45 }
double float64
Definition: Nsound.h:146
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
A class the provides draw utilities and a wavetable oscillator.
Definition: Generator.h:50
float64 sr
Definition: example3.cc:24