On 4/3/06, Georg Holzmann grhPD@gmx.at wrote:
Hallo!
hm ... could you describe the algorithm you want to implement a little bit more? If you want to do sample by sample processing fexpr~ is usually a little bit slow ... (at least in my experiments)
Hi, it seems very simple what i'm trying to do (if i was programming it in C it would be fairly trivial), so its suprising how difficult its turning out to be... basically, i want to make an abstraction which has a signal input, and a signal output (which is initially silence regardless of input signal). when it recieves a bang (in a different inlet maybe) it should wait for the next zero-crossing in the input signal, then let the signal through for a specified number of zero-crossings (lets say 20) then it turns off again on the 20th zero-crossing.
so far i've got a signal which is 1 when there is a zero crossing and 0 otherwise (attached), i just need to use this to switch on the output when the first 1 arrives at a point after there is a bang or a 1 to signal that we want output to turn on.
hope that makes sense...
so i'm guessing i need to use a variable or [value]. but can i set this within an fexpr~ object, and will it update fast enough (if it takes a block to update then its no good).
as messages are calculate once per block I think that's not possible ...
i see.. so to do things sample by sample, everything has to be signals? no control values. thats what makes this tricky i guess.
thanks very much for your help!
pete.