Author Topic: Automatic Mark Files - Add "Clipping" under General Tab  (Read 734 times)

EF

  • Jr. Member
  • **
  • Posts: 1
    • View Profile
When Automatic Marking Files I would like to be able to select Clipping from the list. Many times clipping is poor on a file but still gts a higher rating then another with little or no clipping.

Admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 660
    • View Profile
    • https://www.smilarityapp.com
Re: Automatic Mark Files - Add "Clipping" under General Tab
« Reply #1 on: May 06, 2020, 21:20:35 »
Clipping doesn't participate in rating calculation, if you want automark by it you need use Javascipt, see example:
Code: [Select]
/*
Author: Similarity Team
Version: 1.0
Description:
Simple auto-mark dialog analog
For speedup before launch analyze all files ("Analyze all" context menu)
*/

// unmark all files
results.audio.unmark();

// simple mark by lower bitrate
var dups = results.audio.dups;
for (var idx = 0; idx < dups.length; ++idx) {
let item1 = dups[idx].item1;
let item2 = dups[idx].item2;
        // skip counter-pair (1-2 and 2-1), process pair only once
        if (item1.path > item2.path) continue;
// first priority
if (item1.analysis.rating > item2.analysis.rating)
{ item2.marked = true; continue; }
if (item1.analysis.rating < item2.analysis.rating)
{ item1.marked = true; continue; }
// second priority
if (item1.analysis.clips > item2.analysis.clips)
{ item2.marked = true; continue; }
if (item1.analysis.clips < item2.analysis.clips)
{ item1.marked = true; continue; }
// 3rd priority
if (item1.analysis.maxFreq > item2.analysis.maxFreq)
{ item2.marked = true; continue; }
if (item1.analysis.maxFreq < item2.analysis.maxFreq)
{ item1.marked = true; continue; }
}

hsei

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Automatic Mark Files - Add "Clipping" under General Tab
« Reply #2 on: June 05, 2020, 10:56:28 »
As far as I can see the listed script file does not help.
The two ifs under first priority cover all pairs with different rating.
Only those with identical rating get examined by the second priority checks.
Third priority is in the same manner only examined when clips are identical.

For the problem stated either the priority order has to be interchanged or some rating tolerance has to be introduced:
  if (item1.analysis.rating > item2.analysis.rating+tolerance) ...
  if (item1.analysis.rating < item2.analysis.rating-tolerance) ...