header={ "chef": "BeatRig", "recipe_version": "0.298", "title": "Referenced Loudness", "description": "Normalise one file and all others relative to it.", "spice": "BQ==:G+Hy36kJcnQQYYavb/JV2Il6eCYr6h4hRJHCF9rRbhX5BcazL6cuTgUMdz0xA50VWA5PmmV0Q7aWkiUtNFtbk991l+t0e8IBXMReMIT1GNjnZZDv7n2YRAo0xcSQbY0ixjG6LLH4wGKnspKAoA/v69iLn6N2IH0XzIZwTGdHSo4=", "flavour": "Kc2pygThLLqsZD6pJcFbol7xFjDIa2+ROvYDnpqp5w9nBvSRHPU1Ze43YPsOv8QP7D2+FQlvaAIMgB+quZRQtbdFfZHaNALW3eUSdxGXQTOwjOWnyyNbzwDYXgRXQ5p2rIydVscSEmhcbKZw8DAdif19kK/lvSTccIuM+ByEFjg=", "time": 1723931231, "magnetron_version": "1.0.317", "category": "Audio", "core_version": "0.6.4", "palette": "Clean Slate", "dependencies": "", "instructions": "", "tags": "", "type": "default", "os": "windows,macOS", "functions": "main", "uuid": "5fd3af03de9e4ed98502a2e9eddcbd85" }; // ============================================================================= function main() { // ------------------------------------ setMainMessage("preparing"); setProgress(0); validateInputFile(); // ------------------------------------ // GET ALL FILES FROM THE APP var files = getFiles(); // CHECK IF THERE IS AT LEAST ONE FILE if(files.length < 1){ dialog("No files ","Add files before running the recipe.","w"); break; } // ------------------------------------ // DIALOG var r = dial(files); // CANCELLED if ( r.confirm != 1 ) { break; } var ref_id = parseInt(r.reference.split(';')[0]); // ------------------------------------ // REFERENCE LOUDNESS setMainMessage("Analysing file "+i+"/"+files.length); // FILE PROPERTIES var f = files[ref_id]; // ------------------------------------ // FILE LOUDNESS AND PEAK var settings = {}; settings["AdjustTargetType"] = "LU"; settings["AdjustTargetLevel"] = 0.; settings["RelativeGate"] = -10.; settings["DialogGate"] = false; settings["CalibrationLU"] = r.lufs; var refSpecs = levelFileAnalyse( f.path, settings); var adjust = refSpecs.AdjustLevel; // ------------------------------------ // PROCESS THE FILES setMainMessage("processing"); var path = getPathInfo( files[ref_id].path ); var export_folder = path.folder+gvar.pss+'Normalised'+gvar.pss; makeFolder(export_folder ); // ------------------------------------ // PROCESS THE FILES for (i=0;i