Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/freebsd-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
run: |
mkdir -p ${{github.workspace}}/temp

# - name: Downloading a DLS file for testing
# uses: ethanjli/cached-download-action@v0.1.4
# with:
# url: http://www.ronimusic.com/sf2/Airfont_340.dls
# destination: ${{env.TEMP}}/soundfont.dls
# cache-key: cached.soundfont.dls
# enable-cross-os-archive: true
- name: Downloading a DLS file for testing
uses: ethanjli/cached-download-action@v0.1.4
with:
url: https://ftp.chasnah.com/soundfonts/Airfont_340.dls
destination: ${{env.TEMP}}/soundfont.dls
cache-key: cached.soundfont.dls
enable-cross-os-archive: true

- name: FreeBSD test
id: test
Expand All @@ -44,7 +44,7 @@ jobs:
googletest
run: |
set -e -x
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}} -DSOUNDFONT_TEST=ON
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cd ${{github.workspace}}/build
ctest -C ${{env.BUILD_TYPE}} --verbose
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,22 @@ jobs:
run: |
mkdir -p ${{github.workspace}}/temp

# - name: '${{ matrix.icon }} Downloading a DLS file for testing'
# uses: ethanjli/cached-download-action@v0.1.4
# with:
# url: http://www.ronimusic.com/sf2/Airfont_340.dls
# destination: ${{env.TEMP}}/soundfont.dls
# cache-key: cached.soundfont.dls
# enable-cross-os-archive: true
- name: '${{ matrix.icon }} Downloading a DLS file for testing'
uses: ethanjli/cached-download-action@v0.1.4
with:
url: https://ftp.chasnah.com/soundfonts/Airfont_340.dls
destination: ${{env.TEMP}}/soundfont.dls
cache-key: cached.soundfont.dls
enable-cross-os-archive: true

- name: '${{ matrix.icon }} Configure CMake with USE_44KHZ=${{ matrix.USE_44KHZ }} and USE_16BITS_SAMPLES=${{ matrix.USE_16BITS_SAMPLES }}'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}} -DUSE_44KHZ=${{ matrix.USE_44KHZ }} -DUSE_16BITS_SAMPLES=${{ matrix.USE_16BITS_SAMPLES }}
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
-DUSE_44KHZ=${{ matrix.USE_44KHZ }}
-DUSE_16BITS_SAMPLES=${{ matrix.USE_16BITS_SAMPLES }}
-DSOUNDFONT_TEST=ON

- name: '${{ matrix.icon }} Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/mac-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@ jobs:
run: |
mkdir -p ${{github.workspace}}/temp
# - name: Downloading a DLS file for testing
# uses: ethanjli/cached-download-action@v0.1.4
# with:
# url: http://www.ronimusic.com/sf2/Airfont_340.dls
# destination: ${{env.TEMP}}/soundfont.dls
# cache-key: cached.soundfont.dls
# enable-cross-os-archive: true
- name: Downloading a DLS file for testing
uses: ethanjli/cached-download-action@v0.1.4
with:
url: https://ftp.chasnah.com/soundfonts/Airfont_340.dls
destination: ${{env.TEMP}}/soundfont.dls
cache-key: cached.soundfont.dls
enable-cross-os-archive: true

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
-DSOUNDFONT_TEST=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/win-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
- name: '${{ matrix.icon }} Temp Environment Variable'
run: mkdir temp

# - name: '${{ matrix.icon }} Downloading a DLS file for testing'
# uses: ethanjli/cached-download-action@v0.1.4
# with:
# url: http://www.ronimusic.com/sf2/Airfont_340.dls
# destination: ${{env.TEMP}}/soundfont.dls
# cache-key: cached.soundfont.dls
# enable-cross-os-archive: true
- name: '${{ matrix.icon }} Downloading a DLS file for testing'
uses: ethanjli/cached-download-action@v0.1.4
with:
url: https://ftp.chasnah.com/soundfonts/Airfont_340.dls
destination: ${{env.TEMP}}/soundfont.dls
cache-key: cached.soundfont.dls
enable-cross-os-archive: true

- name: '${{ matrix.icon }} Configure CMake'
id: configuration
Expand All @@ -66,6 +66,7 @@ jobs:
-DCPACK_SYSTEM_NAME=${{matrix.arch}}
-DDEPENDENCY_DIRS=${{github.workspace}}/vcpkg/installed/${{matrix.triplet}}/bin
-DINSTALL_DEPENDENCIES=ON
-DSOUNDFONT_TEST=ON
- name: '${{ matrix.icon }} Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/win-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ jobs:
echo "cache_path=$(cygpath -m $TEMP)" >> $GITHUB_OUTPUT
echo "dependencies=$(cygpath -m $MSYSTEM_PREFIX/bin)" >> $GITHUB_OUTPUT

