How to stop my super-simple fixed-length silence plugin from making new clips each time?

This is my first time making an Audacity plugin, and I would be very grateful for any guidance.

My objective is to be able to press a hotkey and have a small, fixed amount of silence appear in my track. My plugin so far is this:

;nyquist plug-in
;version 1
;type generate
;name “Add 0.65s Silence”

(s-rest 0.65)

It basically works, but the new silence always appears as a new “clip” within the track, which must be manually joined on both sides (or ignored at the risk of making a mistake later). Since the task of adding silence is something I have to repeat very often, it would be great not to have to do that. Incidentally, I notice that the Generate → Silence… function does not have this issue; the new silence it creates goes into the currently selected clip, widening it. Is there a way I can get that behavior in my plugin?

I’m using Audacity 3.4.2.

Thank you!

I’m not a writer of Nyquist plugins - so no expert …

But couldn’t you just add commands to your plugin for

  1. select the track (or select all)
  2. use the Join Clips command

Peter

;nyquist plug-in
;version 1
;type generate
;name "Add 0.65s Silence"
;mergeclips 1

(s-rest 0.65)
1 Like

Thank you so much, Steve! This simple change will make editing enormously more efficient for both myself and my coworkers. Again, thank you!

1 Like