# Batch Actions

To start a batch process, select the file(s) or directory(es) you want to process and choose the desired action.

The following actions can be applied to one or more files/folders/disks at the same time. MidiKit will make changes only if necessary (and possible).

## Fix

### Extension/Type

if your preferred sequencer application does not recognize your MIDI files, it means that for some reason, for example if the MIDI files were on a DOS disk or were downloaded from the internet, these files have the wrong file type attribute (The file type is used by applications to filter out files they can not read). This command assigns the correct 'MIDI' Macintosh file type to your files.

To ensure platform interoperability (on other OSes, Macintosh HFS file type metadata is not handled), the appropriate name extension is also added to the files: "kar" for valid Soft Karaoke files and "mid" for all other MIDI files.

You may also change the MIDI file creator (owner) during this operation. The Macintosh Finder uses this property to associate documents to their applications.

NB: You can also use the Finder "File/Get Info Open With/Change All" on a selected file to associate a file type with an application.

### Tempo/Signature

Some applications may ignore tempo and signature messages (or crash) if the related messages are not stored into the first track (ie. Master/Conductor track ) of format 1 MIDI files. You may fix this with this command.

### Invalid Delta Time

Corrupted files may contain invalid delta time values (time between two events). You can specify a maximum value in minutes which is considered valid. If an invalid value is found the sequence is truncated accordingly: any subsequent event is ignored.

### Missing Reset Sysex Messages

Adds the specified reset messages, if missing.

### Filter Redundant Data

Consecutive identical events will be removed. Only program change, controllers, pitch, channel aftertouch and note aftertouch messages are processed.

### Set Sequence Start to 01:01:000

This will set the delta-time of very first event in the file to 0.

## Convert

This action converts the MIDI files to the specified format.

- Converting to 0 a karaoke file will produce a Tune1000 karaoke file. Both format 0 and 1 will be processed.
- Converting to 1 a karaoke file will produce a SoftKaraoke file. Only format 0 files will be processed: Converting a format 1 karaoke file to SoftKaraoke requires that you convert first to 0 and then back to 1.

To convert to XF/WX karaoke format, you should use the "Convert Karaoke" menu command.

You may specify some file conversion options into the conversion dialog:

- "Use GM instruments as track names" --> The General MIDI instrument names will be used as track names when converting to format 1.
- "Compressed" --> The resulting file will be compressed.

| CAUTION: During the conversion to format 0, data specific to format 1 (tracks organization and names, for example) is lost. It's a good idea to backup you files before converting them! When converting a file to format 1, Midikit handles channel prefix messages associated with channels (not tracks), so channel prefix values greater than 15 will be ignored. |

## Convert Karaoke

Converts to Tunes1000, YAMAHA XF format or GEM WX format 0 files.

Because XF chords are not encoded as strings, a "mapping" table is needed to convert string types to XF "sequencer specific" meta events. You can edit this data to meet your needs in the "XF/WX Chords Map" (Tools > Chords Map Panel).

Same thing for the GEM WX chords, which requires a specific text formating to be recognized by GEM keyboards.

For better readability, you can optionally limit the length of lyrics lines. If this is not possible (a single synced line exceeds the specified length), a warning is issued in the log.

Finally, you can enter a set of characters to remove from lyrics. This may be useful for better compatibilty with some keyboards. Only ASCII characters can be entered.

## Compand

### Compress

If you use a MIDI file player/sequencer that supports compressed MIDI files, you may compress your files with this command. The compression amount is tipically up to 10% in format 0 and up to 20% in format 1 and is obtained by removing redundant status messages, i.e. if more contiguous events have the same status byte, only the first occurrence is saved. Result files are still MIDI files!

### Expand

You may expand compressed MIDI files to provide better compatibility.

## Extract Lyrics

Saves the selected MIDI files lyrics on disk. Text files will be created in same directory of the MIDI files and will be named as the MIDI file + appropriate extension. If a file with the same resulting name already exists, it will be replaced. The file will be saved using the specified encoding.

Available formats are plain text, LRC, LRC Enhanced and ChordPro.

## Lyrics/Markers

The following operations allows you to preserve karaoke information, which is usually ignored by professional sequencers, while markers are not. So the steps are:

1. Convert the lyrics to markers.
2. Open the file with your preferred sequencer and make whatever changes you like.
3. Export the file as Standard MIDI file.
4. Convert the markers back to lyrics (only tagged markers are processed).

### Lyrics To Markers

This operation will convert existing lyrics into markers meta events using the followings tags:
lyrics --> @
chords --> %

### Markers To Lyrics

This operation will convert existing markers into valid karaoke meta events, depending on the followings tags:
@ --> lyrics
% --> chords

## Change/Swap MIDI Channels

Change the channel of every event targeting channel x to new channel y, or swap channel x and y.

## Set Meta Event Text

Sets the specified meta event to either a specified string or the filename minus extension. You can also apply regular expressions to filter the filename.

## Transpose

You can here batch transpose a selection of files/folders in the range of +/- 12 semitones, specifying which MIDI channels to process.

## Remove Track

Remove the specied track from all selected files.

| CAUTION: There's no way to undo this. Make a backup before using this destructive action! |