summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/simpl/base.cpp22
-rw-r--r--src/simpl/base.h40
2 files changed, 31 insertions, 31 deletions
diff --git a/src/simpl/base.cpp b/src/simpl/base.cpp
index 3f6c093..17df215 100644
--- a/src/simpl/base.cpp
+++ b/src/simpl/base.cpp
@@ -192,42 +192,42 @@ void Frame::size(int new_size)
_size = new_size;
}
-void Frame::audio(number* new_audio)
+void Frame::audio(sample* new_audio)
{
_audio = new_audio;
}
-number* Frame::audio()
+sample* Frame::audio()
{
return _audio;
}
-void Frame::synth(number* new_synth)
+void Frame::synth(sample* new_synth)
{
_synth = new_synth;
}
-number* Frame::synth()
+sample* Frame::synth()
{
return _synth;
}
-void Frame::residual(number* new_residual)
+void Frame::residual(sample* new_residual)
{
_residual = new_residual;
}
-number* Frame::residual()
+sample* Frame::residual()
{
return _residual;
}
-void Frame::synth_residual(number* new_synth_residual)
+void Frame::synth_residual(sample* new_synth_residual)
{
_synth_residual = new_synth_residual;
}
-number* Frame::synth_residual()
+sample* Frame::synth_residual()
{
return _synth_residual;
}
@@ -338,12 +338,12 @@ void PeakDetection::window_size(int new_window_size)
_window_size = new_window_size;
}
-number PeakDetection::min_peak_separation()
+sample PeakDetection::min_peak_separation()
{
return _min_peak_separation;
}
-void PeakDetection::min_peak_separation(number new_min_peak_separation)
+void PeakDetection::min_peak_separation(sample new_min_peak_separation)
{
_min_peak_separation = new_min_peak_separation;
}
@@ -374,7 +374,7 @@ Peaks PeakDetection::find_peaks_in_frame(Frame* frame)
// If the signal contains more than 1 frame worth of audio, it will be broken
// up into separate frames, each containing a std::vector of peaks.
// Frames* PeakDetection::find_peaks(const samples& audio)
-Frames PeakDetection::find_peaks(int audio_size, number* audio)
+Frames PeakDetection::find_peaks(int audio_size, sample* audio)
{
clear();
unsigned int pos = 0;
diff --git a/src/simpl/base.h b/src/simpl/base.h
index d460d0c..3710a92 100644
--- a/src/simpl/base.h
+++ b/src/simpl/base.h
@@ -10,7 +10,7 @@ using namespace std;
namespace simpl
{
-typedef double number;
+typedef double sample;
// ---------------------------------------------------------------------------
@@ -21,9 +21,9 @@ typedef double number;
class Peak
{
public:
- number amplitude;
- number frequency;
- number phase;
+ sample amplitude;
+ sample frequency;
+ sample phase;
Peak* next_peak;
Peak* previous_peak;
int partial_id;
@@ -70,10 +70,10 @@ private:
int _max_partials;
Peaks _peaks;
Partials _partials;
- number* _audio;
- number* _synth;
- number* _residual;
- number* _synth_residual;
+ sample* _audio;
+ sample* _synth;
+ sample* _residual;
+ sample* _synth_residual;
void init();
public:
@@ -102,14 +102,14 @@ public:
// audio buffers
int size();
void size(int new_size);
- void audio(number* new_audio);
- number* audio();
- void synth(number* new_synth);
- number* synth();
- void residual(number* new_residual);
- number* residual();
- void synth_residual(number* new_synth_residual);
- number* synth_residual();
+ void audio(sample* new_audio);
+ sample* audio();
+ void synth(sample* new_synth);
+ sample* synth();
+ void residual(sample* new_residual);
+ sample* residual();
+ void synth_residual(sample* new_synth_residual);
+ sample* synth_residual();
};
typedef std::vector<Frame*> Frames;
@@ -131,7 +131,7 @@ private:
int _max_peaks;
std::string _window_type;
int _window_size;
- number _min_peak_separation;
+ sample _min_peak_separation;
Frames _frames;
public:
@@ -154,8 +154,8 @@ public:
void window_type(std::string new_window_type);
int window_size();
void window_size(int new_window_size);
- number min_peak_separation();
- void min_peak_separation(number new_min_peak_separation);
+ sample min_peak_separation();
+ void min_peak_separation(sample new_min_peak_separation);
int num_frames();
Frame* frame(int frame_number);
Frames frames();
@@ -166,7 +166,7 @@ public:
// Find and return all spectral peaks in a given audio signal.
// If the signal contains more than 1 frame worth of audio, it will be broken
// up into separate frames, with an array of peaks returned for each frame.
- virtual Frames find_peaks(int audio_size, number* audio);
+ virtual Frames find_peaks(int audio_size, sample* audio);
};
} // end of namespace Simpl