# - name: '${{ matrix.icon }} Downloading a DLS file for testing'
# uses: ethanjli/cached-download-action@v0.1.4
# with:
# url: http://www.ronimusic.com/sf2/Airfont_340.dls
# destination: ${{steps.tmp.outputs.cache_path}}/soundfont.dls
# cache-key: cached.soundfont.dls
# enable-cross-os-archive: true
- name: '${{ matrix.icon }} Downloading a DLS file for testing'
uses: ethanjli/cached-download-action@v0.1.4
with:
url: https://ftp.chasnah.com/soundfonts/Airfont_340.dls
destination: ${{steps.tmp.outputs.cache_path}}/soundfont.dls
cache-key: cached.soundfont.dls
enable-cross-os-archive: true

- name: '${{ matrix.icon }} Configure CMake'
id: configuration
Expand All @@ -74,6 +74,7 @@ jobs:
-DDEPENDENCY_DIRS=${{steps.tmp.outputs.dependencies}}
-DCPACK_SYSTEM_NAME=${{matrix.sys}}
-DINSTALL_DEPENDENCIES=ON
-DSOUNDFONT_TEST=ON

- name: '${{ matrix.icon }} Build'
run: cmake --build build --config ${{env.BUILD_TYPE}}
Expand Down
16 changes: 10 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 3.21)

project( sonivox
LANGUAGES C CXX
VERSION 4.0.1.0
VERSION 4.0.2.0
)

# GoogleTest requires at least C++14
Expand Down Expand Up @@ -93,6 +93,10 @@ if (SF2_SUPPORT)
set(_FLOAT_DCF ON)
endif()

set(DLS_URL "https://ftp.chasnah.com/soundfonts/Airfont_340.dls" CACHE STRING "DLS file URL for testing")
set(DLS_SIZE "81362584" CACHE STRING "DLS file size")
set(DLS_HASH "beb3e39e3c9fc51ef4dff36fdd8db0361471a91d244c3ee78af90f6d3c783b04" CACHE STRING "DLS file SHA256 hash")

if (DEFINED ENV{GITHUB_OUTPUT})
file(APPEND
"$ENV{GITHUB_OUTPUT}"
Expand Down Expand Up @@ -479,14 +483,14 @@ if (BUILD_TESTING)
set(SOUNDFONT "${TEMPDIR}/soundfont.dls")
target_compile_definitions(SonivoxTest PUBLIC SOUNDFONT_TEST)
if (NOT EXISTS ${SOUNDFONT})
message(STATUS "Downloading DLS file for testing to ${SOUNDFONT}")
file(DOWNLOAD "http://www.ronimusic.com/sf2/Airfont_340.dls" ${SOUNDFONT})
message(STATUS "Downloading DLS file from ${DLS_URL} for testing to ${SOUNDFONT}")
file(DOWNLOAD ${DLS_URL} ${SOUNDFONT})

file(SIZE ${SOUNDFONT} SOUNDFONTSIZE)
file(MD5 ${SOUNDFONT} SOUNDFONTHASH)
file(SHA256 ${SOUNDFONT} SOUNDFONTHASH)
message(STATUS "DLS file ${SOUNDFONT} size: ${SOUNDFONTSIZE}")
message(STATUS "DLS file ${SOUNDFONT} MD5 hash: ${SOUNDFONTHASH}")
if (NOT (SOUNDFONTSIZE EQUAL 81362584 AND SOUNDFONTHASH STREQUAL "40c0cd4ad29ae411a8fc3d6681002a2b"))
message(STATUS "DLS file ${SOUNDFONT} SHA256 hash: ${SOUNDFONTHASH}")
if (NOT (SOUNDFONTSIZE EQUAL ${DLS_SIZE} AND SOUNDFONTHASH STREQUAL ${DLS_HASH}))
message(FATAL_ERROR "The downloaded DLS file is corrupted.")
endif()
endif()
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The build system has the following options:
* `USE_16BITS_SAMPLES`: Uses 16 bits samples (instead of 8 bit). ON by default. The rendered audio uses always 16 bits.
* `BUILD_SHARED_LIBS`: to control the generation and install of both the static or shared libraries from the sources. (ON by default).
* `BUILD_TESTING`: ON by default, to control if the unit tests are built, which require Google Test.
* `SOUNDFONT_TEST`: OFF by default, to unit test DLS processing.
* `BUILD_APPLICATION`: ON by default, to build and install the CLI program. ON by default.
* `NEW_HOST_WRAPPER`: Uses the new CRT-based host wrapper for faster file loading. ON by default.
* `SF2_SUPPORT`: Enable SF2 support and float DCF. ON by default.
Expand All @@ -50,6 +51,12 @@ The synthesizer types options (at least one must be enabled):

* `MAX_VOICES`: Maximum number of voices. 64 by default.

Other CMake variables that you may want to override when SOUNDFONT_TEST is ON:

* `DLS_URL`; https://ftp.chasnah.com/soundfonts/Airfont_340.dls
* `DLS_SIZE`: 81362584 (size of the DLS file in bytes)
* `DLS_HASH`: beb3e39e3c9fc51ef4dff36fdd8db0361471a91d244c3ee78af90f6d3c783b04 (SHA256 hash of the DLS file)

See also the [CMake documentation](https://cmake.org/cmake/help/latest/index.html) for common build options.

## Differences with upstream
Expand Down