ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2011-03-02T00:14:52+02:00 https://brainmodular.com/forums/app.php/feed/topic/2733 2011-03-02T00:14:52+02:00 2011-03-02T00:14:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18308#p18308 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>

@23fx23 Impressive script! Exactly what I need for my stuff and it works very well !!! You make my day and I wish to not find other problems within my patch ( and I'm sure there is other sysex problem in view since I'm a bit blind with numbers :cool::cool:
Thanks you so much for your help ! ;)

Statistics: Posted by moody33 — 01 Mar 2011, 23:14


]]>
2011-03-01T23:31:45+02:00 2011-03-01T23:31:45+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18306#p18306 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> the exact same weird thingz as moody :)

@moody, i m not sure i fully understood, but this is a new version that may solve the pb:
it's a multimode single script, normally you should be able to set_only, extract_only or booth via the listbox.

CODE:

///////////////////////////////////////////////////////////////// Get/Set Each&#40;n&#41; + IndexStart from/to array of values in/out/////////////////////////////////////////////////////////////var ArrayIN, ArrayOUT, ValuesIn, valuesOut, Mode &#58; tparameter;var GoSet &#58; tparameter;var Index &#58; tparameter;var SubSize&#58; tparameter;var ValTMP&#58; integer;var i, l &#58; integer;var NB_OF_SUBS, ID, pass, lvals &#58; integer;////////////////////////procedure init;begin  ArrayIn&#58;= createParam&#40;'Array in', PtArray&#41;;           setisOutput&#40;Arrayin,false&#41;;goset  &#58;= createParam&#40;'Process', Ptbutton&#41;;           setisOutput&#40;goset,false&#41;;index  &#58;= createParam&#40;'index &#40;offset&#41;', Ptdatafader&#41;; setisOutput&#40;index,false&#41;;SetFormat&#40;index,'%.0f'&#41;; SetMax&#40;index,511&#41;;SubSize&#58;= createParam&#40;'each &#40;subsize&#41;', Ptdatafader&#41;; setisOutput&#40;subsize,false&#41;;SetFormat&#40;subsize,'%.0f'&#41;; SetMax&#40;subsize,511&#41;; setMin&#40;subsize,1&#41;; setValue&#40;subsize,1&#41;;Mode  &#58;= createParam&#40;'mode', PtListBox&#41;;             setisOutput&#40;Mode,false&#41;;SetListBoxString&#40;Mode, '"Set only", "Set+Extract", "Extract only"'&#41;;setvalue&#40;mode,0&#41;;ValuesIn&#58;= createParam&#40;'Values in', PtArray&#41;;           setisOutput&#40;ValuesIn,false&#41;;ArrayOut&#58;= createParam&#40;'Array out', PtArray&#41;;           setisINput&#40;ArrayOut,false&#41;;ValuesOut&#58;= createParam&#40;'Values out', PtArray&#41;;         setisINput&#40;ValuesOut,false&#41;;setLength&#40;ArrayOut,0&#41;;end;/////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; beginif &#40;n=ArrayIn&#41; then IN_TO_OUT;if &#40;n=GoSet&#41; and &#40;getValue&#40;GoSet&#41;=1&#41; then begin     IN_TO_OUT;      if getvalue&#40;mode&#41;<2 then INSERT_VALUES;      if getvalue&#40;mode&#41;>0 then EXTRACT_VALUES;     end;end;//////////////////////////////////////////procedure EXTRACT_VALUES;begin     NB_OF_SUBS&#58;= L div round&#40;getvalue&#40;subsize&#41;&#41;;     setlength&#40;ValuesOut,NB_OF_SUBS&#41;;      for i&#58;= 0 to NB_OF_SUBS-1 do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if &#40;ID < L&#41; then begin            ValTMP&#58;= round&#40;getdataArrayValue&#40;Arrayout,id&#41;&#41;;            setDataArrayValue&#40;ValuesOut,i,ValTMP&#41;;            end else begin            setDataArrayValue&#40;ValuesOut,i,0&#41;;            end;       end;end;////////////////////////procedure INSERT_VALUES;begin      for i&#58;= 0 to Lvals-1 do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if ID < L then begin            ValTMP&#58;= round&#40;getdataArrayValue&#40;valuesin,i&#41;&#41;;            setDataArrayValue&#40;ArrayOut,ID,VALTMP&#41;;            end;       end;end;///////////////procedure IN_TO_OUT;begin    L&#58;= getlength&#40;arrayin&#41;;    Lvals&#58;= getLength&#40;ValuesIn&#41;;    setlength&#40;arrayOut,L&#41;;    for i&#58;= 0 to L-1 do begin        setDataArrayValue&#40;ArrayOut,i,getDataArrayValue&#40;ArrayIn,i&#41;&#41;;     end;end;//////////////////////////////

