ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
Statistics: Posted by oli_lab — 24 Oct 2016, 23:40
we need both !
]]>
Statistics: Posted by oli_lab — 24 Oct 2016, 11:02
Statistics: Posted by gurulogic — 24 Oct 2016, 06:43

Statistics: Posted by nay-seven — 19 Oct 2016, 08:46
CODE:
param := copy(param,CHAR_START, CHAR_START + NB_CHAR_MAX);CODE:
if Length(param) > NB_CHAR_MAX then begin param := copy(param,CHAR_START , minI(CHAR_START + NB_CHAR_MAX,Length(param))); end;Statistics: Posted by 23fx23 — 19 Oct 2016, 07:43
Statistics: Posted by gurulogic — 19 Oct 2016, 06:14
CODE:
/////////////////////////////////////////////// IML VST Scroller 23fx 17/10/16// Allow to scroll Vst params names and values// And passes them to items // VST and items should be in same patch // of the script, VST should be TAGGED// with 'VST ' tag bellow, and items// tag numbered from 0 to NB_ELEMENTS-1////////////////////////////////////////////const NB_ELEMENTS = 8; //how many items ie faders/knobsconst NB_CHAR_MAX = 8; // Max lengh of displayed namesconst MODE_MULTI = true; //set false if only one vst in same patch, true // for multi vst spread accross different patchsconst msg_VST_TAG = 'VST '; //vst header tag followed by space const msg_SET_PATCH = 'SET_TARGET_PATCH SENDER_PATCH'; const msg_SET_STRING = 'SET_STRING_VALUE '; const msg_GET_VALUE = 'GET_VALUE '; const msg_SET_VALUE = 'SET_VALUE '; const max_count_scroll = 200; const max_count_set = 200; //when scrolling iml get VST values and sets item values //that items values get back to script via array // normally we want when modifying items to // send values back to vst // so there is a wait time when scrolling //to avoid msgs loops overflows being constantly send back //idem when we set a value, params array in feedback //this means high amount of message we stop while we set // increase if observing feedback, decrease for less wait // parameters declaration var pParamsArray : Tparameter;var pCommaIn : Tparameter; var pscroll : Tparameter; var parray : Tparameter;var pNB_params : Tparameter; var pMax_Scroll : Tparameter; var pMax_Pages : Tparameter; var pCounting_Scroll: Tparameter;var pCounting_Set: Tparameter; var pIML: Tparameter; //var output : array [0..NB_ELEMENTS] of Tparameter;var sl1 : TStringList; //var mess : string; var scroll : integer; var count_scroll : integer; var counting_scroll : boolean; var count_set : integer; var counting_set : boolean; var nb_params : integer; var param : string; var msg_iml: string; var i ,iscroll, id, idscroll: integer; var in_val, mem_val ,idval: single; var array_mem : array [0..NB_ELEMENTS] of single; // destroyprocedure Destroy;begin sl1.free;end; ///////////////////////////////////////////////////////// // initialisation : create parametersprocedure init;var i : integer;begin SetModuleColor($909090); pParamsArray := CreateParam('params array',ptArray); SetIsOutput(pParamsArray,false); SetFastCallBack(pParamsArray, false); pCommaIn := CreateParam('params names',ptTextField); SetIsOutPut(pCommaIn,false); SetFastCallBack(pCommaIn , false); pscroll := CreateParam('scroll',ptDataField); SetIsOutPut(pscroll,false); SetFastCallBack(pscroll, false); parray := CreateParam('items array',ptArray); SetIsOutput(parray,false); setlength(parray,NB_ELEMENTS); SetFastCallBack(parray , false); pNB_params := CreateParam('nb of params',ptDataField); SetIsInPut(pNB_params,false); pMax_Scroll := CreateParam('max scroll',ptDataField); SetIsInPut(pMax_Scroll,false); pMax_Pages := CreateParam('max pages',ptDataField); SetIsInPut(pMax_Pages,false); pCounting_Set:= CreateParam('VST feedback blocked',ptSwitch); SetIsInPut(pCounting_Set,false); pCounting_Scroll:= CreateParam('User feedback blocked',ptSwitch); SetIsInPut(pCounting_Scroll,false); pIML:= CreateParam('IML_message',ptTextField); SetIsInPut(pIML,false); count_scroll:= -1; count_set:= -1; counting_scroll := FALSE; counting_set := FALSE; Sl1.Create; Sl1.SetCommaText(GetStringValue(pCommaIn)); nb_params := Sl1.count; SetValue(pNB_params,nb_params); SetValue(pMax_Scroll,nb_params-NB_ELEMENTS); SetValue(pMax_Pages, nb_params div NB_ELEMENTS); end;///INIT /////////////////////////////////// Procedure SEND_NAMES_TO_ITEMS;begin For i := 0 to NB_ELEMENTS-1 do begin iscroll:=i+scroll; if (iscroll<nb_params) then begin param := SL1.GetStrings(iscroll); if Length(param) > NB_CHAR_MAX then begin param := copy(param,0,NB_CHAR_MAX); end; end else begin param := '_'; end; msg_iml := +msg_SET_STRING + inttostr(i) + ' CAPTION '+ ''''+param+''''; SendUsineMsg (msg_iml); //name apply end;//loopend; ///////////////////////////////////////////// Procedure SEND_VALUES_TO_ITEMS; var temp : single;begin For i := 0 to NB_ELEMENTS-1 do begin iscroll:=i+scroll; if (iscroll<nb_params) then begin param := SL1.GetStrings(iscroll); //method A gets from VST to temp var and send back to item // but use 2x more iml messages so prob higher cpu // msg_iml := msg_GET_VALUE + msg_VST_TAG + param + ' "PARAM_VALUE"'; // SendUsineMsg (msg_iml); //get from vst to temp var // msg_iml := msg_SET_VALUE + inttostr(i) + ' 1 '+ '"PARAM_VALUE"'; // SendUsineMsg (msg_iml); // send temp var to item //method B picks directly from params array float temp := GetDataArrayValue(pParamsArray,iscroll); msg_iml := msg_SET_VALUE + inttostr(i) + ' 1 '+ floattostr(temp); SendUsineMsg (msg_iml); // send temp var to item end else begin msg_iml := msg_SET_VALUE + inttostr(i) + ' 1 '+ '0'; SendUsineMsg (msg_iml); //send 0 if out of range end; end; //loop end;///////////////////////////////Procedure IMPORT_COMMA_TEXT;begin Sl1.SetCommaText(GetStringValue(pCommaIn)); nb_params := Sl1.count; SetValue(pNB_params,nb_params); SetValue(pMax_Scroll,nb_params-NB_ELEMENTS); SetValue(pMax_Pages, nb_params div NB_ELEMENTS); end; //////////////////////////////////////Procedure SEND_VALUE_TO_VST;begin if (idscroll < nb_params) then begin if(MODE_MULTI) then begin msg_iml := msg_SET_PATCH + ',' + '"'+ msg_SET_VALUE + msg_VST_TAG + '''' +SL1.GetStrings(idscroll)+ ''''+ ' '+ floattostr(idval) +'"'; SetStringValue(pIML,msg_iml); end else begin SendUsineMsg (msg_SET_PATCH); msg_iml := msg_SET_VALUE + msg_VST_TAG + '''' +SL1.GetStrings(idscroll)+ ''''+ ' '+ floattostr(idval); SendUsineMsg (msg_iml); end; end; end;/////////////////////////////////////////////////////////////////////////// procedure Callback(n:integer);begin if(n=pCommaIn) then begin IMPORT_COMMA_TEXT; SEND_NAMES_TO_ITEMS; end; if( (n= parray) AND (not counting_scroll))then begin count_set :=0; //while we set we don't want params array in feedback For i := 0 to NB_ELEMENTS-1 do begin in_val := GetDataArrayValue(parray,i); mem_val := array_mem[i]; if (mem_val - in_val <> 0) then begin id := i; idval := in_val; end; array_mem[i] := getDataArrayValue(parray,i); end; //loop idscroll := id + scroll; SEND_VALUE_TO_VST; end; if (n = pscroll) then begin count_scroll := 0; SendUsineMsg (msg_SET_PATCH); scroll := trunc(GetValue(pscroll)); (SEND_NAMES_TO_ITEMS); (SEND_VALUES_TO_ITEMS); end; if(n=pParamsArray) AND (not counting_set)then begin count_scroll := 0; (SEND_VALUES_TO_ITEMS); end; end; ////Callback // strace(GetStringValue(outPut)); /////////////////////////////////////////////// Procedure Process;begin if (count_scroll >-1) then begin count_scroll := count_scroll+1; counting_scroll := true; if (count_scroll >max_count_scroll) then begin count_scroll :=-1; counting_scroll := false; end; SetValue(pCounting_Scroll,count_scroll); end; if (count_set >-1) then begin count_set := count_set+1; counting_set := true; if (count_set >max_count_set) then begin count_set :=-1; counting_set := false; end; SetValue(pCounting_Set,count_set); end; end; //PROC //////////////////////////////////////////////////// // no process blocStatistics: Posted by 23fx23 — 19 Oct 2016, 00:37
CODE:
////////////////////////////// set a max char length for comma text elements////////////////////////////const MAX_LEN = 8; //max displayed chars per itemVar Commain,Commaout : tparameter;Var SL1: Tstringlist; ////////////////////////////// Procedure Init; Begin commain:= CreateParam('comma in',Pttextfield);Setisoutput(commain,false); commaout:= CreateParam('comma out',Pttextfield);Setisinput(commaout,false); SL1.Create; SetModuleColor($909090);END; // destroyprocedure Destroy;begin sl1.free;end; ///////////////////////////////////////////////////////////Procedure Callback (n:integer); Var i, L, Litem :integer; Var item : string; BEGIN SL1.setcommatext(getstringvalue(COMMAIN)); L := SL1.Getcount; for i:= 0 to L -1 do begin item := SL1.GetStrings(i); Litem:= Length(item); if Litem > MAX_LEN then begin item := copy(item,0,MAX_LEN); SL1.setstrings(i,item); end; end; SetStringValue(commaout,SL1.Getcommatext); END; /////////////////////////////////////Statistics: Posted by 23fx23 — 18 Oct 2016, 23:48
Statistics: Posted by sephult — 17 Oct 2016, 12:32
Statistics: Posted by nay-seven — 17 Oct 2016, 11:06
Statistics: Posted by nay-seven — 17 Oct 2016, 10:43
Statistics: Posted by gurulogic — 17 Oct 2016, 10:35
Statistics: Posted by gurulogic — 17 Oct 2016, 07:18


