View Single Post
Old 05-29-2017, 03:30 AM   #1
eviluess
Human being with feelings
 
eviluess's Avatar
 
Join Date: Dec 2015
Location: Guangzhou, China
Posts: 176
Default How to use array of objects?

Hey all,

Since JSFX supports pseudo object programming.

And I tried to use the RMS function in "Gain Reduction Scope".
However I didn't figure out how to replace "rmsa,rmsb" to rms[i].

I've tried the following method but failed:

rmss=1024; // just like fftwindow, I consider it as the start address of an array

sp=0;
while (sp*2<num_ch)
(
rmsa=rmss[sp];
rmsa.rms.init(histsize, srate);
sp=sp+1;
);

The compiling is OK, but I can't get the actual results except 0 from rmsa.rms.getmax.

I also tried the following method, but it still retuns 0.

sp=0;
while (sp*2<num_ch)
(
rmsa=rmss+sp*4;
rmsa.rms.init(histsize, srate);
sp=sp+1;
);

---------3rd variation------

rms1.rms.init(histsize, srate);
rms2.rms.init(histsize, srate);

rmss[0]=rms1;
rmss[1]=rms2;
...

sp=0;
while (sp*2<num_ch)
(
rmsa=rmss+sp*4; // or rmss[sp]
rmsa.xxxxx
sp=sp+1;
);


Could anyone tell me how to use the array of object correctly?

Thanks!

Last edited by eviluess; 05-29-2017 at 03:30 AM. Reason: mistyping
eviluess is offline   Reply With Quote