Prev Previous Post   Next Post Next
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
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.