Last active
August 6, 2021 17:22
-
-
Save aike/5b382f3e671cad953c7ef372e2227f28 to your computer and use it in GitHub Desktop.
sample outlier checker KONTAKT CREATOR TOOLS script
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
pitchThreshold = 0.2 -- semitone | |
loudnessThreshold = 6.0 -- dB | |
print(scriptPath) | |
print("=== pitch check ===") | |
pitchBatchData = mir.detectPitchBatch(scriptPath) | |
for filename, pitch in pairs(pitchBatchData) do | |
detune = pitch - math.floor(pitch) | |
if (detune > 0.5) then | |
detune = detune - 1.0 | |
end | |
if (math.abs(detune) > pitchThreshold) then | |
nopath = filesystem.filename(filename) | |
print(" " .. nopath .. " " .. detune) | |
end | |
end | |
print("=== loudness check ===") | |
loudnessBatchData = mir.detectLoudnessBatch(scriptPath) | |
cnt = 0 | |
meanLoudness = 0 | |
for filename, loudness in pairs(loudnessBatchData) do | |
meanLoudness = meanLoudness + loudness | |
cnt = cnt + 1 | |
end | |
meanLoudness = meanLoudness / cnt | |
for filename, loudness in pairs(loudnessBatchData) do | |
deviation = loudness - meanLoudness | |
if (math.abs(deviation) > loudnessThreshold) then | |
nopath = filesystem.filename(filename) | |
print(" " .. nopath .. " " .. deviation) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment