/SoundFXAnalysis

Analyzing game sound effects with the Essentia library in Python.

Primary LanguageMax

SoundFXAnalysis

Compares two sets of sound effects samples with the Essentia library in Python 2.7. Only works on Mac OS

Thesis: https://www.academia.edu/33058454/Bridging_the_Gap_Between_Procedural_and_Hand-Made_Sound_Effects

Setup Guide

If you don't have Homebrew installed, go here https://brew.sh/ and install it.

1. Install essentia:

Install homebrew tap:

brew tap MTG/essentia

Install compiling the code for the latest official release of Essentia

brew install essentia

2. Add audio files

Place two sets of .aif audio files in the audio folder, each file from first group containing A_ and from the second B_ in their name A_1 and B_1, A_2 and B_2 etc. will be considered pairs. If you want another format, edit the file extension in ./src/analyseAudioFiles.

3. Run the scripts

Cd to the project directory and run this shell script

sh runThis.sh

4. Look at results in ./analysisResults

You will see data sets with extractor information and a plot folder with distances between each pair for each descriptor.

Example of distances: Inharmonicity Distance Plots

Example of descriptors informative about sound effects:

"sfx": {
    "pitch_after_max_to_before_max_energy_ratio": 17.6925086975,
    "pitch_centroid": 39.9060401917,
    "pitch_max_to_total": 0,
    "pitch_min_to_total": 0.864197552204,
    "inharmonicity": [1.54586632561e-05, 2.82796239759e-08, 0.0716148465872, 0.190517455339, 2.71049157163e-06, 0.0714647769928, 0.006208056584, 3.20903126294e-07, 0.108355008066, 0.000992167275399, 0.106407150626, 0.0962193533778, 0.121791563928, 2.35628886003e-06, 0.099796243012, 0.179769963026, 0.0293446909636, 1.96134536168e-07, 0.0206530541182, 0.0220838654786, 2.18039275524e-08, 0.0808639004827, 0.242937847972, 3.12513066092e-07, 0.106884777546, 0.00752843590453, 1.42215430543e-08, 0.0993544235826, 0.0010963260429, 0.112641021609, 0.0935312435031, 0.238969668746, 0.174205988646, 6.19035290583e-07, 0.383238583803, 2.41571724473e-05, 2.00606848466e-07, 0.0512699112296, 0.00949310418218, 1.87315514211e-08, 0.0760740563273, 0.018827939406, 1.04680964341e-06, 0.121833607554, 0.00482570799068, 0.123865820467, 0.0840193331242, 0.000641009537503, 0.0902872234583, 0.0926534309983, 0.18345169723, 0.0191008895636, 1.01132243913e-07, 0.166694954038, 0.12222570926, 2.53516304838e-07, 0.0587590076029, 0.00847428571433, 6.55031868746e-08, 0.10886515677, 0.15177205205, 1.3512365058e-06, 0.109408132732, 0.00458729732782, 2.40837084675e-06, 0.158670425415, 0.00307412259281, 0.0846279114485, 4.53553553825e-07, 0.213705420494, 0.28660684824, 6.96115023402e-08, 0.169395595789, 0.0137161156163, 3.06037115649e-08, 0.155238524079, 0.00612672511488, 3.69773864861e-08, 0.100676685572, 0.0205425955355, 0],
    "oddtoevenharmonicenergyratio": [0.000109957385575, 3.42445423485e-06, 0.468402564526, 0.274596571922, 3.78930781153e-05, 0.635538339615, 0.0361543670297, 1.24534108181e-05, 0.48072129488, 0.00393826374784, 0.175197049975, 0.399122774601, 5.7453212738, 0.000178121917997, 2.29098129272, 2.91154789925, 0.335512638092, 4.83230678583e-06, 3.36203694344, 0.0706306546926, 1.65679477959e-06, 0.49675694108, 3.2093296051, 8.22814308776e-06, 0.895660400391, 0.0369883328676, 6.54836549074e-06, 0.377697259188, 0.00847170315683, 0.164178952575, 4.92966556549, 5.89980173111, 0.194920763373, 2.50407447311e-05, 0.118794433773, 0.000433015404269, 5.79278685109e-06, 2.11091828346, 0.0594925098121, 1.03965044218e-06, 0.558934688568, 1.69667220116, 2.6810410418e-05, 0.38774728775, 0.0236710608006, 0.1868288517, 0.252178639174, 0.00688080443069, 0.244388580322, 0.403176963329, 1.56185007095, 0.396680384874, 5.51646007807e-05, 3.06317949295, 0.445650517941, 8.8868318926e-06, 1.27333235741, 0.0517166703939, 2.60038223132e-06, 0.631273329258, 1.19071245193, 5.37098057976e-05, 0.517598211765, 0.0169094074517, 0.000278621824691, 0.470605164766, 29.6060352325, 0.296946376562, 1.12095685836e-05, 3.40130996704, 1.67597484589, 2.00794238481e-05, 2.37915468216, 0.11723293364, 5.88649436395e-06, 0.175486013293, 0.0328051298857, 4.72471083413e-06, 0.496431171894, 0.224968910217, 0],
    "tristimulus": [[0.989622712135, 0.0103772394359, 0], [0.998152911663, 0.00184710999019, 0], [0.395277172327, 0.342757821083, 0.261965125799], [0.184339895844, 0.355450391769, 0.460209548473], [0.993881940842, 0.00611807452515, 0], [0.289436608553, 0.373399883509, 0.337163507938], [0.623623251915, 0.353525042534, 0.0228518359363], [0.996483445168, 0.00351652945392, 0], [0.323671758175, 0.379868030548, 0.296460151672], [0.728483438492, 0.249660283327, 0.0218562483788], [0.309801012278, 0.17003236711, 0.520166516304], [0.399032980204, 0.374465674162, 0.226501241326], [0.111034907401, 0.542792141438, 0.346172839403], [0.986829519272, 0.0131704555824, 0], [0.0835483372211, 0.406375080347, 0.510076582432], [0.206569641829, 0.499974638224, 0.293455779552], [0.249080762267, 0.207785472274, 0.543133795261], [0.997806549072, 0.00219342904165, 0], [0.197689682245, 0.479418426752, 0.322891771793], [0.502567887306, 0.474957853556, 0.0224741678685], [0.998714566231, 0.00128551071975, 0], [0.380985707045, 0.412266612053, 0.206747680902], [0.0932050719857, 0.417952001095, 0.488842785358], [0.997139751911, 0.00286026950926, 0], [0.254153937101, 0.393926382065, 0.351919770241], [0.596484601498, 0.379354774952, 0.0241605825722], [0.997447550297, 0.0025524457451, 0], [0.340423732996, 0.357559233904, 0.302017122507], [0.712625384331, 0.26654779911, 0.0208268761635], [0.308366298676, 0.170221909881, 0.521411895752], [0.0606330446899, 0.545762956142, 0.393604010344], [0.0775144100189, 0.563340365887, 0.359145134687], [0.267053961754, 0.245396867394, 0.487549215555], [0.995020866394, 0.00497915642336, 0], [0.19136865437, 0.480032682419, 0.32859864831], [0.979615151882, 0.0203848332167, 0], [0.997598946095, 0.00240104203112, 0], [0.229771658778, 0.479817062616, 0.290411382914], [0.544503808022, 0.431360930204, 0.0241352263838], [0.998981416225, 0.0010185939027, 0], [0.358745872974, 0.408984690905, 0.232269465923], [0.186342701316, 0.504915654659, 0.308741539717], [0.994848787785, 0.00515120476484, 0], [0.327229559422, 0.29712125659, 0.375649243593], [0.661876797676, 0.322426944971, 0.0156962927431], [0.303416371346, 0.199229925871, 0.497353643179], [0.346705794334, 0.274127691984, 0.379166543484], [0.723610401154, 0.25752055645, 0.0188691541553], [0.267465919256, 0.194676369429, 0.537857592106], [0.387299031019, 0.339148670435, 0.273552328348], [0.221457034349, 0.486016690731, 0.292526096106], [0.231765896082, 0.249793276191, 0.518440723419], [0.992627441883, 0.00737252971157, 0], [0.224540233612, 0.484721928835, 0.29073792696], [0.210940033197, 0.239656433463, 0.549403607845], [0.997027754784, 0.00297221844085, 0], [0.254662513733, 0.401260435581, 0.344077050686], [0.575841903687, 0.397037655115, 0.0271204728633], [0.99839001894, 0.00160997384228, 0], [0.326512813568, 0.415236026049, 0.258251219988], [0.132066190243, 0.375965178013, 0.491968631744], [0.992724597454, 0.00727537833154, 0], [0.328626275063, 0.373628675938, 0.297745049], [0.675356209278, 0.311553508043, 0.0130901392549], [0.983582079411, 0.0164179205894, 0], [0.376264601946, 0.296456336975, 0.327279001474], [0, 0.660573363304, 0.339426606894], [0.263680309057, 0.198202013969, 0.538117825985], [0.996663093567, 0.00333689711988, 0], [0.0794902667403, 0.583655357361, 0.336854279041], [0.0839764550328, 0.299666643143, 0.616356790066], [0.995538949966, 0.00446101697162, 0], [0.214467287064, 0.471290439367, 0.314242303371], [0.452916443348, 0.526372253895, 0.0207112319767], [0.99757963419, 0.00242033763789, 0], [0.256393820047, 0.299981683493, 0.443624526262], [0.609171390533, 0.362913161516, 0.0279154293239], [0.997831046581, 0.00216892547905, 0], [0.370332151651, 0.397207796574, 0.232460036874], [0.424797266722, 0.527269005775, 0.0479337647557], [1, 0, 0]]
},