summaryrefslogtreecommitdiff
path: root/sndobj/ReSyn.cpp
diff options
context:
space:
mode:
authorJohn Glover <glover.john@gmail.com>2010-10-21 13:39:28 +0100
committerJohn Glover <glover.john@gmail.com>2010-10-21 13:39:28 +0100
commitce65c30264be9683dd3a59b35730d2f31e02d37f (patch)
tree90aaf2e77526af9ba099e76175956d0dd6a37633 /sndobj/ReSyn.cpp
parentb46b988f164f983fc889c7bc0c96953e4609d27a (diff)
downloadsimpl-ce65c30264be9683dd3a59b35730d2f31e02d37f.tar.gz
simpl-ce65c30264be9683dd3a59b35730d2f31e02d37f.tar.bz2
simpl-ce65c30264be9683dd3a59b35730d2f31e02d37f.zip
Changed from floats to doubles in the C/C++ code, makes Python integration a bit easier. Fixed a bug that would cause SndObjSynthesis to crash if peak values were floats.
Diffstat (limited to 'sndobj/ReSyn.cpp')
-rw-r--r--sndobj/ReSyn.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/sndobj/ReSyn.cpp b/sndobj/ReSyn.cpp
index f81871a..9d72b12 100644
--- a/sndobj/ReSyn.cpp
+++ b/sndobj/ReSyn.cpp
@@ -30,8 +30,8 @@ ReSyn::ReSyn(){
}
-ReSyn::ReSyn(SinAnal* input, int maxtracks, Table* table, float pitch, float scale, float tscal,
- int vecsize, float sr)
+ReSyn::ReSyn(SinAnal* input, int maxtracks, Table* table, double pitch, double scale, double tscal,
+ int vecsize, double sr)
: SinSyn(input, maxtracks, table, scale, vecsize, sr){
m_pitch = pitch;
AddMsg("pitch", 31);
@@ -42,7 +42,7 @@ ReSyn::~ReSyn(){
}
int
-ReSyn::Set(char* mess, float value){
+ReSyn::Set(char* mess, double value){
switch(FindMsg(mess)){
@@ -67,17 +67,17 @@ ReSyn::DoProcess() {
if(m_input){
- float ampnext,amp,freq, freqnext, phase,phasenext;
- float a2, a3, phasediff, cph;
+ double ampnext,amp,freq, freqnext, phase,phasenext;
+ double a2, a3, phasediff, cph;
int i3, i, j, ID;
int notcontin = 0;
bool contin = false;
int oldtracks = m_tracks;
- float* tab = m_ptable->GetTable();
+ double* tab = m_ptable->GetTable();
if((m_tracks = ((SinAnal *)m_input)->GetTracks()) >
m_maxtracks) m_tracks = m_maxtracks;
- memset(m_output, 0, sizeof(float)*m_vecsize);
+ memset(m_output, 0, sizeof(double)*m_vecsize);
// for each track
i = j = 0;
@@ -132,7 +132,7 @@ ReSyn::DoProcess() {
a3 = 1./(3*m_facsqr) * (freqnext - freq - 2*a2*m_factor);
// interpolation resynthesis loop
- float inc1, inc2, a, ph, cnt, frac;
+ double inc1, inc2, a, ph, cnt, frac;
int ndx;
a = amp;
ph = phase;