Skip to content

Instantly share code, notes, and snippets.

@t94j0
Created November 6, 2021 20:32
Show Gist options
  • Save t94j0/672cc3ae92453073760a338c60283506 to your computer and use it in GitHub Desktop.
Save t94j0/672cc3ae92453073760a338c60283506 to your computer and use it in GitHub Desktop.

Revisions

  1. t94j0 created this gist Nov 6, 2021.
    31 changes: 31 additions & 0 deletions ss14_macOS_instruments.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    # Using Instruments in Space Station 14 on macOS

    SS14 uses [FluidSynth] as a backend for playing MIDI files. The FluidSynth dylib is not included as a resource in the game, so we must add it ourselves. Luckily, [HomeBrew] has formula for this.

    ## Installation

    1. Install fluid-synth

    ```bash
    brew install fluid-synth
    ```

    For M1 users, the ARM version isn't compatible, so you either need to prepend `arch -x86_64` or install HomeBrew to `/usr/local/homebrew`

    2. Copy the resulting dylib to `/usr/local/lib`

    ```bash
    HOMEBREW_HOME=/usr/local/homebrew
    sudo ln -s $HOMEBREW_HOME/Cellar/fluid-synth/2.2.3/lib/libfluidsynth.3.0.3.dylib /usr/local/lib/libfluidsynth.dylib
    ```

    * Ensure `$HOMEBREW_HOME` is set to the root of your HomeBrew folder.
    * The SS13 wrapper, [NFluidSynth], calls [NativeLibrary.Load][1] to load the dylib. One of the paths it checks is `/usr/local/lib`.

    3. Restart SS14 and you're good to go


    [FluidSynth]: https://github.com/FluidSynth/fluidsynth
    [HomeBrew]: https://formulae.brew.sh/formula/fluid-synth
    [NFluidsynth]: https://github.com/atsushieno/nfluidsynth
    [1]: https://github.com/atsushieno/nfluidsynth/blob/6a70a438be8892a6756f3bb1452f4704acc66290/NFluidsynth/Native/LibFluidsynth.cs#L36