we need teachers like you! ;) i've been wondering about this: is the f+1 counter solution less expensive than a tgl? or does the toggle only slow down screen redraws? cheers, robbert
Roman Haefeli wrote:
hi matthew again
i attached a small patch, that shows how i would implement the most simple 'state alternator'. if you want to make state switching dependent on other states, it might be helpfull to have a look at the helppatch of [&& ], [|| ], [== ] and such. with these objects, it should be possible to implement the logic you want to achieve.
some random tips, that are important, when doing logic-stuff:
- many objects with two inlets only send a 'result' to the outlet, when
they're triggered by the left ('hot') inlet, whereas, if they get a message at their right ('cold') inlet, only their internal state is changed, but nothing is sent to the outlet. (Section 2.3.3 of the pd-html-manual is more detailed and might be interesting for you)
- you should care about execution order. for example, when one outlet is
connected to two inlets, the order of execution is *not* defined, or in other words: you don't know, which inlet gets the message first. therefore usually a [trigger]-object is inserted in between in order to avoid 'undefinedness' (have a look at the help of [trigger]).
- read the section about the 'depth-first'-principle in pd (section
2.3.2).
i hope, that was not too 'teacherish' ;-)
roman
hello robbert
On Tue, 2007-01-23 at 09:50 +0100, robbert van hulzen wrote:
we need teachers like you! ;) i've been wondering about this: is the f+1 counter solution less expensive than a tgl? or does the toggle only slow down screen redraws? cheers, robbert
theoretically, banging a [tgl] is more expensive than the [==]/[f ] construct, because - as you mentioned - the redrawing. though you won't notice it, when triggering at a very low rate (e.g. by footpedal). i usually use gui-objects only, when i really make use of the gui-part of the object, which is not the case here. but this might be a matter of taste.
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
in the case of [tgl] the choice is sometimes one gui object or a number of non-gui ones-- even simply the clarity of a patch can be helped by choosing [tgl]. but thanks for your advice, and i may find ways to use the non-guis instead. sounds like a good principle. cheers, robbert
On 1/23/07 4:03 PM, "Roman Haefeli" reduzierer@yahoo.de wrote:
hello robbert
On Tue, 2007-01-23 at 09:50 +0100, robbert van hulzen wrote:
we need teachers like you! ;) i've been wondering about this: is the f+1 counter solution less expensive than a tgl? or does the toggle only slow down screen redraws? cheers, robbert
theoretically, banging a [tgl] is more expensive than the [==]/[f ] construct, because - as you mentioned - the redrawing. though you won't notice it, when triggering at a very low rate (e.g. by footpedal). i usually use gui-objects only, when i really make use of the gui-part of the object, which is not the case here. but this might be a matter of taste.
roman
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
robbert van hulzen wrote:
in the case of [tgl] the choice is sometimes one gui object or a number of non-gui ones-- even simply the clarity of a patch can be helped by choosing [tgl]. but thanks for your advice, and i may find ways to use the non-guis instead. sounds like a good principle.
everything that can be built with "a number of objects", can also be build with 1 single object: just use abstractions.
mfa.sdr IOhannes