Usage of available commandline tools for Windows

GNMIDI screenshot GN MIDI Tools are Win32 commandline tools for analysing, converting, modifying MIDI files.
The tools can be licensed for commercial or noncommercial uses.


batchexec is a tool that reads parameters from an .ini text file and converts all matching files found in the input folder into an output folder (including subfolders) by calling a specified commandline tool for each matching file.
This tool can be used for the MIDI tools on this page and also for other commandline tools.
It can call a tool for each subfolder or call a tool for each file that matches a list of given file extensions.
batchexec catches standard error output and writes it into a logfile. A progress percentage and current folder name is displayed during running.

(c) 1998-2017 GN MIDI Solutions, Austria,
batchexec is no demo. Distributing tool or license is probibited.
Licensed permission for noncommercial use by Max Mustermann.
No permission for distribution.
usage: batchexec filename.ini [sectionname]
default .ini file is batchtool.ini
default sectionname is first section found in .ini file if there is only one section existing in the file

batchexec examples

usage and .ini file syntax
batchexec batchtool.ini TRANSPOSENOTES_ALLCHANNELS
batchexec batchtool.ini CONVERTFOLDERS


midi2txt converts a binary MIDI file into readable ASCII text.
The text can be modified and converted back to midi using txt2midi utiltity if the text syntax is still correct.

usage: midi2txt [-error][-chunk][-short][-info][-lyric][-tact][-units][-ms][-dec][-channel] file.mid [file.txt]
-error  checks file only. Produces only error report
-chunk  prints structure of midi file (header, tracks)
-short  prints short info about text, tracknames, programs
-info   prints info about text, tracknames, programs, controls
-lyric  prints lyrics only
-tact   marks end of tact bars with .
-units  prints position of all events in midi units.
-ms     prints position of all events in milliseconds (1st track only).
-dec    print decimal values instead of notes, channels, programs,pauses...
-channel        print channel before every event

midi2txt examples

midi2txt -units -ms coldice5.mid coldice5_midi2txt_readabletext.txt
result text: coldice5_midi2txt_readabletext.txt
midi2txt -dec coldice5.mid coldice5_midi2txt_using_option_values.txt
result text: coldice5_midi2txt_using_option_values.txt
midi2txt -dec -short coldice5.mid coldice5_midi2txt_using_option_values_short.txt
result text: coldice5_midi2txt_using_option_values_short.txt
midi2txt -chunk coldice5.mid coldice5_midi2txt_chunk.txt
result text: coldice5_midi2txt_chunk.txt


txt2midi converts text converted using midi2txt utility back to a MIDI file. The text syntax must be valid.

usage: txt2midi [-version] [-programs] textfile.txt midifile.mid


midi2csv converts a binary MIDI file into a comma separated text table. The rows are commands and the columns are parameters and additional calculated time information.
The csv can be modified using a text editor or using a spreadsheet application and converted back to MIDI file using csv2midi

usage: midi2csv [-combinenoteonoff] [-separator sepcharacter] input.mid [output.csv]
-combine        finds corresponding note on/off commands and merges them in an output line
-separator      the separator used in spreadsheet (usually semicolon ; or comma ,

midi2csv examples

midi2csv coldice4.mid coldice4_midi2csv_semicolon.csv
result text: coldice4_midi2csv_semicolon.csv
midi2csv -sep , coldice4.mid coldice4_midi2csv_using_comma.csv
result text: coldice4_midi2csv_using_comma.csv
midi2csv -combine coldice4.mid coldice4_midi2csv_combinednoteonoff.csv
result text: coldice4_midi2csv_combinednoteonoff.csv


csv2midi converts a text file generated by midi2csv utility back to a MIDI file.

usage: csv2midi input.csv output.mid


mid2parson reads the notes from a specified channel of a binary midi file and makes it mono. The remaining notes are converted to Parsons code which is often used to find parts from the song by a given search term that has not to be very exact (e.g. humming).

midi2pars [-channel #][-track #] input.mid [output.txt]
(channel # is 1-16,  track # is 1-255)


midinote converts a binary MIDI file into a text file that can easily read by machines or software. Each line contains a MIDI command with values as parameters. The parameters contain also calculated times.
The text file can be modified using a text editor and converted back to a MIDI file using utility note2mid.

usage: midinote [-nohead] [-val] [-ev ...][-units][-time] input.mid [output.txt]

-noheader       don't print header that explains the columns
-values         print cryptical values for easier import into programs
-eventlist ...  print only events of kind listed in argument ...
-units  print column with units
-time   print column with milliseconds
input.mid       get notes sorted by start time from this midi file
output.txt      write output into a text file (default: standard output)
by default units and time columns are shown

midinote examples

midinote coldice3.mid coldice3_midinote_readable.txt
result text: coldice3_midinote_readabletext.txt
midinote -values coldice3.mid coldice3_midinote_values.txt
result text: coldice3_midinote_values.txt
midinote -eventlist t -time coldice3.mid coldice3_midinote_textevents.txt
result text: coldice3_midinote_textevents.txt


note2mid converts a text file generated by midinote utility back to a MIDI file.

usage: note2mid textfile midifile


removechords removes chords of given formats in a midi file

removechords input.mid output.mid -method methodname -format chordformats ...

REMOVECHORDFORMATS removeformat1 removeformat2 ...
REMOVECHORDFORMATSEXCEPT exceptformat1 expceptformat2 ...
REMOVEDUPLICATECHORDS preferformat1 preferformat2 ...

default method is REMOVECHORDFORMATS

removechords examples

removechords -method REMOVEALLCHORDS coldice3.mid nochords.mid
removechords coldice3.mid chords_without_psr_and_biab.mid -method REMOVECHORDFORMATS -format PSR BIAB
removechords coldice3.mid chords_onlypsr.mid -method REMOVECHORDFORMATSEXCEPT -format PSR
removechords coldice3.mid chords_onlyoneformat.mid -method REMOVEDUPLICATECHORDS -format PSR WORDBOX LYRIC TEXT MARKER BIAB


midimove moves MIDI commands of a binary MIDI file by a millisecond amount forward or backward.

Licensed permission for noncommercial use by Max Mustermann.
No permission for distribution.
(c) 1998-2017 GN MIDI Solutions, Austria,
midimove is no demo. Distributing tool or license is probibited.
midimove [-millisec #] [-channels #] [-events list] [-ignoreinvalidmoving[=yes/no]] input.mid output.mid
-millisec #     negative ms moves events into direction of start of song
-ignoreinvalidmoving    set to time 0 if moving not possible
                (e.g. when using -ms -10000 and events are in first 10 seconds)                    
-channels #     a list of channels e.g. 1-9,11-16 (default: all channels)
-events list    a list of event type names separated by , e.g. notes,controls (default: all event types except meter tempo and tact)
Following event names are currently supported:
channelevents   (all event types that have a channel number like notes, pitchbends, programs, controls, aftertouch, polyaftertouch)
metaevents   (all meta event types including metatext but not tempo and not meter (tact))
metatext     (all meta text types like lyrics, text, markers, trackname, instrument ...)
lyrics       (meta text of type lyrics)
text         (meta text of type text)
markers      (meta text of type markers
sysex        (system exclusive)

midimove examples

midimove -ms -130 -channels 1,4 input.mid output130.mid
midimove -ms +50 -channels 1-10 -events notes,pitchbend,controls,programs,sysex input.mid output50.mid © Günter Nagler Contact