Thanks! I used [pipe] because I had an obvious timing problem and that was an explicit delay object. Didn't occur to me that [trigger] could control the timing as well. It's use wasn't obvious to me from what I had read about it.<div>
<br></div><div>I will make the adjustments you suggest and see where I get. I expect I will have more questions.<div><br></div><div><br></div><div>Thanks again,</div><div><br></div><div>-Theron</div><div>^<br><div><div><br>
<div class="gmail_quote">On Fri, Feb 4, 2011 at 5:17 AM, Matt Barber <span dir="ltr"><<a href="mailto:brbrofsvl@gmail.com">brbrofsvl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br>
Before you go any further in Pd, you should check out the [trigger]<br>
object. It's the single most important object in Pd, in my opinion -<br>
it will help you get the timing right in these kinds of situations.<br>
Trigger forces hot-cold things to happen in the correct order<br>
explicitly -- without it you have to rely on the order in which you<br>
made the connections, which you can't SEE in the patch.<br>
<br>
You should use [trigger] instead of the [pipe 0] construction you have<br>
as well, the number box should most likely be a message with a zero in<br>
it (to hardwire it to zero), and you should probably be sending it to<br>
the cold inlet of the [int] (so that it just sets the [int] state<br>
rather than passing the zero through once when you set it and then<br>
once again on the first bang of the [until]).<br>
<br>
But again, master the use of [trigger] before you go any further --<br>
multiple lines coming from an object should make you feel<br>
uncomfortable until you're sure you're doing it correctly.<br>
<br>
I hope this helps.<br>
<font color="#888888"><br>
MB<br>
</font><div><div></div><div class="h5"><br>
<br>
><br>
> I've looked over the help patches, the FLOSS manual, and at a number of<br>
> examples, but I'm clearly missing something.<br>
><br>
> I'm trying to build a proof-of-concept state table for a grid sequencer. I<br>
> figured out to use an array to store my states, and I can write to and read<br>
> from the table, except when I'm trying to use pack.<br>
><br>
> The reason for pack is to get the column, row, and state of each button in a<br>
> range of the state table (will be a single column in my end use, but I'm<br>
> doing the whole thing for now).<br>
><br>
> Attached is a patch with a 2x2 grid set up and you can click on them and set<br>
> the state table. That works. It's the lookup part that doesn't. I'm<br>
> stepping through the entire state table, deriving the column and row from<br>
> the index and looking up the value of that index. This all works until I<br>
> send those three pieces of information to a pack object, it re-arranges<br>
> things in inconsistent manner. Clearly there's either a timing thing or I'm<br>
> not understanding the data flow of what I'm doing. Or maybe I'm just not<br>
> getting the point of pack.<br>
><br>
> I'm pretty new to this and every step is a struggle, so any suggestions are<br>
> welcome. But if there are any tips or pointers on why pack is not working<br>
> the way I think it should - or what I should be using to accomplish what I'm<br>
> trying to do - I would appreciate it.<br>
><br>
><br>
><br>
> Long-winded description of how the attached patch is behaving:<br>
><br>
> Buttons are arranged in column, row order. I'm just storing 0/1 values in<br>
> the state_table array. If I click on the first and last buttons, my array<br>
> is then 1 0 0 1. So state_table[i] gets me the off/on value for the button.<br>
> i div 2 gets me the column number and i mod 2 gets me the row number.<br>
><br>
> If I just print these three outputs I get everything out in the order I<br>
> expect:<br>
><br>
> column: 0<br>
> row: 0<br>
> state: 1<br>
> column: 0<br>
> row: 1<br>
> state: 0<br>
> column: 1<br>
> row: 0<br>
> state: 0<br>
> column: 1<br>
> row: 1<br>
> state: 1<br>
><br>
> If I send the three values into a pack object and print the output of that,<br>
> I get:<br>
><br>
> pack: 0 1 0<br>
> pack: 0 0 1<br>
> pack: 1 1 0<br>
> pack: 1 0 0<br>
><br>
> I would expect this:<br>
><br>
> pack: 0 0 1<br>
> pack: 0 1 0<br>
> pack: 1 0 0<br>
> pack: 1 1 1<br>
><br>
> So things are coming in the wrong order overall, and the state values are<br>
> wrong.<br>
><br>
><br>
> Thanks,<br>
><br>
> -Theron<br>
</div></div></blockquote></div><br></div></div></div></div>