BUG. "Apply Chain" doesn't work with "Silence"

Audacity v 2.1.1, Win 7.

PROBLEM: Applying “Silence” as “chain” to an MP3 file silences it COMPLETELY
regardless of the setting of silence duration.

Test file: any old MP3, say 3 min.

Steps to Reproduce (skipping the obvious/required Double-Click, OK, etc.):

  1. Edit Chains
  2. Add “Alex”
  3. Insert “Silence”
  4. Insert “ExportMP3”
  5. Edit the step “Silence”
  6. Duration: 2 sec.
  7. Apply Chain “Alex”
  8. Apply to Files…
  9. Open the test file

The new (processed) file will be found in “cleaned” subdirectory.
Same name as original, same size, same duration but
COMPLETELY (from beginning to end) SILENCED, i.e.,
in vernacular, completely clobbered.
File > Open —> a straight “audio” line.

Additional Comments:

If same file is “manually” opened (File > Open) and then
Generate > Silence… (say, same 2 sec.)
the result is CORRECT, AS EXPECTED:
2 sec. silence prepended to the actual audio/file.

I expect the “Silence” step in “Chains” to be the same as the one
in the “Generate”, as long as I see the other generates like
Chirp and Noise offered on the Insert > “Select Command” > “Choose command” panel.

How are you Inserting Silence? Generate > Silence is the only “real” show element. All others are phantoms and are treated oddly by Audacity tools. For example, if you Time Shift a show later in time with the idea of making it play some time later after you push Play in your music player, it’s not going to work. The time you “inserted” isn’t real and will vanish in an export.

Your Time Offset appears real to you on the timeline and should stick as part of the show. This is a known problem and is being addressed.

Koz

I think this is as expected when you apply the Chain to files. Effects are applied to the whole audio file because there is no way in most effect interfaces to specify the duration to be applied.

Generators were recently added to Chains, perhaps without too much thought, but the length control in a generator does not specify a “length to apply”. The control responds to the length that is selected. If you select a region in a project and apply the Silence Generator in a Chain to a project, that region will be correctly silenced.

But when you apply the silence generator in a Chain to files, the whole file gets selected and you will see that the length control in the Silence Generator thus changes to the length of that audio file.

Where exactly do you want to silence audio in the files? The start or the end of the file? There may be Nyquist plugins you can add to a Chain that will do what you want.

Gale

As audacityalex said, Silence (Generate Silence) is being added to a Chain.

That is nothing to do with this topic, though.


Gale

I notice that recalling a saved User Preset in a generator does not change the duration controls in the effect. If it did, that “might” provide a way for a generator to specify a duration in a Chain.

Either way, that appears to be a bug.


Gale

There would still be a problem that there is currently no way for the Chain to know “where” you want the silence to be generated (at the start of the file, at the end, or somewhere in the middle). The same situation exists for other generators (such as “Tone” and “Chirp”).

Currently, if you look in the Chain text file, the “duration” for generators is not listed. This is a very simple example of a generator effect being used in a Chain - note that the duration is not included:

Tone:Amplitude="0.800000000000" Frequency="440.000000000000" Interpolation="Linear" Waveform="Sine"
ExportFlac:

As with processing effects, if a selection is not defined (and Chains currently have no way to define a selection), the effect (or generator) is applied to the entire file. This is really a design limitation rather than a bug.

That is a design limitation if even user presets don’t save the duration, yes.

If you set the generator in the Chain to use a “User Preset” for example called “6s”, the parameters for the command change to:

Use_Preset="User Preset:6s"

which doesn’t specify parameters at all. All the parameters in the preset are actually respected, even if the generator’s settings when called from the Generate Menu are different, except for duration. The “duration” in the preset just uses whatever is the last used duration.

You might argue that if Duration was a parameter in the Chain file, that it would only be used when setting a preset. This would provide a way to let the duration of the current selection be used for the generation, rather than the one specified in the Chain.

But totally irrespective of what Chains in a generator should do, if you save some User Presets in for example the Tone generator, click in the track or make a selection, Generate > Tone… and select a preset, then as default behaviour the Duration in the control should change to the duration when you saved the preset. Otherwise, what is the point of saving the preset?

Perhaps it would be nice to be able to specify “automatic” in the preset, meaning that when you recalled the preset it would not change the duration in the control, but I don’t think ignoring the saved duration as now is the right thing to do.


Gale

Generator “Presets” do not store the duration setting.
This is an example of how the settings are stored for the “Tone” generator:

Parameters=Amplitude="0.800000000000" Frequency="440.000000000000" Interpolation="Linear" Waveform="Sine"

“Presets” look a bit silly for the “Silence” generator because there are no settings other than “duration” (which is not saved). This is a (small) downside from having a common interface design for all Audacity effects.

That sounds reasonable. How would you envisage it?
One possibility:

  • A checkbox for “Use Selection Duration”.
  • When enabled, the “duration” time control is greyed out.
    • When disabled the time control is honoured by Chains and saved in presets.

It still does nothing for the issue that there is no way to specify “where” the silence is generated.
How would this behave if the Chain is applied to a 30 second track and the Chain generates 5 seconds of silence?

Many thanks to all the people who have provided insightful comments to this topic (so far :slight_smile:

I’d like to respectfully (Audacity IS a great product) present a couple of answers to

  1. people who have a problem with me calling the problem a “Bug”.

A Bug by any other name is a BUG (obviously, everybody is free to pick/use any name they feel confortable with).
First, the Audacity developers are in no way obligated to add generators to the Chain feature.
But when it is offered, with even the inclusion of “Parameters”, it becomes a BUG:
1.1. The unhappy user/victim is sent on a wild goose chase manipulating Parameters only to always end up with a fully clobbered file.
1.2. At the very least (to save the appearances) in the “Edit Parameters > Manage > About”
instead of
Description: Creates audio of zero amplitude
there should be something to this effect,
Description: Replaces the full audio file with Silence

Something similar for “Chirp”, BTW.

  1. people who wonder how it should/could be done properly.

Preliminary: “How are you Inserting Silence? Generate > Silence is the only “real” show element.”
I explained the default I expected (and needed) in the Bug submission:
<<
If same file is “manually” opened (File > Open) and then
Generate > Silence… (say, same 2 sec.)
the result is CORRECT, AS EXPECTED:
2 sec. silence PREpended to the actual audio/file.

If a “real”, meaningful “Chain Silence” is to be included in the product
(my vote is, yes, please, as soon as practicable)
a simple Parameter should/could be added:

Time position in the file (hh:mm:ss, etc.)

similar to the (implied) CURSOR position in the non-Chain (manual) “Generate > Silence”.

Note: as mentioned above, the default, “beginning of file” (00:00:00), cursor position was my particular preference in the Chain
(as would be in the “manual” approach).

In terms of developing a “product” the term “bug” has a narrower, more specific meaning (though I appreciate that from a user perspective this is largely irrelevant :wink:)

From Wikipedia: “A software bug is an error, flaw, failure, or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.”
So if something is working as intended, then it’s not a “bug” (regardless of how bad the user experience).
That does not mean that something that works “as intended” but has other flaws should not be fixed. On the contrary, a “bug” is just one type of flaw, and the goal of developing a product is to provide the best possible experience for users.

Please also note that generators in Chains is a new feature, on top of which there has been a very recent introduction of a standard interface for all built-in effects. The support and documentation crew are still getting to grips with these changes, and there are still development aspects that require more work. Your comments here provide valuable “user feedback”.

So if a generator in a Chain was given a start time of 1 min 30 seconds, and a duration of 30 seconds, would it “insert” the generated audio at 1 min 30 seconds, or would it overwrite the track from 1 minute 30 seconds to 2 minutes?
I’m thinking that we would want both options.

OK, thanks. I see those parameters in pluginsettings.cfg.

We could get over that by adding an option of some kind for duration.

I was not envisaging the checkbox greying out the time control. You might want to always save the current duration into a preset, but be able to modify the duration to be generated.

I assume you mean that if the new option is enabled and you make a selection in the waveform, the greyed out time value would be the selected length, and when there is no selection the greyed out time value would be the last used duration? If so, the duration shown in the time control would be as now, but the greying out could be misconstrued as something other than that displayed duration being used (perhaps a preset, but presets are never loaded when opening the generator from the Generate Menu).

“Selection Duration” could be taken to mean the waveform selection, but if generating at the cursor there is no waveform selection duration.

Because generators are a special case where the duration is part of the “effect”, I was envisaging that Chains would use the selection duration encountered in the waveform (or the last used duration if there is no selection encountered), unless the Chain enabled a preset. A preset that had a saved duration would over-ride the encountered or last used duration.

All I was envisaging that the checkbox in the generator would do is determine if the duration was saved into the preset (as the user would see it, whether loading the preset could change the duration control). Perhaps “Automatic” was implying more than I intended. The checkbox could be labelled “Save Duration into User Presets”.

Perhaps something like you suggest might be neater, but at the moment I can see ambiguities unless I am misunderstanding what your idea is.

Without options, it would have to reduce the waveform selection (and in this case the track) by 25 seconds. At least sometimes this is what the user might want when applying the Chain to the project, but many times something else might be wanted.

Because generators are this “special case”, and we have the difference where Chains could be applied to projects or to (all of) imported files, I’m not convinced the generator commands in Chains should have a load of options. Also what would it mean for generators if there was a general option to apply Chain commands to one or more specific selections, ignoring the waveform selection?

Would it not be preferred to simply use an appropriate Nyquist effect if you wanted e.g. to silence the lead in and fade out in imported files?


Gale

OK, but if that is your only use case as you now seem to be saying, why not simply use Missing features - Audacity Support then you can have a solution to the problem today. :sunglasses: The availability of that reduces the immediate urgency of the problem you point out, which is complex. “Time Position” is not enough. Generators apply to selections too, as Steve said.

There are more important feature lacks in Chains than this, in my opinion - such as no FFmpeg exports, no uncompressed exports other than 16-bit PCM WAV, and inability to specify sample rate and bit rate (for uncompressed files).


Gale

So if a generator in a Chain was given a start time of 1 min 30 seconds, and a duration of 30 seconds, would it “insert” the generated audio at 1 min 30 seconds, or would it overwrite the track from 1 minute 30 seconds to 2 minutes?
I’m thinking that we would want both options

Currently, the manual (non-Chain) “Generate > Silence…” inserts.
(That’s why I had been very happy with the “Generate > Silence… 1-2 sec.” on opening the file - with default Cursor at time 00:00:00).
It just makes sure a file is played with a delay of 1-2 sec. at start.
As of Oct. 6, 2015, no player in the world has an option to insert a delay (say, 1-2 sec.) between songs.

However, I’d vote for both options.

But when there is a selection in the waveform it overwrites.

Also, if a file a Chain is being applied to is 3 minutes long and we set a start time of 5 minutes, what should happen? We might want to generate extra audio at five minutes when applying a generator to a project but probably not when applying to a file.

So for applying to files, arguably a different control is needed that refers to the percentage time of the file.


Gale

OK, so I noted your “vote”. Peter can archive this topic in due course if there are no further comments from anyone. Thanks for your input.


Gale