Jump to content
OffendedV

[mml_thing] An mml automation and conversion tool

Recommended Posts

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

download latest (v1.5.2)

This is a command prompt app. You cannot open it by double-clicking on the exe. You must launch it from your command prompt.


Features

  • propagate_t Propagate Tempo : Adds all tempos from track 1 to all other tracks. Splits notes if necessary.
  • propagate_p Propagate Performance Tempo: Adds performance tempo to tempos on track 1.
  • propagate_v Propagate Volume : Copies starting volume from track 1 to other tracks that don't have a start volume. If no volume is found, adds v15 to tracks without starting volume. 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.
  • max_velocity Boosts or lowers velocities to match provided maximuim velocity. Keeps relative distance between velocities.
  • min_velocity Boosts or lowers velocities to match provided minimum velocity. Keeps relative distance between velocities.
  • add_sustain_track Adds a basic sustain track with sustain off/on every beat.
  • clean Currently only removes endlines.
  • kick_track Converts selected track to a kick track. All notes are converted to C2, so they work with new 3mle.
  • snare_track Converts selected track to a snare track. All notes are converted to D2, so they work with new 3mle.
  • cymbal_track Converts selected track to a cymbal track. All notes are converted to C3, so they work with new 3mle.
  • 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 your midi files in 3mle, optimize all tracks, do things, go outside and get some fresh air (lol), 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 converts track 1 to kick track.

mml_thing.exe harambe.mml dedmeme.ms2mml --kick_track 1 --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.


Updates

v1.5.2

  • Change tempo propagation order. Adds tempos to the end of other notes. Fixes issues like t100t110 becoming t110t100.
  • Keep 3mle track ordering. This would also cause 3mle track names to be erased, which we don't like so much.

v1.5.1

  • Revert changes to ties, which broke propagate tempo. [queue sad violins] Thanks to ST for the bug report!

v1.5.0

  • Added 'max_velocity' and 'min_velocity' to give more control over velocity operations. Max/min velocity will boost or lower the maximum/minimum volume. Steps between velocities are kept as much as possible, which helps when you have tracks with big velocity gaps. You can think of this as an expander.
  • Added comment support, though the output isn't always very pretty. At least we don't explode anymore.
  • Optimize propagate_t to merge small denominations together (less verbose output). Shouldn't output 2 million r16& anymore.
  • Changed how mml_thing handles ties and endlines to match 3mle behavior more closely.
  • Fix a compress bug where it would skip some velocities.

v1.4.0

  • Added 'add_sustain_track' option, which creates a basic track with sustain toggling on beats. Only works when outputting to ms2mml.
  • Added 'kick_track', 'snare_track' and 'cymbal_track' options. This will convert all notes of the selected track to the correct kick, snare, cymbal (C2, D2, C3). Nothing else is changed on the track. You will need to provide the track number. Thanks to Yasuno for the idea!
  • Renamed a bunch of options again. Sorry about that, names will stop to change once I'm out of beta. 'Propagate' is split into 'propagate_t' and 'propagate_p', for tempo and performance tempo respectively. 'start_volume' renamed to 'propagate_v'. Remember you can use short-options to apply all of the propagates : '-pPv'.
  • Sneakily add triplet support. Nobody seems to have noticed they were missing. Triplets are sad.
  • Updated 3mle backend to new data model. Fixes some parsing issues like '&l4c' or out of range tempos.
  • Removed deprecated 'propagate'.

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_t           Propagate Tempo : Adds all tempos from track 1 to all other tracks.
 -P, --propagate_p           Propagate Performance Tempo : Adds performance tempos to all tempos on track 1.
 -v, --propagate_v           Propagate Volume : If track 1 has a starting volume, copies it to other tracks.
                             If not, adds v15 to beginning of tracks without volume.
 -C, --compress              Narrows the gap between velocity steps. Make everything louder.
 -M, --max_velocity <value>  Boosts or lowers velocities to match provided maximuim velocity.
                             Keeps relative distance between velocities.
 -m, --min_velocity <value>  Boosts or lowers velocities to match provided minimum velocity.
                             Keeps relative distance between velocities.
 -s, --add_sustain_track     Adds a basic sustain track with sustain on/off on beats.
                             Currently only works when exporting ms2mml.
 -c, --clean                 Additional optimizations. Currently, only removes line endings.
 -e, --everything            Apply almost all post-process operations :
                             propagate_t, propagate_p, propagate_v, compress, add_sustain_track, clean.
     --kick_track <value>    Converts selected track to a kick track. Must provide track number.
     --snare_track <value>   Converts selected track to a snare track. Must provide track number.
     --cymbal_track <value>  Converts selected track to a cymbal track. Must provide track number.
     --ms2mml                Outputs in 'ms2mml' format.
 -h, --help                  Print this help

