ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
Statistics: Posted by 23fx23 — 30 Oct 2017, 11:18 Statistics: Posted by oli_lab — 30 Oct 2017, 08:46
]]>
Maybe as a module or perhaps a script guru can make this?
or did I miss something ?
File uploaded: http://www.sensomusic.com/forums/upload ... change.pat
]]>
Statistics: Posted by 23fx23 — 30 Oct 2017, 01:32
Statistics: Posted by sephult — 30 Oct 2017, 00:53
Statistics: Posted by gurulogic — 28 Oct 2017, 20:31
Statistics: Posted by sephult — 28 Oct 2017, 02:55
Statistics: Posted by senso — 27 Oct 2017, 16:04
Statistics: Posted by 23fx23 — 04 Oct 2017, 07:49
Statistics: Posted by sm_jamieson — 04 Oct 2017, 01:12
Statistics: Posted by gurulogic — 03 Oct 2017, 11:12
CODE:
////////////////////////////////////////////////////////////////////////////////////////////// Pass If Chg Array //// HH3 FX23 03/10/17////////////////////////////////////////////////////////////////////////////////////////////const SIZE = 8; // nb of out wanted = size of arrayconst PREFIX = 'OUT_'; // PREFIX for outputs names, folowed by Integer;var ArrayIn: Tparameter;var OUTPUTS: Array Of Tparameter; var i, l, count: integer; var ArrayLast: Array of single; /////////////////////////////////////PROCEDURE INIT;BEGIN ArrayIn := CreateParam('ArrayIn',PtArray); SetIsOutput(ArrayIn,False); setMin(arrayIn,-Maxint); setMax(ArrayIn,maxint); SetArrayLength(OUTPUTS,SIZE); // we set the arraylength to create N outputs of size defined by constant on top // of script. for i:=0 to SIZE -1 do begin OUTPUTS[i]:= CreateParam(PREFIX+IntToStr(i),PtDataField); SetIsInput(OUTPUTS[i],false); end; setArrayLength(ArrayLast,SIZE); setdontsave(arrayIn,false); END;//INit //////////////////////////////PROCEDURE Callback(N:integer); BEGIN if (n=arrayIn) then begin l:= getlength(ArrayIn); count:=-1; end;END;//callback//////////////////////////////PROCEDURE PROCESS;var valin: single; BEGIN if count > -2 then begin //start counting when callback has set count to -1 inc(count) ; // -1+1=0 so at first bloc count is 0 end; if count < 2 then begin //for 2 blocs compare 2nd bloc to reset length to 0 if a value passe in first for i:=0 to l-1 do begin valin:= getDataArrayValue(ArrayIn,i); if (ArrayLast[i] - valin<>0) then begin setValue(OUTPUTS[i],valin); setLength(OUTPUTS[i],1); ArrayLast[i]:= valin; end else begin setLength(OUTPUTS[i],0); end; end; end; if count = 2 then begin count:=-2; end; end;Statistics: Posted by 23fx23 — 03 Oct 2017, 10:22
Statistics: Posted by gurulogic — 03 Oct 2017, 02:31
Statistics: Posted by 23fx23 — 30 Oct 2017, 11:18
Statistics: Posted by oli_lab — 30 Oct 2017, 08:46
Statistics: Posted by 23fx23 — 30 Oct 2017, 01:32
Statistics: Posted by sephult — 30 Oct 2017, 00:53
Statistics: Posted by gurulogic — 28 Oct 2017, 20:31
Statistics: Posted by sephult — 28 Oct 2017, 02:55
Statistics: Posted by senso — 27 Oct 2017, 16:04
Statistics: Posted by 23fx23 — 04 Oct 2017, 07:49
Statistics: Posted by sm_jamieson — 04 Oct 2017, 01:12
Statistics: Posted by gurulogic — 03 Oct 2017, 11:12
CODE:
////////////////////////////////////////////////////////////////////////////////////////////// Pass If Chg Array //// HH3 FX23 03/10/17////////////////////////////////////////////////////////////////////////////////////////////const SIZE = 8; // nb of out wanted = size of arrayconst PREFIX = 'OUT_'; // PREFIX for outputs names, folowed by Integer;var ArrayIn: Tparameter;var OUTPUTS: Array Of Tparameter; var i, l, count: integer; var ArrayLast: Array of single; /////////////////////////////////////PROCEDURE INIT;BEGIN ArrayIn := CreateParam('ArrayIn',PtArray); SetIsOutput(ArrayIn,False); setMin(arrayIn,-Maxint); setMax(ArrayIn,maxint); SetArrayLength(OUTPUTS,SIZE); // we set the arraylength to create N outputs of size defined by constant on top // of script. for i:=0 to SIZE -1 do begin OUTPUTS[i]:= CreateParam(PREFIX+IntToStr(i),PtDataField); SetIsInput(OUTPUTS[i],false); end; setArrayLength(ArrayLast,SIZE); setdontsave(arrayIn,false); END;//INit //////////////////////////////PROCEDURE Callback(N:integer); BEGIN if (n=arrayIn) then begin l:= getlength(ArrayIn); count:=-1; end;END;//callback//////////////////////////////PROCEDURE PROCESS;var valin: single; BEGIN if count > -2 then begin //start counting when callback has set count to -1 inc(count) ; // -1+1=0 so at first bloc count is 0 end; if count < 2 then begin //for 2 blocs compare 2nd bloc to reset length to 0 if a value passe in first for i:=0 to l-1 do begin valin:= getDataArrayValue(ArrayIn,i); if (ArrayLast[i] - valin<>0) then begin setValue(OUTPUTS[i],valin); setLength(OUTPUTS[i],1); ArrayLast[i]:= valin; end else begin setLength(OUTPUTS[i],0); end; end; end; if count = 2 then begin count:=-2; end; end;Statistics: Posted by 23fx23 — 03 Oct 2017, 10:22
Statistics: Posted by gurulogic — 03 Oct 2017, 02:31