the algorithm i'm trying to implement using fexpr~ requires some kind of variable, to store whether it's current output is on or off (1 or 0) - it needs to act differently in each case. ideally i'd like to simply put the output back into another input so i can just query its current state, but obviously this causes dsp loop errors, and i cant use send~ and recieve~ to do this because it delays it by a block, so on a sample by sample basis its completely out of date by the time it comes back as one of the inputs..
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).
any ideas?
thanks.
Hallo!
the algorithm i'm trying to implement using fexpr~ requires some kind of variable, to store whether it's current output is on or off (1 or 0) - it needs to act differently in each case. ideally i'd like to simply put the output back into another input so i can just query its current state, but obviously this causes dsp loop errors, and i cant use send~ and recieve~ to do this because it delays it by a block, so on a sample by sample basis its completely out of date by the time it comes back as one of the inputs..
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)
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 ...
LG Georg
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.
Hallo, Peter Worth hat gesagt: // Peter Worth wrote:
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...
If you'd accept C: There is an external called "zerocross~" in xjimmies, which counts zerocrossings: http://tot.sat.qc.ca/down/nslam/doc/DOC_HTML/_nSLAMv2Reference.html#zerocros...
Frank Barknecht _ ______footils.org_ __goto10.org__
See attached patch. Could probably still use a little tweaking, and there's a lower limit on number of crossings per gate, but maybe this is a start.
-david
On 4/3/06, Frank Barknecht fbar@footils.org wrote:
Hallo, Peter Worth hat gesagt: // Peter Worth wrote:
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...
If you'd accept C: There is an external called "zerocross~" in xjimmies, which counts zerocrossings: http://tot.sat.qc.ca/down/nslam/doc/DOC_HTML/_nSLAMv2Reference.html#zerocros...
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 4/3/06, david golightly davigoli@gmail.com wrote:
See attached patch. Could probably still use a little tweaking, and there's a lower limit on number of crossings per gate, but maybe this is a start.
-david
thats excellent, thanks very much!
the problem was that i couldnt check the current state of the fexpr~ output within the fexpr~ itself, without getting dsp loop errors, or using s~ and r~ and delaying by a block. but it seems obvious now that thats what $y is for..
thanks again.
pete