Schmitt trigger... Possible?

Ohhh… i see the light!
Computer data is stored on tape in a way that, for each time signal falls from a positive value to zero, the reader can reset a timer.
Time lapsed between 2 falls determine which bit is: short pulse is zero, long pulse is 1.
So, the goal is to have, for each positive values in the wave, a “max signal” that form our square wave…
I still have no idea on how to implement this… but is it!
Thanks for your advices & patience =)

If i use this code:

(setf threshold 0.08)  ;tweak this value as necessary

(let* ((sig (lowpass2 (snd-abs (highpass8 s 3000)) 3000))
       (sig (s-max (diff sig threshold) 0)))
  (clip (mult sig ny:all) 0.8))

audacity just prompt “Nyquist returned the value: 0,080000” and do nothing on signal…

Oops, I used the ‘legacy’ symbol for the track audio.
Replace the “s” variable with "track*, like this:

(setf threshold 0.08)  ;tweak this value as necessary

(let* ((sig (lowpass2 (snd-abs (highpass8 *track* 3000)) 3000))
       (sig (s-max (diff sig threshold) 0)))
  (clip (mult sig ny:all) 0.8))