Statistics: Posted by 23fx23 — 01 Mar 2011, 22:31


]]>
2011-03-01T23:03:34+02:00 2011-03-01T23:03:34+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18301#p18301 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> moody is working on a specific project ( an editor for the G2 synthesizer )
but you don't need to follow this to make your own project ;)

Statistics: Posted by nay-seven — 01 Mar 2011, 22:03


]]>
2011-03-01T22:37:41+02:00 2011-03-01T22:37:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18298#p18298 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> Usine begins to be too much difficult for me
it's now made for progammers and as i quit school
at fourteen i can't follow now i know nothing about math
and yet less in programming i had a look on the next new module
working with csound that makes everybody very enthusiastic
but it's still C language
i already don't understand the use of "arrays " so I think
i can't go on
good night and excuse me

Statistics: Posted by waolelaid — 01 Mar 2011, 21:37


]]>
2011-03-01T21:09:19+02:00 2011-03-01T21:09:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18297#p18297 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>

Statistics: Posted by moody33 — 01 Mar 2011, 20:09


]]>
2011-03-01T20:38:52+02:00 2011-03-01T20:38:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18296#p18296 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> .I take a look.

Statistics: Posted by moody33 — 01 Mar 2011, 19:38


]]>
2011-03-01T20:38:13+02:00 2011-03-01T20:38:13+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18295#p18295 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
I'm not sure to understand well, but you seems to correctly understand what I mean. To be more clear => Back to my first example with 3 x 512 values stored in one big array of 1536 values. I want to set a new value for index n°2 (A) , another one for index 512+2 (B) , and another one for index 1024+2(C). Each new value to set are different, so that's why an array input is required. So for A: new value=a ; for B=>b ; for C=> c where a is the first value of an input array, b, the second value , and c the third value to set.

For the second script, in state of setting a new value each subsize+offset , I need to extract values like the GetArrayVal module do. In my example, I would like to extract element value 10, value 512+10, and value 1024+10. all extracting values should be output as an array output.

The challenge was just in case of, and was a bit of joke.However , I'd really like to have a script like this.

Sure, I will take a look in how to make script one day, but it seems to be very hard for me to understand, It's like chinese and far beyond my own logic. ! Although I don't say I will never learn how to. :) I'm often impressed by people like you, bsork and other , going deeply in this kind of programming ! :o

Statistics: Posted by moody33 — 01 Mar 2011, 19:38


]]>
2011-03-01T20:28:08+02:00 2011-03-01T20:28:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18294#p18294 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>

CODE:

//////////////////////////// SetEach+IndexStart_array of values in/////////////////////////var ArrayIN, ArrayOUT, ValuesIn &#58; tparameter;var GoSet &#58; tparameter;var Index, valin &#58; tparameter;var SubSize&#58; tparameter;var i, l &#58; integer;////////////////////////procedure init;begin  ArrayIn&#58;= createParam&#40;'Array in', PtArray&#41;;           setisOutput&#40;Arrayin,false&#41;;goset  &#58;= createParam&#40;'set values', Ptbutton&#41;;        setisOutput&#40;goset,false&#41;;index  &#58;= createParam&#40;'index &#40;offset&#41;', Ptdatafader&#41;; setisOutput&#40;index,false&#41;;SetFormat&#40;index,'%.0f'&#41;; SetMax&#40;index,511&#41;;SubSize&#58;= createParam&#40;'each &#40;subsize&#41;', Ptdatafader&#41;; setisOutput&#40;subsize,false&#41;;SetFormat&#40;subsize,'%.0f'&#41;; SetMax&#40;subsize,511&#41;; setMin&#40;subsize,1&#41;; setValue&#40;subsize,1&#41;;//valin  &#58;= createParam&#40;'value', Ptdatafader&#41;;          setisOutput&#40;valin,false&#41;;//SetFormat&#40;valin,'%.0f'&#41;; SetMax&#40;valin,255&#41;;ValuesIn&#58;= createParam&#40;'Values in', PtArray&#41;;           setisOutput&#40;ValuesIn,false&#41;;ArrayOut&#58;= createParam&#40;'Array out', PtArray&#41;;         setisINput&#40;ArrayOut,false&#41;;setLength&#40;ArrayOut,0&#41;;end;/////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; var NB_OF_SUBS, ID &#58; integer;beginif &#40;n=ArrayIn&#41; then IN_TO_OUT;if &#40;n=GoSet&#41; and &#40;getValue&#40;GoSet&#41;=1&#41; then begin     IN_TO_OUT;     NB_OF_SUBS&#58;= L div round&#40;getvalue&#40;subsize&#41;&#41;;      for i&#58;= 0 to NB_OF_SUBS-1 do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if ID <= &#40;MinI&#40;L,getLength&#40;ValuesIn&#41;&#41;-1&#41; then begin     setDataArrayValue&#40;ArrayOut,ID,getdataArrayValue&#40;valuesin,i&#41;&#41;;     end;  end;end;end;///////////////procedure IN_TO_OUT;begin    L&#58;= getlength&#40;arrayin&#41;;    setlength&#40;arrayOut,L&#41;;    for i&#58;= 0 to L-1 do begin        setDataArrayValue&#40;ArrayOut,i,getDataArrayValue&#40;ArrayIn,i&#41;&#41;;     end;end;//////////////////////////////

