Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfixes, benchmarks and ability to analyze only a portion of a track.
Updated link to binary.
- Loading branch information
thomas.friedel
committed
Apr 3, 2017
1 parent
8d16d24
commit 5662899
Showing
10 changed files
with
457 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package TrackAnalyzer; | ||
|
||
import com.beust.jcommander.Parameter; | ||
import com.beust.jcommander.converters.CommaParameterSplitter; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class CommandLineArgsBenchmark { | ||
@Parameter | ||
public List<String> filenames = new ArrayList<String>(); | ||
|
||
@Parameter(names = "--duration", description = "cut track to length <duration> s for faster analysis") | ||
public int duration = -1; | ||
|
||
@Parameter(names = "-setToneProfile", description = "sets tone profile to one of 6") | ||
public int toneProfile = 4; | ||
|
||
@Parameter(names = "-setHopSize", description = "hopsize") | ||
public int hopSize = 8192; | ||
|
||
@Parameter(names = "-setOctaves", description = "octaves") | ||
public int octaves = 6; | ||
|
||
@Parameter(names = "-setTemporalWindow", description = "temporal window (0-2") | ||
public int temporalWindow = 0; | ||
|
||
@Parameter(names = "-setSegmentation", description = "segmentation (0,2)") | ||
public int segmentation = 0; | ||
|
||
@Parameter(names = "-setSimilarityMeasure", description = "similarity measure (0-1)") | ||
public int similarityMeasure = 0; | ||
|
||
@Parameter(names = "-setDetunedBandweight", description = "bandweight") | ||
public float detunedBandweight = 0.2f; | ||
|
||
|
||
@Parameter(names = "-setGaussianSigma", description = "gaussian sigma") | ||
public float hcdfGaussianSigma = (float) 8.0; | ||
|
||
|
||
@Parameter(names = "-setTuningMethod", description = "tuning method") | ||
public int tuningMethod = 0; | ||
|
||
@Parameter(names = "-setDirectSkStretch", description = "sets spectral kernal bandwidth (between zero and 4)") | ||
public double directSkStretch = 0.8; | ||
|
||
@Parameter(names = "-1", description = "nothing") | ||
public boolean nothing = false; | ||
|
||
@Parameter(names = "-l", description = "text file containing list of audio files") | ||
public String filelist = ""; | ||
|
||
@Parameter(names = "-o", description = "write results to text file") | ||
public String writeList = ""; | ||
|
||
@Parameter(names = {"--help","-h","-?"}, help = true) | ||
public boolean help; | ||
|
||
public static final String DEBUG = "-debug"; | ||
@Parameter(names = DEBUG, description = "Used to debug TrackAnalyzer") | ||
public boolean debug = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package TrackAnalyzer; | ||
|
||
public class MirexScore { | ||
/** | ||
* calculate mirex score between keys a and b (camelot notation) | ||
* | ||
* MIREX score weightings | ||
* Key relation Score | ||
* Exact match (tonic) 1.0 | ||
* Perfect Fifth (dominant) 0.5 | ||
* Perfect fourth (subdominant) 0.5 | ||
* Relative major/minor 0.3 | ||
* Parallel major/minor 0.2 | ||
* @param camelotA - string of 2 or 3 characters containing camelot key, e.g. 8A | ||
* @param camelotB - string of 2 or 3 characters containing camelot key, e.g. 8A | ||
* @return | ||
*/ | ||
public static float mirexScore(String camelotA, String camelotB) { | ||
int a_nr, b_nr; | ||
try { | ||
a_nr = Integer.parseInt(camelotA.substring(0, camelotA.length()-1)); | ||
b_nr = Integer.parseInt(camelotB.substring(0, camelotB.length()-1)); | ||
} catch(NumberFormatException e) { | ||
return 0; | ||
} | ||
char a_gender = camelotA.charAt(camelotA.length()-1); | ||
char b_gender = camelotB.charAt(camelotB.length()-1); | ||
if (camelotA.equals(camelotB)) | ||
return (float)1.0; | ||
else if (((a_nr - b_nr) % 12 == 1 || (b_nr - a_nr) % 12 == 1) && | ||
a_gender == b_gender) | ||
return (float)0.5; | ||
else if ( | ||
(a_gender == 'A' && b_gender == 'B' && (a_nr + 3) % 12 == (b_nr % 12)) | ||
|| | ||
(a_gender == 'B' && b_gender == 'A' && (a_nr % 12 == (b_nr + 3) % 12)) | ||
) | ||
return (float)0.2; | ||
else | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.