Draw Tool Constrain feature

A constrain function for the Draw tool would make editing pops and clicks a lot easier. If this feature could be added I would certainly find it helpful as I am sure others would also.

Repair may suffice.

repair in action.gif
Select at Zero crossing applied prior to repair.

There’'s also the “Smooth” tool (see: https://manual.audacityteam.org/man/draw_tool.html)


Thank you for the reply Trebor & Steve, both suggestions are helpful but not the solution for my issue.

What I need to make it work is the following;

1 When zoomed in close enough that you can select a single dot (not in the waveform view).
2 With a single dot selected and placed where you want, a (constrain feature or lock feature [eg. alt L or something]) so as you move the pencil all the dots you pass over would be placed in the exact same position as the dot that was locked on.

I hope this helps explain my Feature Request?

How about this as an alternative:

  1. Zoom in and set the first sample to the required level
  2. Switch to the normal selection tool (“F1”) and select from the first to the last sample that you want at that level
  3. Press a keyboard shortcut to run a “magic effect” that sets all the selected samples to the same level as the first selected sample.

I’d imagine that in most cases you would want the it to start at the existing level of the waveform, in which case steps 1 and 2 are not required.

Well, after 16 or so years or so with Audacity (including much use of the Repair tool) I never knew about the “smoothing”. :astonished:

This made me look at the Manual page - which I subsequently tweaked for the 3.2.0 alpha Manual to make the two modes of use clearer to the reader:



Thanks again.

I guess the “Magic Effect” would be okay, but would it not be easier to just have a function like “shift” or something that would lock the pencil at the selected level so all the dots swiped over while holding down that key would be redrawn to exactly that first selected dot?

I think that it would be so rarely useful that I would not want to inflict it onto every Audacity user on Earth.

Here’s the “magic” plug-in (updated 31st Jan 2022):
constant.ny (554 Bytes)
When installed and enabled it will show up in the bottom section of the “Effect” menu as “Constant Level”.

Installation instructions for Nyquist plug-ins on Windows:

Note that for stereo tracks, there are three options. It can act on just the left channel, just the right channel, or both channels. Rather than writing three separate plug-ins, I’ve provided the plug-in with a multi-choice menu to choose which you want.

To run the effect with a single shortcut key:

  1. Make a macro containing only the “Constant Level” effect (select whichever channel option you want)
  2. Make a keyboard shortcut to run the Macro.
    If you want, you could create 3 Macros, one for each of the channel options.

    More information about Macros here: Macros - Audacity Manual
    More about keyboard shortcuts here: Shortcuts Preferences - Audacity Manual

Thank you Steve, I will give it a go…

Hello Steve, the constant plug-in works with the both option, but If I choose left only or right only it applies the constant effect to that channel but then places the cleared spike on the opposite channel?

Interesting. How did you install the plug-in?

(I’ve just updated the plug-in due to a typo in the original version that I posted).

Hello again.

I installed the plugin by placing it in the audacity plug in folder and then enabling it. Where can I get your updated version?

Thank You for your help by the way, it will save my a countless amount of time which is greatly appreciated.

Here: https://forum.audacityteam.org/download/file.php?id=34691 [updated 31st Jan 2022]
It’s a drop-in replacement for the first version. Just copy it over the first version - no need to re-enable.

Thank you so much, again.


I can’t reproduce that.
Please provide precise step by step details of what you are doing, preferably with screenshots, so that I can reproduce the problem.

Just a thought: Are you using an old version of Audacity? The current version is 3.1.3 (look in “Help menu > About Audacity”)

Hello Steve, Here is a screen capture of the issue. The Left constant and the both work fine, the issue only seems to happen with the right constant.

Thanks. I don’t know how I missed that :blush: :smiley:

Here’s a fixed version, and I’ll update the previous post.
constant.ny (554 Bytes)

Works Perfectly now. Thanks so much…