Statistics: Posted by 23fx23 — 01 Mar 2011, 19:28


]]>
2011-03-01T20:08:54+02:00 2011-03-01T20:08:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18293#p18293 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
i was looking at your other challenge but, while i could easily make the clocked insert feature, the sort_array code is quite trickier
than i imagined and above my pgming (basic) math or scripting skillz for now, i will make a break and update this one by waiting a new challenging attempt ;)

i have no pb and enjoy helping you as much as i can but beleive me, you should try slowly learn scripting, i did have no clue a few month ago as well ;)

Statistics: Posted by 23fx23 — 01 Mar 2011, 19:08


]]>
2011-03-01T18:22:31+02:00 2011-03-01T18:22:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18290#p18290 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
And at last, a related script that could give to the user a Get array Element Value each (n) size with offset?

Could be very useful in some situation, and especially in my attempt to build a full sysex editor for my beloved G2.

Thanks you for your precious help cause I actually know absolutely nothing in scripting.

Statistics: Posted by moody33 — 01 Mar 2011, 17:22


]]>
2011-03-01T13:09:24+02:00 2011-03-01T13:09:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18278#p18278 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> thanks a lot master bsork!

Statistics: Posted by 23fx23 — 01 Mar 2011, 12:09


]]>
2011-03-01T13:03:11+02:00 2011-03-01T13:03:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18277#p18277 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> Statistics: Posted by bsork — 01 Mar 2011, 12:03


]]>
2011-03-01T12:46:21+02:00 2011-03-01T12:46:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18275#p18275 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
indeed feel should go to nb_of_sub -1 and skip the test, but would need some kind of security cause there is the added startindex, wich if too high could make trying to set a out of range index for output array(superior to it's size, so returning error). mm maybe force max startoffsetindex to sub_size via a temp variable, but then im affraid it could set the last step in some unwanted conditions.. dk if see what i mean.., if so any idea on best solution? would you also do the first 'in_to_out' then do the second specific steps setting procedure or would have done different way?

@moody, you're welcome, as i was far for a long time from usine, i needed for reminder-trainings, your requests were perfect :)

Statistics: Posted by 23fx23 — 01 Mar 2011, 11:46


]]>
2011-03-01T12:17:07+02:00 2011-03-01T12:17:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18271#p18271 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> ? Or two?

You are so nice to make a script for this problem 23fx23 ! I'm very happy with, it seems to works fine for me in this states.
Thanks you a lot .;)

Statistics: Posted by moody33 — 01 Mar 2011, 11:17


]]>
2011-03-01T09:29:18+02:00 2011-03-01T09:29:18+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18269#p18269 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> - Max for the index parameter should be 511, not 512.
- The FOR loop should go from 0 to (NO_OF_SUBS-1), then the IF-test can be skipped.

Nice work!

Statistics: Posted by bsork — 01 Mar 2011, 08:29


]]>
2011-03-01T01:59:19+02:00 2011-03-01T01:59:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18267#p18267 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> there is a start offset index (in your case '2', then a 'each' sublocsize, here 512, when pressing button it will set each subindex
of the same inputvalue.

CODE:

