creating a square wave that follows the recording of a drum

Hello!
I have a recording of repetative beating on a single bass drum.
I want to create a channel with a 10msec square signal for each beat on the drum. (I made an ilustration in the picture)
I tried using the beat finder but it does not track the beat properly, and gives a complicated beat analysis for a very simple beat from 1 drum (you can see in the picture)
how can I do such a thing?

Thanks
Untitled.jpg

Pulses ? …
~10ms pulse for every drumbeat.png
https://manual.audacityteam.org/man/noise_gate.html

yes… so the first step would be perhaps to use the noise resuction to such a level that only the peaks will stay. but how can i make a 10ms pulse for every peak that remains?
that is, i need from the onset of the peaks a 10ms square pulse.
If it was python i would say something like "if it goes over a certain threshold, create 10ms pulse… "

In “Nyquist” (https://manual.audacityteam.org/man/nyquist.html) you can do the same.
Fir example, for a mono track:

(setf val 0.8)        ;level of pulse
(setf duration 0.05)  ;length of pulse in seconds
(setf threshold 0.7)  ;Threshold level to trigger pulse

(setf blocksize (round (* *sound-srate* 0.01)))
(setf stepsize blocksize)

(let ((envelope (s-avg *track* blocksize stepsize op-peak)))
  (setf envelope (diff envelope threshold))
  (trigger envelope (const val duration)))