Welcome to %s forums

BrainModular Users Forum

Login Register

preset manager

I need help on a Patch
Post Reply
Fléau
Member
Posts: 99
Contact:

Unread post by Fléau » 26 Apr 2013, 10:58

Hello,
i'm about to patch a preset manager,
i actually use a 1024 matrixcombobox with 10 vst
but it begin to be dirty and muddled.
my idea is to make someting like bigtick zen with more than 128 slot
zen webpage
i want to be able to sort preset by synth/instrument/genre.
for the moment i'm only thinking howto.
any idea are welcome.

i may have found a way to do it,
but the resulting listbox is a list of number (0 to x)
i'd like to sort the 1024 listbox and dynamically make a new one.

edit: if only i had a 'commatext to array' and an 'array to commatext'...

Fléau
Member
Posts: 99
Contact:

Unread post by Fléau » 26 Apr 2013, 13:10

i've found an old bSork's script that could do the job,
but i need some quick help from a script guru
this script output x textout
and i'd like to have a concatened commatext of each output.
could someone help me?

Code: Select all

(**************************************************************************************

  Gets a comma separated list and outputs ARR_SIZE text fields. 

  The selected list items (or rather their numbers) are stored in an array which is 
  saved by the Preset Manager and the Conductor.

  bSork, March 2009

***************************************************************************************)

CONST ARR_SIZE = 4; // Also update the ARR_SIZE constant module if this is changed.
CONST MAX_NUM = 1024; // This is the max number of elements in the list. Increase this
                    // when needed, or - with a shorter list - reduce the size to save 
                    // some CPU cycles.

VAR pUpd    : Tparameter;
VAR pList   : Tparameter;
VAR pNumArr : Tparameter;
VAR pNum    : Tparameter;

VAR pOut  : ARRAY OF Tparameter;

VAR i, j, len, num  : INTEGER;
VAR s, c, d, t      : STRING;
VAR list            : ARRAY OF STRING;

VAR withinQuotes, quote: BOOLEAN;

PROCEDURE init;
BEGIN  
  pUpd := CreateParam('update', ptButton); SetIsOutPut(pUpd, FALSE);
  pList := CreateParam('sep list in', ptTextField); SetIsOutput(pList, FALSE);
  pNumArr := CreateParam('selected elements', ptArray); SetIsOutput(pNumArr, FALSE);
  pNum := CreateParam('num elements', ptDataField); SetIsInput(pNum, FALSE);
  SetMin(pNum, 0); SetMax(pNum, 100); SetFormat(pNum, '%0.f');

  SetArrayLength(pOut, ARR_SIZE);

  FOR i := 0 TO (ARR_SIZE -1) DO BEGIN
     pOut[i] := CreateParam('text out ' + IntToStr(i + 1), ptTextField);
     SetIsInput(pOut[i], FALSE);
  END;

  SetArrayLength(list, MAX_NUM);

END;

// main
BEGIN
   IF &#40;GetValue&#40;pUpd&#41; <> 0&#41; THEN BEGIN
      withinQuotes &#58;= FALSE;
      quote &#58;= FALSE;
      num &#58;= 0;
      t &#58;= '';
      s &#58;= GetStringValue&#40;pList&#41;;
      len &#58;= Length&#40;s&#41;;
      //writeln&#40;s&#41;;
      FOR i &#58;= 1 TO len DO BEGIN
         c &#58;= Copy&#40;s, i, 1&#41;;

         IF &#40;i < len&#41; THEN BEGIN
            d &#58;= Copy&#40;s, i + 1, 1&#41;;
         END
         ELSE BEGIN
            d &#58;= 'TheEndIsNigh!!!!';
         END;

         IF &#40;&#40;c = '"'&#41; AND &#40;d = '"'&#41;&#41; THEN BEGIN
            quote &#58;= TRUE;
            t &#58;= t + c;
         END
         ELSE IF &#40;&#40;c = '"'&#41; AND quote&#41; THEN BEGIN
            quote &#58;= FALSE;
         END
         ELSE IF &#40;c = '"'&#41; THEN BEGIN
            withinQuotes &#58;= NOT &#40;withinQuotes&#41;;
         END
         ELSE BEGIN
            IF &#40;&#40;c = ','&#41; AND NOT withinQuotes&#41; THEN BEGIN
               list&#91;num&#93; &#58;= t;
               num &#58;= num + 1;
               t &#58;= '';
            END
            ELSE BEGIN
               t &#58;= t + c;
            END;
         END;
      END;
      IF &#40;Length&#40;t&#41; > 0&#41; THEN BEGIN
         list&#91;num&#93; &#58;= t;
         num &#58;= num + 1;
      END;        

      FOR i &#58;= num TO &#40;MAX_NUM - 1&#41; DO BEGIN
         list&#91;i&#93; &#58;= '';
      END;

      FOR i &#58;= 0 TO &#40;ARR_SIZE - 1&#41; DO BEGIN
         j &#58;= trunc&#40;GetDataArrayValue&#40;pNumArr, i&#41;&#41;;
         t &#58;= list&#91;j&#93;;
         SetStringValue&#40;pOut&#91;i&#93;, t&#41;;
      END;

      SetValue&#40;pUpd, 0&#41;;
      SetValue&#40;pNum, num&#41;;
   END;