//////////////////////////// SetEach+IndexStart/////////////////////////var ArrayIN, ArrayOUT &#58; tparameter;var GoSet &#58; tparameter;var Index, valin &#58; tparameter;var SubSize&#58; tparameter;var i, l &#58; integer;////////////////////////procedure init;begin  ArrayIn&#58;= createParam&#40;'Array in', PtArray&#41;;           setisOutput&#40;Arrayin,false&#41;;goset  &#58;= createParam&#40;'set values', Ptbutton&#41;;        setisOutput&#40;goset,false&#41;;index  &#58;= createParam&#40;'index &#40;offset&#41;', Ptdatafader&#41;; setisOutput&#40;index,false&#41;;SetFormat&#40;index,'%.0f'&#41;; SetMax&#40;index,512&#41;;SubSize&#58;= createParam&#40;'each &#40;subsize&#41;', Ptdatafader&#41;; setisOutput&#40;subsize,false&#41;;SetFormat&#40;subsize,'%.0f'&#41;; SetMax&#40;subsize,512&#41;; setMin&#40;subsize,1&#41;; setValue&#40;subsize,1&#41;;valin  &#58;= createParam&#40;'value', Ptdatafader&#41;;          setisOutput&#40;valin,false&#41;;SetFormat&#40;valin,'%.0f'&#41;; SetMax&#40;valin,255&#41;;ArrayOut&#58;= createParam&#40;'Array out', PtArray&#41;;         setisINput&#40;ArrayOut,false&#41;;setLength&#40;ArrayOut,0&#41;;end;/////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; var NB_OF_SUBS, ID &#58; integer;beginif &#40;n=ArrayIn&#41; then IN_TO_OUT;if &#40;n=GoSet&#41; and &#40;getValue&#40;GoSet&#41;=1&#41; then begin     IN_TO_OUT;     NB_OF_SUBS&#58;= L div round&#40;getvalue&#40;subsize&#41;&#41;;      for i&#58;= 0 to NB_OF_SUBS  do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if ID <= L-1 then begin     setDataArrayValue&#40;ArrayOut,ID,getValue&#40;valin&#41;&#41;;     end;  end;end;end;///////////////procedure IN_TO_OUT;begin    L&#58;= getlength&#40;arrayin&#41;;    setlength&#40;arrayOut,L&#41;;    for i&#58;= 0 to L-1 do begin        setDataArrayValue&#40;ArrayOut,i,getDataArrayValue&#40;ArrayIn,i&#41;&#41;;     end;end;//////////////////////////////

Statistics: Posted by 23fx23 — 01 Mar 2011, 00:59


]]>
2011-03-01T00:33:30+02:00 2011-03-01T00:33:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18262#p18262 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> http://www.sensomusic.com/forums/viewtopic.php?id=2221

Index n°2 means elements number 2 of each array of 512 elements.
For exemple, for an array of 3 x 512 values stored in one big array of 1536 values, I need to change value number 2 , value number 514 ( 512+2 ), and value number 1026 ( 1024+2). And so on if the array is bigger. So , If i reverse the process ( that's why I want to do ) by cutting the big array in several bloc of array size 512, I could access to index n°2 of each bloc and change the value. don't know if I'm really clear, so if i'm not, nevermind ! ;)

Statistics: Posted by moody33 — 28 Feb 2011, 23:33


]]>
2011-02-28T23:43:03+02:00 2011-02-28T23:43:03+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18257#p18257 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
But that does only work well if the values you're updating are after another in the array. I'm not sure I understand what you mean by "index n°2" - is it every other index like 0, 2, 4, 6.. or something like that? If so, things can get clumsy with modules, and a script would certainly work better, If you need any help writing a script like this, I can help you.

Off topic, I know, but weren't you the one who reported something wrong with the wiki for one of my scripts some days ago? I tried to search for the topic today, but couldn't find it.

Statistics: Posted by bsork — 28 Feb 2011, 22:43


]]>
2011-02-28T23:08:31+02:00 2011-02-28T23:08:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18253#p18253 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
I'm not sure to understand your advice ( my english is...not always on top:P ) I'm dealing with sysex values received from my hardware by blocs of 512 values. Then I store them in one big array ( up to 25000 values sometimes ! ). Each of the 512 blocs contains informations in index n°2 that I need to change after the storage process. So , the better way is probably to cut the big bloc to several 512 blocs to re-compose the orginal flow. but I don't know how to start using the extract-sub array. I'd like to avoid using a lot of array module as shown in my pictures.

So if you have an idea where to start to process the big bloc by several 512 ones...you are welcome !

Statistics: Posted by moody33 — 28 Feb 2011, 22:08


]]>
2011-02-28T22:45:16+02:00 2011-02-28T22:45:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18252#p18252 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> Statistics: Posted by bsork — 28 Feb 2011, 21:45


]]>
2011-02-28T22:30:04+02:00 2011-02-28T22:30:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18249#p18249 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> ???

I need to set about 64 elements in an array , but my patch have nearly 25% of cpu load ! I really can't use it but I need it ! :/

have you got another solution? Is there a script that might do the job?

Thanks.

Statistics: Posted by moody33 — 28 Feb 2011, 21:30


]]>
BrainModular BrainModular Users Forum 2011-03-02T00:14:52+02:00 https://brainmodular.com/forums/app.php/feed/topic/2733 2011-03-02T00:14:52+02:00 2011-03-02T00:14:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18308#p18308 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>

@23fx23 Impressive script! Exactly what I need for my stuff and it works very well !!! You make my day and I wish to not find other problems within my patch ( and I'm sure there is other sysex problem in view since I'm a bit blind with numbers :cool::cool:
Thanks you so much for your help ! ;)

Statistics: Posted by moody33 — 01 Mar 2011, 23:14


]]>
2011-03-01T23:31:45+02:00 2011-03-01T23:31:45+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18306#p18306 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> the exact same weird thingz as moody :)

@moody, i m not sure i fully understood, but this is a new version that may solve the pb:
it's a multimode single script, normally you should be able to set_only, extract_only or booth via the listbox.

CODE:

///////////////////////////////////////////////////////////////// Get/Set Each&#40;n&#41; + IndexStart from/to array of values in/out/////////////////////////////////////////////////////////////var ArrayIN, ArrayOUT, ValuesIn, valuesOut, Mode &#58; tparameter;var GoSet &#58; tparameter;var Index &#58; tparameter;var SubSize&#58; tparameter;var ValTMP&#58; integer;var i, l &#58; integer;var NB_OF_SUBS, ID, pass, lvals &#58; integer;////////////////////////procedure init;begin  ArrayIn&#58;= createParam&#40;'Array in', PtArray&#41;;           setisOutput&#40;Arrayin,false&#41;;goset  &#58;= createParam&#40;'Process', Ptbutton&#41;;           setisOutput&#40;goset,false&#41;;index  &#58;= createParam&#40;'index &#40;offset&#41;', Ptdatafader&#41;; setisOutput&#40;index,false&#41;;SetFormat&#40;index,'%.0f'&#41;; SetMax&#40;index,511&#41;;SubSize&#58;= createParam&#40;'each &#40;subsize&#41;', Ptdatafader&#41;; setisOutput&#40;subsize,false&#41;;SetFormat&#40;subsize,'%.0f'&#41;; SetMax&#40;subsize,511&#41;; setMin&#40;subsize,1&#41;; setValue&#40;subsize,1&#41;;Mode  &#58;= createParam&#40;'mode', PtListBox&#41;;             setisOutput&#40;Mode,false&#41;;SetListBoxString&#40;Mode, '"Set only", "Set+Extract", "Extract only"'&#41;;setvalue&#40;mode,0&#41;;ValuesIn&#58;= createParam&#40;'Values in', PtArray&#41;;           setisOutput&#40;ValuesIn,false&#41;;ArrayOut&#58;= createParam&#40;'Array out', PtArray&#41;;           setisINput&#40;ArrayOut,false&#41;;ValuesOut&#58;= createParam&#40;'Values out', PtArray&#41;;         setisINput&#40;ValuesOut,false&#41;;setLength&#40;ArrayOut,0&#41;;end;/////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; beginif &#40;n=ArrayIn&#41; then IN_TO_OUT;if &#40;n=GoSet&#41; and &#40;getValue&#40;GoSet&#41;=1&#41; then begin     IN_TO_OUT;      if getvalue&#40;mode&#41;<2 then INSERT_VALUES;      if getvalue&#40;mode&#41;>0 then EXTRACT_VALUES;     end;end;//////////////////////////////////////////procedure EXTRACT_VALUES;begin     NB_OF_SUBS&#58;= L div round&#40;getvalue&#40;subsize&#41;&#41;;     setlength&#40;ValuesOut,NB_OF_SUBS&#41;;      for i&#58;= 0 to NB_OF_SUBS-1 do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if &#40;ID < L&#41; then begin            ValTMP&#58;= round&#40;getdataArrayValue&#40;Arrayout,id&#41;&#41;;            setDataArrayValue&#40;ValuesOut,i,ValTMP&#41;;            end else begin            setDataArrayValue&#40;ValuesOut,i,0&#41;;            end;       end;end;////////////////////////procedure INSERT_VALUES;begin      for i&#58;= 0 to Lvals-1 do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if ID < L then begin            ValTMP&#58;= round&#40;getdataArrayValue&#40;valuesin,i&#41;&#41;;            setDataArrayValue&#40;ArrayOut,ID,VALTMP&#41;;            end;       end;end;///////////////procedure IN_TO_OUT;begin    L&#58;= getlength&#40;arrayin&#41;;    Lvals&#58;= getLength&#40;ValuesIn&#41;;    setlength&#40;arrayOut,L&#41;;    for i&#58;= 0 to L-1 do begin        setDataArrayValue&#40;ArrayOut,i,getDataArrayValue&#40;ArrayIn,i&#41;&#41;;     end;end;//////////////////////////////

