Hi,
I have wired up some Phototransistors to my Bela mini analog inputs I am getting some predictable good results but quite a few spikes. See the screenshot below. low light should give me 0.00123 etc. High light 0.1 ++ Thats great when it works, but I get crazy spikes of 5, 6 7 etc. So I guess my question is.. do you always need to software filter to get rid of these. I noticed a C++ example where you do this.

I was actually trying to use SuperCollider and getting the same results as this PD example and finding it pretty hard to filter it.

Any tips would be really welcome.

Many thanks

Simon

Amazingly, In a strange late night twist ChatGTP seems to have solved it for me in SuperCollider.
Is this sort of filtering pretty standard then?

(
SynthDef("AnalogInputs",{ arg inPin=0;
var input0 = AnalogIn.ar(inPin);
input0 = Lag.ar(input0, 0.1); // Smooth input with a short lag
input0 = input0.clip(0.0001, 0.3);
SendReply.kr(Impulse.kr(10), '/input', input0);
}).add;

Those are not high spikes. They are very small numbers written in scientific notation.

Ah ok.... Thanks. I thought it might be something like that. The code above seems to clear them out of the way so I think its ok.

Cheers