now working range for loop using reference instead of value (which was copied)

nix
Pierre Alexandre Tremblay 8 years ago
parent d9ccee2776
commit 21eb0f825f

@ -3,6 +3,7 @@
#include "SC_PlugIn.h" #include "SC_PlugIn.h"
#include <vector> #include <vector>
// #include "stft.h"
static InterfaceTable *ft; static InterfaceTable *ft;
@ -47,16 +48,20 @@ void BufNMF(World *world, struct SndBuf *dstBuf, struct sc_msg_iter *msg)
tmp_vec[i] = srcBuf->data[(i*srcChanCount)+j]; tmp_vec[i] = srcBuf->data[(i*srcChanCount)+j];
} }
// //dumb vector process with c++ syntax
// for(double value : tmp_vec){
// value *= -1;
// }
//dumb vector process with c++ syntax //dumb vector process with c++ syntax
for(int i=0;i<tmp_vec.size();i++){ for(double& value : tmp_vec){
tmp_vec[i] *= -1; value *= -1;
} }
// //dumb vector process with c syntax
// for(int i=0;i<tmp_vec.size();i++){
// tmp_vec[i] *= -1;
// }
// fft and ifft for fun
// Spectrogram spec = stft.process(tmp_vec);
// std::vector<double> out_vec = istft.process(spec);
//writes the output //writes the output
for (int i=0;i<srcFrameCount;i++){ for (int i=0;i<srcFrameCount;i++){
dstBuf->data[(i*srcChanCount)+j] = (float)tmp_vec[i]; dstBuf->data[(i*srcChanCount)+j] = (float)tmp_vec[i];

Loading…
Cancel
Save