Time Markers to assist computations

Hello. I’ve been using Audacity for a few years. It’s a great program.

I do a lot of audio editing to combine FM Radio broadcast of sporting events with the TV broadcast. I record both then bring the audio into Audacity. The goal is to adjust the FM audio to match the TV audio which acts as a reference. When complete I export the corrected FM audio and add this as an extra audio track to the original video.

To do this in Audacity I use mainly these functions:

(1) “Cut” to remove a section of audio to move it forward.
(2) “Generate Silence” to pad the audio in places to shift the audio back.
(3) “Change Tempo” because in some instances the FM audio has been time compressed or expanded because of editing in the studio, e.g. coming out of a commercial break too late they compress the live broadcast to catch back up to real time.

In all three cases I note a beginning and an ending time location of interest. Note the place that gets acted on in (1) and (2) above are in a different time location (typically during a commercial break where I don’t care) so I need to know the delta time which I unfortunately need to use a calculator to do. Also it’s not possible for me to simple select the region of time because I need to move and playback clips to confirm before editing. So there is a lot of writing down the times, doing the math manually, then typing the results back into Audacity. This is all very inefficient. So here’s what I propose or would like to have:

(1) Add the ability to create a time marks. Wherever the selection start is, I’d like to press a button to save that as a time mark. The time mark would stay there until I overwrite it. I would need a few time marks. Perhaps we could have time marks 0 through 9 although I don’t know that I need that many. TM0, TM1, TM2, etc.

(2) Ability to use the difference between time marks, e.g. TM1-TM0, for length/duration or a pair of them for ratio functions. Specifically I would use the difference in these cases:

(A) As the length value for the current selection. A button next to the area where you normally type in the length would be perfect for this.
(B) “Generate Silence” as the duration value when prompted. Again a button on that form for that would be great.
(C) “Change Tempo” ability to use 4 time marks to get the ratio for the percent change, e.g. (TM1-TM0)/(TM3-TM2). Again a button on that dialog box for this would be great.

To simplify the code and interface to do this perhaps in each of the 3 cases the time marks would have to be certain ones. E.g., as the length or duration values perhaps it would only use TM1-TM0, and for “Change Tempo” it would only use the time markers as I gave in the example.

The user can still enter lengths, duration and percent change as they normally would, but the extra (hopefully small and not intrusive) buttons could dramatically speed up editing process.

Also the ability to go a specific time mark could be very handy. Plus after an edit move the time marks where appropriate. For example if a time mark is near the end of the audio and you clip some of the beginning audio, then move the time mark so it’s still referencing the same point in the new audio stream.

These features would be very welcome and I estimate would reduce my editing time to much less than 1/2 the time required now.

I didn’t quite follow all of that, but perhaps these two plug-ins may be of some use to you: https://forum.audacityteam.org/t/labels-to-show-time-that-a-recording-was-made/47327/1

The time shift tool is a better solution …

The time shift tool shifts the entire track. I need to shift only from starting at a point in the “middle” of the track to the end of the track. Also the tracks are typically over 3 hours so you certainly don’t want to display the entire time that you’re shifting or it will take forever to render onto the screen. I never have more than about 10 seconds displayed on the screen for this reason.

What you need to do is to create a “split” at your “point in the “middle” of the track”

Place the cursor there and use Edit > Clip Boundaries > Split or it’s short cut Ctrl+I

You can them move each of the split sections separately.

See this page in the manual: https://manual.audacityteam.org/man/audacity_tracks_and_clips.html

I struggled with slow speeds when editing long projects typically two hours for me - much improved when I upgraded my hardware - now running on a PC laptop Windows 10 with a 256GB SSD with a 1TB metal spinning disk as an onboard D: drive in the laptop.

The 256 SSD I use for the OS and apps - and for active editing data - Audacity projects and photo editing with Photoshop, Once editing is complete the files can be moved to the slower (but much bigger) 1TB disk.

It’s the SSD that makes all the difference - my other engine is a Macbook Pro which just has a 256 SSD - and that is fast with Audacity too.


Those are all great suggestions, but still not quite optimal for what I’m doing.

How about a compromise? Is it possible to add a feature to copy and paste times from/to:

Selection Start
Duration (when adding silence, or anywhere else that requires a time entry)

When coping to the clipboard if you can do this as simple text, then I can paste it into another app where I can perform the calculations quickly, then I could copy my result back to the clipboard and paste it back into Audacity.

This should be fairly easy to code and would help me big time. :smiley:

As far as the interface to do this one way would be to copy the entire “Selection Start” as long as any part of it has the focus and the user presses the copy key (e.g. Ctrl C on Windows). If this isn’t possible because it conflicts with the existing interface for copy/paste audio stream sections then another way is to right click in the value section which already gives you the pop up menu to select the “units” of time, and add two items → copy + paste.

This would really help me guys. Thanks.

The pasted time value would either need to be in one specified format (such as decimal time in seconds, which Audacity uses internally), or there would need to be detection, validation and conversion for all supported formats. Even with the constraint that pasted time values must match the selected time format, there still needs to be validation of the pasted data, and an agreed syntax for the data. And then there’s the code to actually handle reading and writing to and from the clipboard, which I assume you would want to be in a text format, or perhaps as numeric data?

Not impossible, but by no means “fairly easy”.

Fair point about it not being “fairly easy”. Parsing input is one of the most tedious of coding tasks. Lots of possible combinations to deal with.

Yes about the format needing to be defined and data needing to be validated. A few thoughts…

If there’s any error then paste nothing and perhap give the user feedback with the “standard system error beep”, or something that says format error.

I put a tiny bit of thought into the format. (Obviously you know more of what’s appropriate for practical integration into Audacity.) I see a few options. One is to use whatever format is currently selected. A few examples of legal text are:

samples 123456
hh:mm:ss + milliseconds 01:23:45.678

Where the text “samples” or “hh:mm:ss + milliseconds” is not pasted/copied to/from the clipboard, but the “:” and “.” as part of the numerical entry are.

Another though is the same except you would in fact include the descriptive text like “samples” and separate it from the numeric data with the pipe character “|”. This way the side receiving the pasted info would know the data format to be parsed. Or you could use a numerical code or short prefix for each of the different legal formats preceding the pipe. If the copied data is pasted into an external app and it can’t a particular format, then that’s just tough luck for it. It can beep too. :wink:

All the parsing ironically makes this more difficult to code than implementing a marker + math system. I could give a much better explanation of the marker + math and why it would be so helpful by illustrating using some marked up screen captures if that would help you better understand that request.

Of course being greedy I’d like both copy/paste times and the marker system! :laughing:

…and drag and drop into the time fields while we’re at it… :smiley:

Reading through your first post again, wouldn’t it be easier to simply split the track that you are trying to synchronize, into chunks, cutting out any “dead” areas (such as adverts / silences), then use the Time Shift tool to drag the pieces so that they line up (visually) with the other track?

You may be correct. I haven’t tried that yet because I’m fearful of the size of the tracks slowing things to a crawl. They are up to 4 hours long, and even with SSD this can slow down the operation significantly.

When I move a “chunk” it’s always from the previous advert all the way to the end of file. That way it keeps things close. Many times the sync stays perfect through several advert breaks, so it’s advantageous to grab everything from a point in the track to the very end. As the edits get closer to the end the size of the chunks naturally get smaller.

I’ll give it a try in the next few days and let you know if that’s a viable solution for me. It certainly should be easier if it doesn’t cause the interface to lag severely.

Thanks Steve.

I’ve now got an i7 laptop with SSD, but my previous laptop was a dual core pentium with spinny disk. On that laptop, things got slow with large files, so I just chopped up large projects into smaller projects (between 30 minutes to 1 hour max). When necessary, I’d stitch the projects together at the end by simply importing the WAV files from each of the projects into a new project. Mostly that last step was unnecessary and I could just use the 30 / 60 minute files.


I used the feature as you suggest and yes it does work. Thank you. However there’s one slight issue I’m having…

If you attempt to shift a piece (call it piece B) into/through an existing piece (call it piece A) it stops. This is understandable behavior. In my case I’d prefer it to “plow through” piece A. For example if I attempt to move piece B one second into piece A then I’d like piece A to be trimmed by one second to make room for the movement. Perhaps if the user held down the shift key while using the time shift tool (or some other key) it could allow it to do this.

Half of the edits I perform need this. Without this it takes me an extra step because I have to manually remove some of piece A.

When you want to replace parts of track with other parts, it’s easier if you use multiple tracks.
The steps that you cannot see in the GIF below are:

  • “Track Focus” is the track that is currently being operated on. It is indicated by a yellow border to the track. To move track focus from one track to another, use the up / down cursor keys.

  • “Track Selection” is indicated by the highlighting of the track (notice in particular the highlighting of the info panel on the left end of the track). The selectedness of the track that has focus may be toggled on / off by pressing the ENTER key.

Note that to speed up the process, keyboard shortcuts may be used (they are shown in the menus).

Click on the image below to expand it.