Jump to content
Sign in to follow this  
OffendedV

[mml_thing] An mml automation and conversion tool

Recommended Posts

A simple tool to automate repetitive and tedious 3mle tasks.

download latest (v1.3.0)

THIS IS ALPHA BUILD AND MAY KILL YOUR CAT, MEOW


Features

  • propagate Adds first tempo from track 1 to all other tracks. Adds performance tempo if missing.
  • propagate2 Currently experimental, adds all tempos from track 1 to all other tracks. Adds performance tempo if missing.
  • start_volume Copies starting volume from track 1 to other tracks that don't have a start volume. If no volume is present, adds v15 (because loud is good!)
  • compress When importing midi files with velocity, the velocity steps are often really wide and noticeable. Fixes this by narrowing the gap between velocity "steps" and makes everything louder if possible.
  • clean Currently only removes endlines.
  • ms2mml Outputs the file in Maple Story 2 format so you can "Open File" in the game's sequencer.
  • batch mode By specifying a folder as input, the tool will process all '.mml' files in the specified folder non-recursively. All options currently work in batch mode.


How to use

  • Import you midi files in 3mle, optimize all tracks, do things like sustain, save when finished.
  • Use this tool to post-process and convert your mml file to Maple Story 2 format (no copypasta required).


Examples

The following applies all processes and outputs to "glou.ms2mml".

mml_thing.exe turkey.mml glou.ms2mml -e --ms2mml

The following will output the final file "C:\gud beats\sandstorm.out.ms2mml". You can import that file in Maple Story 2.

mml_thing.exe "C:\gud beats\sandstorm.mml" --propagate --compress --clean --ms2mml

You can also use short options to help your tendinitis.

mml_thing.exe "C:\gud beats\sandstorm.mml" -pvc --ms2mml

This will apply propagate and clean on all '.mml' files in folder "gud beats" and output the files as '.out.ms2mml' in "C:\gud beats\out\".

mml_thing.exe "C:\gud beats\" --propagate --clean --ms2mml

This will convert all '.mml' files in folder "my song" to '.ms2mml' format. The files will be output in the current working directory and named song1.ms2mml, song2.ms2mml, etc. If the current working folder is "my song", the ms2mml files will be output in "out/" subfolder.

mml_thing.exe "C:\my song\" song.ms2mml --ms2mml


Setup

The tool doesn't require any special installation to be used, but if you use it often, the following might be nice.

  • To be able to launch the tool from any folder you are working in, add the tool folder to your user 'Path' environment variable : 'System > Advanced System Settings > Environment Variables...' Edit or create user variable 'Path' and add the mml_thing folder to it. When downloading new versions, overwrite the exe in there.
  • To launch a command prompt from your current directory in File Explorer, type 'cmd' in the top path bar.
  • To easily copy the path of a file or folder, shift + right click a file and select 'Copy as path'.
  • If you don't like command prompts gtfo scrub.


Bugs

Please report bugs to [email protected]
I need to be able to reproduce issues, so please attach required mml files if they are needed. I can guarantee your files will solely be used for bugfixing and deleted afterwards.


Whats in the pipeline

Here's what I have in mind currently.

  • compress Rewrite compress to take into account all tracks, and make intra-track normalization correct.
  • generate_sustain_track Generate a basic sustain track with sustain on/off on beats with half beat offset.
  • merge_folder Will merge all mml files in a folder, useful when splitting midi tracks in multiple mml files. No moar copypasta! [tbd, requires RE of 3mle format]


Updates

v1.3.0  - Added experimental 'propagate2', a rewrite of propagate. The new version will copy all tempos from the first track to the others. It will split notes appropriately. Volume propagation moved to its own option. Propagate2 will replace propagate in next major version.
             - Moved propagate volume to new 'start_volume' option. Grabs the first volume from track 1 and copies it to other tracks.
             - Deprecated 'propagate' (will be removed in next major version).
             - Renamed 'normalize_velocity' to 'compress'. Changed its short option to '-C'.
v1.2.0  - Added short options and "everything" option.
             - Fix some path bugs.
v1.1.0  - Added batch mode.


Help

