Products
Orders
Services
Impressum
Freeware
Links

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

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, http://www.gnmidi.com
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

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.

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

usage: midi2txt [-error][-chunk][-short][-info][-lyric][-tact][-units][-ms][-dec][-channel] file.mid [file.txt]
options:
-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

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

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

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

midi2csv

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

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

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

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

usage: csv2midi input.csv output.mid

mid2parson

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

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.

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

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

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

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

usage: note2mid textfile midifile

removechords

removechords removes chords of given formats in a midi file

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

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

methods:
REMOVEALLCHORDS
REMOVECHORDFORMATS removeformat1 removeformat2 ...
REMOVECHORDFORMATSEXCEPT exceptformat1 expceptformat2 ...
REMOVEDUPLICATECHORDS preferformat1 preferformat2 ...

chordformats: LYRIC TEXT MARKER PSR WORDBOX BIAB
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

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

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

Licensed permission for noncommercial use by Max Mustermann.
No permission for distribution.
(c) 1998-2017 GN MIDI Solutions, Austria, http://www.gnmidi.com
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:
all
channelevents   (all event types that have a channel number like notes, pitchbends, programs, controls, aftertouch, polyaftertouch)
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

midireplacetext

midireplacetext replaces META text in a MIDI file.

This tool can be applied using batchexec to many MIDI files (batch conversion).
Using batchexec no DOS commandline knowledge is required.

usage: midireplacetext [-table=filename.rp] [-filter=typename][-match=text] [-replace=newtext] input.mid output.mid
special characters can be encoded in hex e.g. -match=\x3d
typenames are: all lyric text marker copyright trackname instrument devicename programname
matching copyright text is only replaced in commercial version when authorized in license

midireplacetext examples

midireplacetext -filter lyric -match errer -replace error input.mid output.mid
midireplacetext -table translation1.rp input.mid output.mid

midireplacetext .rp example file

Gitarre =>guitar // comment 
[trackname]Melodie=>melody
[lyric]\228=>ae
[lyric]\246=>oe
[lyric]\252=>ue
[lyric]\196=>Ae
[lyric]\214=>Oe
[lyric]\220=>Ue
[lyric]\xdf=>sz
[all][something else]=>[etwas anderes]
\=\>=>->
[text]\\=>\///comment directly after a / character
\[copyright\]=>(c)
explanation of these lines: 
Gitarre with following space character is replaced against guitar with following space character in all text
Melody is replaced against melody in track names only
German latin-1 characters ä,ö,ü,Ä,Ö,Ü,ß are replaced against ascii sequences ae,oe,ue,Ae,Oe,Ue,sz  in meta lyrics only
text [something else] is replaced against [etwas anderes] in all text  (because [all] is specified here it was not necessary to escape the [...] parts. Alternative would have been \[something else\]=>\[etwas anderes\]
=> is replaced against -> in all text 
\ is replaced against / in meta text only   (usually occurs as paragraphs in .kar files but could rarely also occur as normal text in middle of text)
[copyright] is replaced against (c) in all text
www.gnmidi.com © Günter Nagler Contact