Guest User

Quality-String: Title Formatting Script Snippet for foobar2000

a guest
Oct 4th, 2022
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | Software | 0 0
  1. Quality-String: Title Formatting Script Snippet
  2.  
  3. edit 3 (2022-10-04): Foremost thanks for the gold, kind stranger! As a second I did some upgrades and switches for customisation. Since I'm already editing the post anyway I'll take the opportunity to reformat my post in it's entirety. If something's wrong, missing or needs improvement, tell me!
  4.  
  5. This script gives compressed information about codecs, profiles, bitrates, samplerates and channels. It can be used as a column in your playlist, as folder suffix in your file operation presets, as a category in your album list views or as part of a masstagger script.
  6.  
  7. this script should be pretty useful for every serious collector (looking at you soulseek folks)
  8.  
  9. edits & features:
  10. - channels now are at end of the string (get skipped when stereo)
  11. - 'WavPack' shows up as WVC instead of WV
  12. - 'Monkey's Audio' shows up as APE
  13. - 'Musepack' shows up as MPC and it's codec profiles/qualities as Q7 (Insane), Q8 (BrainDead) etc.
  14. - Vorbis Profiles get recognized via %bitrate_nominal%
  15. - for easy customization I added some variables at the beginning of the script
  16. - delimiter DLM: change '-' to '~', '+', '.' etc
  17. - bracket BRC: change '[]' to '()', '{}', '<>' or omit if you don't want them at all (in that case also delete the 2 apostrophes)
  18. - kiloHertz KHZ: change kHz to k or delete
  19. - BitsPerSample BPS: change bit to b or delete
  20. - Bitrate BTR: change kbps to kb, k or delete (most bitrates like 192 or 320 are pretty self-explanatory)
  21. - write standard WST: if you want to omit samplerate and bits per sample on standard cd rips (16b-44k) then set WST to 0 else 1.
  22.  
  23. I'd recommend editing the script in an editor and not in foobar
  24. script:
  25. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26. $puts(DLM,'-')$puts(BRC,'[]')$puts(KHZ,kHz)$puts(BPS,bit)$puts(BTR,kbps)$puts(WST,1)$puts(CHN,$ifgreater($info(channels),2,$get(DLM)$info(channels)Ch,$ifequal($info(channels),1,$get(DLM)Mono,)))$puts(VBQ,$replace($info(bitrate_nominal),32,Q-2,45,Q-1,48,Q-1,64,Q0,80,Q1,96,Q2,112,Q3,128,Q4,160,Q5,192,Q6,224,Q7,227,Q7,256,Q8,320,Q9,500,Q10))$puts(BRS,$if($greater(%samplerate%,199000),,$if($and($equal(%samplerate%,44100),$equal($info(bitspersample),16),$equal($get(WST),1)),$get(DLM)$info(bitspersample)$get(BPS)$get(DLM)$div(%samplerate%,1000)$get(KHZ),$if($and($equal(%samplerate%,44100),$equal($info(bitspersample),16),$equal($get(WST),0)),,$get(DLM)$info(bitspersample)$get(BPS)$get(DLM)$div(%samplerate%,1000)$get(KHZ)))))$puts(EXT,$upper($if($or($stricmp($ext(%filename_ext%),aif),$stricmp($ext(%filename_ext%),aiff)),AIFF,$if($or($stricmp($ext(%filename_ext%),mid),$stricmp($ext(%filename_ext%),midi),$stricmp($ext(%filename_ext%),kar),$stricmp($ext(%filename_ext%),rmi)),MIDI,$ext(%filename_ext%)))))$puts(CDC,$replace($upper($replace($lower(%codec%),monkey''s audio,APE,wavpack,WVC,musepack,MPC)),' (FLOATING-POINT)',,IMA ADPCM,ADPCM,PCM,$get(EXT)))$puts(CPR,$upper($replace($lower($info(codec_profile)),quality ,q,'',,braindead,q8,insane,q7,xtreme,q1,standard,q5,radio,q4,thumb,q3,telephone,q2,unstable'/'experimental,UST,vbr ,))$get(VBQ))$puts(LSY,$get(CDC)$if($stricmp($get(CPR),CBR),$get(DLM)%bitrate%$get(BTR),$if($info(codec_profile),$get(DLM)$get(CPR),$if($info(bitrate_nominal),$get(DLM)$get(VBQ),))))$puts(LSL,$get(CDC)$get(BRS))$puts(FMT,$if($stricmp($info(encoding),lossy),$get(LSY),$if($stricmp($info(encoding),lossless),$get(LSL),$get(EXT))))$insert($get(BRC),$get(FMT)$get(CHN),1)
  27. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. (copy and paste to custom column)
  29.  
  30. outputted strings:
  31. AAC-LC-Mono
  32. AAC-LC
  33. AAC-SBR
  34. ADPCM-Mono
  35. AIFF-16bit-44kHz
  36. AIFF-16bit-48kHz
  37. AIFF-24bit-44kHz
  38. AIFF-24bit-48kHz
  39. AIFF-32bit-44kHz
  40. APE-16bit-44kHz
  41. APE-24bit-192kHz
  42. DSD64
  43. DSD128
  44. DSD256
  45. DSD512
  46. DST64-6Ch
  47. FLAC-16bit-44kHz-6Ch
  48. FLAC-16bit-44kHz
  49. FLAC-16bit-192kHz
  50. FLAC-24bit-44kHz
  51. FLAC-24bit-48kHz
  52. FLAC-24bit-96kHz
  53. FLAC-24bit-192kHz
  54. MIDI
  55. MP2-112kbps
  56. MP2-128kbps
  57. MP2-192kbps
  58. MP2-256kbps
  59. MP3-24kbps-Mono
  60. MP3-32kbps-Mono
  61. MP3-32kbps
  62. MP3-40kbps-Mono
  63. MP3-48kbps-Mono
  64. MP3-48kbps
  65. MP3-56kbps-Mono
  66. MP3-56kbps
  67. MP3-64kbps-Mono
  68. MP3-64kbps
  69. MP3-80kbps
  70. MP3-96kbps-Mono
  71. MP3-96kbps
  72. MP3-111kbps
  73. MP3-112kbps
  74. MP3-128kbps-Mono
  75. MP3-128kbps
  76. MP3-160kbps
  77. MP3-192kbps
  78. MP3-224kbps
  79. MP3-320kbps
  80. MP3-ABR
  81. MP3-VBR
  82. MP3-V1
  83. MP3-V2
  84. MP3-V2-Mono
  85. ..
  86. MP3-V9
  87. MPC-Q1
  88. ..
  89. MPC-Q10
  90. OPUS-Mono
  91. OPUS
  92. VGM
  93. VORBIS-Q-1
  94. VORBIS-Q0
  95. VORBIS-Q1
  96. ..
  97. VORBIS-Q10
  98. WAV-8bit-8kHz-Mono
  99. WAV-16bit-44kHz
  100. WAV-16bit-48kHz-Mono
  101. WAV-16bit-48kHz
  102. WAV-16bit-96kHz
  103. WAV-24bit-44kHz
  104. WAV-24bit-48kHz
  105. WAV-24bit-96kHz
  106. WAV-32bit-11kHz
  107. WAV-32bit-32kHz
  108. WAV-32bit-44kHz-Mono
  109. WAV-32bit-44kHz
  110. WAV-32bit-48kHz
  111. WMA-Mono
  112. WMA-V1
  113. ..
  114. WMA-V9
  115. WVC-16bit-44kHz
  116. WVC-24bit-96kHz
  117. WVC-32bit-192kHz
  118.  
  119. if it throws only MP3 or MP3-134 (weird bitrates) try using utilities>fix vbr header
Add Comment
Please, Sign In to add comment