CODE:
IF(2BarsHavePassedNow) THEN countNoOfBars:=countNoOfBars+2;Statistics: Posted by amiga909 — 21 Nov 2008, 20:45
Statistics: Posted by senso — 19 Nov 2008, 08:56
CODE:
///////////////////////////////////////////////////// DATA Delay // Like an audio delay but works with DATA flows//////////////////////////////////////////////////// parameters declarationvar input : Tparameter;var output : Tparameter;var delay : TParameter;const N_BLOC_DELAY = 1000;var TabDelay : array of Single;// initialisation : create parametersprocedure init;begin Input := CreateParam('in',ptDataField); Output := CreateParam('out',ptDataField); delay := CreateParam('delay',ptDataFader); SetIsInput(Output,false); SetIsOutPut(Input,false); SetIsOutPut(delay,false); SetFormat(delay,'%.0f'); SetMin(delay,0); SetMax(delay,BlocDuration*(N_BLOC_DELAY-2)); SetSymbol(delay,'ms'); SetValue(delay,100); SetScale(delay,lsLog); SetArraylength(TabDelay,N_BLOC_DELAY); SetLength(outPut,1); end;// Global variablesvar tmp : Single;var writepos : integer;var readpos : integer;//////////////////////////////// main proc//////////////////////////////begin readpos := (readpos+1) mod N_BLOC_DELAY; writepos := (readpos+Trunc(GetValue(delay)/Blocduration)) mod N_BLOC_DELAY; TabDelay [writePos] := GetValue(input); tmp := TabDelay[readPos]; SetValue(output,tmp); // set output value end.CODE:
SetMax(delay,BlocDuration*(N_BLOC_DELAY-2));CODE:
readpos := (readpos+1) mod N_BLOC_DELAY; writepos := (readpos+Trunc(GetValue(delay)/Blocduration)) mod N_BLOC_DELAY;Statistics: Posted by amiga909 — 18 Nov 2008, 15:44
CODE:
IF(2BarsHavePassedNow) THEN countNoOfBars:=countNoOfBars+2;Statistics: Posted by amiga909 — 21 Nov 2008, 20:45
Statistics: Posted by senso — 19 Nov 2008, 08:56
CODE:
///////////////////////////////////////////////////// DATA Delay // Like an audio delay but works with DATA flows//////////////////////////////////////////////////// parameters declarationvar input : Tparameter;var output : Tparameter;var delay : TParameter;const N_BLOC_DELAY = 1000;var TabDelay : array of Single;// initialisation : create parametersprocedure init;begin Input := CreateParam('in',ptDataField); Output := CreateParam('out',ptDataField); delay := CreateParam('delay',ptDataFader); SetIsInput(Output,false); SetIsOutPut(Input,false); SetIsOutPut(delay,false); SetFormat(delay,'%.0f'); SetMin(delay,0); SetMax(delay,BlocDuration*(N_BLOC_DELAY-2)); SetSymbol(delay,'ms'); SetValue(delay,100); SetScale(delay,lsLog); SetArraylength(TabDelay,N_BLOC_DELAY); SetLength(outPut,1); end;// Global variablesvar tmp : Single;var writepos : integer;var readpos : integer;//////////////////////////////// main proc//////////////////////////////begin readpos := (readpos+1) mod N_BLOC_DELAY; writepos := (readpos+Trunc(GetValue(delay)/Blocduration)) mod N_BLOC_DELAY; TabDelay [writePos] := GetValue(input); tmp := TabDelay[readPos]; SetValue(output,tmp); // set output value end.CODE:
SetMax(delay,BlocDuration*(N_BLOC_DELAY-2));CODE:
readpos := (readpos+1) mod N_BLOC_DELAY; writepos := (readpos+Trunc(GetValue(delay)/Blocduration)) mod N_BLOC_DELAY;Statistics: Posted by amiga909 — 18 Nov 2008, 15:44