GTCMT / MIG-MusicPerformanceAnalysis

GNU General Public License v2.0
6 stars 6 forks source link

Identify & fix redundant code #2

Open ashispati opened 5 years ago

ashispati commented 5 years ago

I am thinking of the following plan to do this:

  1. There are some MATLAB functions which are not being used in the entire repo (e.g. fixSamplingRateInFiles.m in the src/prediction_models/experiments/pitched_instrument_regression/ folder). A simple exercise which would help identify such code is if each of us picks a folder make a list of the functions (NOT scripts) inside that folder are not being used. I have done it for the sub-folders of src/prediction_models/experiments/ folder as an example and others can follow the same for the other folders and generate these lists as comments on this issue thread (as shown below). You may also add any other comments as you see fit.
  2. The next step could be to try running all the scripts in these individual folders and check if they all function as expected.
ashispati commented 5 years ago

Folder: src/prediction_models/experiments/pitched_instrument_regression/

  1. testFileStatus.m: this might be useful for data preprocessing but doesn't belong in this folder
  2. fixSamplingRateInFiles.m: this might be useful for data preprocessing but doesn't belong in this folder
  3. main.m: Not a function but we are not using it any of our results
  4. createTrainingDataPitchedInstruments.m: only used in main.m
  5. evaluatePerformancePitchedInstrument.m: only used in main.m
  6. stackFolds.m: doesn't belong in this folder
  7. nfoldPartition.m: doesn't belong in this folder

Additionally there are a few feature extraction functions in this folder named as extract...Features.m which should ideally be in src/prediction_models/feature_extraction/ folder

ashispati commented 5 years ago

Folder: src/prediction_models/experiments/snare_etude_regression/

  1. featureNormalization2.m
ashispati commented 5 years ago

Folder: src/prediction_models/preprocessing/pitch/

  1. wavelet.m
  2. wavePitch.m
  3. yinAlgo.m The above files are used in estimatePitch.m but these algorithms have not been used in any of our experiments so far. Might be a good idea to also move all pYin related files / scripts to a separate sub-folder.
  4. intervalCents.m: also available in src/prediction_models/preprocessing/pitch/quantization/
ashispati commented 5 years ago

Folder: src/prediction_models/preprocessing/score_alignment/

  1. ToolSimpleDtw.m: also available in src/prediction_models/feature_extraction/StandardFeatures/
ashispati commented 5 years ago

Folder: src/prediction_models/scanning/

  1. checkDurSegments.m
  2. checkNumSegments.m
  3. copySongsToFolder.m
  4. findAnnotationOutliers.m
  5. findMissingAnnotations.m
  6. scanSegmentFilepaths.m All the above are not used anywhere else in the repo. They are useful in finding files with missing annotations. But scanning folder might not be the best location for them though.
ashispati commented 5 years ago

Folder: src/prediction_models/visualizations/

  1. README This folder only contains this file and nothing else. Might consider removing it altogether and create it later if needed
ashispati commented 5 years ago

Folder: src/prediction_models/fix_broken_tracks/

  1. fixBrokenFiles.py: used to fix some of the bad audio files This is a useful Python script but I am thinking if we should have this in this code repository !!
ashispati commented 5 years ago

Folder: src/prediction_models/feature_extraction/

  1. ampDev.m
  2. extractFeaturesPitchedInstruments.m: This has copies in the experiments folder also
  3. FeatureSpectralFlatness.m
  4. FeatureSpectralKurtosis.m
  5. FeatureSpectralMfccs.m
  6. FeatureSpectralRolloff.m
  7. FeatureSpectralSkewness.m
  8. FeatureSpectralTonalPowerRatio.m
  9. ToolMfccFb All above from 3. to 9. are duplicated in src/prediction_models/feature_extraction/StandardFeatures/
  10. GenerateDctMatrix.m: should be in the StandardFeatures folder
ashispati commented 5 years ago

Folder: src/prediction_models/feature_extraction/MFCC This contains the labrosa MFCC extraction code and is being used in the timbreDev.m feature extraction. Not sure why we are not using Alexander's MFCC extraction code for this though.

ashispati commented 5 years ago

Folder: src/prediction_models/feature_extraction/ScoreBasedDesignedFeatures/

  1. HistInsertDeleteNotes.m
  2. IncorrectNotes.m
  3. TempoHistFeat.m
ashispati commented 5 years ago

Folder: src/prediction_models/feature_extraction/StandardFeatures/

  1. ComputeBeatHisto.m
  2. ComputeKey.m
  3. ComputeNoveltyFunction.m
  4. ComputePitch.m
  5. FeatureSpectralCrestFactor.m
  6. FeatureSpectralDecrease.m
  7. FeatureSpectralPitchChroma.m
  8. FeatureSpectralSlope.m
  9. FeatureSpectralSpread.m
  10. FeatureTimeAcfCoeff.m
  11. FeatureTimeMaxAcf.m
  12. FeatureTimePeakEnvelope.m
  13. FeatureTimePredictivityRatio.m
  14. FeatureTimeStd.m
  15. NoveltyFlux.m
  16. NoveltyHainsworth.m
  17. NoveltyLaroche.m
  18. PitchSpectralAcf.m
  19. PitchSpectralHps.m
  20. PitchTimeAcf.m
  21. PitchTimeAmdf.m
  22. PitchTimeAuditory.m
  23. PitchTimeZeroCrossings.m
  24. TestGammaToneFb.m
  25. ToolFreq2Bark.m
  26. ToolFreq2Mel.m
  27. ToolFreq2Midi.m
  28. ToolGammaToneFb.m
  29. ToolMidi2Freq.m
ashispati commented 5 years ago

The feature_extraction folder can be reorganized into 3 sub-folders for baseline, designed and score_based_designed features The preprocessing/pitch folder can be reorganized into 2 sub-folders acf and pyin