Skip to content

Commit 3ae4c07

Browse files
authored
Merge branch 'EmbeddedSynth:master' into master
2 parents e5c7680 + 2dac582 commit 3ae4c07

11 files changed

Lines changed: 142 additions & 146 deletions

File tree

.github/workflows/win-msvc.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,23 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
include:
21-
- { icon: '🟪', arch: "x64", os: "windows-latest" }
22-
- { icon: '🟩', arch: "arm64", os: "windows-11-arm" }
21+
- { icon: '🟪', arch: "win64", os: "windows-latest", triplet: "x64-windows" }
22+
- { icon: '🟫', arch: "win32", os: "windows-latest", triplet: "x86-windows" }
23+
- { icon: '🟩', arch: "arm64", os: "windows-11-arm", triplet: "arm64-windows" }
2324
runs-on: ${{ matrix.os }}
2425
name: 🚧${{ matrix.icon }} msvc ${{ matrix.arch }}
2526

2627
steps:
2728
- uses: actions/checkout@v6
2829

30+
- name: '${{ matrix.icon }} Build vcpkg'
31+
uses: johnwason/vcpkg-action@v7
32+
id: vcpkg
33+
with:
34+
pkgs: gtest zlib
35+
triplet: ${{ matrix.triplet }}
36+
token: ${{ github.token }}
37+
2938
- name: '${{ matrix.icon }} Install NSIS'
3039
uses: repolevedavaj/install-nsis@v1.1.0
3140
with:
@@ -48,11 +57,15 @@ jobs:
4857
enable-cross-os-archive: true
4958

5059
- name: '${{ matrix.icon }} Configure CMake'
60+
id: configuration
5161
run: >
52-
cmake -G Ninja -B ${{github.workspace}}/build
62+
cmake ${{ steps.vcpkg.outputs.vcpkg-cmake-config }}
63+
-G Ninja -B ${{github.workspace}}/build
5364
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
5465
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
5566
-DCPACK_SYSTEM_NAME=${{matrix.arch}}
67+
-DDEPENDENCY_DIRS=${{github.workspace}}/vcpkg/installed/${{matrix.triplet}}/bin
68+
-DINSTALL_DEPENDENCIES=ON
5669
5770
- name: '${{ matrix.icon }} Build'
5871
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
@@ -79,6 +92,6 @@ jobs:
7992
uses: actions/upload-artifact@v6
8093
with:
8194
name: SonivoxV4-msvc-installer-${{matrix.arch}}
82-
path: ${{github.workspace}}/build/sonivox-4.0.0-${{matrix.arch}}.exe
95+
path: ${{github.workspace}}/build/sonivox-${{steps.configuration.outputs.config_version}}-${{matrix.arch}}.exe
8396
retention-days: 90
8497
overwrite: true

.github/workflows/win-msys2.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
env:
1111
BUILD_TYPE: RelWithDebInfo
1212
INSTALL_LOCATION: SonivoxV4
13-
TEMP: temp
1413

1514
jobs:
1615
build:
@@ -53,24 +52,28 @@ jobs:
5352
gtest:p
5453
5554
- name: '${{ matrix.icon }} TEMP Environment Variable'
55+
id: tmp
5656
run: |
57-
mkdir temp
57+
echo "cache_path=$(cygpath -m $TEMP)" >> $GITHUB_OUTPUT
58+
echo "dependencies=$(cygpath -m $MSYSTEM_PREFIX/bin)" >> $GITHUB_OUTPUT
5859
5960
- name: '${{ matrix.icon }} Downloading a DLS file for testing'
6061
uses: ethanjli/cached-download-action@v0.1.3
6162
with:
6263
url: http://www.ronimusic.com/sf2/Airfont_340.dls
63-
destination: temp/soundfont.dls
64+
destination: ${{steps.tmp.outputs.cache_path}}/soundfont.dls
6465
cache-key: cached.soundfont.dls
6566
enable-cross-os-archive: true
6667

6768
- name: '${{ matrix.icon }} Configure CMake'
69+
id: configuration
6870
run: >
6971
cmake -B build -G Ninja
7072
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
7173
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}}
72-
-DDEPENDENCY_DIRS=${{steps.msys2.outputs.msys2-location}}/${{matrix.sys}}/bin
74+
-DDEPENDENCY_DIRS=${{steps.tmp.outputs.dependencies}}
7375
-DCPACK_SYSTEM_NAME=${{matrix.sys}}
76+
-DINSTALL_DEPENDENCIES=ON
7477
7578
- name: '${{ matrix.icon }} Build'
7679
run: cmake --build build --config ${{env.BUILD_TYPE}}
@@ -100,6 +103,6 @@ jobs:
100103
uses: actions/upload-artifact@v6
101104
with:
102105
name: SonivoxV4-msys2-installer-${{matrix.sys}}
103-
path: ${{github.workspace}}/build/sonivox-4.0.0-${{matrix.sys}}.exe
106+
path: ${{github.workspace}}/build/sonivox-${{steps.configuration.outputs.config_version}}-${{matrix.sys}}.exe
104107
retention-days: 90
105108
overwrite: true

CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[=========================================================================[
2-
Copyright (c) 2022-2025 Pedro López-Cabanillas
2+
Copyright (c) 2022-2026 Pedro López-Cabanillas
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 3.21)
1818

1919
project( sonivox
2020
LANGUAGES C CXX
21-
VERSION 4.0.0.0
21+
VERSION 4.0.1.0
2222
)
2323

2424
# GoogleTest requires at least C++14
@@ -37,7 +37,8 @@ option(NEW_HOST_WRAPPER "Use the new host wrapper" TRUE)
3737
option(SF2_SUPPORT "Enable SF2 support and float DCF" TRUE)
3838
option(ZLIB_SUPPORT "Enable XMF ZLIB Unpacker support" TRUE)
3939
option(EAS_WT_SYNTH "Enable WaveTable Synth" TRUE)
40-
option(EAS_FM_SYNTH "Enable FM Synth" FALSE)
40+
option(EAS_FM_SYNTH "Enable FM Synth" TRUE)
41+
option(INSTALL_DEPENDENCIES "Deploy dependency libraries" FALSE)
4142

4243
if (NOT (EAS_WT_SYNTH OR EAS_FM_SYNTH OR EAS_HYBRID_SYNTH))
4344
message(FATAL_ERROR "At least one synthesizer type must be enabled: EAS_WT_SYNTH, EAS_FM_SYNTH, EAS_HYBRID_SYNTH.")
@@ -91,9 +92,16 @@ if (SF2_SUPPORT)
9192
set(_FLOAT_DCF ON)
9293
endif()
9394

95+
if (DEFINED ENV{GITHUB_OUTPUT})
96+
file(APPEND
97+
"$ENV{GITHUB_OUTPUT}"
98+
"config_version=${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\n"
99+
)
100+
endif()
101+
94102
include(GNUInstallDirs)
95103

96-
set(PROJECT_RELEASE_DATE "December 30, 2025")
104+
set(PROJECT_RELEASE_DATE "February 14, 2026")
97105

98106
if (BUILD_TESTING)
99107
find_package(GTest CONFIG)
@@ -490,7 +498,7 @@ if (BUILD_APPLICATION)
490498
add_subdirectory(example)
491499
endif()
492500

493-
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
501+
if (INSTALL_DEPENDENCIES)
494502
message(STATUS "DEPENDENCY_DIRS: ${DEPENDENCY_DIRS}")
495503
install(RUNTIME_DEPENDENCY_SET sonivox-dependencies
496504
COMPONENT sonivox_runtime

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
# NOTICE: This is only a fork of the main project's repository: [EmbeddedSynth/sonivox](https://github.com/EmbeddedSynth/sonivox).
44

5-
[![Linux CI](https://github.com/pedrolcl/sonivox/actions/workflows/linux-ci.yml/badge.svg)](https://github.com/pedrolcl/sonivox/actions/workflows/linux-ci.yml)
5+
[![Linux CI](https://github.com/EmbeddedSynth/sonivox/actions/workflows/linux-ci.yml/badge.svg)](https://github.com/EmbeddedSynth/sonivox/actions/workflows/linux-ci.yml)
66

7-
[![Windows MSYS2 CI](https://github.com/pedrolcl/sonivox/actions/workflows/win-msys2.yml/badge.svg)](https://github.com/pedrolcl/sonivox/actions/workflows/win-msys2.yml)
7+
[![Windows MSYS2 CI](https://github.com/EmbeddedSynth/sonivox/actions/workflows/win-msys2.yml/badge.svg)](https://github.com/EmbeddedSynth/sonivox/actions/workflows/win-msys2.yml)
88

9-
[![Windows MSVC CI](https://github.com/pedrolcl/sonivox/actions/workflows/win-msvc.yml/badge.svg)](https://github.com/pedrolcl/sonivox/actions/workflows/win-msvc.yml)
9+
[![Windows MSVC CI](https://github.com/EmbeddedSynth/sonivox/actions/workflows/win-msvc.yml/badge.svg)](https://github.com/EmbeddedSynth/sonivox/actions/workflows/win-msvc.yml)
1010

11-
[![macOS CI](https://github.com/pedrolcl/sonivox/actions/workflows/mac-ci.yml/badge.svg)](https://github.com/pedrolcl/sonivox/actions/workflows/mac-ci.yml)
11+
[![macOS CI](https://github.com/EmbeddedSynth/sonivox/actions/workflows/mac-ci.yml/badge.svg)](https://github.com/EmbeddedSynth/sonivox/actions/workflows/mac-ci.yml)
1212

13-
[![FreeBSD CI](https://github.com/pedrolcl/sonivox/actions/workflows/freebsd-ci.yml/badge.svg)](https://github.com/pedrolcl/sonivox/actions/workflows/freebsd-ci.yml)
13+
[![FreeBSD CI](https://github.com/EmbeddedSynth/sonivox/actions/workflows/freebsd-ci.yml/badge.svg)](https://github.com/EmbeddedSynth/sonivox/actions/workflows/freebsd-ci.yml)
1414

15-
[![Android CI](https://github.com/pedrolcl/sonivox/actions/workflows/android-ci.yml/badge.svg)](https://github.com/pedrolcl/sonivox/actions/workflows/android-ci.yml)
15+
[![Android CI](https://github.com/EmbeddedSynth/sonivox/actions/workflows/android-ci.yml/badge.svg)](https://github.com/EmbeddedSynth/sonivox/actions/workflows/android-ci.yml)
1616

1717
This project originated as a fork of the Android Open Source Project 'platform_external_sonivox', including a CMake based build system to be used not on Android, but on any other computer Operating System. Google licensed this work originally named Sonivox EAS (Embedded Audio Synthesis) from the company Sonic Network Inc. under the terms of the Apache License 2.0.
1818

@@ -42,11 +42,12 @@ The build system has the following options:
4242
* `SF2_SUPPORT`: Enable SF2 support and float DCF. ON by default.
4343
* `ZLIB_SUPPORT`: Enable XMF ZLIB Unpacker support. ON by default.
4444
* `BUILD_MANPAGE`: Build the manpage of the CLI program. OFF by default.
45+
* `INSTALL_DEPENDENCIES`: Deploy dependency libraries. OFF by default.
4546

4647
The synthesizer types options (at least one must be enabled):
4748

4849
* `EAS_WT_SYNTH`: Enable WaveTable Synth. ON by default.
49-
* `EAS_FM_SYNTH`: Enable FM Synth. OFF by default.
50+
* `EAS_FM_SYNTH`: Enable FM Synth. ON by default.
5051
* `EAS_HYBRID_SYNTH`: Enable Hybrid Synth. OFF by default. Requires both `USE_44KHZ` and `USE_16BITS_SAMPLES` to be OFF.
5152

5253
* `MAX_VOICES`: Maximum number of voices. 64 by default.
@@ -57,9 +58,9 @@ See also the [CMake documentation](https://cmake.org/cmake/help/latest/index.htm
5758

5859
This fork currently reverts these commits:
5960

60-
* Full revert of [af41595](https://github.com/pedrolcl/platform_external_sonivox/commit/af41595537b044618234fe7dd9ebfcc652de1576) (Remove unused code from midi engine)
61-
* Full revert of [34ba480](https://github.com/pedrolcl/platform_external_sonivox/commit/34ba4804f643549b8ac74e5f56bfe64db3234447) (Remove unused code)
62-
* Partial revert of [2fa59c8](https://github.com/pedrolcl/platform_external_sonivox/commit/2fa59c8c6851b453271f33f254c7549fa79d07fb) (Build separate sonivox libs with and without jet...)
61+
* Full revert of [af41595](https://github.com/aosp-mirror/platform_external_sonivox/commit/af41595537b044618234fe7dd9ebfcc652de1576) (Remove unused code from midi engine)
62+
* Full revert of [34ba480](https://github.com/aosp-mirror/platform_external_sonivox/commit/34ba4804f643549b8ac74e5f56bfe64db3234447) (Remove unused code)
63+
* Partial revert of [2fa59c8](https://github.com/aosp-mirror/platform_external_sonivox/commit/2fa59c8c6851b453271f33f254c7549fa79d07fb) (Build separate sonivox libs with and without jet...)
6364

6465
All the sources from the Android repository are kept in place, but some are not built and included in the compiled products. A few headers, mostly empty, are included in the 'fakes' subdirectory to allow compilation outside Android.
6566

@@ -88,7 +89,7 @@ Options:
8889
-V, --Verbosity n Verbosity: 0=no, 1=fatals, 2=errors, 3=warnings, 4=infos, 5=details
8990
-R, --reverb-post-mix ignore CC91 reverb send.
9091
-C, --chorus-post-mix ignore CC93 chorus send.
91-
-s, --sndlib n sound engine library: 1=wt, 2=fm, 3=hybrid.
92+
-s, --sndlib n sound engine library: 1=wt, 2=fm, 3=hybrid.
9293
~~~
9394

9495
The following examples assume the default option USE_44KHZ=ON:
@@ -135,7 +136,7 @@ Example 8: pipe the rendered audio thru the ['mpv' media player](https://mpv.io/
135136

136137
Besides being multiplatform, this supports progress view and better navigation (backed by in-memory cache).
137138

138-
You may replace "ants.mid" by another MIDI or XMF file, like "test/res/testmxmf.mxmf"
139+
You may replace [ants.mid](https://github.com/EmbeddedSynth/sonivox/blob/devel/test/res/ants.mid) by another MIDI or XMF file, like [testmxmf.mxmf](https://github.com/EmbeddedSynth/sonivox/blob/devel/test/res/testmxmf.mxmf)
139140

140141
## Unit tests
141142

@@ -158,7 +159,7 @@ There are two environment variables that you may set before running the tests (m
158159

159160
## License
160161

161-
Copyright (c) 2022-2025 Pedro López-Cabanillas and others.
162+
Copyright (c) 2022-2026 Pedro López-Cabanillas and others.
162163

163164
Copyright (c) 2008-2024, The Android Open Source Project.
164165

arm-wt-22k/lib_src/compute_tick_conv.c

Lines changed: 0 additions & 76 deletions
This file was deleted.

arm-wt-22k/lib_src/eas_public.c

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,11 +2462,21 @@ EAS_PUBLIC EAS_RESULT EAS_MetricsReset (EAS_DATA_HANDLE pEASData)
24622462
*/
24632463
EAS_PUBLIC EAS_RESULT EAS_SetSoundLibrary (EAS_DATA_HANDLE pEASData, EAS_HANDLE pStream, EAS_SNDLIB_HANDLE pSndLib)
24642464
{
2465-
if (pStream)
2465+
if (pStream != NULL)
24662466
{
2467+
if (pStream->pParserModule != NULL)
2468+
{
24672469
if (!EAS_StreamReady(pEASData, pStream))
2468-
return EAS_ERROR_NOT_VALID_IN_THIS_STATE;
2470+
return EAS_ERROR_NOT_VALID_IN_THIS_STATE;
24692471
return EAS_IntSetStrmParam(pEASData, pStream, PARSER_DATA_EAS_LIBRARY, (EAS_IPTR) pSndLib);
2472+
}
2473+
else if (pStream->handle != NULL)
2474+
{
2475+
S_INTERACTIVE_MIDI *pMIDIStream = (S_INTERACTIVE_MIDI *) pStream->handle;
2476+
return VMSetEASLib(pMIDIStream->pSynth, pSndLib);
2477+
}
2478+
else
2479+
return EAS_FAILURE;
24702480
}
24712481

24722482
return VMSetGlobalEASLib(pEASData->pVoiceMgr, pSndLib);
@@ -2537,7 +2547,7 @@ EAS_PUBLIC EAS_RESULT EAS_LoadDLSCollection (EAS_DATA_HANDLE pEASData, EAS_HANDL
25372547
EAS_RESULT result;
25382548
EAS_DLSLIB_HANDLE pDLS;
25392549

2540-
if (pStream != NULL)
2550+
if (pStream != NULL && pStream->pParserModule != NULL)
25412551
{
25422552
if (!EAS_StreamReady(pEASData, pStream))
25432553
return EAS_ERROR_NOT_VALID_IN_THIS_STATE;
@@ -2553,14 +2563,24 @@ EAS_PUBLIC EAS_RESULT EAS_LoadDLSCollection (EAS_DATA_HANDLE pEASData, EAS_HANDL
25532563

25542564
if (result == EAS_SUCCESS)
25552565
{
2556-
2557-
/* if a stream pStream is specified, point it to the DLS collection */
2558-
if (pStream)
2559-
result = EAS_IntSetStrmParam(pEASData, pStream, PARSER_DATA_DLS_COLLECTION, (EAS_IPTR) pDLS);
2560-
2561-
/* global DLS load */
2566+
/* if a stream pStream is specified, point it to the DLS collection */
2567+
if (pStream != NULL)
2568+
{
2569+
if (pStream->pParserModule != NULL)
2570+
{
2571+
result = EAS_IntSetStrmParam(pEASData, pStream, PARSER_DATA_DLS_COLLECTION, (EAS_IPTR) pDLS);
2572+
}
2573+
else if (pStream->handle != NULL)
2574+
{
2575+
S_INTERACTIVE_MIDI *pMIDIStream = (S_INTERACTIVE_MIDI *) pStream->handle;
2576+
result = VMSetDLSLib(pMIDIStream->pSynth, pDLS);
2577+
}
25622578
else
2563-
result = VMSetGlobalDLSLib(pEASData, pDLS);
2579+
result = EAS_FAILURE;
2580+
}
2581+
/* global DLS load */
2582+
else
2583+
result = VMSetGlobalDLSLib(pEASData, pDLS);
25642584
}
25652585

25662586
return result;

0 commit comments

Comments
 (0)