Statistics: Posted by 23fx23 — 17 Oct 2016, 04:32
Statistics: Posted by nay-seven — 16 Oct 2016, 23:35
Statistics: Posted by 23fx23 — 16 Oct 2016, 22:15

Statistics: Posted by gurulogic — 16 Oct 2016, 21:31
Statistics: Posted by 23fx23 — 16 Oct 2016, 16:26
Statistics: Posted by nay-seven — 16 Oct 2016, 13:56
Statistics: Posted by 23fx23 — 16 Oct 2016, 04:39

Statistics: Posted by 23fx23 — 16 Oct 2016, 04:22
Statistics: Posted by oli_lab — 24 Oct 2016, 23:40
Statistics: Posted by oli_lab — 24 Oct 2016, 11:02
Statistics: Posted by gurulogic — 24 Oct 2016, 06:43

Statistics: Posted by nay-seven — 19 Oct 2016, 08:46
CODE:
param := copy(param,CHAR_START, CHAR_START + NB_CHAR_MAX);CODE:
if Length(param) > NB_CHAR_MAX then begin param := copy(param,CHAR_START , minI(CHAR_START + NB_CHAR_MAX,Length(param))); end;Statistics: Posted by 23fx23 — 19 Oct 2016, 07:43
Statistics: Posted by gurulogic — 19 Oct 2016, 06:14
CODE:
/////////////////////////////////////////////// IML VST Scroller 23fx 17/10/16// Allow to scroll Vst params names and values// And passes them to items // VST and items should be in same patch // of the script, VST should be TAGGED// with 'VST ' tag bellow, and items// tag numbered from 0 to NB_ELEMENTS-1////////////////////////////////////////////const NB_ELEMENTS = 8; //how many items ie faders/knobsconst NB_CHAR_MAX = 8; // Max lengh of displayed namesconst MODE_MULTI = true; //set false if only one vst in same patch, true // for multi vst spread accross different patchsconst msg_VST_TAG = 'VST '; //vst header tag followed by space const msg_SET_PATCH = 'SET_TARGET_PATCH SENDER_PATCH'; const msg_SET_STRING = 'SET_STRING_VALUE '; const msg_GET_VALUE = 'GET_VALUE '; const msg_SET_VALUE = 'SET_VALUE '; const max_count_scroll = 200; const max_count_set = 200; //when scrolling iml get VST values and sets item values //that items values get back to script via array // normally we want when modifying items to // send values back to vst // so there is a wait time when scrolling //to avoid msgs loops overflows being constantly send back //idem when we set a value, params array in feedback //this means high amount of message we stop while we set // increase if observing feedback, decrease for less wait // parameters declaration var pParamsArray : Tparameter;var pCommaIn : Tparameter; var pscroll : Tparameter; var parray : Tparameter;var pNB_params : Tparameter; var pMax_Scroll : Tparameter; var pMax_Pages : Tparameter; var pCounting_Scroll: Tparameter;var pCounting_Set: Tparameter; var pIML: Tparameter; //var output : array [0..NB_ELEMENTS] of Tparameter;var sl1 : TStringList; //var mess : string; var scroll : integer; var count_scroll : integer; var counting_scroll : boolean; var count_set : integer; var counting_set : boolean; var nb_params : integer; var param : string; var msg_iml: string; var i ,iscroll, id, idscroll: integer; var in_val, mem_val ,idval: single; var array_mem : array [0..NB_ELEMENTS] of single; // destroyprocedure Destroy;begin sl1.free;end; ///////////////////////////////////////////////////////// // initialisation : create parametersprocedure init;var i : integer;begin SetModuleColor($909090); pParamsArray := CreateParam('params array',ptArray); SetIsOutput(pParamsArray,false); SetFastCallBack(pParamsArray, false); pCommaIn := CreateParam('params names',ptTextField); SetIsOutPut(pCommaIn,false); SetFastCallBack(pCommaIn , false); pscroll := CreateParam('scroll',ptDataField); SetIsOutPut(pscroll,false); SetFastCallBack(pscroll, false); parray := CreateParam('items array',ptArray); SetIsOutput(parray,false); setlength(parray,NB_ELEMENTS); SetFastCallBack(parray , false); pNB_params := CreateParam('nb of params',ptDataField); SetIsInPut(pNB_params,false); pMax_Scroll := CreateParam('max scroll',ptDataField); SetIsInPut(pMax_Scroll,false); pMax_Pages := CreateParam('max pages',ptDataField); SetIsInPut(pMax_Pages,false); pCounting_Set:= CreateParam('VST feedback blocked',ptSwitch); SetIsInPut(pCounting_Set,false); pCounting_Scroll:= CreateParam('User feedback blocked',ptSwitch); SetIsInPut(pCounting_Scroll,false); pIML:= CreateParam('IML_message',ptTextField); SetIsInPut(pIML,false); count_scroll:= -1; count_set:= -1; counting_scroll := FALSE; counting_set := FALSE; Sl1.Create; Sl1.SetCommaText(GetStringValue(pCommaIn)); nb_params := Sl1.count; SetValue(pNB_params,nb_params); SetValue(pMax_Scroll,nb_params-NB_ELEMENTS); SetValue(pMax_Pages, nb_params div NB_ELEMENTS); end;///INIT /////////////////////////////////// Procedure SEND_NAMES_TO_ITEMS;begin For i := 0 to NB_ELEMENTS-1 do begin iscroll:=i+scroll; if (iscroll<nb_params) then begin param := SL1.GetStrings(iscroll); if Length(param) > NB_CHAR_MAX then begin param := copy(param,0,NB_CHAR_MAX); end; end else begin param := '_'; end; msg_iml := +msg_SET_STRING + inttostr(i) + ' CAPTION '+ ''''+param+''''; SendUsineMsg (msg_iml); //name apply end;//loopend; ///////////////////////////////////////////// Procedure SEND_VALUES_TO_ITEMS; var temp : single;begin For i := 0 to NB_ELEMENTS-1 do begin iscroll:=i+scroll; if (iscroll<nb_params) then begin param := SL1.GetStrings(iscroll); //method A gets from VST to temp var and send back to item // but use 2x more iml messages so prob higher cpu // msg_iml := msg_GET_VALUE + msg_VST_TAG + param + ' "PARAM_VALUE"'; // SendUsineMsg (msg_iml); //get from vst to temp var // msg_iml := msg_SET_VALUE + inttostr(i) + ' 1 '+ '"PARAM_VALUE"'; // SendUsineMsg (msg_iml); // send temp var to item //method B picks directly from params array float temp := GetDataArrayValue(pParamsArray,iscroll); msg_iml := msg_SET_VALUE + inttostr(i) + ' 1 '+ floattostr(temp); SendUsineMsg (msg_iml); // send temp var to item end else begin msg_iml := msg_SET_VALUE + inttostr(i) + ' 1 '+ '0'; SendUsineMsg (msg_iml); //send 0 if out of range end; end; //loop end;///////////////////////////////Procedure IMPORT_COMMA_TEXT;begin Sl1.SetCommaText(GetStringValue(pCommaIn)); nb_params := Sl1.count; SetValue(pNB_params,nb_params); SetValue(pMax_Scroll,nb_params-NB_ELEMENTS); SetValue(pMax_Pages, nb_params div NB_ELEMENTS); end; //////////////////////////////////////Procedure SEND_VALUE_TO_VST;begin if (idscroll < nb_params) then begin if(MODE_MULTI) then begin msg_iml := msg_SET_PATCH + ',' + '"'+ msg_SET_VALUE + msg_VST_TAG + '''' +SL1.GetStrings(idscroll)+ ''''+ ' '+ floattostr(idval) +'"'; SetStringValue(pIML,msg_iml); end else begin SendUsineMsg (msg_SET_PATCH); msg_iml := msg_SET_VALUE + msg_VST_TAG + '''' +SL1.GetStrings(idscroll)+ ''''+ ' '+ floattostr(idval); SendUsineMsg (msg_iml); end; end; end;/////////////////////////////////////////////////////////////////////////// procedure Callback(n:integer);begin if(n=pCommaIn) then begin IMPORT_COMMA_TEXT; SEND_NAMES_TO_ITEMS; end; if( (n= parray) AND (not counting_scroll))then begin count_set :=0; //while we set we don't want params array in feedback For i := 0 to NB_ELEMENTS-1 do begin in_val := GetDataArrayValue(parray,i); mem_val := array_mem[i]; if (mem_val - in_val <> 0) then begin id := i; idval := in_val; end; array_mem[i] := getDataArrayValue(parray,i); end; //loop idscroll := id + scroll; SEND_VALUE_TO_VST; end; if (n = pscroll) then begin count_scroll := 0; SendUsineMsg (msg_SET_PATCH); scroll := trunc(GetValue(pscroll)); (SEND_NAMES_TO_ITEMS); (SEND_VALUES_TO_ITEMS); end; if(n=pParamsArray) AND (not counting_set)then begin count_scroll := 0; (SEND_VALUES_TO_ITEMS); end; end; ////Callback // strace(GetStringValue(outPut)); /////////////////////////////////////////////// Procedure Process;begin if (count_scroll >-1) then begin count_scroll := count_scroll+1; counting_scroll := true; if (count_scroll >max_count_scroll) then begin count_scroll :=-1; counting_scroll := false; end; SetValue(pCounting_Scroll,count_scroll); end; if (count_set >-1) then begin count_set := count_set+1; counting_set := true; if (count_set >max_count_set) then begin count_set :=-1; counting_set := false; end; SetValue(pCounting_Set,count_set); end; end; //PROC //////////////////////////////////////////////////// // no process blocStatistics: Posted by 23fx23 — 19 Oct 2016, 00:37
CODE:
////////////////////////////// set a max char length for comma text elements////////////////////////////const MAX_LEN = 8; //max displayed chars per itemVar Commain,Commaout : tparameter;Var SL1: Tstringlist; ////////////////////////////// Procedure Init; Begin commain:= CreateParam('comma in',Pttextfield);Setisoutput(commain,false); commaout:= CreateParam('comma out',Pttextfield);Setisinput(commaout,false); SL1.Create; SetModuleColor($909090);END; // destroyprocedure Destroy;begin sl1.free;end; ///////////////////////////////////////////////////////////Procedure Callback (n:integer); Var i, L, Litem :integer; Var item : string; BEGIN SL1.setcommatext(getstringvalue(COMMAIN)); L := SL1.Getcount; for i:= 0 to L -1 do begin item := SL1.GetStrings(i); Litem:= Length(item); if Litem > MAX_LEN then begin item := copy(item,0,MAX_LEN); SL1.setstrings(i,item); end; end; SetStringValue(commaout,SL1.Getcommatext); END; /////////////////////////////////////Statistics: Posted by 23fx23 — 18 Oct 2016, 23:48
Statistics: Posted by sephult — 17 Oct 2016, 12:32
Statistics: Posted by nay-seven — 17 Oct 2016, 11:06
Statistics: Posted by nay-seven — 17 Oct 2016, 10:43
Statistics: Posted by gurulogic — 17 Oct 2016, 10:35
Statistics: Posted by gurulogic — 17 Oct 2016, 07:18


Statistics: Posted by 23fx23 — 17 Oct 2016, 04:32
Statistics: Posted by nay-seven — 16 Oct 2016, 23:35
Statistics: Posted by 23fx23 — 16 Oct 2016, 22:15

Statistics: Posted by gurulogic — 16 Oct 2016, 21:31
Statistics: Posted by 23fx23 — 16 Oct 2016, 16:26
Statistics: Posted by nay-seven — 16 Oct 2016, 13:56
Statistics: Posted by 23fx23 — 16 Oct 2016, 04:39

Statistics: Posted by 23fx23 — 16 Oct 2016, 04:22