mml_thing
version : 1.5.2 beta
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
On 12/9/2018 at 9:20 PM, OffendedV said:

propogate2

Works perfect for me so far, I did a song with 12 tempo changes and then took it in-game and it played correctly.

Share this post


Link to post

Aaaaand v1.4.0 is out. Another one bites the dust, dun, dun, dun.

I had to rename some things again, sorry.

This one adds a few new features, namely add_sustain_track which should help get you started when making sustain tracks. @Yasuno recommended I add a converter for kick, snare and cymbal tracks, which I did. These will make sure your percussion tracks work with the new 3mle sound bank.

Like all releases with new features, bugs may be creeping around ready to strike. Please do not through food at me for bugs, unless it is cake. Then its ok you can throw cakes at me. nomnom

I'm out of alpha and into beta. I've gathered enough feedback from different places that seem to indicate no cats were killed. Very happy about that.

Full release notes :

v1.4.0  - Added 'add_sustain_track' option, which creates a basic track with sustain toggling on beats. Only works when outputting to ms2mml.
             - Added 'kick_track', 'snare_track' and 'cymbal_track' options. This will convert all notes of the selected track to the correct kick, snare, cymbal (C2, D2, C3). Nothing else is changed on the track. You will need to provide the track number. Thanks to Yasuno for the idea!
             - Renamed a bunch of options again. Sorry about that, names will stop to change once I'm out of beta. 'Propagate' is split into 'propagate_t' and 'propagate_p', for tempo and performance tempo respectively. 'start_volume' renamed to 'propagate_v'. Remember you can use short-options to apply all of the propagates : '-pPv'.
             - Sneakily add triplet support. Nobody seems to have noticed they were missing. Triplets are sad.
             - Updated 3mle backend to new data model. Fixes some parsing issues like '&l4c' or out of range tempos.
             - Removed deprecated 'propagate'.

Share this post


Link to post

Hey! That "scrub" cyanwitch from reddit here.

I was wondering - would you mind elaborating more on the difference between tempo and performance tempo? & the reason they need to be distinguished in this context?

Thanks again for your work!

Share this post


Link to post

Hey @RubeusHagrid o/

Performance tempo is for the character animation in game. When you set it, your character will play faster/slower according to the perf tempo. Its just for show, but adds a nice touch :)

Here's a good guide with all the info you'd ever need (and more). It talks about performance tempo on page ~27.

Cheers

Share this post


Link to post

Ho Ho Ho, you've been bad boiis but I still got an update for you.

This update adds some more velocity tools, which should help when dealing with backup tracks or songs with large dynamic ranges. I also worked on propagate tempo so the split notes get collapsed to generate less verbose outputs. A few bugs were fixed and the tool doesn't die if you use an mml file with comments.

Merry christmas and happy RNGesus XD

v1.5.0

  • Added 'max_velocity' and 'min_velocity' to give more control over velocity operations. Max/min velocity will boost or lower the maximum/minimum volume. Steps between velocities are kept as much as possible, which helps when you have tracks with big velocity gaps. You can think of this as an expander.
  • Added comment support, though the output isn't always very pretty. At least we don't explode anymore.
  • Optimize propagate_t to merge small denominations together (less verbose output). Shouldn't output 2 million r16& anymore.
  • Changed how mml_thing handles ties and endlines to match 3mle behavior more closely.
  • Fix a compress bug where it would skip some velocities.
Edited by OffendedV

Share this post


Link to post

Just used this today and propagate_t totally made my life a little easier on a song. I totally appreciate your hard work!

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

×