Smart clips file size issue (file size doubles after copy + effect)

Today I ran into an issue with Audacity 3.2.1 (it’s the AppImage, on Ubuntu 20.04.5 LTS, in case that’s relevant). It’s similar to the github issue Performance and file size issues when copying and pasting a small portion of a very large clip, but the discussion there seems to be specifically about copying into a new project, whereas this issue is about within-project copy/paste.

To reproduce:

  1. Generate a 30 second chirp (file size: 5.4 MB)
  2. Copy 1 second of that later in the track (file size: 5.4 MB)
  3. Apply a destructive effect to the 30s clip (e.g. Amplify…, -30dB) (new file size: 10.8 MB)

I understand that this is to enable untrimming the shorter clip, but honestly trimming/untrimming clips is more of a hazard than a benefit to me–I like to use clip edges for alignment, and if I accidentally drag the edges around then I’ve lost that information. In this toy example, it’s easy to identify what’s causing the file size issue, but only because we know the steps we took–in a larger project with many clips, and more subtle effects applied, there’s no way to diagnose which clip(s) might be the culprit. I know there’s been some issues filed around visually indicating that part of a clip is hidden, but what I really want is to be able to turn off the ability to trim/untrim clips, and the related preservation of that hidden audio information.

Is anything like that coming up in the pipeline?

At this point, the project contains:

  • Track 1 (5.4 MB)
  • Track 1 undo data (5.4 MB)
  • Track 2 (hardly anything as the track’s contents are the same data as track 1’s undo data)

Total around 10.8 MB.
However, (tested on Linux) there is an additional 5.4 MB of data in the temporary “WAL” file, but this is automatically removed when the project is closed (and consolidated into a single AUP3 file).

On saving and closing the project, the undo data is dropped, but now track 2 requires its own copy of the full track data (5.4 MB), so the saved project size is still around 10.8 MB. This is about double the size of an Audacity project prior to “smart clips” because both tracks 1 and 2 contain 30 seconds of data, whereas without smart clips track 2 would have only contained 1 second of data. The developers consider this to be a feature and not a bug, so there is no plan to “fix” it.

It gets worse…
Adding a few more steps to your example:

  1. Generate a 30 second chirp (file size: 5.4 MB)
  2. Copy 1 second of that later in the track
  3. Apply a destructive effect to the 30s clip (e.g. Amplify…, -30dB) (new file size: 10.8 MB)
  4. Copy another 1 second from track 1 to track 2
  5. Apply another destructive effect to track 1
  6. Copy another 1 second from track 1 to track 2
  7. Apply another destructive effect to track 1
  8. Save and close.

The new project size is 20.8 MB (each clip contains a full and unique 30 seconds of audio, totalling 120 seconds, even though there’s only 33 seconds of audio visible in the project).