Statistics: Posted by 23fx23 — 01 Mar 2011, 22:31


]]>
2011-03-01T23:03:34+02:00 2011-03-01T23:03:34+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18301#p18301 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> moody is working on a specific project ( an editor for the G2 synthesizer )
but you don't need to follow this to make your own project ;)

Statistics: Posted by nay-seven — 01 Mar 2011, 22:03


]]>
2011-03-01T22:37:41+02:00 2011-03-01T22:37:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18298#p18298 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> Usine begins to be too much difficult for me
it's now made for progammers and as i quit school
at fourteen i can't follow now i know nothing about math
and yet less in programming i had a look on the next new module
working with csound that makes everybody very enthusiastic
but it's still C language
i already don't understand the use of "arrays " so I think
i can't go on
good night and excuse me

Statistics: Posted by waolelaid — 01 Mar 2011, 21:37


]]>
2011-03-01T21:09:19+02:00 2011-03-01T21:09:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18297#p18297 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>

Statistics: Posted by moody33 — 01 Mar 2011, 20:09


]]>
2011-03-01T20:38:52+02:00 2011-03-01T20:38:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18296#p18296 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> .I take a look.

Statistics: Posted by moody33 — 01 Mar 2011, 19:38


]]>
2011-03-01T20:38:13+02:00 2011-03-01T20:38:13+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18295#p18295 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
I'm not sure to understand well, but you seems to correctly understand what I mean. To be more clear => Back to my first example with 3 x 512 values stored in one big array of 1536 values. I want to set a new value for index n°2 (A) , another one for index 512+2 (B) , and another one for index 1024+2(C). Each new value to set are different, so that's why an array input is required. So for A: new value=a ; for B=>b ; for C=> c where a is the first value of an input array, b, the second value , and c the third value to set.

For the second script, in state of setting a new value each subsize+offset , I need to extract values like the GetArrayVal module do. In my example, I would like to extract element value 10, value 512+10, and value 1024+10. all extracting values should be output as an array output.

The challenge was just in case of, and was a bit of joke.However , I'd really like to have a script like this.

Sure, I will take a look in how to make script one day, but it seems to be very hard for me to understand, It's like chinese and far beyond my own logic. ! Although I don't say I will never learn how to. :) I'm often impressed by people like you, bsork and other , going deeply in this kind of programming ! :o

Statistics: Posted by moody33 — 01 Mar 2011, 19:38


]]>
2011-03-01T20:28:08+02:00 2011-03-01T20:28:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18294#p18294 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>

CODE:

//////////////////////////// SetEach+IndexStart_array of values in/////////////////////////var ArrayIN, ArrayOUT, ValuesIn &#58; tparameter;var GoSet &#58; tparameter;var Index, valin &#58; tparameter;var SubSize&#58; tparameter;var i, l &#58; integer;////////////////////////procedure init;begin  ArrayIn&#58;= createParam&#40;'Array in', PtArray&#41;;           setisOutput&#40;Arrayin,false&#41;;goset  &#58;= createParam&#40;'set values', Ptbutton&#41;;        setisOutput&#40;goset,false&#41;;index  &#58;= createParam&#40;'index &#40;offset&#41;', Ptdatafader&#41;; setisOutput&#40;index,false&#41;;SetFormat&#40;index,'%.0f'&#41;; SetMax&#40;index,511&#41;;SubSize&#58;= createParam&#40;'each &#40;subsize&#41;', Ptdatafader&#41;; setisOutput&#40;subsize,false&#41;;SetFormat&#40;subsize,'%.0f'&#41;; SetMax&#40;subsize,511&#41;; setMin&#40;subsize,1&#41;; setValue&#40;subsize,1&#41;;//valin  &#58;= createParam&#40;'value', Ptdatafader&#41;;          setisOutput&#40;valin,false&#41;;//SetFormat&#40;valin,'%.0f'&#41;; SetMax&#40;valin,255&#41;;ValuesIn&#58;= createParam&#40;'Values in', PtArray&#41;;           setisOutput&#40;ValuesIn,false&#41;;ArrayOut&#58;= createParam&#40;'Array out', PtArray&#41;;         setisINput&#40;ArrayOut,false&#41;;setLength&#40;ArrayOut,0&#41;;end;/////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; var NB_OF_SUBS, ID &#58; integer;beginif &#40;n=ArrayIn&#41; then IN_TO_OUT;if &#40;n=GoSet&#41; and &#40;getValue&#40;GoSet&#41;=1&#41; then begin     IN_TO_OUT;     NB_OF_SUBS&#58;= L div round&#40;getvalue&#40;subsize&#41;&#41;;      for i&#58;= 0 to NB_OF_SUBS-1 do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if ID <= &#40;MinI&#40;L,getLength&#40;ValuesIn&#41;&#41;-1&#41; then begin     setDataArrayValue&#40;ArrayOut,ID,getdataArrayValue&#40;valuesin,i&#41;&#41;;     end;  end;end;end;///////////////procedure IN_TO_OUT;begin    L&#58;= getlength&#40;arrayin&#41;;    setlength&#40;arrayOut,L&#41;;    for i&#58;= 0 to L-1 do begin        setDataArrayValue&#40;ArrayOut,i,getDataArrayValue&#40;ArrayIn,i&#41;&#41;;     end;end;//////////////////////////////

