ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2012-05-24T15:07:21+02:00 https://brainmodular.com/forums/app.php/feed/topic/3210 2012-05-24T15:07:21+02:00 2012-05-24T15:07:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=23470#p23470 <![CDATA[scripting only if changed]]>
I did iterate, and it is working, thanks!!

Statistics: Posted by woodslanding — 24 May 2012, 15:07


]]>
2012-05-24T09:52:07+02:00 2012-05-24T09:52:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=23468#p23468 <![CDATA[scripting only if changed]]> after that yes you would have to loop trhu and set elmts by elmts.

Statistics: Posted by 23fx23 — 24 May 2012, 09:52


]]>
2012-05-24T06:48:17+02:00 2012-05-24T06:48:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=23464#p23464 <![CDATA[scripting only if changed]]>
Because getLength on a ptArray won't compile--it says not enough parameters. But the wiki shows only one parameter.

edit:

Okay, I am much closer.... my script is almost working, but my array out length is not the same as the input array. How can I do this?

Niether of these works:

//setLength(paramsOUT, getLength(paramsIN));
//setValue(paramsOUT, getValue(paramsIN));

In both cases, my output array shows length 1 ( paramsOUT[1] ) regardless of the size of the input array.

Do I have to iterate through the in and set the out element by element? That's fine, but I can't even get a correct length for the output array, after setting it to length -1!

Thanks!!!

-eric

Statistics: Posted by woodslanding — 24 May 2012, 06:48


]]>
2012-04-09T04:08:39+02:00 2012-04-09T04:08:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22954#p22954 <![CDATA[scripting only if changed]]>
Thanks so much!
-eric

Statistics: Posted by woodslanding — 09 Apr 2012, 04:08


]]>
2012-04-06T13:38:41+02:00 2012-04-06T13:38:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22944#p22944 <![CDATA[scripting only if changed]]>
IF (stop = 1) then begin setlength(paramsOUT,-1); end else begin setlength(paramsOUT,length);end;

then your loop to set the values.

Statistics: Posted by 23fx23 — 06 Apr 2012, 13:38


]]>
2012-04-05T15:55:05+02:00 2012-04-05T15:55:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22939#p22939 <![CDATA[scripting only if changed]]>
this script has the only syntax I could find that compiles, and it doesn't work. I just want to be able to set the values of a few specific elements of the array, and be able to stop it from a switch. Seems easy enough.... but I can't get it working. I'm seeing all zeroes at the output no matter the value of STOP:

CODE:

