Posting here too since I got a lot of silence on pd-dev. From the README:
A tglgrid is a grid of cells that can each be toggled on and off. It can be instantiated with different dimensions depending on your project's needs. You can bang the left input to output a list of the active cells in the currently active column and send a column number to the right input to select the active column. Cells can also be toggled and/or turned on/off by sending messages: "tgl col row", "on col row", or "off col row".
Right now this has only been tested on linux. I would appreciate any reports about success and/or failure of running this in other environments.
The github page is here: https://github.com/nicklan/tglgrid You can find screenshots there if you're interested.
As this is my first external, I'm sure I've made some horrible coding/design mistakes and appreciate any feedback in that regard.
Cheers!
-Nick
Hi,
sound great, thanks for sharing !
Here are some features request that come to mind:
It can be another object, such as rtglgrid, or a creation argument (tglgrid 10 10 byrow).
Happy hacking :)
On 03/27/2013 02:03 PM, Charles Goyard wrote:
Hi,
sound great, thanks for sharing !
Sure, hope you find it useful, and thanks for the feedback. Responses below inline.
Here are some features request that come to mind:
- add the possibility to work by row and not by column.
It can be another object, such as rtglgrid, or a creation argument (tglgrid 10 10 byrow).
Yep, this is in the back of my mind as a feature, I just need to think through the best way to have the interactions work.
- add a "say col row" message that returns a single cell state.
This is easy to do, and I had even started it, but I had second thoughts about it's necessity. You can always filter out the state of a single cell from the list that's output when you do the standard bang, but maybe for simplicity's sake I should add this too. The question in my mind was, does this output a single value at the first outlet, or is there a second outlet for this?
- before someone else asks: dynamic resize of the matrix :)
Also shouldn't be too tough, I'll add it to the todo list.
Cheers,
Nick
This is really nice. I like the red highlighting when you hover over a square. Very clean and useful.
I'd give a +1 to adding a [get row x( method, as well as [get row col( for a single cell.
Joel
On 03/27/2013 11:08 AM, Nick Lanham wrote:
On 03/27/2013 02:03 PM, Charles Goyard wrote:
Hi,
sound great, thanks for sharing !
Sure, hope you find it useful, and thanks for the feedback. Responses below inline.
Here are some features request that come to mind:
- add the possibility to work by row and not by column.
It can be another object, such as rtglgrid, or a creation argument (tglgrid 10 10 byrow).
Yep, this is in the back of my mind as a feature, I just need to think through the best way to have the interactions work.
- add a "say col row" message that returns a single cell state.
This is easy to do, and I had even started it, but I had second thoughts about it's necessity. You can always filter out the state of a single cell from the list that's output when you do the standard bang, but maybe for simplicity's sake I should add this too. The question in my mind was, does this output a single value at the first outlet, or is there a second outlet for this?
- before someone else asks: dynamic resize of the matrix :)
Also shouldn't be too tough, I'll add it to the todo list.
Cheers,
Nick
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Looks quite nice! One thing that might make your Tcl-side development easier is to put all the Tcl code into a tglgrid.tcl file and load that in the setup() function. The template Makefile will automatically handle that file for you. You can see an example of that in hcs/cursor.c: http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/externals/hcs/cu... http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/externals/hcs/cu...
Then you can also better manage redraws within the Tk event loop using the [after idle [after 0]] hack: http://wiki.tcl.tk/9926
.hc
On 03/27/2013 05:34 AM, Nick Lanham wrote:
Posting here too since I got a lot of silence on pd-dev. From the README:
A tglgrid is a grid of cells that can each be toggled on and off. It can be instantiated with different dimensions depending on your project's needs. You can bang the left input to output a list of the active cells in the currently active column and send a column number to the right input to select the active column. Cells can also be toggled and/or turned on/off by sending messages: "tgl col row", "on col row", or "off col row".
Right now this has only been tested on linux. I would appreciate any reports about success and/or failure of running this in other environments.
The github page is here: https://github.com/nicklan/tglgrid You can find screenshots there if you're interested.
As this is my first external, I'm sure I've made some horrible coding/design mistakes and appreciate any feedback in that regard.
Cheers!
-Nick
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Just FYI, I've pushed a fairly big update that adds the following features:
and "rsay row"
grid dimensions
It should load your old saves fine, please let me know if it doesn't.
Hope people find this useful, and thanks for the feedback so far!
-Nick