ArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2010-11-14T23:58:12+02:00 https://brainmodular.com/forums/app.php/feed/topic/2555 2010-11-14T23:58:12+02:00 2010-11-14T23:58:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16928#p16928 <![CDATA[un-concal list...]]>
Thank for explication.

I try to unproved the script with an supplementary inlet for choose the number active of out (maybe can i patch that more easily) and a random determination of N elements in one list.

Statistics: Posted by multiphone — 14 Nov 2010, 22:58


]]>
2010-11-14T19:51:23+02:00 2010-11-14T19:51:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16927#p16927 <![CDATA[un-concal list...]]>

once you catched the in/out creation, more explained in the 'basics scripts' section in wiki,
the only thing to catch is Tstringlist, it's kind of delphi object that can pick a commatext, and let acces the individual
elements via indexes in it's internal memory. the script just reassingn elements to same output nb.
it just need a protection to assign only if an element exists,, via checking if index (i) is within the total number of elements
given by the SL1.count , otherwise it sets a blank name ''.

hope it helps.

Statistics: Posted by 23fx23 — 14 Nov 2010, 18:51


]]>
2010-11-14T12:16:08+02:00 2010-11-14T12:16:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16924#p16924 <![CDATA[un-concal list...]]>
Very nice !

Thanks for efficiency.

I look your code deeper.

Statistics: Posted by multiphone — 14 Nov 2010, 11:16


]]>
2010-11-13T21:56:05+02:00 2010-11-13T21:56:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16919#p16919 <![CDATA[un-concal list...]]>

here is the equivalent with tstringlist.

CODE:

  /////////////////////////////////////////////// Spread CommaText Elmts to individual outs////////////////////////////////////////////Const NB_ELMTS = 8;   // adjust for nb of output wanted////////////////////////////// parameters declarationvar CommaIN   &#58; Tparameter;var outputs   &#58; Array of Tparameter;var sl1       &#58; TStringList;var i         &#58; integer;/////////////////////////procedure Destroy;begin   sl1.free;end;////////////////////////////procedure init;begin   CommaIN &#58;= CreateParam&#40;'Comma_In',ptTextField&#41;; SetIsOutPut&#40;CommaIN,false&#41;;setArrayLength&#40;OUTPUTS,NB_ELMTS&#41;;  for i&#58;=0 to NB_ELMTS -1 do begin      outputs&#91;i&#93; &#58;= CreateParam&#40;'out'+ intToStr&#40;i&#41;,ptTextField&#41;;      SetIsInPut&#40;Outputs&#91;i&#93;,false&#41;;   end; Sl1 &#58;= TStringList.Create; end;//////////////////////////////////////////procedure Callback&#40;n&#58;integer&#41;;begin if &#40;n=commaIn&#41; then begin  SL1.commatext&#58;= getStringValue&#40;CommaIN&#41;;       for i&#58;= 0 to NB_ELMTS -1 do begin         if i < SL1.count then begin           setStringValue&#40;outputs&#91;i&#93;,Sl1.strings&#91;i&#93;&#41;;         end else begin           setStringValue&#40;outputs&#91;i&#93;,''&#41;;          end;       end;   end;end;//////////////////////////////////////////////

Statistics: Posted by 23fx23 — 13 Nov 2010, 20:56


]]>
2010-11-13T21:14:54+02:00 2010-11-13T21:14:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16918#p16918 <![CDATA[un-concal list...]]> Statistics: Posted by woodslanding — 13 Nov 2010, 20:14


]]>
2010-11-11T20:35:39+02:00 2010-11-11T20:35:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16903#p16903 <![CDATA[un-concal list...]]>
indeed, this script is not free CPU, but it works.

I would love to improve it, but I am still unable at this time.

To be continued ...

Statistics: Posted by multiphone — 11 Nov 2010, 19:35


]]>
2010-11-11T20:26:19+02:00 2010-11-11T20:26:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16902#p16902 <![CDATA[un-concal list...]]>
but i think at the time it was done woodslanding was new to script and searched a too complex way of doing this.
scanning all characters one by one, when the tstringlist allow a direct access to separate elements.
a much simpler code can be done for that, using TstringList that pick input as it's commatext.
think it will be also lighter on cpu.

looks like

CODE:

for i&#58;=0 to SL.count -1 do begin       outputs&#91;i&#93; &#58;= SL.strings&#91;i&#93;   end;
i ll try to post the full script later.

Statistics: Posted by 23fx23 — 11 Nov 2010, 19:26


]]>
2010-11-11T19:59:44+02:00 2010-11-11T19:59:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16901#p16901 <![CDATA[un-concal list...]]>
I had not seen this post !

All is ok, thanks woodslanding.

Statistics: Posted by multiphone — 11 Nov 2010, 18:59


]]>
2010-11-11T19:40:12+02:00 2010-11-11T19:40:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16900#p16900 <![CDATA[un-concal list...]]> open it to change out number

CODE:

/// commastring splitter by emoon//////const stringCount = 6;  // if this is too small, it doesn't like it.....var outputs    &#58; array of Tparameter;var input      &#58; Tparameter;var strings    &#58; array of String;var commatext  &#58; String;// destroy// initialisation &#58; create parametersprocedure init;var digit  &#58; string;var i  &#58; integer; begin    input &#58;= CreateParam&#40;'commaText',ptTextField&#41;;    SetIsOutput&#40;input,false&#41;;        setArrayLength&#40;strings, stringCount&#41;;    setArrayLength&#40;outputs, stringCount&#41;;         for i &#58;= 0 to &#40;stringCount - 1&#41; do begin        digit &#58;= IntToStr&#40;i + 1&#41;;        outputs&#91;i&#93; &#58;= CreateParam&#40;'String ' + digit,ptTextField&#41;;        SetIsInPut&#40;Outputs&#91;i&#93;,false&#41;;    end;end;procedure Callback&#40;n&#58;integer&#41;;var charCount &#58; integer;var i &#58; integer;var ch&#58; string;var pos&#58; integer;begin     commatext &#58;= ' ' + getStringValue&#40;Input&#41; + ',';     i &#58;= 0;     charCount &#58;= 0;     for pos &#58;= 1 to length&#40;commatext&#41; do     begin        ch &#58;= copy&#40;commatext,pos,1&#41;;               if &#40;ch = ','&#41; then         begin            strings&#91;i&#93; &#58;= copy&#40;commatext,pos - charCount + 1, charCount - 1&#41;;            SetStringValue&#40;Outputs&#91;i&#93;,strings&#91;i&#93;&#41;;            strace&#40;'in loop ' + strings&#91;i&#93;&#41;;            // a little bounds checking            if &#40;i = length&#40;strings&#41;&#41; then break;             i &#58;= i + 1;            charCount &#58;= 0;                   end;        charCount &#58;= charCount + 1;                end;       end;// no process bloc

Statistics: Posted by nay-seven — 11 Nov 2010, 18:40


]]>
2010-11-11T19:06:37+02:00 2010-11-11T19:06:37+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16899#p16899 <![CDATA[un-concal list...]]>
I have one question for the community of patcher or scripter. I try to do the opposite of the script "ConCal list". Rather than adding lists, I try to separate the elements one by one. For example, a list of 16 élements in 16 separate lists of one elements. If you have any ideas I'm interested.

Thanks in advance

Statistics: Posted by multiphone — 11 Nov 2010, 18:06


]]>
BrainModular BrainModular Users Forum 2010-11-14T23:58:12+02:00 https://brainmodular.com/forums/app.php/feed/topic/2555 2010-11-14T23:58:12+02:00 2010-11-14T23:58:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16928#p16928 <![CDATA[un-concal list...]]>
Thank for explication.

I try to unproved the script with an supplementary inlet for choose the number active of out (maybe can i patch that more easily) and a random determination of N elements in one list.

Statistics: Posted by multiphone — 14 Nov 2010, 22:58


]]>
2010-11-14T19:51:23+02:00 2010-11-14T19:51:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16927#p16927 <![CDATA[un-concal list...]]>

once you catched the in/out creation, more explained in the 'basics scripts' section in wiki,
the only thing to catch is Tstringlist, it's kind of delphi object that can pick a commatext, and let acces the individual
elements via indexes in it's internal memory. the script just reassingn elements to same output nb.
it just need a protection to assign only if an element exists,, via checking if index (i) is within the total number of elements
given by the SL1.count , otherwise it sets a blank name ''.

hope it helps.

Statistics: Posted by 23fx23 — 14 Nov 2010, 18:51


]]>
2010-11-14T12:16:08+02:00 2010-11-14T12:16:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16924#p16924 <![CDATA[un-concal list...]]>
Very nice !

Thanks for efficiency.

I look your code deeper.

Statistics: Posted by multiphone — 14 Nov 2010, 11:16


]]>
2010-11-13T21:56:05+02:00 2010-11-13T21:56:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16919#p16919 <![CDATA[un-concal list...]]>

here is the equivalent with tstringlist.

CODE:

  /////////////////////////////////////////////// Spread CommaText Elmts to individual outs////////////////////////////////////////////Const NB_ELMTS = 8;   // adjust for nb of output wanted////////////////////////////// parameters declarationvar CommaIN   &#58; Tparameter;var outputs   &#58; Array of Tparameter;var sl1       &#58; TStringList;var i         &#58; integer;/////////////////////////procedure Destroy;begin   sl1.free;end;////////////////////////////procedure init;begin   CommaIN &#58;= CreateParam&#40;'Comma_In',ptTextField&#41;; SetIsOutPut&#40;CommaIN,false&#41;;setArrayLength&#40;OUTPUTS,NB_ELMTS&#41;;  for i&#58;=0 to NB_ELMTS -1 do begin      outputs&#91;i&#93; &#58;= CreateParam&#40;'out'+ intToStr&#40;i&#41;,ptTextField&#41;;      SetIsInPut&#40;Outputs&#91;i&#93;,false&#41;;   end; Sl1 &#58;= TStringList.Create; end;//////////////////////////////////////////procedure Callback&#40;n&#58;integer&#41;;begin if &#40;n=commaIn&#41; then begin  SL1.commatext&#58;= getStringValue&#40;CommaIN&#41;;       for i&#58;= 0 to NB_ELMTS -1 do begin         if i < SL1.count then begin           setStringValue&#40;outputs&#91;i&#93;,Sl1.strings&#91;i&#93;&#41;;         end else begin           setStringValue&#40;outputs&#91;i&#93;,''&#41;;          end;       end;   end;end;//////////////////////////////////////////////

Statistics: Posted by 23fx23 — 13 Nov 2010, 20:56


]]>
2010-11-13T21:14:54+02:00 2010-11-13T21:14:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16918#p16918 <![CDATA[un-concal list...]]> Statistics: Posted by woodslanding — 13 Nov 2010, 20:14


]]>
2010-11-11T20:35:39+02:00 2010-11-11T20:35:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16903#p16903 <![CDATA[un-concal list...]]>
indeed, this script is not free CPU, but it works.

I would love to improve it, but I am still unable at this time.

To be continued ...

Statistics: Posted by multiphone — 11 Nov 2010, 19:35


]]>
2010-11-11T20:26:19+02:00 2010-11-11T20:26:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16902#p16902 <![CDATA[un-concal list...]]>
but i think at the time it was done woodslanding was new to script and searched a too complex way of doing this.
scanning all characters one by one, when the tstringlist allow a direct access to separate elements.
a much simpler code can be done for that, using TstringList that pick input as it's commatext.
think it will be also lighter on cpu.

looks like

CODE:

for i&#58;=0 to SL.count -1 do begin       outputs&#91;i&#93; &#58;= SL.strings&#91;i&#93;   end;
i ll try to post the full script later.

Statistics: Posted by 23fx23 — 11 Nov 2010, 19:26


]]>
2010-11-11T19:59:44+02:00 2010-11-11T19:59:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16901#p16901 <![CDATA[un-concal list...]]>
I had not seen this post !

All is ok, thanks woodslanding.

Statistics: Posted by multiphone — 11 Nov 2010, 18:59


]]>
2010-11-11T19:40:12+02:00 2010-11-11T19:40:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16900#p16900 <![CDATA[un-concal list...]]> open it to change out number

CODE:

/// commastring splitter by emoon//////const stringCount = 6;  // if this is too small, it doesn't like it.....var outputs    &#58; array of Tparameter;var input      &#58; Tparameter;var strings    &#58; array of String;var commatext  &#58; String;// destroy// initialisation &#58; create parametersprocedure init;var digit  &#58; string;var i  &#58; integer; begin    input &#58;= CreateParam&#40;'commaText',ptTextField&#41;;    SetIsOutput&#40;input,false&#41;;        setArrayLength&#40;strings, stringCount&#41;;    setArrayLength&#40;outputs, stringCount&#41;;         for i &#58;= 0 to &#40;stringCount - 1&#41; do begin        digit &#58;= IntToStr&#40;i + 1&#41;;        outputs&#91;i&#93; &#58;= CreateParam&#40;'String ' + digit,ptTextField&#41;;        SetIsInPut&#40;Outputs&#91;i&#93;,false&#41;;    end;end;procedure Callback&#40;n&#58;integer&#41;;var charCount &#58; integer;var i &#58; integer;var ch&#58; string;var pos&#58; integer;begin     commatext &#58;= ' ' + getStringValue&#40;Input&#41; + ',';     i &#58;= 0;     charCount &#58;= 0;     for pos &#58;= 1 to length&#40;commatext&#41; do     begin        ch &#58;= copy&#40;commatext,pos,1&#41;;               if &#40;ch = ','&#41; then         begin            strings&#91;i&#93; &#58;= copy&#40;commatext,pos - charCount + 1, charCount - 1&#41;;            SetStringValue&#40;Outputs&#91;i&#93;,strings&#91;i&#93;&#41;;            strace&#40;'in loop ' + strings&#91;i&#93;&#41;;            // a little bounds checking            if &#40;i = length&#40;strings&#41;&#41; then break;             i &#58;= i + 1;            charCount &#58;= 0;                   end;        charCount &#58;= charCount + 1;                end;       end;// no process bloc

Statistics: Posted by nay-seven — 11 Nov 2010, 18:40


]]>
2010-11-11T19:06:37+02:00 2010-11-11T19:06:37+02:00 https://brainmodular.com/forums/viewtopic.php?t=2555&p=16899#p16899 <![CDATA[un-concal list...]]>
I have one question for the community of patcher or scripter. I try to do the opposite of the script "ConCal list". Rather than adding lists, I try to separate the elements one by one. For example, a list of 16 élements in 16 separate lists of one elements. If you have any ideas I'm interested.

Thanks in advance

Statistics: Posted by multiphone — 11 Nov 2010, 18:06


]]>