//////////////////////////////////////////////////////////////Const COUNT = 9;var paramsOUT  &#58; TParameter;var paramsIN  &#58; TParameter;Var indicesIN  &#58;TParameter;Var valuesIN  &#58; Array&#91;0..COUNT-1&#93; of TParameter;Var stopIN    &#58;Tparameter;Var indices &#58; TStringList;Procedure Destroy;begin   indices.free;end;// initialisation &#58; create parametersprocedure init;var i &#58; integer;begin  paramsIN &#58;= CreateParam&#40;'param arr',PtArray&#41;;  SetIsOutput&#40;paramsIN,false&#41;;  SetFastCallback&#40;paramsIN,false&#41;;  SetMax&#40;paramsIn,MAXINT&#41;;  paramsOUT &#58;= CreateParam&#40;'param arr',PtArray&#41;;  SetIsInput&#40;paramsOUT,false&#41;;  SetFastCallback&#40;paramsOUT,false&#41;;  SetMax&#40;paramsOUT,MAXINT&#41;;     for i &#58;= 0 to &#40;COUNT - 1&#41; DO BEGIN     valuesIN&#91;i&#93; &#58;= CreateParam&#40;'value' + intToStr&#40;i&#41;, PtTextfield&#41;;     SetIsOutput&#40;valuesIN&#91;i&#93;,false&#41;;     SetFastCallback&#40;valuesIN&#91;i&#93;,false&#41;;  END;    indicesIN &#58;= CreateParam&#40;'indices', PtTextfield&#41;;  SetIsOutput&#40;indicesIN,false&#41;;  SetFastCallback&#40;indicesIN,false&#41;;   stopIN &#58;= CreateParam&#40;'stop', PtSwitch&#41;;  SetIsOutput&#40;stopIN,false&#41;;  SetFastCallback&#40;stopIN,false&#41;; end;// Callback procedureProcedure Callback&#40;N&#58;integer&#41;; var i,idx,stop,length &#58; integer;value &#58; double;name &#58; String;begin    stop &#58;= trunc&#40;getValue&#40;stopIN&#41;&#41;;     // how to stop an array???    length &#58;= getLength&#40;paramsIN&#41;;        IF &#40;n = stopIN&#41; and &#40;stop = 1&#41; then FOR i &#58;= 0 to &#40;length - 1&#41; DO setLength&#40;paramsOUT, -1&#41;    ELSE BEGIN        setLength&#40;paramsOUT, length&#41;;        for i &#58;= 0 to &#40;length - 1&#41; DO           setDataArrayValue&#40;paramsOUT, i, paramsIN&#41;;        indices.CommaText &#58;= GetStringValue&#40;indicesIN&#41;;        // set the value of the array output at the index to the fader value coming in.        FOR i &#58;= 0 to &#40;COUNT - 1&#41; DO setDataArrayValue&#40;paramsOUT,strToInt&#40;indices.Strings&#91;i&#93;&#41;,getValue&#40;valuesIN&#91;i&#93;&#41;&#41;;    ENDend;//////////////////////////////// main proc//////////////////////////////Procedure Process;beginend;

Statistics: Posted by woodslanding — 05 Apr 2012, 15:55


]]>
2012-04-05T13:44:06+02:00 2012-04-05T13:44:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22933#p22933 <![CDATA[scripting only if changed]]>
if for the whole array, just set the array to correct size when need to set values, then next bloc set it's lenght to -1. = stopped,
one solution like here is to trigg a counter when callback used to set your array changes, and when the count=+1 in process you setlength back to -1. Alternatively you can trig the back to -1 size via another input callback if wanna avoid process, but imo unless you really want to do all by script and complexify in this case, better make simple script for the functions you need and add a pic module after that, like bsork suggested me once ;)

Statistics: Posted by 23fx23 — 05 Apr 2012, 13:44


]]>
2012-04-05T10:03:49+02:00 2012-04-05T10:03:49+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22930#p22930 <![CDATA[scripting only if changed]]>
Still can't figure out how to stop a PTArray.

Statistics: Posted by woodslanding — 05 Apr 2012, 10:03


]]>
2012-04-04T16:55:24+02:00 2012-04-04T16:55:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22925#p22925 <![CDATA[scripting only if changed]]> Statistics: Posted by woodslanding — 04 Apr 2012, 16:55


]]>
2012-04-04T09:11:47+02:00 2012-04-04T09:11:47+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22923#p22923 <![CDATA[scripting only if changed]]> not exactly what you want but maybe a source of inspiration

CODE:

