[Stk] problems implementing polyphony...
Patrick J. Collins
patrick at collinatorstudios.com
Mon Sep 17 12:46:34 PDT 2012
> The first think to try would be replacing the vectors of pointers with
> a simple array of pointers (in FM.h).
I am not sure if I know exactly how to do that...
You are saying to change:
std::vector<ADSR *> adsr_;
std::vector<FileLoop *> waves_;
std::vector<StkFloat> ratios_;
std::vector<StkFloat> gains_;
to arrays? But we don't know how much space to allocate for the
arrays... So does it become something like:
ADSR *adsr_;
FileLoop *waves_;
StkFloat ratios_;
StkFloat gains_;
and then in .cp:
adsr_.resize( nOperators_ );
waves_.resize( nOperators_ );
becomes something like:
adsr_ = (ADSR*)malloc(sizeof(ADSR) * nOperators_);
waves_ = (FileLoop*)malloc(sizeof(FileLoop) * nOperators_);
?
And then I am not sure what happens with ratios_ and gains_...
ratios_ = *(StkFloat*)malloc(sizeof(StkFloat) * nOperators_);
gains_ = *(StkFloat*)malloc(sizeof(StkFloat) * nOperators_);
?
Then I am really unsure what to do with the .push_back for ratios_ and
gains_... But doing this shows a ton of errors.. delete waves_[i]
doesn't work either.
Patrick J. Collins
http://collinatorstudios.com
More information about the Stk
mailing list