ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2012-01-27T11:10:56+02:00 https://brainmodular.org/forums/app.php/feed/topic/3331 2012-01-27T11:10:56+02:00 2012-01-27T11:10:56+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22448#p22448 <![CDATA[Array Question]]>

Statistics: Posted by caco — 27 Jan 2012, 10:10


]]>
2012-01-26T18:19:07+02:00 2012-01-26T18:19:07+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22436#p22436 <![CDATA[Array Question]]>
Senso - To me, the logical way to do this without scripting was with the Get Array Element Value module. Would it be possible for this to take an array as an index? Currently it only acts on the first value but it could be expanded so it would work on every value passed to index?
It's a good suggestion, and can be extended to many other modules like, the cross-fader, etc.
Unfortunately, it's not so easy to implement and we are working hard on the V6. I'll try to remind this point to implement it in future releases.
senso+++

Statistics: Posted by senso — 26 Jan 2012, 17:19


]]>
2012-01-26T17:00:52+02:00 2012-01-26T17:00:52+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22435#p22435 <![CDATA[Array Question]]>

I was hoping to avoid scripting this but I think it is inevitable as I don't think the current array modules can do this.

Senso - To me, the logical way to do this without scripting was with the Get Array Element Value module. Would it be possible for this to take an array as an index? Currently it only acts on the first value but it could be expanded so it would work on every value passed to index?

Statistics: Posted by caco — 26 Jan 2012, 16:00


]]>
2012-01-26T16:50:45+02:00 2012-01-26T16:50:45+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22434#p22434 <![CDATA[Array Question]]>

CODE:

var ArrayIn, IndexsIn, ArrayOut &#58; tparameter;///////////////////////////////////////////////procedure init;begin   ArrayIn&#58;= CreateParam&#40;'Arrayin',ptarray&#41;; SetisOutput&#40;arrayin,false&#41;; IndexsIn&#58;= CreateParam&#40;'Indexsin',ptarray&#41;; SetisOutput&#40;Indexsin,false&#41;; Arrayout&#58;= CreateParam&#40;'Arrayout',ptarray&#41;; Setisinput&#40;arrayout,false&#41;; end;//////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; var i,L,ID&#58; integer;begin  L&#58;=MinI&#40;getlength&#40;IndexsIn&#41;,getLength&#40;Arrayin&#41;&#41;;  setLength&#40;arrayout,L&#41;;     for i&#58;=0 to L-1 do begin     ID&#58;=round&#40;getdataArrayValue&#40;indexsIn,i&#41;&#41;;     setdataArrayvalue&#40;Arrayout,i,getdataArrayValue&#40;Arrayin,ID&#41;&#41;;     end;END;//CB////////////////////////////////////////////

Statistics: Posted by 23fx23 — 26 Jan 2012, 15:50


]]>
2012-01-26T16:33:56+02:00 2012-01-26T16:33:56+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22433#p22433 <![CDATA[Array Question]]> but this will take one bloc latency per requested value.

so script is a much more efficient and easy method here. . basically you check lenght of array2, loop thru the array to look IDs to pick from array1 and create a new array3 of same length and copy the datas. it's done in 5mn, I will post you one here.

Statistics: Posted by 23fx23 — 26 Jan 2012, 15:33


]]>
2012-01-26T16:20:11+02:00 2012-01-26T16:20:11+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22432#p22432 <![CDATA[Array Question]]>

I have array1 that is1024 long and contains a variety of results, I then have array2 which changes size and contains the indices I want from array1. So what I want to is extract those particular values from array1 into a new array but I am not sure how. So if array2 is [0,5,6,128] I want to extract the values at those positions in array1 into a new array. Does that make sense?

The tricky bit is that array2 changes size so the extraction process needs to be able to dynamically change.