////////////////////////////////////////////////////////////////////////////////////////////// Pass If Chg Array create an array where only values that changed in array in will pass //// As it need 2 blocs &#40;one to check, one to store&#41; it relies on Process procedure         //// The callback will trig a counter. at bloc 0 it will compare new array with previously  //// stored one. At bloc 1 it will store the array to be compared next                      //// The values that didn't changed are those where substracting equal 0, will set          //// corresponding output length to 0, behaviour of passifChange in Usine                   //////////////////////////////////////////////////////////////////////////////////////////////const SIZE = 16;          // nb of out wanted = size of arrayconst PREFIX = 'OUT_';   // PEFIX for outputs names, folowed by Integer;var ArrayIn&#58; Tparameter;var OUTPUTS&#58; Array Of Tparameter;     // we will use an array of Tparameters, to allow N creations easilyvar i,l,count&#58; integer;               // we declare the variable we will use and their typevar valtmp&#58;    single;var ArrayLast&#58; Array of single;       // ArrayLast will be used to store array to check wich values changed on new in                                      // chg./////////////////////////////////////PROCEDURE INIT;BEGIN  ArrayIn &#58;=CreateParam&#40;'ArrayIn',PtArray&#41;; SetIsOutput&#40;ArrayIn,False&#41;; setMin&#40;arrayIn,0&#41;;setMax&#40;ArrayIn,127&#41;;   SetArrayLength&#40;OUTPUTS,SIZE&#41;;       // we set the arraylength to create N outputs of size defined by constant on top                                      // of script.   for i&#58;=0 to SIZE -1 do begin    OUTPUTS&#91;i&#93;&#58;= CreateParam&#40;PREFIX+IntToStr&#40;i&#41;,PtDataField&#41;; SetIsInput&#40;OUTPUTS&#91;i&#93;,false&#41;;    end;   // we create the outputs, names with the prefix followed by their corresponding nb. setArrayLength&#40;ArrayLast,SIZE&#41;;   //we set the memory array the same sizesetdontsave&#40;arrayIn,false&#41;;       // by doing this the arrayin can be saved to Pm or on quiting the patchEND;//INit//////////////////////////////PROCEDURE Callback&#40;N&#58;integer&#41;; BEGIN     if &#40;n=arrayIn&#41; then begin       l&#58;= getlength&#40;ArrayIn&#41;;       count&#58;=-1;                 // if detected arrayin chg, we trig the counter for process to start.     end;END;//callback//////////////////////////////PROCEDURE PROCESS;BEGIN if count >= -1 then begin        //start counting when callback has set count to -1   count&#58;=count+1;               // -1+1=0 so at first bloc count is 0   end;    if count = 0 then begin        // at first bloc we compare all values of new array with previous one.     for i&#58;=0 to l-1 do begin       if ArrayLast&#91;i&#93;-getDataArrayValue&#40;ArrayIn,i&#41;<>0 then begin   // if there is a difference that mean        valtmp&#58;= getDataArrayValue&#40;ArrayIn,i&#41;;                     //this value has changed           setLength&#40;OUTPUTS&#91;i&#93;,1&#41;;                         // we make a size 1 to activate data pass           setValue&#40;OUTPUTS&#91;i&#93;,valtmp&#41;;                    // and set the value with discovered one       end      else begin                                 // otherwise if no differences          setLength&#40;OUTPUTS&#91;i&#93;,0&#41;;              // we setLength of 0 = don't pass.       end;      end;      end;     if count = 1 then begin                // on next bloc we store the array to internal memory for next compare.       for i&#58;=0 to L-1 do begin           ArrayLast&#91;i&#93;&#58;=getdataArrayValue&#40;ArrayIn,i&#41;;                setLength&#40;OUTPUTS&#91;i&#93;,0&#41;;                // and make no values pass anymore.             end;      count&#58;=-2;                                      // and stop the counter as we reset it to -2      end; end;

Statistics: Posted by nay-seven — 04 Apr 2012, 09:11


]]>
2012-04-04T02:06:51+02:00 2012-04-04T02:06:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22921#p22921 <![CDATA[scripting only if changed]]>
Thanks!!
-eric

Statistics: Posted by woodslanding — 04 Apr 2012, 02:06


]]>
2011-11-03T20:06:15+02:00 2011-11-03T20:06:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21763#p21763 <![CDATA[scripting only if changed]]>
The coeff to db is to retrieve the associated dB of a coeff (the inverse of the function above)

CODE:

coeffTodB&#40;0.5&#41; = -6coeffTodB&#40;0.25&#41; = -12...
Olivier:

I'm getting:

Undeclared Identifier

when I use the function coeffToDB(single)

Statistics: Posted by woodslanding — 03 Nov 2011, 19:06


]]>
2011-10-28T10:28:34+02:00 2011-10-28T10:28:34+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21717#p21717 <![CDATA[scripting only if changed]]>
Thanks so much!!!

