---------- Forwarded message ---------- Date: Fri, 28 Jan 2011 15:28:39 -0500 (EST) From: Mathieu Bouchard matju@artengine.ca To: Tedb0t lists@liminastudio.com Subject: Re: [PD] Multi-dimensional arrays
On Fri, 28 Jan 2011, Tedb0t wrote:
Awesome! I started this patch (basically a drum sequencer interface with recallable banks), but not sure why [#store] isn't working here:
It's because [#many] contains a [#store] that needs to have a 2-dimensional grid in it, and [#many] doesn't check that you give it such a grid, and by default, [#store] contains a 0-dimensional grid whose contents is a single 0.
Perhaps the [#store]s need to be initialized with the right dimensions? Not sure how to do that...
A grid literal such as «6 8 #» will expand to a 6×8 grid of zeroes, if you pass it as a single argument where a grid is expected (using parentheses) or as a list-message to a grid-inlet.
for example, [#store (6 8 #)] and to clear the contents, have a «6 8 #» messagebox.
(I use «» to quote a list or messagebox contents in email. It's not part of GridFlow.)
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Excellent, I've been making tons of progress! Now I'm wondering if there's a way to retrieve a single column from a [#many] object...? I have been trying a for++ loop to iterate through the rows of a specified column but it's not working very well and I can only do that via a [#store] object...
Thanks so much!!
±t3db0t
On Jan 28, 2011, at 3:34 PM, Mathieu Bouchard wrote:
On Fri, 28 Jan 2011, Tedb0t wrote:
Awesome! I started this patch (basically a drum sequencer interface with recallable banks), but not sure why [#store] isn't working here:
It's because [#many] contains a [#store] that needs to have a 2-dimensional grid in it, and [#many] doesn't check that you give it such a grid, and by default, [#store] contains a 0-dimensional grid whose contents is a single 0.
Perhaps the [#store]s need to be initialized with the right dimensions? Not sure how to do that...
A grid literal such as «6 8 #» will expand to a 6×8 grid of zeroes, if you pass it as a single argument where a grid is expected (using parentheses) or as a list-message to a grid-inlet.
for example, [#store (6 8 #)] and to clear the contents, have a «6 8 #» messagebox.
(I use «» to quote a list or messagebox contents in email. It's not part of GridFlow.)
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On Fri, 28 Jan 2011, Tedb0t wrote:
Excellent, I've been making tons of progress! Now I'm wondering if there's a way to retrieve a single column from a [#many] object...?
[#slice] can give you any subrectangle inside of that grid, including a column, but it will give it to you as a 2-dimensional grid ; that is, dim(1,n). If you need a dim(n) you can use [#redim] afterwards.
have been trying a for++ loop to iterate through the rows of a specified column but it's not working very well and I can only do that via a [#store] object...
Do you want to do something like this ? http://gridflow.ca/gallery/sequenceur.pd.png http://gridflow.ca/gallery/sequenceur.pd.mp3
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC