forked from FluidSynth/fluidsynth
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Standardise dependency management with vcpkg #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MengLinMaker
wants to merge
10
commits into
jet2jet:master
Choose a base branch
from
MengLinMaker:vcpkg
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
27190c5
[fluidsynth-emscripten] patch for build with Emscripten (for v2.3.x)
jet2jet 194cf7b
[fluidsynth-emscripten] rename original README.md to add fluidsynth-e…
jet2jet 718b523
[fluidsynth-emscripten] Add readme for this repository
jet2jet b218e00
After upgrading from fluidsynth-emscripten-2.2.1 to 2.3.0 I ran into …
jameadows cf19de5
Merge pull request #8 from jameadows/master
jet2jet 607d731
Add sndfile dependency with vcpkg package manager
MengLinMaker cd5f4dd
C99 float math not required for wasm compilation
MengLinMaker 40b1715
Default options off to reduce dependencies and binary size
MengLinMaker 23247a2
Add vcpkg build config for libsndfile
MengLinMaker dd29c9a
Revert "C99 float math not required for wasm compilation"
MengLinMaker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,6 @@ install_manifest.txt | |
| # ProjectFiles | ||
| *.pro.user* | ||
| *.user | ||
|
|
||
| # Package manager | ||
| vcpkg_installed | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "version": 6, | ||
| "cmakeMinimumRequired": { | ||
| "major": 3, | ||
| "minor": 13, | ||
| "patch": 0 | ||
| }, | ||
| "configurePresets": [ | ||
| { | ||
| "name": "wasm", | ||
| "generator": "", | ||
| "cacheVariables": { | ||
| "CMAKE_BUILD_TYPE": "RELEASE" | ||
| } | ||
| }, | ||
| { | ||
| "name": "wasm-libsndfile", | ||
| "inherits": "wasm", | ||
| "cacheVariables": { | ||
| "enable-libsndfile": "on" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,100 +1,46 @@ | ||
| # FluidSynth | ||
|
|
||
| | | Build Status | | ||
| |---|---| | ||
| | <img src="https://www.kernel.org/theme/images/logos/tux.png" height="30" alt=""> **Linux** | [](https://github.com/FluidSynth/fluidsynth/actions?query=workflow%3A%22FluidSynth+Linux%22) | | ||
| | <img src="https://cdn.pling.com/img//hive/content-pre1/112422-1.png" height="25" alt=""> **FreeBSD** | [](https://cirrus-ci.com/github/FluidSynth/fluidsynth) | | ||
| | <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master) | | ||
| | <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows (vcpkg)** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=6&branchName=master) | | ||
| | <img src="https://www.apple.com/favicon.ico" height="30" alt=""> **MacOSX** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=5&branchName=master) | | ||
| | <img src="https://www.android.com/favicon.ico" height="30" alt=""> **Android** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=4&branchName=master) | | ||
| # FluidSynth with Emscripten-specific patch | ||
|
|
||
| This repository is based on [FluidSynth](https://github.com/FluidSynth/fluidsynth) repository, and contains some changes to build with Emscripten. | ||
|
|
||
| #### FluidSynth is a cross-platform, real-time software synthesizer based on the Soundfont 2 specification. | ||
| The original README is here: [README.original.md](./README.original.md) | ||
|
|
||
| FluidSynth generates audio by reading and handling MIDI events from MIDI input devices by using a [SoundFont](https://github.com/FluidSynth/fluidsynth/wiki/SoundFont). It is the software analogue of a MIDI synthesizer. FluidSynth can also play MIDI files. | ||
| ## Build | ||
|
|
||
| [](https://sonarcloud.io/dashboard?id=FluidSynth_fluidsynth) [](https://lgtm.com/projects/g/FluidSynth/fluidsynth/context:cpp) [](https://www.openhub.net/p/fluidsynth) | ||
| > Tested with Emscripten version 3.1.10. | ||
|
|
||
| 1. (Optional) Update `emscripten/exports.txt`, containing export functions for JS program | ||
| * The script `emscripten/make-exports.js` will update this automatically, gathering functions from `include` directory. | ||
| 2. Make sure that Emscripten is usable on the current environment | ||
| 3. Make `build` directory | ||
| 4. Enter `build` directory and execute `emcmake cmake -Denable-oss=off -DCMAKE_BUILD_TYPE=Release ..` | ||
| * If no other options are specified, and `cmake` is running with `emcmake` (or `emconfigure`), the build configurations are initialized for Emscripten-build mode. | ||
| 5. In `build` directory, execute `emmake make` | ||
|
|
||
| ## Documentation | ||
| After successful build, `libfluidsynth-<version>.js` will be created at `build/src` directory. | ||
|
|
||
| The central place for documentation and further links is our **wiki** here at GitHub: | ||
| * If `enable-debug` specified on the `cmake` execution (e.g. `emcmake cmake -Denable-debug=on ..`), a map file `libfluidsynth-<version>.wasm.map` is also generated. | ||
| * Currently it seems that it cannot be used. | ||
| * If `enable-separate-wasm` specified on the `cmake` execution (e.g. `emcmake cmake -Denable-separate-wasm=on ..`), `libfluidsynth-<version>.wasm` and `libfluidsynth-<version>.wast` are also generated. | ||
| * For AudioWorklet, you cannot use `*.wasm` file directly. | ||
| * In Emscripten-build mode, standalone application named `fluidsynth` is not emitted. | ||
|
|
||
| #### https://github.com/FluidSynth/fluidsynth/wiki | ||
| ## Build static library for Emscripten | ||
|
|
||
| If you are missing parts of the documentation, let us know by writing to our mailing list. | ||
| Of course, you are welcome to edit and improve the wiki yourself. All you need is an account at GitHub. Alternatively, you may send an EMail to our mailing list along with your suggested changes. Further information about the mailing list is available in the wiki as well. | ||
| Please specify `-D BUILD_SHARED_LIBS=off` on calling emcmake. (e.g. `emcmake cmake -D BUILD_SHARED_LIBS=off ..`) | ||
|
|
||
| Latest information about FluidSynth is also available on the web site at https://www.fluidsynth.org/. | ||
| In this mode, you can also build sources under `doc` directory (e.g. `cd build/doc && make fluidsynth_simple -j16`), although all exportable functions will be exported. | ||
|
|
||
| ## License | ||
|
|
||
| The source code for FluidSynth is distributed under the terms of the [GNU Lesser General Public License](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html), see the [LICENSE](https://github.com/FluidSynth/fluidsynth/blob/master/LICENSE) file. To better understand the conditions how FluidSynth can be used in e.g. commercial or closed-source projects, please refer to the [LicensingFAQ in our wiki](https://github.com/FluidSynth/fluidsynth/wiki/LicensingFAQ). | ||
|
|
||
| ## Building from source | ||
|
|
||
| For information on how to build FluidSynth from source, please [refer to our wiki](https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake). | ||
|
|
||
| ## Links | ||
|
|
||
| - FluidSynth's Home Page, https://www.fluidsynth.org | ||
|
|
||
| - FluidSynth's wiki, https://github.com/FluidSynth/fluidsynth/wiki | ||
|
|
||
| - FluidSynth's API documentation, https://www.fluidsynth.org/api/ | ||
|
|
||
| --- | ||
| ## Usage | ||
|
|
||
| ## Historical background | ||
| Place `libfluidsynth-<version>.js` file to your space and load `libfluidsynth-<version>.js`. After load, almost all FluidSynth API functions are accessible via `Module` object (note that all function names have the prefix `_`). | ||
|
|
||
| ### Why did we do it | ||
| To use `libfluidsynth-<version>.js` in AudioWorklet, load it into AudioWorklet before your worklet JS file. In your worklet JS file, you can access `Module` object via `AudioWorkletGlobalScope.wasmModule`. | ||
|
|
||
| The synthesizer grew out of a project, started by Samuel Bianchini and | ||
| Peter Hanappe, and later joined by Johnathan Lee, that aimed at | ||
| developing a networked multi-user game. | ||
| ## Miscellaneous | ||
|
|
||
| Sound (and music) was considered a very important part of the game. In | ||
| addition, users had to be able to extend the game with their own | ||
| sounds and images. Johnathan Lee proposed to use the Soundfont | ||
| standard combined with intelligent use of midifiles. The arguments | ||
| were: | ||
| * Currently only several APIs are tested. Some APIs such as for drivers may not work. | ||
|
|
||
| - Wavetable synthesis is low on CPU usage, it is intuitive and it can | ||
| produce rich sounds | ||
|
|
||
| - Hardware acceleration is possible if the user owns a Soundfont | ||
| compatible soundcard (important for games!) | ||
|
|
||
| - MIDI files are small and Soundfont2 files can be made small thru the | ||
| intelligent use of loops and wavetables. Together, they are easier to | ||
| downloaded than MP3 or audio files. | ||
|
|
||
| - Graphical editors are available for both file format: various | ||
| Soundfont editors are available on PC and on Linux (Smurf!), and | ||
| MIDI sequencers are available on all platforms. | ||
|
|
||
| It seemed like a good combination to use for an (online) game. | ||
|
|
||
| In order to make Soundfonts available on all platforms (Linux, Mac, | ||
| and Windows) and for all sound cards, we needed a software Soundfont | ||
| synthesizer. That is why we developed FluidSynth. | ||
|
|
||
| ### Design decisions | ||
|
|
||
| The synthesizer was designed to be as self-contained as possible for | ||
| several reasons: | ||
|
|
||
| - It had to be multi-platform (Linux, macOS, Win32). It was therefore | ||
| important that the code didn't rely on any platform-specific | ||
| library. | ||
| ## License | ||
|
|
||
| - It had to be easy to integrate the synthesizer modules in various | ||
| environments, as a plugin or as a dynamically loadable object. I | ||
| wanted to make the synthesizer available as a plugin (jMax, LADSPA, | ||
| Xmms, WinAmp, Director, ...); develop language bindings (Python, | ||
| Java, Perl, ...); and integrate it into (game) frameworks (Crystal | ||
| Space, SDL, ...). For these reasons I've decided it would be easiest | ||
| if the project stayed very focused on its goal (a Soundfont | ||
| synthesizer), stayed small (ideally one file) and didn't dependent | ||
| on external code. | ||
| This program and all source codes, including the original FluidSynth program, its source codes, modifications of FluidSynth source codes for building library with Emscripten, and sources codes used only for building `libfluidsynth-<version>.js`, are licensed under [GNU Lesser General Public License (v2.1)](./LICENSE) (LGPL v2.1). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # FluidSynth | ||
|
|
||
| | | Build Status | | ||
| |---|---| | ||
| | <img src="https://www.kernel.org/theme/images/logos/tux.png" height="30" alt=""> **Linux** | [](https://github.com/FluidSynth/fluidsynth/actions?query=workflow%3A%22FluidSynth+Linux%22) | | ||
| | <img src="https://cdn.pling.com/img//hive/content-pre1/112422-1.png" height="25" alt=""> **FreeBSD** | [](https://cirrus-ci.com/github/FluidSynth/fluidsynth) | | ||
| | <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master) | | ||
| | <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows (vcpkg)** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=6&branchName=master) | | ||
| | <img src="https://www.apple.com/favicon.ico" height="30" alt=""> **MacOSX** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=5&branchName=master) | | ||
| | <img src="https://www.android.com/favicon.ico" height="30" alt=""> **Android** | [](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=4&branchName=master) | | ||
|
|
||
|
|
||
| #### FluidSynth is a cross-platform, real-time software synthesizer based on the Soundfont 2 specification. | ||
|
|
||
| FluidSynth generates audio by reading and handling MIDI events from MIDI input devices by using a [SoundFont](https://github.com/FluidSynth/fluidsynth/wiki/SoundFont). It is the software analogue of a MIDI synthesizer. FluidSynth can also play MIDI files. | ||
|
|
||
| [](https://sonarcloud.io/dashboard?id=FluidSynth_fluidsynth) [](https://lgtm.com/projects/g/FluidSynth/fluidsynth/context:cpp) [](https://www.openhub.net/p/fluidsynth) | ||
|
|
||
|
|
||
| ## Documentation | ||
|
|
||
| The central place for documentation and further links is our **wiki** here at GitHub: | ||
|
|
||
| #### https://github.com/FluidSynth/fluidsynth/wiki | ||
|
|
||
| If you are missing parts of the documentation, let us know by writing to our mailing list. | ||
| Of course, you are welcome to edit and improve the wiki yourself. All you need is an account at GitHub. Alternatively, you may send an EMail to our mailing list along with your suggested changes. Further information about the mailing list is available in the wiki as well. | ||
|
|
||
| Latest information about FluidSynth is also available on the web site at https://www.fluidsynth.org/. | ||
|
|
||
| ## License | ||
|
|
||
| The source code for FluidSynth is distributed under the terms of the [GNU Lesser General Public License](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html), see the [LICENSE](https://github.com/FluidSynth/fluidsynth/blob/master/LICENSE) file. To better understand the conditions how FluidSynth can be used in e.g. commercial or closed-source projects, please refer to the [LicensingFAQ in our wiki](https://github.com/FluidSynth/fluidsynth/wiki/LicensingFAQ). | ||
|
|
||
| ## Building from source | ||
|
|
||
| For information on how to build FluidSynth from source, please [refer to our wiki](https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake). | ||
|
|
||
| ## Links | ||
|
|
||
| - FluidSynth's Home Page, https://www.fluidsynth.org | ||
|
|
||
| - FluidSynth's wiki, https://github.com/FluidSynth/fluidsynth/wiki | ||
|
|
||
| - FluidSynth's API documentation, https://www.fluidsynth.org/api/ | ||
|
|
||
| --- | ||
|
|
||
| ## Historical background | ||
|
|
||
| ### Why did we do it | ||
|
|
||
| The synthesizer grew out of a project, started by Samuel Bianchini and | ||
| Peter Hanappe, and later joined by Johnathan Lee, that aimed at | ||
| developing a networked multi-user game. | ||
|
|
||
| Sound (and music) was considered a very important part of the game. In | ||
| addition, users had to be able to extend the game with their own | ||
| sounds and images. Johnathan Lee proposed to use the Soundfont | ||
| standard combined with intelligent use of midifiles. The arguments | ||
| were: | ||
|
|
||
| - Wavetable synthesis is low on CPU usage, it is intuitive and it can | ||
| produce rich sounds | ||
|
|
||
| - Hardware acceleration is possible if the user owns a Soundfont | ||
| compatible soundcard (important for games!) | ||
|
|
||
| - MIDI files are small and Soundfont2 files can be made small thru the | ||
| intelligent use of loops and wavetables. Together, they are easier to | ||
| downloaded than MP3 or audio files. | ||
|
|
||
| - Graphical editors are available for both file format: various | ||
| Soundfont editors are available on PC and on Linux (Smurf!), and | ||
| MIDI sequencers are available on all platforms. | ||
|
|
||
| It seemed like a good combination to use for an (online) game. | ||
|
|
||
| In order to make Soundfonts available on all platforms (Linux, Mac, | ||
| and Windows) and for all sound cards, we needed a software Soundfont | ||
| synthesizer. That is why we developed FluidSynth. | ||
|
|
||
| ### Design decisions | ||
|
|
||
| The synthesizer was designed to be as self-contained as possible for | ||
| several reasons: | ||
|
|
||
| - It had to be multi-platform (Linux, macOS, Win32). It was therefore | ||
| important that the code didn't rely on any platform-specific | ||
| library. | ||
|
|
||
| - It had to be easy to integrate the synthesizer modules in various | ||
| environments, as a plugin or as a dynamically loadable object. I | ||
| wanted to make the synthesizer available as a plugin (jMax, LADSPA, | ||
| Xmms, WinAmp, Director, ...); develop language bindings (Python, | ||
| Java, Perl, ...); and integrate it into (game) frameworks (Crystal | ||
| Space, SDL, ...). For these reasons I've decided it would be easiest | ||
| if the project stayed very focused on its goal (a Soundfont | ||
| synthesizer), stayed small (ideally one file) and didn't dependent | ||
| on external code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,12 +19,22 @@ | |
|
|
||
| # CMake based build system. Pedro Lopez-Cabanillas <[email protected]> | ||
|
|
||
| include ( FluidUnitTest ) | ||
| add_custom_target ( demo ) | ||
| unset ( BUILD_DEMOS ) | ||
| if ( NOT EMSCRIPTEN_SUPPORT ) | ||
| set ( BUILD_DEMOS on ) | ||
| elseif ( NOT BUILD_SHARED_LIBS ) | ||
| set ( BUILD_DEMOS on ) | ||
| else ( NOT EMSCRIPTEN_SUPPORT ) | ||
| set ( BUILD_DEMOS off ) | ||
| endif ( NOT EMSCRIPTEN_SUPPORT ) | ||
|
|
||
| ADD_FLUID_DEMO ( example ) | ||
| ADD_FLUID_DEMO ( fluidsynth_arpeggio ) | ||
| ADD_FLUID_DEMO ( fluidsynth_fx ) | ||
| ADD_FLUID_DEMO ( fluidsynth_metronome ) | ||
| ADD_FLUID_DEMO ( fluidsynth_simple ) | ||
| if ( BUILD_DEMOS ) | ||
| include ( FluidUnitTest ) | ||
| add_custom_target ( demo ) | ||
|
|
||
| ADD_FLUID_DEMO ( example ) | ||
| ADD_FLUID_DEMO ( fluidsynth_arpeggio ) | ||
| ADD_FLUID_DEMO ( fluidsynth_fx ) | ||
| ADD_FLUID_DEMO ( fluidsynth_metronome ) | ||
| ADD_FLUID_DEMO ( fluidsynth_simple ) | ||
| endif ( BUILD_DEMOS ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be unnecessary because
vcpkg_installedis created inbuilddirectory by default.(Executing build command on the root directory is not recommended.)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My makefile is gitignored, whoops.
Why is executing build on root not recommended?
The build output will still be generated in the "build" folder.
For me I run - on macos:
1. Install dependency - in this case
sndfileaccording tovcpkg.jsonThis creates a
vcpkg_installedfolder in project root.2. Build file
Here is a the makefile I used that is gitignored:
Preset options are written in
CMakePresets.jsonThen we can extend presets and add installation scripts to makefile for different configs.
Build instructions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late response.
The
builddirectory is a recommendation based on the original FluidSynth building instruction (https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake).I think it has an advantage that the all intermediate/output files will be generated into
builddirectory.