Statistics: Posted by woodslanding — 28 Oct 2011, 10:28


]]>
2011-10-24T04:47:04+02:00 2011-10-24T04:47:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21688#p21688 <![CDATA[scripting only if changed]]> Statistics: Posted by woodslanding — 24 Oct 2011, 04:47


]]>
2011-10-22T12:07:35+02:00 2011-10-22T12:07:35+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21679#p21679 <![CDATA[scripting only if changed]]> Just a detail, to have a real NULL event set its size to -1 instead of 0, it's more general and efficient in Usine.

CODE:

setLength&#40;output,-1&#41;;
also the about the "Coeff to DB"

To change the volume of an audio flow, you can do a multiplication by a Coeff:

CODE:

-6 dB = mult by 0.5-12db = mult by 0.25...
The coeff to db is to retrieve the associated dB of a coeff (the inverse of the function above)

CODE:

coeffTodB&#40;0.5&#41; = -6coeffTodB&#40;0.25&#41; = -12...

Statistics: Posted by senso — 22 Oct 2011, 12:07


]]>
2011-10-22T01:00:59+02:00 2011-10-22T01:00:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21678#p21678 <![CDATA[scripting only if changed]]>
but then need to set back to size 1 if a float or arraysize for activating and setting values, and usually this imply that the callback trig a procedure, set sizes and values, trig a counter in process, and then in next process bloc (count+1) it will set back size to 0.
i have no clues for the db math thing sorry..

Statistics: Posted by 23fx23 — 22 Oct 2011, 01:00


]]>
2011-10-22T00:20:16+02:00 2011-10-22T00:20:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21677#p21677 <![CDATA[scripting only if changed]]>
Also, I'm wondering what the math is for COEFF->DB ??

Thanks for any tips,
-e

Statistics: Posted by woodslanding — 22 Oct 2011, 00:20


]]>
BrainModular BrainModular Users Forum 2012-05-24T15:07:21+02:00 https://brainmodular.com/forums/app.php/feed/topic/3210 2012-05-24T15:07:21+02:00 2012-05-24T15:07:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=23470#p23470 <![CDATA[scripting only if changed]]>
I did iterate, and it is working, thanks!!

Statistics: Posted by woodslanding — 24 May 2012, 15:07


]]>
2012-05-24T09:52:07+02:00 2012-05-24T09:52:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=23468#p23468 <![CDATA[scripting only if changed]]> after that yes you would have to loop trhu and set elmts by elmts.

Statistics: Posted by 23fx23 — 24 May 2012, 09:52


]]>
2012-05-24T06:48:17+02:00 2012-05-24T06:48:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=23464#p23464 <![CDATA[scripting only if changed]]>
Because getLength on a ptArray won't compile--it says not enough parameters. But the wiki shows only one parameter.

edit:

Okay, I am much closer.... my script is almost working, but my array out length is not the same as the input array. How can I do this?

Niether of these works:

//setLength(paramsOUT, getLength(paramsIN));
//setValue(paramsOUT, getValue(paramsIN));

In both cases, my output array shows length 1 ( paramsOUT[1] ) regardless of the size of the input array.

Do I have to iterate through the in and set the out element by element? That's fine, but I can't even get a correct length for the output array, after setting it to length -1!

Thanks!!!

-eric

Statistics: Posted by woodslanding — 24 May 2012, 06:48


]]>
2012-04-09T04:08:39+02:00 2012-04-09T04:08:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22954#p22954 <![CDATA[scripting only if changed]]>
Thanks so much!
-eric

Statistics: Posted by woodslanding — 09 Apr 2012, 04:08


]]>
2012-04-06T13:38:41+02:00 2012-04-06T13:38:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22944#p22944 <![CDATA[scripting only if changed]]>
IF (stop = 1) then begin setlength(paramsOUT,-1); end else begin setlength(paramsOUT,length);end;

then your loop to set the values.

Statistics: Posted by 23fx23 — 06 Apr 2012, 13:38


]]>
2012-04-05T15:55:05+02:00 2012-04-05T15:55:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22939#p22939 <![CDATA[scripting only if changed]]>
this script has the only syntax I could find that compiles, and it doesn't work. I just want to be able to set the values of a few specific elements of the array, and be able to stop it from a switch. Seems easy enough.... but I can't get it working. I'm seeing all zeroes at the output no matter the value of STOP:

CODE:

//////////////////////////////////////////////////////////////Const COUNT = 9;var paramsOUT  &#58; TParameter;var paramsIN  &#58; TParameter;Var indicesIN  &#58;TParameter;Var valuesIN  &#58; Array&#91;0..COUNT-1&#93; of TParameter;Var stopIN    &#58;Tparameter;Var indices &#58; TStringList;Procedure Destroy;begin   indices.free;end;// initialisation &#58; create parametersprocedure init;var i &#58; integer;begin  paramsIN &#58;= CreateParam&#40;'param arr',PtArray&#41;;  SetIsOutput&#40;paramsIN,false&#41;;  SetFastCallback&#40;paramsIN,false&#41;;  SetMax&#40;paramsIn,MAXINT&#41;;  paramsOUT &#58;= CreateParam&#40;'param arr',PtArray&#41;;  SetIsInput&#40;paramsOUT,false&#41;;  SetFastCallback&#40;paramsOUT,false&#41;;  SetMax&#40;paramsOUT,MAXINT&#41;;     for i &#58;= 0 to &#40;COUNT - 1&#41; DO BEGIN     valuesIN&#91;i&#93; &#58;= CreateParam&#40;'value' + intToStr&#40;i&#41;, PtTextfield&#41;;     SetIsOutput&#40;valuesIN&#91;i&#93;,false&#41;;     SetFastCallback&#40;valuesIN&#91;i&#93;,false&#41;;  END;    indicesIN &#58;= CreateParam&#40;'indices', PtTextfield&#41;;  SetIsOutput&#40;indicesIN,false&#41;;  SetFastCallback&#40;indicesIN,false&#41;;   stopIN &#58;= CreateParam&#40;'stop', PtSwitch&#41;;  SetIsOutput&#40;stopIN,false&#41;;  SetFastCallback&#40;stopIN,false&#41;; end;// Callback procedureProcedure Callback&#40;N&#58;integer&#41;; var i,idx,stop,length &#58; integer;value &#58; double;name &#58; String;begin    stop &#58;= trunc&#40;getValue&#40;stopIN&#41;&#41;;     // how to stop an array???    length &#58;= getLength&#40;paramsIN&#41;;        IF &#40;n = stopIN&#41; and &#40;stop = 1&#41; then FOR i &#58;= 0 to &#40;length - 1&#41; DO setLength&#40;paramsOUT, -1&#41;    ELSE BEGIN        setLength&#40;paramsOUT, length&#41;;        for i &#58;= 0 to &#40;length - 1&#41; DO           setDataArrayValue&#40;paramsOUT, i, paramsIN&#41;;        indices.CommaText &#58;= GetStringValue&#40;indicesIN&#41;;        // set the value of the array output at the index to the fader value coming in.        FOR i &#58;= 0 to &#40;COUNT - 1&#41; DO setDataArrayValue&#40;paramsOUT,strToInt&#40;indices.Strings&#91;i&#93;&#41;,getValue&#40;valuesIN&#91;i&#93;&#41;&#41;;    ENDend;//////////////////////////////// main proc//////////////////////////////Procedure Process;beginend;

