Modern C++ goodness

ftz MIDI

Library for working with MIDI data

This library provides a convenient interface for manipulation of MIDI data as well as providing higher level abstractions for I/O.

Key features

  • Cross platform - written in pure ISO C++17 (+ #pragma once).
  • Free software - released under the terms of GNU GPLv3 or any later version.


Compiler support

  • G++ 8 or newer with libstdc++

How to get

You need to use Conan to install and use this library. To install Conan on APT-based distros you would typically do:

# apt install python-pip
$ pip install conan

Then add official ftz repository:

$ conan remote add ftz https://conan.ftz.lyberta.net

Then you need to follow a Conan tutorial to declare that your project depends on this library, for example, using conanfile.txt:


Or using conanfile.py:

build_requires = "ftzMIDI/Latest@Lyberta/Latest"

The rest depends on your build system. In CMake you would do:

# Importing Conan settings.

# Adding example executable target.
add_executable(Example ...)

# Specifying libraries to link executable to.
target_link_libraries(Example PRIVATE CONAN_PKG::ftzMIDI)

After that in your source code you include files like this:

#include <ftz/MIDI/SomeHeader.h>

To build your code, remember to execute conan install before calling conan build or cmake so your dependencies will be set correctly.

Source code

API reference

Manually building the library

Build dependencies:

  • Git
  • G++ 8 or newer
  • CMake 3.8 or newer
  • Conan 1.2 or newer
  • ALSA

To install dependencies on Debian Testing you would invoke:

# apt install git g++-8 cmake python-pip libasound2-dev
$ pip install conan

If you didn’t have Conan installed before, you probably need to configure the default profile:

$ conan profile new --detect default
$ conan profile update settings.compiler.version=8 default
$ conan profile update settings.compiler.libcxx=libstdc++11 default
$ conan profile update settings.cppstd=17 default

Add official ftz repository to Conan:

$ conan remote add ftz https://conan.ftz.lyberta.net

Clone the repository and switch into it:

$ git clone https://gitlab.com/ftz/midi.git
$ cd midi

Build the Conan package with your specified user and channel:

$ conan create . User/Channel