Apply effect to parts of selection found by SoundFinder.ny

Basically I want an automatic version of Punch Paste, which would detect silent fragments with algorithm from SoundFinder.ny and rewrite the fragments with copied sound.

So I want to do something like this:

(if (and (< v thres) (= sound-search 0) (/= sound-start -1) (> sil-c sil-length) (/= silence-start -1))
  ...
  (mixpaste (part-of-s-between silence-start sound-start))

What’s the easiest way to achieve it?

Also, instead of hacking the plugins, is it possible to achieve something like this by making a Macro which would read a layer with labels (which SoundFinder.ny produces), select the first silent part on the selected track, apply Punch Paste, select the second silent part and so on?

Any other simpler approach?

Thanks!

I don’t think there’s an easy way to do this, but …

Not with a “normal” Macro (because these simply apply a list of commands, and your task requires programming logic to loop through the regions), but I think it is probably possible with a “Nyquist-Macro”.

Note that Nyquist-Macros are a very new feature. There’s a lot of new stuff for Nyquist-Macros in the next version of Audacity (2.3.1) which is due for release soon. The documentation fo Nyquist-Macros is currently playing catch-up, but you can find some information here:
https://manual.audacityteam.org/man/nyquist_macros.html

Documentation for Nyquist is here: Missing features - Audacity Support