B0ney / mmp-remap

Python script to remap resources in lmms project files (WIP)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLI tool to re-map paths in LMMS projects.

Note: You cannot edit resources of individual instruments.

Requirements

  • Python

Recommended

  • LMMS installed and configured.

Resources that can be re-mapped:

  • Audio - wav, ogg, mp3, flac, aiff, ds, spx, voc, aif, au

    • AudioFileProcessor
    • Sample Clip
    • SlicerT
  • Soundfonts - .sf2, .sf3

    • SF2 Player
  • VSTs - .dll, .exe, .so

    • Vestige

How to Use

First list out the resources:

python mmpa.py ./project.mmpz list

Use the information provided from that output to determine what resource to remap.

There are 2 ways resources can be re-mapped:

  • With string matching
  • With fancy regular expressions

Re-map with an Index

The simplest method if you don't want to re-map that many resources.

First we list out the instruments:

python ./mmpa.py ./test.mmpz list
INFO: Listing all resources and its references

[1] drums/snare01.ogg
        1 - REFERENCE

[2] drums/bassdrum_acoustic01.ogg
        1 - REFERENCE

[3] drums/hihat_foot_pedal01.ogg
        1 - REFERENCE

[4] drums/kick_hard01.ogg
        1 - REFERENCE
python mmpa.py ./test.mmpz idx 1 "drums/hihat_foot_pedal01.ogg" -o "test2.mmpz"

Match based re-mapping

Might be all you need when re-mapping multiple resources.

python mmpa.py ./test.mmpz match "C:\Users\Bob\Documents\LMMS\samples\" "usersample:" -o "test2.mmpz"

Regex based re-mapping

Very advanced

TODO

CLI args

Short Long Description
-c --config Override LMMS' default configuration path.

Subcommands

When you need to do something quick and dirty.

Long Description
match Re-map project resources with simple string matching.
re Re-map project resources with regular expresessions.
-o/--out Specify the output file (when using the commands above).
(adding .mmpz will compress the project)
list List all of the resources and its associated instruments.

Compatibility

Should work across nearly all LMMS versions

Tested with python 3.8

About

Python script to remap resources in lmms project files (WIP)

License:Mozilla Public License 2.0


Languages

Language:Python 100.0%