Music Pairing

In this page I describe, how the system pairs the local music collection with the recordings as available in the SCD Database:

  • The algorithm assumes a certain setup of the music collection:
    • All music is provided as mp3 files.
    • When a CD is stored, all its tracks are in one directory. If single tracks are missing, because they are only waltzes and not SCD dances, the system can cope with that as well.
    • The file name starts with a track number and finishes with a signature, e.g S8x32
  • Calculating signatures for albums and directories
    • For each album or directory the system calculates a signature
    • There are currently (2024/03) three patterns implemented
      • 01 Petronella – R8x32.mp3
      • 01 Petronella – 8x32R.mp3
      • 01 Petronella – 8r32.mp3
      • Different patterns to identify the signature of a file could be implemented on demand.
    • In case where no signature of the file or recording can be identified X0x00 is used. The count of the recording/files is placed at the start.
  • Scoring and finding pairs
    • For each album on SCD and each directory a score is calculated.
    • Parsing through the signature the system counts fits, misFits and nullFits, i.e. for (X0x00) and skips (holes)
    • The score is normalized between 0 and 1:
      • 0.5 + 0.5 CountFit/CountAll – 0.5 CountMisfit/CountAll – 0.2 CountSkip/CountAll – 0.2* CountNullfit/CountAll
      • The parameters yield sensible results.
    • The album with a perfect fit shows a score of 1 and is automatically accepted.
    • For other directories a list of albums with score more than 0.5 is kept, so the user can do quality checking.

Example

The directory “/storage/6639-3863/Music/SCD/Berkeley Scottish Players/None So Pretty” has the following signature 008,R8x40,S8x32,J8x32,R8x32,X0x00,R8x32,X0x00,R8x32

as its listing reads like

01 None So Pretty – R8x40 (digitized).mp3
02 Bonnie Flowers O’er The Muir – S8x32 (digitized).mp3
03 Wild Geese, The – J8x32 (digitized).mp3
04 Shetland Fiddler, The – R8x32 (digitized).mp3
05 Wandering Waltzes – W (digitized).mp3
06 Ye’re Welcome, Charlie Stuart – R8x32 (digitized).mp3
08 Montgomerie’s Rant, The – R8x32 (digitized).mp3

My directory Bach_-_Die_Kunst_der_Fuge_-_Kocsis yields as signature “010,X0x00,X0x00,X0x00,X0x00,X0x00,X0x00,X0x00,X0x00,X0x00,X0x00”. So the system can cope with “normal” music as well.

This system works only if you have an organized person, who sticks to one naming convention. Thanks Heiko!