Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

midi

> 编程语言
Open source

Library for reading and writing of MIDI messages and MIDI files (SMF) with Go

358 stars0 likes0 views
WebsiteGitHub

About

Library for reading and writing of MIDI messages and MIDI files (SMF) with Go

midi

library for reading and writing of MIDI messages and SMF/MIDI files with Go.

Note: If you are reading this on Github, please note that the repo has moved to Gitlab (gitlab.com/gomidi/midi) and this is only a mirror.

  • Go version: >= 1.24.2
  • OS/architectures: everywhere Go runs (tested on Linux and Windows).

Installation

go get gitlab.com/gomidi/midi/v2@latest

Features

This package provides a unified way to read and write "over the wire" MIDI data and MIDI files (SMF).

  • implementation of complete MIDI standard ("cable" and SMF MIDI)
  • unified Driver interface (see below)
  • reading and optional writing with "running status"
  • seamless integration with io.Reader and io.Writer
  • no dependencies outside the standard library
  • low overhead
  • shortcuts for General MIDI, Sysex messages etc.
  • CLI tools that use the library
  • SMF files can be converted back and forth into a human readable JSON format

Drivers

For "cable" communication you need a Driver to connect with the MIDI system of your OS. Currently the following drivers available in the drivers subdirectory (all multi-platform):

  • rtmididrv based on rtmidi (requires CGO)
  • webmididrv based on the Web MIDI standard (produces webassembly)
  • midicatdrv based on the midicat binaries via piping (stdin / stdout) (no CGO needed)
  • testdrv for testing (no CGO needed)

(there used to be a driver, based on portmidi, but this is not supported anymore)

Examples

…
…

Documentation

see https://pkg.go.dev/gitlab.com/gomidi/midi/v2

License

MIT (see LICENSE file)

Credits

Inspiration and low level code for MIDI reading (see internal midilib package) came from the http://github.com/afandian/go-midi package of Joe Wass which also helped as a starting point for the reading of SMF files.

Alternatives

Matt Aimonetti is also working on MIDI inside https://github.com/mattetti/audio but I didn't try it.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gogogolangmidimidi-files

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言