Skip to content

Commit

Permalink
Added mikmod / timidity for MIDI and S3M support.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuckj committed Jan 25, 2021
1 parent 70d45bf commit 17bcb33
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@ ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8

RUN apt update \
&& apt upgrade -y \
&& apt install -y locales ffmpeg openjdk-8-jre-headless nano flac lame wget \
&& apt install -y locales ffmpeg openjdk-8-jre-headless nano flac lame mikmod timidity wget \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /opt/subsonic \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
&& mkdir -p /var/subsonic/transcode \
&& cd /var/subsonic/transcode \
&& ln -s "$(which ffmpeg)"
&& ln -s "$(which ffmpeg)" \
&& ln -s "$(which lame)" \

RUN wget --no-check-certificate https://s3-eu-west-1.amazonaws.com/subsonic-public/download/subsonic-6.1.6-standalone.tar.gz \
&& tar xvzf subsonic-6.1.6-standalone.tar.gz -C /opt/subsonic \
&& rm -rf subsonic-6.1.6-standalone.tar.gz

COPY mikmod_stdout /var/subsonic/transcode
COPY timidity_stdout /var/subsonic/transcode

COPY entrypoint.sh /opt/subsonic/entrypoint.sh

WORKDIR /opt/subsonic
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ variables. See the table below for customization options.
| SUBSONIC_DEFAULT_PODCAST_FOLDER | The default folder (within the container) for podcasts. | /var/music/Podcast |
| SUBSONIC_DEFAULT_PLAYLIST_FOLDER | The default folder (within the container) for playlists. | /var/playlists |

The container has ffmpeg, mikmod (for screamtracker modules), timidity (for midi files), and LAME (for encoding screamtracker and midi files to MP3).
Subsonic is not, by default, configured to use mikmod or timitidy. You must add the configuration. In the transcoding section, add a configuration like
the following for screamtracker / etc files:

| Name | Convert from | Convert to | Step 1 | Step 2 |
| :----------------- | :------------------------------------------------------------------------- | :--------- | :----------------- | :---------------------------------------------------------------------- |
| xm, mod, etc > mp3 | xm mod s3m 669 it stm amf dsm far gdm gt2 imf med mtm okt stx ult umx apun | mp3 | mikmod_stdout %s | lame -r -b %b --tt %t --ta screamtracker --tl %l -S --resample 44.1 - - |
| mid > mp3 | mid | mp3 | timidity_stdout %s | lame - -b 64 |

The `mikmod_stdout` and `timidity_stdout` scripts are simple scripts that run mikmod and timidity sending
the output to stdout in wav format for lame to use for encoding. If you have no need to handle tracker or
midi files than you can safely ignore this configuration.

The container will use volumes for for the following directories within the container:

Expand Down
4 changes: 4 additions & 0 deletions mikmod_stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
MIKMOD=/usr/local/bin/mikmod
${MIKMOD} --noloops -X -q -i -hq -su -d 6 -p 0 --norc "${1}" | tee
#${MIKMOD} -d stdout --noloops -X -q -i --hqmixer --surround --norc "$1" | tee
3 changes: 3 additions & 0 deletions timidity_stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
TIMIDITY=/usr/bin/timidity
${TIMIDITY} "${1}" -Ow -o - | tee

0 comments on commit 17bcb33

Please sign in to comment.