Statistics: Posted by 23fx23 — 01 Mar 2011, 19:28


]]>
2011-03-01T20:08:54+02:00 2011-03-01T20:08:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18293#p18293 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
i was looking at your other challenge but, while i could easily make the clocked insert feature, the sort_array code is quite trickier
than i imagined and above my pgming (basic) math or scripting skillz for now, i will make a break and update this one by waiting a new challenging attempt ;)

i have no pb and enjoy helping you as much as i can but beleive me, you should try slowly learn scripting, i did have no clue a few month ago as well ;)

Statistics: Posted by 23fx23 — 01 Mar 2011, 19:08


]]>
2011-03-01T18:22:31+02:00 2011-03-01T18:22:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18290#p18290 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
And at last, a related script that could give to the user a Get array Element Value each (n) size with offset?

Could be very useful in some situation, and especially in my attempt to build a full sysex editor for my beloved G2.

Thanks you for your precious help cause I actually know absolutely nothing in scripting.

Statistics: Posted by moody33 — 01 Mar 2011, 17:22


]]>
2011-03-01T13:09:24+02:00 2011-03-01T13:09:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18278#p18278 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> thanks a lot master bsork!

Statistics: Posted by 23fx23 — 01 Mar 2011, 12:09


]]>
2011-03-01T13:03:11+02:00 2011-03-01T13:03:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18277#p18277 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> Statistics: Posted by bsork — 01 Mar 2011, 12:03


]]>
2011-03-01T12:46:21+02:00 2011-03-01T12:46:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18275#p18275 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
indeed feel should go to nb_of_sub -1 and skip the test, but would need some kind of security cause there is the added startindex, wich if too high could make trying to set a out of range index for output array(superior to it's size, so returning error). mm maybe force max startoffsetindex to sub_size via a temp variable, but then im affraid it could set the last step in some unwanted conditions.. dk if see what i mean.., if so any idea on best solution? would you also do the first 'in_to_out' then do the second specific steps setting procedure or would have done different way?

@moody, you're welcome, as i was far for a long time from usine, i needed for reminder-trainings, your requests were perfect :)

Statistics: Posted by 23fx23 — 01 Mar 2011, 11:46


]]>
2011-03-01T12:17:07+02:00 2011-03-01T12:17:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18271#p18271 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> ? Or two?

You are so nice to make a script for this problem 23fx23 ! I'm very happy with, it seems to works fine for me in this states.
Thanks you a lot .;)

Statistics: Posted by moody33 — 01 Mar 2011, 11:17


]]>
2011-03-01T09:29:18+02:00 2011-03-01T09:29:18+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18269#p18269 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> - Max for the index parameter should be 511, not 512.
- The FOR loop should go from 0 to (NO_OF_SUBS-1), then the IF-test can be skipped.

Nice work!

Statistics: Posted by bsork — 01 Mar 2011, 08:29


]]>
2011-03-01T01:59:19+02:00 2011-03-01T01:59:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18267#p18267 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> there is a start offset index (in your case '2', then a 'each' sublocsize, here 512, when pressing button it will set each subindex
of the same inputvalue.

CODE:

//////////////////////////// SetEach+IndexStart/////////////////////////var ArrayIN, ArrayOUT &#58; tparameter;var GoSet &#58; tparameter;var Index, valin &#58; tparameter;var SubSize&#58; tparameter;var i, l &#58; integer;////////////////////////procedure init;begin  ArrayIn&#58;= createParam&#40;'Array in', PtArray&#41;;           setisOutput&#40;Arrayin,false&#41;;goset  &#58;= createParam&#40;'set values', Ptbutton&#41;;        setisOutput&#40;goset,false&#41;;index  &#58;= createParam&#40;'index &#40;offset&#41;', Ptdatafader&#41;; setisOutput&#40;index,false&#41;;SetFormat&#40;index,'%.0f'&#41;; SetMax&#40;index,512&#41;;SubSize&#58;= createParam&#40;'each &#40;subsize&#41;', Ptdatafader&#41;; setisOutput&#40;subsize,false&#41;;SetFormat&#40;subsize,'%.0f'&#41;; SetMax&#40;subsize,512&#41;; setMin&#40;subsize,1&#41;; setValue&#40;subsize,1&#41;;valin  &#58;= createParam&#40;'value', Ptdatafader&#41;;          setisOutput&#40;valin,false&#41;;SetFormat&#40;valin,'%.0f'&#41;; SetMax&#40;valin,255&#41;;ArrayOut&#58;= createParam&#40;'Array out', PtArray&#41;;         setisINput&#40;ArrayOut,false&#41;;setLength&#40;ArrayOut,0&#41;;end;/////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; var NB_OF_SUBS, ID &#58; integer;beginif &#40;n=ArrayIn&#41; then IN_TO_OUT;if &#40;n=GoSet&#41; and &#40;getValue&#40;GoSet&#41;=1&#41; then begin     IN_TO_OUT;     NB_OF_SUBS&#58;= L div round&#40;getvalue&#40;subsize&#41;&#41;;      for i&#58;= 0 to NB_OF_SUBS  do begin          ID&#58;= round&#40;getvalue&#40;index&#41;+&#40;i*getvalue&#40;subsize&#41;&#41;&#41;;            if ID <= L-1 then begin     setDataArrayValue&#40;ArrayOut,ID,getValue&#40;valin&#41;&#41;;     end;  end;end;end;///////////////procedure IN_TO_OUT;begin    L&#58;= getlength&#40;arrayin&#41;;    setlength&#40;arrayOut,L&#41;;    for i&#58;= 0 to L-1 do begin        setDataArrayValue&#40;ArrayOut,i,getDataArrayValue&#40;ArrayIn,i&#41;&#41;;     end;end;//////////////////////////////

Statistics: Posted by 23fx23 — 01 Mar 2011, 00:59


]]>
2011-03-01T00:33:30+02:00 2011-03-01T00:33:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18262#p18262 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> http://www.sensomusic.com/forums/viewtopic.php?id=2221

Index n°2 means elements number 2 of each array of 512 elements.
For exemple, for an array of 3 x 512 values stored in one big array of 1536 values, I need to change value number 2 , value number 514 ( 512+2 ), and value number 1026 ( 1024+2). And so on if the array is bigger. So , If i reverse the process ( that's why I want to do ) by cutting the big array in several bloc of array size 512, I could access to index n°2 of each bloc and change the value. don't know if I'm really clear, so if i'm not, nevermind ! ;)

Statistics: Posted by moody33 — 28 Feb 2011, 23:33


]]>
2011-02-28T23:43:03+02:00 2011-02-28T23:43:03+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18257#p18257 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
But that does only work well if the values you're updating are after another in the array. I'm not sure I understand what you mean by "index n°2" - is it every other index like 0, 2, 4, 6.. or something like that? If so, things can get clumsy with modules, and a script would certainly work better, If you need any help writing a script like this, I can help you.

Off topic, I know, but weren't you the one who reported something wrong with the wiki for one of my scripts some days ago? I tried to search for the topic today, but couldn't find it.

Statistics: Posted by bsork — 28 Feb 2011, 22:43


]]>
2011-02-28T23:08:31+02:00 2011-02-28T23:08:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18253#p18253 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]>
I'm not sure to understand your advice ( my english is...not always on top:P ) I'm dealing with sysex values received from my hardware by blocs of 512 values. Then I store them in one big array ( up to 25000 values sometimes ! ). Each of the 512 blocs contains informations in index n°2 that I need to change after the storage process. So , the better way is probably to cut the big bloc to several 512 blocs to re-compose the orginal flow. but I don't know how to start using the extract-sub array. I'd like to avoid using a lot of array module as shown in my pictures.

So if you have an idea where to start to process the big bloc by several 512 ones...you are welcome !

Statistics: Posted by moody33 — 28 Feb 2011, 22:08


]]>
2011-02-28T22:45:16+02:00 2011-02-28T22:45:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18252#p18252 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> Statistics: Posted by bsork — 28 Feb 2011, 21:45


]]>
2011-02-28T22:30:04+02:00 2011-02-28T22:30:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=2733&p=18249#p18249 <![CDATA[Set array : more than 64 elements, huge on cpu ! Any alternative?]]> ???

I need to set about 64 elements in an array , but my patch have nearly 25% of cpu load ! I really can't use it but I need it ! :/

have you got another solution? Is there a script that might do the job?

Thanks.

Statistics: Posted by moody33 — 28 Feb 2011, 21:30


]]>