Statistics: Posted by caco — 26 Jan 2012, 15:20


]]>
BrainModular BrainModular Users Forum 2012-01-27T11:10:56+02:00 https://brainmodular.org/forums/app.php/feed/topic/3331 2012-01-27T11:10:56+02:00 2012-01-27T11:10:56+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22448#p22448 <![CDATA[Array Question]]>

Statistics: Posted by caco — 27 Jan 2012, 10:10


]]>
2012-01-26T18:19:07+02:00 2012-01-26T18:19:07+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22436#p22436 <![CDATA[Array Question]]>
Senso - To me, the logical way to do this without scripting was with the Get Array Element Value module. Would it be possible for this to take an array as an index? Currently it only acts on the first value but it could be expanded so it would work on every value passed to index?
It's a good suggestion, and can be extended to many other modules like, the cross-fader, etc.
Unfortunately, it's not so easy to implement and we are working hard on the V6. I'll try to remind this point to implement it in future releases.
senso+++

Statistics: Posted by senso — 26 Jan 2012, 17:19


]]>
2012-01-26T17:00:52+02:00 2012-01-26T17:00:52+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22435#p22435 <![CDATA[Array Question]]>

I was hoping to avoid scripting this but I think it is inevitable as I don't think the current array modules can do this.

Senso - To me, the logical way to do this without scripting was with the Get Array Element Value module. Would it be possible for this to take an array as an index? Currently it only acts on the first value but it could be expanded so it would work on every value passed to index?

Statistics: Posted by caco — 26 Jan 2012, 16:00


]]>
2012-01-26T16:50:45+02:00 2012-01-26T16:50:45+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22434#p22434 <![CDATA[Array Question]]>

CODE:

var ArrayIn, IndexsIn, ArrayOut &#58; tparameter;///////////////////////////////////////////////procedure init;begin   ArrayIn&#58;= CreateParam&#40;'Arrayin',ptarray&#41;; SetisOutput&#40;arrayin,false&#41;; IndexsIn&#58;= CreateParam&#40;'Indexsin',ptarray&#41;; SetisOutput&#40;Indexsin,false&#41;; Arrayout&#58;= CreateParam&#40;'Arrayout',ptarray&#41;; Setisinput&#40;arrayout,false&#41;; end;//////////////////////////////////////Procedure Callback&#40;N&#58;integer&#41;; var i,L,ID&#58; integer;begin  L&#58;=MinI&#40;getlength&#40;IndexsIn&#41;,getLength&#40;Arrayin&#41;&#41;;  setLength&#40;arrayout,L&#41;;     for i&#58;=0 to L-1 do begin     ID&#58;=round&#40;getdataArrayValue&#40;indexsIn,i&#41;&#41;;     setdataArrayvalue&#40;Arrayout,i,getdataArrayValue&#40;Arrayin,ID&#41;&#41;;     end;END;//CB////////////////////////////////////////////

Statistics: Posted by 23fx23 — 26 Jan 2012, 15:50


]]>
2012-01-26T16:33:56+02:00 2012-01-26T16:33:56+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22433#p22433 <![CDATA[Array Question]]> but this will take one bloc latency per requested value.

so script is a much more efficient and easy method here. . basically you check lenght of array2, loop thru the array to look IDs to pick from array1 and create a new array3 of same length and copy the datas. it's done in 5mn, I will post you one here.

Statistics: Posted by 23fx23 — 26 Jan 2012, 15:33


]]>
2012-01-26T16:20:11+02:00 2012-01-26T16:20:11+02:00 https://brainmodular.org/forums/viewtopic.php?t=3331&p=22432#p22432 <![CDATA[Array Question]]>

I have array1 that is1024 long and contains a variety of results, I then have array2 which changes size and contains the indices I want from array1. So what I want to is extract those particular values from array1 into a new array but I am not sure how. So if array2 is [0,5,6,128] I want to extract the values at those positions in array1 into a new array. Does that make sense?

The tricky bit is that array2 changes size so the extraction process needs to be able to dynamically change.

Statistics: Posted by caco — 26 Jan 2012, 15:20


]]>