Statistics: Posted by woodslanding — 05 Apr 2012, 15:55


]]>
2012-04-05T13:44:06+02:00 2012-04-05T13:44:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22933#p22933 <![CDATA[scripting only if changed]]>
if for the whole array, just set the array to correct size when need to set values, then next bloc set it's lenght to -1. = stopped,
one solution like here is to trigg a counter when callback used to set your array changes, and when the count=+1 in process you setlength back to -1. Alternatively you can trig the back to -1 size via another input callback if wanna avoid process, but imo unless you really want to do all by script and complexify in this case, better make simple script for the functions you need and add a pic module after that, like bsork suggested me once ;)

Statistics: Posted by 23fx23 — 05 Apr 2012, 13:44


]]>
2012-04-05T10:03:49+02:00 2012-04-05T10:03:49+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22930#p22930 <![CDATA[scripting only if changed]]>
Still can't figure out how to stop a PTArray.

Statistics: Posted by woodslanding — 05 Apr 2012, 10:03


]]>
2012-04-04T16:55:24+02:00 2012-04-04T16:55:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22925#p22925 <![CDATA[scripting only if changed]]> Statistics: Posted by woodslanding — 04 Apr 2012, 16:55


]]>
2012-04-04T09:11:47+02:00 2012-04-04T09:11:47+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22923#p22923 <![CDATA[scripting only if changed]]> not exactly what you want but maybe a source of inspiration

CODE:

////////////////////////////////////////////////////////////////////////////////////////////// Pass If Chg Array create an array where only values that changed in array in will pass //// As it need 2 blocs &#40;one to check, one to store&#41; it relies on Process procedure         //// The callback will trig a counter. at bloc 0 it will compare new array with previously  //// stored one. At bloc 1 it will store the array to be compared next                      //// The values that didn't changed are those where substracting equal 0, will set          //// corresponding output length to 0, behaviour of passifChange in Usine                   //////////////////////////////////////////////////////////////////////////////////////////////const SIZE = 16;          // nb of out wanted = size of arrayconst PREFIX = 'OUT_';   // PEFIX for outputs names, folowed by Integer;var ArrayIn&#58; Tparameter;var OUTPUTS&#58; Array Of Tparameter;     // we will use an array of Tparameters, to allow N creations easilyvar i,l,count&#58; integer;               // we declare the variable we will use and their typevar valtmp&#58;    single;var ArrayLast&#58; Array of single;       // ArrayLast will be used to store array to check wich values changed on new in                                      // chg./////////////////////////////////////PROCEDURE INIT;BEGIN  ArrayIn &#58;=CreateParam&#40;'ArrayIn',PtArray&#41;; SetIsOutput&#40;ArrayIn,False&#41;; setMin&#40;arrayIn,0&#41;;setMax&#40;ArrayIn,127&#41;;   SetArrayLength&#40;OUTPUTS,SIZE&#41;;       // we set the arraylength to create N outputs of size defined by constant on top                                      // of script.   for i&#58;=0 to SIZE -1 do begin    OUTPUTS&#91;i&#93;&#58;= CreateParam&#40;PREFIX+IntToStr&#40;i&#41;,PtDataField&#41;; SetIsInput&#40;OUTPUTS&#91;i&#93;,false&#41;;    end;   // we create the outputs, names with the prefix followed by their corresponding nb. setArrayLength&#40;ArrayLast,SIZE&#41;;   //we set the memory array the same sizesetdontsave&#40;arrayIn,false&#41;;       // by doing this the arrayin can be saved to Pm or on quiting the patchEND;//INit//////////////////////////////PROCEDURE Callback&#40;N&#58;integer&#41;; BEGIN     if &#40;n=arrayIn&#41; then begin       l&#58;= getlength&#40;ArrayIn&#41;;       count&#58;=-1;                 // if detected arrayin chg, we trig the counter for process to start.     end;END;//callback//////////////////////////////PROCEDURE PROCESS;BEGIN if count >= -1 then begin        //start counting when callback has set count to -1   count&#58;=count+1;               // -1+1=0 so at first bloc count is 0   end;    if count = 0 then begin        // at first bloc we compare all values of new array with previous one.     for i&#58;=0 to l-1 do begin       if ArrayLast&#91;i&#93;-getDataArrayValue&#40;ArrayIn,i&#41;<>0 then begin   // if there is a difference that mean        valtmp&#58;= getDataArrayValue&#40;ArrayIn,i&#41;;                     //this value has changed           setLength&#40;OUTPUTS&#91;i&#93;,1&#41;;                         // we make a size 1 to activate data pass           setValue&#40;OUTPUTS&#91;i&#93;,valtmp&#41;;                    // and set the value with discovered one       end      else begin                                 // otherwise if no differences          setLength&#40;OUTPUTS&#91;i&#93;,0&#41;;              // we setLength of 0 = don't pass.       end;      end;      end;     if count = 1 then begin                // on next bloc we store the array to internal memory for next compare.       for i&#58;=0 to L-1 do begin           ArrayLast&#91;i&#93;&#58;=getdataArrayValue&#40;ArrayIn,i&#41;;                setLength&#40;OUTPUTS&#91;i&#93;,0&#41;;                // and make no values pass anymore.             end;      count&#58;=-2;                                      // and stop the counter as we reset it to -2      end; end;

