https://github.com/tobymurray/midi-silence-trimmer
Remove silence from the start of single track MIDI files
https://github.com/tobymurray/midi-silence-trimmer
Last synced: 3 months ago
JSON representation
Remove silence from the start of single track MIDI files
- Host: GitHub
- URL: https://github.com/tobymurray/midi-silence-trimmer
- Owner: tobymurray
- Created: 2024-01-05T21:10:43.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-07T20:07:10.000Z (9 months ago)
- Last Synced: 2024-12-30T04:18:12.241Z (5 months ago)
- Language: Rust
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MIDI Silence Trimmer
A Rust program to trim silence in MIDI files (by modifying the delta time of the first note and end of track event).
## Overview
This program:
- reads a MIDI file
- identifies the first played note in the track
- identifies the end of track event
- trims the silence by setting the delta time of the note and end of track event to 0
- writes out the modified MIDI file to the specified output path## Usage
```sh
cargo run -- [output_midi_path]: Path to the input MIDI file.
[output_midi_path]: (Optional) Path to the output MIDI file. If not provided, a default output filename will be generated.
```Example
```sh
cargo run -- input.mid output.mid
```This command trims the silence at the beginning of input.mid file and saves the modified MIDI file as output.mid. input.mid is not modified.
## Dependencies
- [midly](https://github.com/kovaxis/midly): a feature-complete MIDI decoder and encoder designed for efficiency and ease of use.
## To build targeting Raspberry Pi
- `sudo pacman -S aarch64-linux-gnu-gcc`
- `rustup target add aarch64-unknown-linux-gnu`