END.

percuson
Member
Posts: 105
Location: Leipzig, Germany
Contact:

Unread post by percuson » 26 Apr 2013, 15:33

I think I should have these ( 'commatext to array' and an 'array to commatext') in my archive....
But what do you want the script to do exactly? Give me an example of the inputs and outputs, please!

Fléau
Member
Posts: 99
Contact:

Unread post by Fléau » 26 Apr 2013, 16:23

if this script was modified to one commatext ouput instead of multiout text, it would be perfect:
ideally: a listbox input, an array input and a list box output.
for example:
listbox input is:
a,b,c,d,e,f,g,h,i,j,etc
array input is:
0,1,3,6,8
result is:
a,b,d,g,i

with this it will be very easy to add 'tag' to each preset and filter them.

percuson
Member
Posts: 105
Location: Leipzig, Germany
Contact:

Unread post by percuson » 26 Apr 2013, 17:21

Hi!
I don't have such a script, but I didn't have enaough time to finish it...
S if you could wait for a couple of hours, I'll finish it, when I'm back home tonight!

Fléau
Member
Posts: 99
Contact:

Unread post by Fléau » 26 Apr 2013, 17:30

for sure,
take your time,
i'm only at the first stage: planning and thinking about the better solution.

percuson
Member
Posts: 105
Location: Leipzig, Germany
Contact:

Unread post by percuson » 26 Apr 2013, 18:32

Hi fléau!

I skipped some other things to finish it fast...

Skript: Select Commatext by Array

I hope, you'll be lucky with it!
And also that it really works...

Fléau
Member
Posts: 99
Contact:

Unread post by Fléau » 27 Apr 2013, 10:14

hi percuson,
it seems to work perfectly,
thank you!
i have tons of things to do until next week, so i will patch it slowly,
will keep you informed as soon as possible.

edit: the 'no selected items' function is great
i don't have to patch the 'no matches' function in case there is no preset corresponding to tags

percuson
Member
Posts: 105
Location: Leipzig, Germany
Contact:

Unread post by percuson » 27 Apr 2013, 12:24

... no problem...
Right now, my idea is to build a Markov chain Midi generator.
I also have to select items out of a ommatext. So I can use it also for myself...

Fléau
Member
Posts: 99
Contact:

Unread post by Fléau » 30 Apr 2013, 11:11

16.5M file, certainly due to the 64 preset manager:
http://www.sensomusic.com/forums/upload ... anager.pat

1st step:
open the patch
open a subpatch/vst slot
Image


2nd step:
open a vst and wire it like that:
Image


3rd step:
first time use of a vst
select your vst slot in the first left listbox
click the 'add' button
click the 'show vst' button
edit your vst
click the 'update' button
Image


add preset of different vst and tags,
now you can sort your preset by tag.

Fléau
Member
Posts: 99
Contact:

Unread post by Fléau » 30 Apr 2013, 15:50

heavy bug found and corrected,
new file uploaded

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests