Regular Interval Labels - cannot handle large files

Hi guys!

I’m new in town and hope that some one could help me out.

I’m trying to split a large/long track into several small tracks. After some searching I finally found the magic wand - “Regular Interval Labels”, it’s a great tool!

It seems that I’m pushing the plugin to the limits:
When trying to set an interval higher than 480 seconds - it fails.
When selecting a track section longer than 7 hours and 55 minutes - it fails.

Can someone guide me to the source code of the plugin? I might be able to fix the issues myself.

Have some of you ever worked on tracks that long and trying to split them?

Thank you for your time.

/Splaxi

Could you please look at the pink panel at the top of the page and fill in the information requested.

If you look in the Plugins folder where you are running Audacity from, you can open “equalabel.ny” in your favourite text editor and change it.

What happens exactly? I have just labelled an hour long track with an interval of 600 seconds (Audacity 2.1.0-alpha, Windows 8.1).

On the same system, I’ve just labelled a 10 hour track with 60 labels at intervals of 600 seconds.


Gale

Hi Gale,

Sorry for my missing details:
Windows XP SP3
Audacity 2.0.6
I downloaded the exe file.

The error I get is “Including your time offset of ~a seconds, your requested~%label interval of ~a seconds is greater than the duration~%of your selected audio (~a seconds)”. I just copied the error from the plugin, because I found a way around my issue. The problem might be that I’m running Windows XP.

I’ve built a label file generator, that fits my needs. It’s a bat file and will ask for hours, minutes, seconds, timesplit period and the title for the labels. It handles up to 999 files.

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION

echo "Remove this line" s> test.txt

set /p Hours="Hours: "

set /p Minutes="Minutes: "

set /p Seconds="Seconds: "

set /p Titel="Titel for tracks: "

set /p Timesplit="Timesplit in seconds: "

set /A TotalSeconds = %Hours% * 60 * 60 + (%Minutes% * 60) + (%Seconds% * 1)

echo Total time is "%TotalSeconds%"

set /A Counter = %TotalSeconds% / %Timesplit%

echo Total chapters is "%Counter%"

set /A countTemp=0
set /A Counter=%Counter%+1
set Chapter = 0

FOR /L %%G in (0,1,%Counter%) DO (
	set /A Chapter=!countTemp!+1
	set Var=00!Chapter!
	set Var=!Var:~-3!
	
	set /A Temp = !countTemp! * %Timesplit%
	echo !Temp!,000000	!Temp!,000000	%Titel%-!Var! >> Labels.txt
	set /A countTemp=!countTemp!+1
)

ENDLOCAL

But I might try import the next large file to my Win7 machine and compare what I can do on either machine.

So looking at your selection length and your offset and label interval setting, is that error statement true?

If not, please state the track length, selection length and the exact value of each setting in the plugin. A screenshot may be convenient. Please see here for how to attach files: https://forum.audacityteam.org/t/how-to-attach-files-to-forum-posts/24026/1


Gale

Hi Gale,

I will do a screen shot in the weekend - so you can see what my settings are when it’s working and what they are when it doesn’t work.

From my point of view - no. I did CTRL+A (Select ALL), and the time periods in the bar at the bottom was 00:00:00.000 - 14:37:20.000. In the Regular Interval form I only changed the period and how the numbers should be applied to the prefix text. When I tried with a smaller part of the track(00:00:00.000 - 08:00:00.000), but it still failed, the time selection in the bar at the bottom defaulted back to the full length of the track. So I concluded that something must have gone wrong, since it changed my selection.

But I will supply screenshots over the weekend :slight_smile:

I’ve just tried an 8 hour selection with labels at intervals of 600 seconds.
It works fine here:

if I’m selecting all of a track that long at 44100 Hz, I can reproduce the error “Including your time offset of ~a seconds, your requested~%label interval of ~a seconds is greater than the duration~%of your selected audio (~a seconds)”. It doesn’t give that error if the 14.5 hours track is at 22050 Hz. This is one of the 32-bit limitations still in Nyquist or Audacity, I guess - at just over 13.5 hours, a 44100 Hz track exceeds the 32-bit limit of 2^31 samples of audio.

Perhaps you clicked outside the track in error, so that Audacity would not have the selection in the track any longer. In that case Audacity would select all the track. Regular Interval Labels works for me in a selection 8 hours long in a 14.5 hour track at 44100 Hz.

But if you can reproduce a problem, please give the steps and the plugin settings.


Gale

I did my test before Splaxi said that he was applying to a 14+ hour selection.
Yes, Nyquist works entirely in 32-bit, so 14 hours of audio at 44100 Hz sample rate will overflow (the number of samples is greater than can be represented as a “signed 32 bit integer”).

To work around this limitation, create a new track (Tracks menu > Add New > Audio Track), and use the track control panel menu to set the track sample rate to a low rate (such as 11025 Hz) Audacity Manual
Then ensure that the selection is in the new (low rate) track only.

This can be altered for the next audacity version (or rather the version after that).
The selection end time (from the property '*selection–>'end) is expressed in seconds and not affected by this limitation.

Sorry Robert can you explain that in more detail. What are you suggesting can be changed?


Gale

OK my name’s not Robert, but what he is (correctly) saying is that once Audacity 2.1 is released, this limitation can be easily fixed.

Audacity 2.1 supports version 4 plugins, which give Nyquist access to additional information from Audacity, including the start/end time of the selection in seconds.
The current version of the Equal Labels plugin has to calculate the start / end times either from the (get-duration) function, or from the ‘LEN’ (number of selected samples) variable, both of which amount to much the same thing because they both depend on the sample count.

To fix this limitation, the plugin version needs to be changed from version 3 to version 4, and then instead of

 (get-duration 1)

using

 (- (get '*selection* 'end)(get '*selection* 'start))

OK so I would suggest tracking this on our Bugzilla, unless you are just going to do it, of course. :wink:

Are there any other Nyquist plugins that would benefit from a similar change?


Gale

Several of the shipped plugins are likely to benefit from updating.

I was planning to update Regular Interval Labels anyway - I think it would be a useful enhancement if there was an option to start the labels at a specified time (currently the start time is relative to the start of the selection, but with version 4 we can start the labels at an absolute time position).

The code in the snippet has to know how long the selection is.
Normally, this is achieved with

(get-duration 1)

for seconds or with the variable ‘len’ in samples.
Due to the 32-bit limitation, len takes the highest possible value–which is negative and ‘get-duration’ = 1 (s).
However, Version 4 plug-ins deliver the start and end time as a property of the variable 'selection and those are expressed in seconds.
Thus, the lines 117 and 118 in equalabel.ny have to be changed to

		(setq start (+ (get '*selection* 'start) (max 0 start))) ;disallow negative label time
		(setf dur (- (get '*selection* 'end) start)) ;calculate duration

Of course, the second line has also to be changed

;version 4

This should work for Audacity 2.1.0 and above.
equalabel.ny (6.24 KB)
Please test it…

Robert