Skip to content

Convert MIDI files that contain sustain pedal events to longer notes

License

Notifications You must be signed in to change notification settings

Teskann/sustain-to-longer-notes

Repository files navigation

🎹 Sustain to Longer Notes

Action results License: MIT

Convert a MIDI file with sustain pedal events to a midi file with changed notes duration.

Sustain to longer notes image

Features

  • ✅ Convert sustain pedal events (controller 64) to longer notes
  • ✅ Remove overlapping notes in the MIDI file

Installation

Prerequisites

  • Python 3.8+
  • Make

Install command

make

Usage

usage: sustain [-h] file [file ...]

Convert the sustain pedal MIDI events to longer notes.

positional arguments:
  file        Input MIDI file(s) to convert. The output file name(s) are the same as input but suffixed by '_sustained'.

options:
  -h, --help  show this help message and exit

Examples

Run on a single file

sustain path/to/my_file.mid

This created the file path/to/my_file_sustained.mid.

Run on a directory

sustain path/to/my/directory

This has run on all *.mid and *.MID files in path/to/my/directory and created the files path/to/my/directory/*_sustained.mid

Compatibility

Ubuntu 22.04 Windows Mac OS
Python 2.7
Python 3.7 ⚠️ ⚠️ ⚠️
Python 3.8
Python 3.9
Python 3.10
Python 3.11
  • ❌: Unsupported
  • ⚠️: Not tested, but may work (not officially supported)
  • ✅: Officially supported

About

Convert MIDI files that contain sustain pedal events to longer notes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published