> For the complete documentation index, see [llms.txt](https://rtmidicore.micdah.dk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rtmidicore.micdah.dk/rtmidi.md).

# RtMidi

We are using a fork of [rtmidi](https://github.com/micdah/rtmidi) where the `rtmidi_c` files have been adapted for better usage with *RtMidi.Core*.

The fork is regularly merged with *upstream*, ensuring fixes, improvements etc are carried over into the version we are using.

## Compiling

Guides on how to compile the runtime-dependent library binary.

### OS X

1. Open terminal and navigate to the root of the repository
2. Compile project:

   ```bash
   $ ./autogen.sh --no-configure
   $ ./configure
   $ make
   ```
3. Copy the newly compiled `dylib` file into the *RtMidi.Core* project:

   ```bash
   $ cp .libs/librtmidi.dylib ~/git/RtMidi.Core/RtMidi.Core/librtmidi.dylib
   ```

#### Pre-requisites

Requires `automake`, `autoconf` and `libtool` to be installed, which is easily done using Homebrew:

```bash
$ brew install autoconf automake libtool
```

### Windows (64 bit)

1. From the root of the repository, navigate to `msw/`
2. Open the solution file `rtmidilib.sln`
3. Change configuration to ***Export***
4. Change target framework to ***x64***
5. Build solution
6. Copy newly compiled `dll` file for x64 into the *RtMidi.Core* project:

   ```bash
   $ cp msw/x64/Export/rtmidilib.dll ~/git/RtMidi.Core/RtMidi.Core/librtmidi.dylib
   ```
7. Change target framework to ***Win32***
8. Build solution
9. Copy newly compiled `dll` file for x86 into the *RtMidi.Core* project:

   ```bash
   $ cp msw/Export/rtmidilib.dll ~/git/RtMidi.Core/RtMidi.Core/rtmidi32.dll
   ```

#### Pre-requisites

Requires Visual Studio 2017 (*or newer*) with the following components installed (*use Visual Studio Installer*)

* Workload: Desktop development with C++
* Individual components:
  * Windows 8.1 SDK
  * Windows Universal CRT SDK

### Linux

1. Open terminal and navigate to the root of the repository
2. Compile project:

   ```bash
   $ ./autogen.sh
   $ ./configure
   $ make
   ```
3. Copy the newly compiled `so` file into the *RtMidi.Core* project:

   ```bash
   $ cp .libs/librtmidi.so ~/git/RtMidi.Core/RtMidi.Core/librtmidi.so
   ```
