View Issue Details

IDCategoryLast Update
0006806bugs2020-04-19 20:17
ReporterfeandinAssigned Tox42 
Reproducibilityalways 
Status closedResolutionfixed 
Platformx86_64OSUbuntuOS Version15.10
Product Version4.6 
Fixed in Version 
Summary0006806: Strip Silence dialog incorrectly splits regions.
DescriptionProblem occurs when user strips silence from region which is shorter than it's linked source file. For very short regions (1 sec and below) it resulted in creation of many unwanted regions with total length exceeding primary region length. Expected behaviour is that range of regions after striping silence is equal to range of initial region being striped.
Steps To Reproduce1. Record/import at least 5 sec of audio. It should contain distinct silent areas (for example percussive beat).
2. Make this region short (0.5 sec)
3. Run Strip Silence dialog and set threshold appropriately.
PROBLEM: Silence intervals appear. However some of them reach far beyond region boundaries.
4. Apply transformation.
PROBLEM: Incorrect regions created.
Additional InformationThe problem is in AudioRegion::find_silence. There is loop which processes audio in 64kB blocks (it is about 1.5 seconds of audio with 44.1khz).
I managed to create simple patch.
TagsNo tags attached.

Activities

feandin

2016-02-29 21:18

reporter  

stripsilence.patch (830 bytes)
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index ddd152b..cca522b 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -1819,9 +1819,11 @@ AudioRegion::find_silence (Sample threshold, framecnt_t min_length, framecnt_t f
 		framecnt_t cur_samples = 0;
 		/* fill `loudest' with the loudest absolute sample at each instant, across all channels */
 		memset (loudest.get(), 0, sizeof (Sample) * block_size);
+		framecnt_t to_read = ((end - pos) < block_size) ? (end - pos) : block_size;
+		
 		for (uint32_t n = 0; n < n_channels(); ++n) {
 
-			cur_samples = read_raw_internal (buf.get(), pos, block_size, n);
+			cur_samples = read_raw_internal (buf.get(), pos, to_read, n);
 			for (framecnt_t i = 0; i < cur_samples; ++i) {
 				loudest[i] = max (loudest[i], abs (buf[i]));
 			}
stripsilence.patch (830 bytes)

x42

2016-03-05 15:01

administrator   ~0018040

fixed in Ardour 4.7-287-gc1ce5dd via https://github.com/Ardour/ardour/pull/214

system

2020-04-19 20:17

developer   ~0023599

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2016-02-29 21:18 feandin New Issue
2016-02-29 21:18 feandin File Added: stripsilence.patch
2016-03-05 15:01 x42 Note Added: 0018040
2016-03-05 15:01 x42 Status new => resolved
2016-03-05 15:01 x42 Resolution open => fixed
2016-03-05 15:01 x42 Assigned To => x42
2020-04-19 20:17 system Note Added: 0023599
2020-04-19 20:17 system Status resolved => closed