i dnon't get it, i want it to work like the onebang object. when you send a click~ in the right inlet, the left inlet should stay open until a click~ comes trough then immediatly closes for other click~'s into the left inlet.
i think i get you now, but i must say "dont have too
what you are trying to do - using clicks as triggers
in MSP - is an attempt to build logic on the signal
this is in many cases simply impossible: as soon as one
part of such a network works, you will always come to
another point where you again need a possibility of
triggering a 0 to 1 transition (the state) by a click
the only method i can think of is using a special object
for that purpose, which is able to do this spike-to-state
i dont know one, but maybe there is one.
You could use edge~ to convert the clicks into bangs, then just use it with a regular onebang. The bangs that are output by the onebang can then be used to trigger click~ objects, envelopes, or whatever you want. Example:
btw such things (signal to signal-generation) need a lot
In my experience, not necessarily. While processing signal clicks is more CPU intensive than processing bangs, it is not that expensive. For example, a samm~ object with 30 click outlets draws no more than 1% of the CPU on a 2.4 GHz Mac.
The native MSP solution probably needs a few more objects to implement the same sample-accurate logic, so that might be more CPU intensive than my approach.
This is probably the simplest way to do it(after C74 introduced gen~ i notice they also added a '+=~' object for regular msp :D).
[+=~] -> [==~ 0.]
Check it out:
Oh, but now i see everyone's examples create a signal click, so i see what you're going for... ooops, well, still, i bet we could trim these solutions down with something from this, in case it helps(i been using +=~ for too many things lately, sorry) :)