Building midi123
Requirements
midi123 has been developed using Crystal 1.4.x through 1.6.x. Previous versions will likely work, but may require a bit of tweaking.
Regardless of your Crystal version, you will need an updated version of the Shards command that has Fossil support built into it. Support was introduced in Shards 0.17.0. If you have problems, you can always use my personal fork of Shards as a temporary measure.
Fossil is required as some of midi123's dependencies are in Fossil repositories.
You'll need both PortAudio and PulseAudio installed.
Getting the sources
$ fossil clone https://chiselapp.com/user/MistressRemilia/repository/midi123/
$ cd midi123
Building with Rake
Using Rake is the easier way to build midi123.
For a default build, you can just run rake
from the root repository directory.
The binary will be in the bin/
directory.
The default target is midi123
, and it has it one option that can be one of three values:
debug
: Produces an un-optimized binary with full debug information.normal
: Produces an optimized binary. This will have some debug information included.speed
: Produces a fully optimized binary without debug information. Additionally, this will also strip the binary. This is the default mode.
Examples of setting these:
rake midi123[speed]
: Build the most optimized binary (and strip it).rake midi123[debug]
: Build an un-optimized debug build.rake midi123
: Exact same as running justrake
.
There are also a few other targets:
rake deps
: Runsshards install
orshards update
.rake clean
: Removes the compiled binary from thebin/
directory.rake clobber
: The same asrake clean
, except this also removes thelib/
directory and theshards.lock
file.rake help
: Show information about the targets.
You can then use rake
to build things in the following ways:
rake
: Builds an optimized binary.rake help
: See the various options for building the binary.rake midi123[debug]
: Builds a non-optimized debug build.rake midi123[normal]
: Builds an optimized binary.rake midi123[fast]
: Builds an optimized, striped binary.
Building manually with Shards
You can forego using Rake if you choose and just use Shards directly. When doing this, it's important to be aware of a few compiler flags:
-Dpreview_mt
: This is REQUIRED for midi123.-Dhaematite_wd40
: Haematite (the library providing SoundFont synthesis) will normally do a few extra checks at runtime to see that the rendering buffers are all the correct size. This is normally only needed during development, and are included mostly for easier debugging. Specifying-Dhaematite_wd40
disables these checks, thereby saving a few extra CPU cycles (Crystal will still do bounds checks on the buffers at runtime).
Examples:
$ shards build --release -p -Dpreview_mt
$ shards build -p