a request for script gurus
- nay-seven
- Site Admin
- Posts: 5684
- Location: rennes France
- Contact:
was wondering if it's possible to have a generic script for the matrix module
i imagine some listbox inlets for example named
switches
button
switch group 1
switch group2..
where you enter a list of number to specify the cells function
this way we can say cells 10,11,12,13,14 are a group of switches
cells 15 & 16 are buttons and so...
do you think it's possible..?
i imagine some listbox inlets for example named
switches
button
switch group 1
switch group2..
where you enter a list of number to specify the cells function
this way we can say cells 10,11,12,13,14 are a group of switches
cells 15 & 16 are buttons and so...
do you think it's possible..?
- nay-seven
- Site Admin
- Posts: 5684
- Location: rennes France
- Contact:
here an example to illustrate :
here a matrix recorder where the last row have different functions
some like rec, over,pause must be switches , clear have to be a button, and last 1,2,3,,4..are different pattern so must be a group of switches..

here a matrix recorder where the last row have different functions
some like rec, over,pause must be switches , clear have to be a button, and last 1,2,3,,4..are different pattern so must be a group of switches..

-
23fx23
- Member
- Posts: 2548
mm seems doable i can try to have a look.
i wonder if a system to configure directly via a menu wouldn't be more easy for user.
ie we enable a 'configure' swich. then we choose button and clic all the cells that must be a button, then leave configure.
then do same for swiches and group swich. i just wonder how to deal multiples group. but i will try with only one group first..
i wonder if a system to configure directly via a menu wouldn't be more easy for user.
ie we enable a 'configure' swich. then we choose button and clic all the cells that must be a button, then leave configure.
then do same for swiches and group swich. i just wonder how to deal multiples group. but i will try with only one group first..
- nay-seven
- Site Admin
- Posts: 5684
- Location: rennes France
- Contact:
cool, and yeah, the listbox is just an idea
-
23fx23
- Member
- Posts: 2548
Code: Select all
//////////////////////////
// MX_MULTIMODES_ 23fx15/05/2K11
// allow to configure cells to act as
// momentary/toggle swich or group swiches
/////////////////////////
// parameters declaration
var Config,MXsize:tparameter;
var Ctype:tparameter;
var arrayout,MEMtypes:tparameter;
var IDclic:tparameter;
var Msdwn:tparameter;
var L, cty,ID: integer;
var msd,cfg:boolean;
// initialisation : create parameters
procedure init;
begin
MXsize:=createParam('Mxsize',ptdatafield);
setisoutput(Mxsize,false);
Config:=createParam('config',ptswitch);
setisoutput(config,false);
ctype:=createParam('ctype',ptListBox);
SetListBoxString(ctype,'button,swich,G1,G2,G3,G4,G5,G6,G7,G8');
setisoutput(ctype,false);
idclic:=createParam('idclic',ptdatafield);
setisoutput(idclic,false);
msdwn:=createParam('msdwn',ptdatafield);
setisoutput(msdwn,false);
arrayout:=createParam('arrayout',Ptarray);
setisinput(Arrayout,false);
MemTypes:=createParam('Memtypes',Ptarray);
setisinput(Memtypes,false);setdontsave(memtypes,false);
id:=0;
msd:=false;
cfg:=false;
end;
// Callback procedure
Procedure Callback(N:integer);
begin
if (n=mxsize) then resize;
if (n=config) then begin
cfg:=getvalue(config)=1;
end;
if (n=idclic) then begin
if getvalue(idclic)>-1 then begin
ID:= trunc(getvalue(idclic));
end;
end;
if (n=msdwn) then begin
MSD:=getvalue(msdwn)=1;
if MSD then begin
//resize;
if CFG then begin
setdataarrayvalue(memtypes,ID,getvalue(ctype));
end;
cty:= trunc(getdataarrayvalue(memtypes,ID));
itrace(cty);
end;//msd
U_CELLS(cty);
end;//msdwn
end;
////////////////////////////
Procedure U_CELLS(mode : integer);
var i:integer;
begin
if mode=0 then begin //button,mmt mode
setdataarrayvalue(arrayout,ID,getvalue(msdwn));
end;
if (mode=1) and (MSD) then begin
setdataarrayvalue(arrayout,ID,1-getdataarrayvalue(arrayout,ID));
end;
if mode>=2 then begin
for i:=0 to L-1 do begin
if getdataarrayvalue(memtypes,i)=mode then begin
setdataarrayvalue(arrayout,i,0);
end;
end;
setdataarrayvalue(arrayout,id,1);
end;
end;
/////////////////////////
Procedure RESIZE;
begin
L:=trunc(getvalue(Mxsize));
setlength(arrayout,L);
setlength(memtypes,L);
end;
//////////////////////////MultiModes_MX
when you enable configure, you can choose a type in combobox (button,switch, or one of 8 group)
then clic the cells you want to behave like this. once done swich of configure.
edit: i forgot, you can delet the line itrace(cty); and make reload script.
the cells type should normally be memorized and you can use preset manager to recall to different layouts.
- nay-seven
- Site Admin
- Posts: 5684
- Location: rennes France
- Contact:
whaoo! so fast crazy boy !
works perfectly , now i've some incompatibility with my visual feedback mode but maybe there's some workaround
will let you know
And i thinks this could be a cool script for many uses and to quickly build patches
Many Thanks !!!
works perfectly , now i've some incompatibility with my visual feedback mode but maybe there's some workaround
will let you know
And i thinks this could be a cool script for many uses and to quickly build patches
Many Thanks !!!
-
23fx23
- Member
- Posts: 2548
cool, yup it will be helpful for me too
. btween it's not the ultimate optimized code for very big matrix, but was much easier
to code like this than tracking and incrementing size of groups, and cpu seems fairly descent like this so...ive chosen the lasy way
let me know if you got pbs with your feedback mode, maybe you need some arrayin to feed the script or i don't know?
(if so you can try to deploy the script so that array out pin is visible on input, and feed your stuff maybe..
happy it's helpuf for ya nay'
to code like this than tracking and incrementing size of groups, and cpu seems fairly descent like this so...ive chosen the lasy way
let me know if you got pbs with your feedback mode, maybe you need some arrayin to feed the script or i don't know?
(if so you can try to deploy the script so that array out pin is visible on input, and feed your stuff maybe..
happy it's helpuf for ya nay'
- nay-seven
- Site Admin
- Posts: 5684
- Location: rennes France
- Contact:
me again,
seems that the state of the cells are not memorized by a preset manager...?
seems that the state of the cells are not memorized by a preset manager...?
-
23fx23
- Member
- Posts: 2548
mm oh yup, forgot that. try this one:
or if you already made assign and don't wanna loose them, add the line in init after arrayout creation:
setdontsave(arrayout,false); then make 'reload script'
Code: Select all
//////////////////////////
// MX_MULTIMODES_ 23fx15/05/2K11
// allow to configure cells to act as
// momentary/toggle swich or group swiches
/////////////////////////
// parameters declaration
var Config,MXsize:tparameter;
var Ctype:tparameter;
var arrayout,MEMtypes:tparameter;
var IDclic:tparameter;
var Msdwn:tparameter;
var L, cty,ID: integer;
var msd,cfg:boolean;
// initialisation : create parameters
procedure init;
begin
MXsize:=createParam('Mxsize',ptdatafield);
setisoutput(Mxsize,false);
Config:=createParam('config',ptswitch);
setisoutput(config,false);
ctype:=createParam('ctype',ptListBox);
SetListBoxString(ctype,'button,swich,G1,G2,G3,G4,G5,G6,G7,G8');
setisoutput(ctype,false);
idclic:=createParam('idclic',ptdatafield);
setisoutput(idclic,false);
msdwn:=createParam('msdwn',ptdatafield);
setisoutput(msdwn,false);
arrayout:=createParam('arrayout',Ptarray);
setisinput(Arrayout,false);setdontsave(arrayout,false);
MemTypes:=createParam('Memtypes',Ptarray);
setisinput(Memtypes,false);setdontsave(memtypes,false);
id:=0;
msd:=false;
cfg:=false;
end;
// Callback procedure
Procedure Callback(N:integer);
begin
if (n=mxsize) then resize;
if (n=config) then begin
cfg:=getvalue(config)=1;
end;
if (n=idclic) then begin
if getvalue(idclic)>-1 then begin
ID:= trunc(getvalue(idclic));
end;
end;
if (n=msdwn) then begin
MSD:=getvalue(msdwn)=1;
if MSD then begin
//resize;
if CFG then begin
setdataarrayvalue(memtypes,ID,getvalue(ctype));
end;
cty:= trunc(getdataarrayvalue(memtypes,ID));
end;//msd
U_CELLS(cty);
end;//msdwn
end;
////////////////////////////
Procedure U_CELLS(mode : integer);
var i:integer;
begin
if mode=0 then begin //button,mmt mode
setdataarrayvalue(arrayout,ID,getvalue(msdwn));
end;
if (mode=1) and (MSD) then begin
setdataarrayvalue(arrayout,ID,1-getdataarrayvalue(arrayout,ID));
end;
if mode>=2 then begin
for i:=0 to L-1 do begin
if getdataarrayvalue(memtypes,i)=mode then begin
setdataarrayvalue(arrayout,i,0);
end;
end;
setdataarrayvalue(arrayout,id,1);
end;
end;
/////////////////////////
Procedure RESIZE;
begin
L:=trunc(getvalue(Mxsize));
setlength(arrayout,L);
setlength(memtypes,L);
end;
//////////////////////////setdontsave(arrayout,false); then make 'reload script'
- nay-seven
- Site Admin
- Posts: 5684
- Location: rennes France
- Contact:
great !
works fine
thanks again
works fine
thanks again