Usage: mml_thing.exe in_file out_file [options]
	Arguments:
 in_file     MML input file or folder.
             Using a folder enters batch mode, which will process all '.mml' files in the specified folder.
 out_file    MML output file.
             Optional, outputs to 'in_file.out.mml' if no argument is provided.
             Outputs to 'out/' subfolder if using batch mode and no argument is provided.
	Options:
 -p, --propagate     [DEPRECATED, See propagate2] Adds tempo from beginning of track1 to all tracks.
                     If performance tempo is missing, adds it.
     --propagate2    [EXPERIMENTAL, Please listen to your song before composing!]
                     Adds all tempos from track1 to all tracks.
                     If performance tempo is missing, adds it.
 -v, --start_volume  If track1 has a starting volume, copies it to other tracks.
                     If not, adds v15 to beginning of all tracks.
 -C, --compress      Narrows the gap between velocity steps if possible. Make everything louder if possible.
 -c, --clean         Additional optimizations. Currently, only removes line endings.
 -e, --everything    Apply all post-process operations : propagate, start_volume, compress, clean.
     --ms2mml        Outputs in 'ms2mml' format.
 -h, --help          Print this help

mml_thing
version : 1.3.0 alpha
author : OffendedV <[email protected]>
Edited by OffendedV

Share this post


Link to post

It's funny, this was on my to do list to do a similar tool but just make it a app on the website basically. But you beat me to the punch, I will try it out. Thanks for sharing it @OffendedV

Share this post


Link to post
On 11/17/2018 at 11:07 AM, OffendedV said:

@Yasuno Haha yeah I'm guessing many coders have the same idea. Let me know how it works for you.

Seems to be working fine so far, I have used it on a few songs.  I think I saw this in the to-do list already but an easy way of being able to output every mml file in a folder, to ms2mml would be useful in our case. (For Ensembles).

Share this post


Link to post

@Yasuno Glad to here its working for you as well. What I have in the backburner is a way to "merge" tracks from multiple mml to a single mml file (useful when splitting midi tracks). Mass converting mml files to ms2mml should be ezpz. Will take a look this weekend.

Share this post


Link to post
On 11/20/2018 at 6:14 PM, OffendedV said:

@Yasuno Weekend came early, let me know if you find any issues with batch mode :)

Seems to be working well! Thank you for taking the time to add it. Saves me a lot of time.

Share this post


Link to post

v1.3.0 is hot off the press. It adds a major rewrite to the propagate option (temporarily named propagate2 while testing). mml_thing will now propagate all tempos from your first track to other tracks. It will split notes appropriately so you don't have to. This required a major effort behind the hood, but now I should be set to add other cool features. I also renamed some stuff and juggled a few options here and there. Why? Who knows!

I am 100% sure I've missed some weird cases when rewriting propagate, please please please listen to your song before pressing compose and send me bug reports. ❤️

Full release notes:

v1.3.0    - Added experimental 'propagate2', a rewrite of propagate. The new version will copy all tempos from the first track to the others. It will split notes appropriately. Volume propagation moved to its own option. Propagate2 will replace propagate in next major version.
        - Moved propagate volume to new 'start_volume' option. Grabs the first volume from track 1 and copies it to other tracks.
        - Deprecated 'propagate' (will be removed in next major version).
        - Renamed 'normalize_velocity' to 'compress'. Changed its short option to '-C'.

Share this post


Link to post
On 11/17/2018 at 6:51 PM, OffendedV said:

If no volume is present, adds v15 (because loud is good!) 

Not true. Loud is not always better and in most cases makes it worse.

Edited by Hisokai

Share this post


Link to post
On 12/8/2018 at 7:39 PM, OffendedV said:

v1.3.0 is hot off the press. It adds a major rewrite to the propagate option (temporarily named propagate2 while testing). mml_thing will now propagate all tempos from your first track to other tracks. It will split notes appropriately so you don't have to. This required a major effort behind the hood, but now I should be set to add other cool features. I also renamed some stuff and juggled a few options here and there. Why? Who knows!

I am 100% sure I've missed some weird cases when rewriting propagate, please please please listen to your song before pressing compose and send me bug reports. ❤️

Full release notes:

v1.3.0    - Added experimental 'propagate2', a rewrite of propagate. The new version will copy all tempos from the first track to the others. It will split notes appropriately. Volume propagation moved to its own option. Propagate2 will replace propagate in next major version.
        - Moved propagate volume to new 'start_volume' option. Grabs the first volume from track 1 and copies it to other tracks.
        - Deprecated 'propagate' (will be removed in next major version).
        - Renamed 'normalize_velocity' to 'compress'. Changed its short option to '-C'.

Oo, will have to try this. Will let you know.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×