axeldelafosse / stemgen

🎛 Stemgen is a Stem file generator. Convert any track into a Stem and have fun with Traktor.
https://stemgen.dev
MIT License
212 stars 39 forks source link

Processing without a metadata file as an input #49

Closed DidierMalenfant closed 5 months ago

DidierMalenfant commented 6 months ago

I'm trying to make sure I'm not going crazy and missing the obvious but in ni-stem.py:

   metaData = []
   if metadataFile:
      fileObj = codecs.open(metadataFile, encoding="utf-8")
      try:
         metaData = json.load(fileObj)
      except IOError:
         raise
      except Exception as e:
         raise RuntimeError("Error while reading metadata file")
      finally:
         fileObj.close()

   numStems = len(stemTracks)
   numMetaEntries = len(metaData["stems"])

if no metataFile is passed, metaData is a list which means metaData["stems"] can't' work right?

Similar thing with _defaultMetadata which is just a list of stem metadata entries but is also accessed with:

self._defaultMetadata["stems"]

which also seems like it can't work.

Am I missing something or is everyone passing a metadata file when converting and therefore missing those bugs?

Thanks!

axeldelafosse commented 5 months ago

Hello Didier,

This is the file you are looking for: https://github.com/axeldelafosse/stemgen/blob/master/metadata.json

Thank you for using Stemgen!