public void AnalyzeSong(string fileDirectory) { visualFacade.SetProgress("Loading Song...", 0.0f); SongFile songFile = MyAudioFileReader.ReadAudioFile(fileDirectory); visualFacade.SetSongFile(songFile); List <SongPropertyValues> songPropertyValuesList = new List <SongPropertyValues>(); visualFacade.SetProgress("Analyze...", 0.1f); AudioAnalyzer audioAnalyzer = new AudioAnalyzer(); audioAnalyzer.LoadAudioFromFile(fileDirectory); audioAnalyzer.Analyze(); songPropertyValuesList.Add(GetSingleBeatsSPV(audioAnalyzer.SongElements)); songPropertyValuesList.Add(GetHeldNoteSPV(audioAnalyzer.SongElements)); visualFacade.PlotSongPropertyValues(songPropertyValuesList); visualFacade.SetProgress("done :)", 1); }
public static SongPropertyValues GetSongPropertyValues(string fileDirectory, float vth, float msqe) { //RectangleDetection.TEST_MAXIMUM_SQUARED_ERROR = msqe; FrequencyBand.ValueThreshold = vth; Console.WriteLine(vth + " / " + msqe); AudioAnalyzer audioAnalyzer = new AudioAnalyzer(); audioAnalyzer.LoadAudioFromFile(fileDirectory); audioAnalyzer.Analyze(); SongPropertyValues spv = GetHeldNoteSPV(audioAnalyzer.SongElements); spv.Normalize(); return(spv); }