Statistics: Posted by nay-seven — 04 Apr 2012, 09:11


]]>
2012-04-04T02:06:51+02:00 2012-04-04T02:06:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=22921#p22921 <![CDATA[scripting only if changed]]>
Thanks!!
-eric

Statistics: Posted by woodslanding — 04 Apr 2012, 02:06


]]>
2011-11-03T20:06:15+02:00 2011-11-03T20:06:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21763#p21763 <![CDATA[scripting only if changed]]>
The coeff to db is to retrieve the associated dB of a coeff (the inverse of the function above)

CODE:

coeffTodB&#40;0.5&#41; = -6coeffTodB&#40;0.25&#41; = -12...
Olivier:

I'm getting:

Undeclared Identifier

when I use the function coeffToDB(single)

Statistics: Posted by woodslanding — 03 Nov 2011, 19:06


]]>
2011-10-28T10:28:34+02:00 2011-10-28T10:28:34+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21717#p21717 <![CDATA[scripting only if changed]]>
Thanks so much!!!

Statistics: Posted by woodslanding — 28 Oct 2011, 10:28


]]>
2011-10-24T04:47:04+02:00 2011-10-24T04:47:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21688#p21688 <![CDATA[scripting only if changed]]> Statistics: Posted by woodslanding — 24 Oct 2011, 04:47


]]>
2011-10-22T12:07:35+02:00 2011-10-22T12:07:35+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21679#p21679 <![CDATA[scripting only if changed]]> Just a detail, to have a real NULL event set its size to -1 instead of 0, it's more general and efficient in Usine.

CODE:

setLength&#40;output,-1&#41;;
also the about the "Coeff to DB"

To change the volume of an audio flow, you can do a multiplication by a Coeff:

CODE:

-6 dB = mult by 0.5-12db = mult by 0.25...
The coeff to db is to retrieve the associated dB of a coeff (the inverse of the function above)

CODE:

coeffTodB&#40;0.5&#41; = -6coeffTodB&#40;0.25&#41; = -12...

Statistics: Posted by senso — 22 Oct 2011, 12:07


]]>
2011-10-22T01:00:59+02:00 2011-10-22T01:00:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21678#p21678 <![CDATA[scripting only if changed]]>
but then need to set back to size 1 if a float or arraysize for activating and setting values, and usually this imply that the callback trig a procedure, set sizes and values, trig a counter in process, and then in next process bloc (count+1) it will set back size to 0.
i have no clues for the db math thing sorry..

Statistics: Posted by 23fx23 — 22 Oct 2011, 01:00


]]>
2011-10-22T00:20:16+02:00 2011-10-22T00:20:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=3210&p=21677#p21677 <![CDATA[scripting only if changed]]>
Also, I'm wondering what the math is for COEFF->DB ??

Thanks for any tips,
-e

Statistics: Posted by woodslanding — 22 Oct 2011, 00:20


]]>