├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
└── runConfigurations.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── fluidsynthandroidhelloworld
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── sndfnt.sf2
│ ├── cpp
│ │ ├── CMakeLists.txt
│ │ ├── fluidsynth
│ │ │ ├── include
│ │ │ │ ├── fluidsynth.h
│ │ │ │ └── fluidsynth
│ │ │ │ │ ├── audio.h
│ │ │ │ │ ├── event.h
│ │ │ │ │ ├── gen.h
│ │ │ │ │ ├── ladspa.h
│ │ │ │ │ ├── log.h
│ │ │ │ │ ├── midi.h
│ │ │ │ │ ├── misc.h
│ │ │ │ │ ├── mod.h
│ │ │ │ │ ├── seq.h
│ │ │ │ │ ├── seqbind.h
│ │ │ │ │ ├── settings.h
│ │ │ │ │ ├── sfont.h
│ │ │ │ │ ├── shell.h
│ │ │ │ │ ├── synth.h
│ │ │ │ │ ├── types.h
│ │ │ │ │ ├── version.h
│ │ │ │ │ └── voice.h
│ │ │ └── lib
│ │ │ │ ├── arm64-v8a
│ │ │ │ ├── libFLAC.so
│ │ │ │ ├── libc++_shared.so
│ │ │ │ ├── libcharset.so
│ │ │ │ ├── libffi.so
│ │ │ │ ├── libfluidsynth-assetloader.so
│ │ │ │ ├── libfluidsynth.so
│ │ │ │ ├── libgio-2.0.so
│ │ │ │ ├── libglib-2.0.so
│ │ │ │ ├── libgmodule-2.0.so
│ │ │ │ ├── libgobject-2.0.so
│ │ │ │ ├── libgthread-2.0.so
│ │ │ │ ├── libiconv.so
│ │ │ │ ├── libintl.so
│ │ │ │ ├── liboboe.so
│ │ │ │ ├── libogg.so
│ │ │ │ ├── libsndfile.so
│ │ │ │ ├── libvorbis.so
│ │ │ │ ├── libvorbisenc.so
│ │ │ │ ├── libvorbisfile.so
│ │ │ │ ├── libz.so
│ │ │ │ └── preloadable_libiconv.so
│ │ │ │ ├── armeabi-v7a
│ │ │ │ ├── libFLAC.so
│ │ │ │ ├── libc++_shared.so
│ │ │ │ ├── libcharset.so
│ │ │ │ ├── libffi.so
│ │ │ │ ├── libfluidsynth-assetloader.so
│ │ │ │ ├── libfluidsynth.so
│ │ │ │ ├── libgio-2.0.so
│ │ │ │ ├── libglib-2.0.so
│ │ │ │ ├── libgmodule-2.0.so
│ │ │ │ ├── libgobject-2.0.so
│ │ │ │ ├── libgthread-2.0.so
│ │ │ │ ├── libiconv.so
│ │ │ │ ├── libintl.so
│ │ │ │ ├── liboboe.so
│ │ │ │ ├── libogg.so
│ │ │ │ ├── libsndfile.so
│ │ │ │ ├── libvorbis.so
│ │ │ │ ├── libvorbisenc.so
│ │ │ │ ├── libvorbisfile.so
│ │ │ │ ├── libz.so
│ │ │ │ └── preloadable_libiconv.so
│ │ │ │ ├── x86
│ │ │ │ ├── libFLAC.so
│ │ │ │ ├── libc++_shared.so
│ │ │ │ ├── libcharset.so
│ │ │ │ ├── libffi.so
│ │ │ │ ├── libfluidsynth-assetloader.so
│ │ │ │ ├── libfluidsynth.so
│ │ │ │ ├── libgio-2.0.so
│ │ │ │ ├── libglib-2.0.so
│ │ │ │ ├── libgmodule-2.0.so
│ │ │ │ ├── libgobject-2.0.so
│ │ │ │ ├── libgthread-2.0.so
│ │ │ │ ├── libiconv.so
│ │ │ │ ├── libintl.so
│ │ │ │ ├── liboboe.so
│ │ │ │ ├── libogg.so
│ │ │ │ ├── libsndfile.so
│ │ │ │ ├── libvorbis.so
│ │ │ │ ├── libvorbisenc.so
│ │ │ │ ├── libvorbisfile.so
│ │ │ │ ├── libz.so
│ │ │ │ └── preloadable_libiconv.so
│ │ │ │ └── x86_64
│ │ │ │ ├── libFLAC.so
│ │ │ │ ├── libc++_shared.so
│ │ │ │ ├── libcharset.so
│ │ │ │ ├── libffi.so
│ │ │ │ ├── libfluidsynth-assetloader.so
│ │ │ │ ├── libfluidsynth.so
│ │ │ │ ├── libgio-2.0.so
│ │ │ │ ├── libglib-2.0.so
│ │ │ │ ├── libgmodule-2.0.so
│ │ │ │ ├── libgobject-2.0.so
│ │ │ │ ├── libgthread-2.0.so
│ │ │ │ ├── libiconv.so
│ │ │ │ ├── libintl.so
│ │ │ │ ├── liboboe.so
│ │ │ │ ├── libogg.so
│ │ │ │ ├── libsndfile.so
│ │ │ │ ├── libvorbis.so
│ │ │ │ ├── libvorbisenc.so
│ │ │ │ ├── libvorbisfile.so
│ │ │ │ ├── libz.so
│ │ │ │ └── preloadable_libiconv.so
│ │ └── native-lib.cpp
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── fluidsynthandroidhelloworld
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── fluidsynthandroidhelloworld
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.toptal.com/developers/gitignore/api/android,androidstudio
3 | # Edit at https://www.toptal.com/developers/gitignore?templates=android,androidstudio
4 |
5 | ### Android ###
6 | # Built application files
7 | *.apk
8 | *.aar
9 | *.ap_
10 | *.aab
11 |
12 | # Files for the ART/Dalvik VM
13 | *.dex
14 |
15 | # Java class files
16 | *.class
17 |
18 | # Generated files
19 | bin/
20 | gen/
21 | out/
22 | # Uncomment the following line in case you need and you don't have the release build type files in your app
23 | # release/
24 |
25 | # Gradle files
26 | .gradle/
27 | build/
28 |
29 | # Local configuration file (sdk path, etc)
30 | local.properties
31 |
32 | # Proguard folder generated by Eclipse
33 | proguard/
34 |
35 | # Log Files
36 | *.log
37 |
38 | # Android Studio Navigation editor temp files
39 | .navigation/
40 |
41 | # Android Studio captures folder
42 | captures/
43 |
44 | # IntelliJ
45 | *.iml
46 | .idea/workspace.xml
47 | .idea/tasks.xml
48 | .idea/gradle.xml
49 | .idea/assetWizardSettings.xml
50 | .idea/dictionaries
51 | .idea/libraries
52 | # Android Studio 3 in .gitignore file.
53 | .idea/caches
54 | .idea/modules.xml
55 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you
56 | .idea/navEditor.xml
57 |
58 | # Keystore files
59 | # Uncomment the following lines if you do not want to check your keystore files in.
60 | #*.jks
61 | #*.keystore
62 |
63 | # External native build folder generated in Android Studio 2.2 and later
64 | .externalNativeBuild
65 | .cxx/
66 |
67 | # Google Services (e.g. APIs or Firebase)
68 | # google-services.json
69 |
70 | # Freeline
71 | freeline.py
72 | freeline/
73 | freeline_project_description.json
74 |
75 | # fastlane
76 | fastlane/report.xml
77 | fastlane/Preview.html
78 | fastlane/screenshots
79 | fastlane/test_output
80 | fastlane/readme.md
81 |
82 | # Version control
83 | vcs.xml
84 |
85 | # lint
86 | lint/intermediates/
87 | lint/generated/
88 | lint/outputs/
89 | lint/tmp/
90 | # lint/reports/
91 |
92 | ### Android Patch ###
93 | gen-external-apklibs
94 | output.json
95 |
96 | # Replacement of .externalNativeBuild directories introduced
97 | # with Android Studio 3.5.
98 |
99 | ### AndroidStudio ###
100 | # Covers files to be ignored for android development using Android Studio.
101 |
102 | # Built application files
103 |
104 | # Files for the ART/Dalvik VM
105 |
106 | # Java class files
107 |
108 | # Generated files
109 |
110 | # Gradle files
111 | .gradle
112 |
113 | # Signing files
114 | .signing/
115 |
116 | # Local configuration file (sdk path, etc)
117 |
118 | # Proguard folder generated by Eclipse
119 |
120 | # Log Files
121 |
122 | # Android Studio
123 | /*/build/
124 | /*/local.properties
125 | /*/out
126 | /*/*/build
127 | /*/*/production
128 | *.ipr
129 | *~
130 | *.swp
131 |
132 | # Keystore files
133 | *.jks
134 | *.keystore
135 |
136 | # Google Services (e.g. APIs or Firebase)
137 | # google-services.json
138 |
139 | # Android Patch
140 |
141 | # External native build folder generated in Android Studio 2.2 and later
142 |
143 | # NDK
144 | obj/
145 |
146 | # IntelliJ IDEA
147 | *.iws
148 | /out/
149 |
150 | # User-specific configurations
151 | .idea/caches/
152 | .idea/libraries/
153 | .idea/shelf/
154 | .idea/.name
155 | .idea/compiler.xml
156 | .idea/copyright/profiles_settings.xml
157 | .idea/encodings.xml
158 | .idea/misc.xml
159 | .idea/scopes/scope_settings.xml
160 | .idea/vcs.xml
161 | .idea/jsLibraryMappings.xml
162 | .idea/datasources.xml
163 | .idea/dataSources.ids
164 | .idea/sqlDataSources.xml
165 | .idea/dynamic.xml
166 | .idea/uiDesigner.xml
167 | .idea/jarRepositories.xml
168 |
169 | # OS-specific files
170 | .DS_Store
171 | .DS_Store?
172 | ._*
173 | .Spotlight-V100
174 | .Trashes
175 | ehthumbs.db
176 | Thumbs.db
177 |
178 | # Legacy Eclipse project files
179 | .classpath
180 | .project
181 | .cproject
182 | .settings/
183 |
184 | # Mobile Tools for Java (J2ME)
185 | .mtj.tmp/
186 |
187 | # Package Files #
188 | *.war
189 | *.ear
190 |
191 | # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
192 | hs_err_pid*
193 |
194 | ## Plugin-specific files:
195 |
196 | # mpeltonen/sbt-idea plugin
197 | .idea_modules/
198 |
199 | # JIRA plugin
200 | atlassian-ide-plugin.xml
201 |
202 | # Mongo Explorer plugin
203 | .idea/mongoSettings.xml
204 |
205 | # Crashlytics plugin (for Android Studio and IntelliJ)
206 | com_crashlytics_export_strings.xml
207 | crashlytics.properties
208 | crashlytics-build.properties
209 | fabric.properties
210 |
211 | ### AndroidStudio Patch ###
212 |
213 | !/gradle/wrapper/gradle-wrapper.jar
214 |
215 | # End of https://www.toptal.com/developers/gitignore/api/android,androidstudio
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Fluidsynth Hello World for Android
2 |
3 | Follow tutorial at:
4 |
5 | [https://medium.com/@hectorricardomendez/creating-a-fluidsynth-hello-world-app-for-android-5e112454a8eb](https://medium.com/@hectorricardomendez/creating-a-fluidsynth-hello-world-app-for-android-5e112454a8eb)
6 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "30.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.example.fluidsynthandroidhelloworld"
9 | minSdkVersion 19
10 | targetSdkVersion 29
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 | externalNativeBuild {
16 | cmake {
17 | cppFlags ""
18 | }
19 | }
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 | externalNativeBuild {
29 | cmake {
30 | path "src/main/cpp/CMakeLists.txt"
31 | version "3.10.2"
32 | }
33 | }
34 | }
35 |
36 | dependencies {
37 | implementation fileTree(dir: "libs", include: ["*.jar"])
38 | implementation 'androidx.appcompat:appcompat:1.2.0'
39 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
40 | testImplementation 'junit:junit:4.12'
41 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
42 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/fluidsynthandroidhelloworld/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.fluidsynthandroidhelloworld;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.example.fluidsynthandroidhelloworld", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/assets/sndfnt.sf2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/assets/sndfnt.sf2
--------------------------------------------------------------------------------
/app/src/main/cpp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # For more information about using CMake with Android Studio, read the
2 | # documentation: https://d.android.com/studio/projects/add-native-code.html
3 |
4 | # Sets the minimum version of CMake required to build the native library.
5 | cmake_minimum_required(VERSION 3.4.1)
6 |
7 | # Create a variable fluidsynth_DIR to specify where the fluidsynth library is located.
8 | set(fluidsynth_DIR ${CMAKE_CURRENT_SOURCE_DIR}/fluidsynth)
9 |
10 | # Our code (native-lib.cpp) will be calling fluidsynth functions, so we add the fluidsynth binaries as dependencies of our code.
11 |
12 | add_library(libc++_shared SHARED IMPORTED)
13 | set_target_properties(libc++_shared PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libc++_shared.so)
14 |
15 | add_library(libcharset SHARED IMPORTED)
16 | set_target_properties(libcharset PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libcharset.so)
17 |
18 | add_library(libffi SHARED IMPORTED)
19 | set_target_properties(libffi PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libffi.so)
20 |
21 | add_library(libFLAC SHARED IMPORTED)
22 | set_target_properties(libFLAC PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libFLAC.so)
23 |
24 | add_library(libfluidsynth SHARED IMPORTED)
25 | set_target_properties(libfluidsynth PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libfluidsynth.so)
26 |
27 | add_library(libfluidsynth-assetloader SHARED IMPORTED)
28 | set_target_properties(libfluidsynth-assetloader PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libfluidsynth-assetloader.so)
29 |
30 | add_library(libgio-2.0 SHARED IMPORTED)
31 | set_target_properties(libgio-2.0 PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libgio-2.0.so)
32 |
33 | add_library(libglib-2.0 SHARED IMPORTED)
34 | set_target_properties(libglib-2.0 PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libglib-2.0.so)
35 |
36 | add_library(libgmodule-2.0 SHARED IMPORTED)
37 | set_target_properties(libgmodule-2.0 PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libgmodule-2.0.so)
38 |
39 | add_library(libgobject-2.0 SHARED IMPORTED)
40 | set_target_properties(libgobject-2.0 PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libgobject-2.0.so)
41 |
42 | add_library(libgthread-2.0 SHARED IMPORTED)
43 | set_target_properties(libgthread-2.0 PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libgthread-2.0.so)
44 |
45 | add_library(libiconv SHARED IMPORTED)
46 | set_target_properties(libiconv PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libiconv.so)
47 |
48 | add_library(libintl SHARED IMPORTED)
49 | set_target_properties(libintl PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libintl.so)
50 |
51 | add_library(liboboe SHARED IMPORTED)
52 | set_target_properties(liboboe PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/liboboe.so)
53 |
54 | add_library(libogg SHARED IMPORTED)
55 | set_target_properties(libogg PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libogg.so)
56 |
57 | add_library(libsndfile SHARED IMPORTED)
58 | set_target_properties(libsndfile PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libsndfile.so)
59 |
60 | add_library(libvorbis SHARED IMPORTED)
61 | set_target_properties(libvorbis PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libvorbis.so)
62 |
63 | add_library(libvorbisenc SHARED IMPORTED)
64 | set_target_properties(libvorbisenc PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libvorbisenc.so)
65 |
66 | add_library(libvorbisfile SHARED IMPORTED)
67 | set_target_properties(libvorbisfile PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libvorbisfile.so)
68 |
69 | add_library(libz SHARED IMPORTED)
70 | set_target_properties(libz PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/libz.so)
71 |
72 | add_library(preloadable_libiconv SHARED IMPORTED)
73 | set_target_properties(preloadable_libiconv PROPERTIES IMPORTED_LOCATION ${fluidsynth_DIR}/lib/${ANDROID_ABI}/preloadable_libiconv.so)
74 |
75 | # Library that will be called directly from JAVA
76 | add_library(native-lib SHARED native-lib.cpp)
77 |
78 | # Specifies the directory where the C or C++ source coude will look the #include header files
79 | target_include_directories(native-lib PRIVATE ${fluidsynth_DIR}/include)
80 |
81 | # Link everything alltogether. Notice that native-lib should be the first element in the list.
82 | target_link_libraries(
83 | native-lib
84 | libc++_shared
85 | libcharset
86 | libffi
87 | libFLAC
88 | libfluidsynth
89 | libfluidsynth-assetloader
90 | libgio-2.0
91 | libglib-2.0
92 | libgmodule-2.0
93 | libgobject-2.0
94 | libgthread-2.0
95 | libiconv
96 | libintl
97 | liboboe
98 | libogg
99 | libsndfile
100 | libvorbis
101 | libvorbisenc
102 | libvorbisfile
103 | libz
104 | preloadable_libiconv
105 | )
106 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_H
22 | #define _FLUIDSYNTH_H
23 |
24 | #include
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | #define BUILD_SHARED_LIBS 1
31 |
32 | #if (BUILD_SHARED_LIBS == 0)
33 | #define FLUIDSYNTH_API // building static lib? no visibility control then
34 | #elif defined(WIN32)
35 | #if defined(FLUIDSYNTH_NOT_A_DLL)
36 | #define FLUIDSYNTH_API
37 | #elif defined(FLUIDSYNTH_DLL_EXPORTS)
38 | #define FLUIDSYNTH_API __declspec(dllexport)
39 | #else
40 | #define FLUIDSYNTH_API __declspec(dllimport)
41 | #endif
42 |
43 | #elif defined(MACOS9)
44 | #define FLUIDSYNTH_API __declspec(export)
45 |
46 | #elif defined(__GNUC__)
47 | #define FLUIDSYNTH_API __attribute__ ((visibility ("default")))
48 |
49 | #else
50 | #define FLUIDSYNTH_API
51 |
52 | #endif
53 |
54 | #if defined(__GNUC__) || defined(__clang__)
55 | # define FLUID_DEPRECATED __attribute__((deprecated))
56 | #elif defined(_MSC_VER) && _MSC_VER > 1200
57 | # define FLUID_DEPRECATED __declspec(deprecated)
58 | #else
59 | # define FLUID_DEPRECATED
60 | #endif
61 |
62 |
63 | /**
64 | * @file fluidsynth.h
65 | * @brief FluidSynth is a real-time synthesizer designed for SoundFont(R) files.
66 | *
67 | * This is the header of the fluidsynth library and contains the
68 | * synthesizer's public API.
69 | *
70 | * Depending on how you want to use or extend the synthesizer you
71 | * will need different API functions. You probably do not need all
72 | * of them. Here is what you might want to do:
73 | *
74 | * - Embedded synthesizer: create a new synthesizer and send MIDI
75 | * events to it. The sound goes directly to the audio output of
76 | * your system.
77 | *
78 | * - Plugin synthesizer: create a synthesizer and send MIDI events
79 | * but pull the audio back into your application.
80 | *
81 | * - SoundFont plugin: create a new type of "SoundFont" and allow
82 | * the synthesizer to load your type of SoundFonts.
83 | *
84 | * - MIDI input: Create a MIDI handler to read the MIDI input on your
85 | * machine and send the MIDI events directly to the synthesizer.
86 | *
87 | * - MIDI files: Open MIDI files and send the MIDI events to the
88 | * synthesizer.
89 | *
90 | * - Command lines: You can send textual commands to the synthesizer.
91 | *
92 | * SoundFont(R) is a registered trademark of E-mu Systems, Inc.
93 | */
94 |
95 | #include "fluidsynth/types.h"
96 | #include "fluidsynth/settings.h"
97 | #include "fluidsynth/synth.h"
98 | #include "fluidsynth/shell.h"
99 | #include "fluidsynth/sfont.h"
100 | #include "fluidsynth/audio.h"
101 | #include "fluidsynth/event.h"
102 | #include "fluidsynth/midi.h"
103 | #include "fluidsynth/seq.h"
104 | #include "fluidsynth/seqbind.h"
105 | #include "fluidsynth/log.h"
106 | #include "fluidsynth/misc.h"
107 | #include "fluidsynth/mod.h"
108 | #include "fluidsynth/gen.h"
109 | #include "fluidsynth/voice.h"
110 | #include "fluidsynth/version.h"
111 | #include "fluidsynth/ladspa.h"
112 |
113 |
114 | #ifdef __cplusplus
115 | }
116 | #endif
117 |
118 | #endif /* _FLUIDSYNTH_H */
119 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/audio.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_AUDIO_H
22 | #define _FLUIDSYNTH_AUDIO_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file audio.h
30 | * @brief Functions for audio driver output.
31 | * @defgroup AudioFunctions Functions for audio output
32 | *
33 | * Defines functions for creating audio driver output. Use
34 | * new_fluid_audio_driver() to create a new audio driver for a given synth
35 | * and configuration settings. The function new_fluid_audio_driver2() can be
36 | * used if custom audio processing is desired before the audio is sent to the
37 | * audio driver (although it is not as efficient).
38 | *
39 | * @sa @ref CreatingAudioDriver
40 | */
41 |
42 | /**
43 | * Callback function type used with new_fluid_audio_driver2() to allow for
44 | * custom user audio processing before the audio is sent to the driver. This
45 | * function is responsible for rendering audio to the buffers.
46 | * The buffers passed to this function are allocated and owned by the respective
47 | * audio driver and are only valid during that specific call (do not cache them).
48 | * For further details please refer to fluid_synth_process().
49 | * @note Whereas fluid_synth_process() allows aliasing buffers, there is the guarentee that @p out
50 | * and @p fx buffers provided by fluidsynth's audio drivers never alias. This prevents downstream
51 | * applications from e.g. applying a custom effect accidentially to the same buffer multiple times.
52 | * @param data The user data parameter as passed to new_fluid_audio_driver2().
53 | * @param len Count of audio frames to synthesize.
54 | * @param nfx Count of arrays in \c fx.
55 | * @param fx Array of buffers to store effects audio to. Buffers may alias with buffers of \c out.
56 | * @param nout Count of arrays in \c out.
57 | * @param out Array of buffers to store (dry) audio to. Buffers may alias with buffers of \c fx.
58 | * @return Should return #FLUID_OK on success, #FLUID_FAILED if an error occurred.
59 | */
60 | typedef int (*fluid_audio_func_t)(void *data, int len,
61 | int nfx, float *fx[],
62 | int nout, float *out[]);
63 |
64 | FLUIDSYNTH_API fluid_audio_driver_t *new_fluid_audio_driver(fluid_settings_t *settings,
65 | fluid_synth_t *synth);
66 |
67 | FLUIDSYNTH_API fluid_audio_driver_t *new_fluid_audio_driver2(fluid_settings_t *settings,
68 | fluid_audio_func_t func,
69 | void *data);
70 |
71 | FLUIDSYNTH_API void delete_fluid_audio_driver(fluid_audio_driver_t *driver);
72 |
73 | FLUIDSYNTH_API fluid_file_renderer_t *new_fluid_file_renderer(fluid_synth_t *synth);
74 | FLUIDSYNTH_API int fluid_file_renderer_process_block(fluid_file_renderer_t *dev);
75 | FLUIDSYNTH_API void delete_fluid_file_renderer(fluid_file_renderer_t *dev);
76 | FLUIDSYNTH_API int fluid_file_set_encoding_quality(fluid_file_renderer_t *dev, double q);
77 |
78 | FLUIDSYNTH_API int fluid_audio_driver_register(const char **adrivers);
79 |
80 | #ifdef __cplusplus
81 | }
82 | #endif
83 |
84 | #endif /* _FLUIDSYNTH_AUDIO_H */
85 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/event.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_EVENT_H
22 | #define _FLUIDSYNTH_EVENT_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file event.h
30 | * @brief Sequencer event functions and defines.
31 | *
32 | * Functions and constants for creating/processing sequencer events.
33 | */
34 |
35 | /**
36 | * Sequencer event type enumeration.
37 | */
38 | enum fluid_seq_event_type
39 | {
40 | FLUID_SEQ_NOTE = 0, /**< Note event with duration */
41 | FLUID_SEQ_NOTEON, /**< Note on event */
42 | FLUID_SEQ_NOTEOFF, /**< Note off event */
43 | FLUID_SEQ_ALLSOUNDSOFF, /**< All sounds off event */
44 | FLUID_SEQ_ALLNOTESOFF, /**< All notes off event */
45 | FLUID_SEQ_BANKSELECT, /**< Bank select message */
46 | FLUID_SEQ_PROGRAMCHANGE, /**< Program change message */
47 | FLUID_SEQ_PROGRAMSELECT, /**< Program select message */
48 | FLUID_SEQ_PITCHBEND, /**< Pitch bend message */
49 | FLUID_SEQ_PITCHWHEELSENS, /**< Pitch wheel sensitivity set message @since 1.1.0 was misspelled previously */
50 | FLUID_SEQ_MODULATION, /**< Modulation controller event */
51 | FLUID_SEQ_SUSTAIN, /**< Sustain controller event */
52 | FLUID_SEQ_CONTROLCHANGE, /**< MIDI control change event */
53 | FLUID_SEQ_PAN, /**< Stereo pan set event */
54 | FLUID_SEQ_VOLUME, /**< Volume set event */
55 | FLUID_SEQ_REVERBSEND, /**< Reverb send set event */
56 | FLUID_SEQ_CHORUSSEND, /**< Chorus send set event */
57 | FLUID_SEQ_TIMER, /**< Timer event (useful for giving a callback at a certain time) */
58 | FLUID_SEQ_ANYCONTROLCHANGE, /**< Any control change message (only internally used for remove_events) */
59 | FLUID_SEQ_CHANNELPRESSURE, /**< Channel aftertouch event @since 1.1.0 */
60 | FLUID_SEQ_KEYPRESSURE, /**< Polyphonic aftertouch event @since 2.0.0 */
61 | FLUID_SEQ_SYSTEMRESET, /**< System reset event @since 1.1.0 */
62 | FLUID_SEQ_UNREGISTERING, /**< Called when a sequencer client is being unregistered. @since 1.1.0 */
63 | #ifndef __DOXYGEN__
64 | FLUID_SEQ_LASTEVENT /**< @internal Defines the count of events enums @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
65 | #endif
66 | };
67 |
68 | /* Event alloc/free */
69 | FLUIDSYNTH_API fluid_event_t *new_fluid_event(void);
70 | FLUIDSYNTH_API void delete_fluid_event(fluid_event_t *evt);
71 |
72 | /* Initializing events */
73 | FLUIDSYNTH_API void fluid_event_set_source(fluid_event_t *evt, fluid_seq_id_t src);
74 | FLUIDSYNTH_API void fluid_event_set_dest(fluid_event_t *evt, fluid_seq_id_t dest);
75 |
76 | /* Timer events */
77 | FLUIDSYNTH_API void fluid_event_timer(fluid_event_t *evt, void *data);
78 |
79 | /* Note events */
80 | FLUIDSYNTH_API void fluid_event_note(fluid_event_t *evt, int channel,
81 | short key, short vel,
82 | unsigned int duration);
83 |
84 | FLUIDSYNTH_API void fluid_event_noteon(fluid_event_t *evt, int channel, short key, short vel);
85 | FLUIDSYNTH_API void fluid_event_noteoff(fluid_event_t *evt, int channel, short key);
86 | FLUIDSYNTH_API void fluid_event_all_sounds_off(fluid_event_t *evt, int channel);
87 | FLUIDSYNTH_API void fluid_event_all_notes_off(fluid_event_t *evt, int channel);
88 |
89 | /* Instrument selection */
90 | FLUIDSYNTH_API void fluid_event_bank_select(fluid_event_t *evt, int channel, short bank_num);
91 | FLUIDSYNTH_API void fluid_event_program_change(fluid_event_t *evt, int channel, short preset_num);
92 | FLUIDSYNTH_API void fluid_event_program_select(fluid_event_t *evt, int channel, unsigned int sfont_id, short bank_num, short preset_num);
93 |
94 | /* Real-time generic instrument controllers */
95 | FLUIDSYNTH_API
96 | void fluid_event_control_change(fluid_event_t *evt, int channel, short control, short val);
97 |
98 | /* Real-time instrument controllers shortcuts */
99 | FLUIDSYNTH_API void fluid_event_pitch_bend(fluid_event_t *evt, int channel, int val);
100 | FLUIDSYNTH_API void fluid_event_pitch_wheelsens(fluid_event_t *evt, int channel, short val);
101 | FLUIDSYNTH_API void fluid_event_modulation(fluid_event_t *evt, int channel, short val);
102 | FLUIDSYNTH_API void fluid_event_sustain(fluid_event_t *evt, int channel, short val);
103 | FLUIDSYNTH_API void fluid_event_pan(fluid_event_t *evt, int channel, short val);
104 | FLUIDSYNTH_API void fluid_event_volume(fluid_event_t *evt, int channel, short val);
105 | FLUIDSYNTH_API void fluid_event_reverb_send(fluid_event_t *evt, int channel, short val);
106 | FLUIDSYNTH_API void fluid_event_chorus_send(fluid_event_t *evt, int channel, short val);
107 |
108 | FLUIDSYNTH_API void fluid_event_key_pressure(fluid_event_t *evt, int channel, short key, short val);
109 | FLUIDSYNTH_API void fluid_event_channel_pressure(fluid_event_t *evt, int channel, short val);
110 | FLUIDSYNTH_API void fluid_event_system_reset(fluid_event_t *evt);
111 |
112 |
113 | /* Only for removing events */
114 | FLUIDSYNTH_API void fluid_event_any_control_change(fluid_event_t *evt, int channel);
115 |
116 | /* Only when unregistering clients */
117 | FLUIDSYNTH_API void fluid_event_unregistering(fluid_event_t *evt);
118 |
119 | /* Accessing event data */
120 | FLUIDSYNTH_API int fluid_event_get_type(fluid_event_t *evt);
121 | FLUIDSYNTH_API fluid_seq_id_t fluid_event_get_source(fluid_event_t *evt);
122 | FLUIDSYNTH_API fluid_seq_id_t fluid_event_get_dest(fluid_event_t *evt);
123 | FLUIDSYNTH_API int fluid_event_get_channel(fluid_event_t *evt);
124 | FLUIDSYNTH_API short fluid_event_get_key(fluid_event_t *evt);
125 | FLUIDSYNTH_API short fluid_event_get_velocity(fluid_event_t *evt);
126 | FLUIDSYNTH_API short fluid_event_get_control(fluid_event_t *evt);
127 | FLUIDSYNTH_API short fluid_event_get_value(fluid_event_t *evt);
128 | FLUIDSYNTH_API short fluid_event_get_program(fluid_event_t *evt);
129 | FLUIDSYNTH_API void *fluid_event_get_data(fluid_event_t *evt);
130 | FLUIDSYNTH_API unsigned int fluid_event_get_duration(fluid_event_t *evt);
131 | FLUIDSYNTH_API short fluid_event_get_bank(fluid_event_t *evt);
132 | FLUIDSYNTH_API int fluid_event_get_pitch(fluid_event_t *evt);
133 | FLUIDSYNTH_API unsigned int fluid_event_get_sfont_id(fluid_event_t *evt);
134 |
135 | #ifdef __cplusplus
136 | }
137 | #endif
138 | #endif /* _FLUIDSYNTH_EVENT_H */
139 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/gen.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_GEN_H
22 | #define _FLUIDSYNTH_GEN_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file gen.h
30 | * @brief Functions and defines for SoundFont generator effects.
31 | */
32 |
33 | /**
34 | * Generator (effect) numbers (Soundfont 2.01 specifications section 8.1.3)
35 | */
36 | enum fluid_gen_type
37 | {
38 | GEN_STARTADDROFS, /**< Sample start address offset (0-32767) */
39 | GEN_ENDADDROFS, /**< Sample end address offset (-32767-0) */
40 | GEN_STARTLOOPADDROFS, /**< Sample loop start address offset (-32767-32767) */
41 | GEN_ENDLOOPADDROFS, /**< Sample loop end address offset (-32767-32767) */
42 | GEN_STARTADDRCOARSEOFS, /**< Sample start address coarse offset (X 32768) */
43 | GEN_MODLFOTOPITCH, /**< Modulation LFO to pitch */
44 | GEN_VIBLFOTOPITCH, /**< Vibrato LFO to pitch */
45 | GEN_MODENVTOPITCH, /**< Modulation envelope to pitch */
46 | GEN_FILTERFC, /**< Filter cutoff */
47 | GEN_FILTERQ, /**< Filter Q */
48 | GEN_MODLFOTOFILTERFC, /**< Modulation LFO to filter cutoff */
49 | GEN_MODENVTOFILTERFC, /**< Modulation envelope to filter cutoff */
50 | GEN_ENDADDRCOARSEOFS, /**< Sample end address coarse offset (X 32768) */
51 | GEN_MODLFOTOVOL, /**< Modulation LFO to volume */
52 | GEN_UNUSED1, /**< Unused */
53 | GEN_CHORUSSEND, /**< Chorus send amount */
54 | GEN_REVERBSEND, /**< Reverb send amount */
55 | GEN_PAN, /**< Stereo panning */
56 | GEN_UNUSED2, /**< Unused */
57 | GEN_UNUSED3, /**< Unused */
58 | GEN_UNUSED4, /**< Unused */
59 | GEN_MODLFODELAY, /**< Modulation LFO delay */
60 | GEN_MODLFOFREQ, /**< Modulation LFO frequency */
61 | GEN_VIBLFODELAY, /**< Vibrato LFO delay */
62 | GEN_VIBLFOFREQ, /**< Vibrato LFO frequency */
63 | GEN_MODENVDELAY, /**< Modulation envelope delay */
64 | GEN_MODENVATTACK, /**< Modulation envelope attack */
65 | GEN_MODENVHOLD, /**< Modulation envelope hold */
66 | GEN_MODENVDECAY, /**< Modulation envelope decay */
67 | GEN_MODENVSUSTAIN, /**< Modulation envelope sustain */
68 | GEN_MODENVRELEASE, /**< Modulation envelope release */
69 | GEN_KEYTOMODENVHOLD, /**< Key to modulation envelope hold */
70 | GEN_KEYTOMODENVDECAY, /**< Key to modulation envelope decay */
71 | GEN_VOLENVDELAY, /**< Volume envelope delay */
72 | GEN_VOLENVATTACK, /**< Volume envelope attack */
73 | GEN_VOLENVHOLD, /**< Volume envelope hold */
74 | GEN_VOLENVDECAY, /**< Volume envelope decay */
75 | GEN_VOLENVSUSTAIN, /**< Volume envelope sustain */
76 | GEN_VOLENVRELEASE, /**< Volume envelope release */
77 | GEN_KEYTOVOLENVHOLD, /**< Key to volume envelope hold */
78 | GEN_KEYTOVOLENVDECAY, /**< Key to volume envelope decay */
79 | GEN_INSTRUMENT, /**< Instrument ID (shouldn't be set by user) */
80 | GEN_RESERVED1, /**< Reserved */
81 | GEN_KEYRANGE, /**< MIDI note range */
82 | GEN_VELRANGE, /**< MIDI velocity range */
83 | GEN_STARTLOOPADDRCOARSEOFS, /**< Sample start loop address coarse offset (X 32768) */
84 | GEN_KEYNUM, /**< Fixed MIDI note number */
85 | GEN_VELOCITY, /**< Fixed MIDI velocity value */
86 | GEN_ATTENUATION, /**< Initial volume attenuation */
87 | GEN_RESERVED2, /**< Reserved */
88 | GEN_ENDLOOPADDRCOARSEOFS, /**< Sample end loop address coarse offset (X 32768) */
89 | GEN_COARSETUNE, /**< Coarse tuning */
90 | GEN_FINETUNE, /**< Fine tuning */
91 | GEN_SAMPLEID, /**< Sample ID (shouldn't be set by user) */
92 | GEN_SAMPLEMODE, /**< Sample mode flags */
93 | GEN_RESERVED3, /**< Reserved */
94 | GEN_SCALETUNE, /**< Scale tuning */
95 | GEN_EXCLUSIVECLASS, /**< Exclusive class number */
96 | GEN_OVERRIDEROOTKEY, /**< Sample root note override */
97 |
98 | /**
99 | * @brief Initial Pitch
100 | *
101 | * @note This is not "standard" SoundFont generator, because it is not
102 | * mentioned in the list of generators in the SF2 specifications.
103 | * It is used by FluidSynth internally to compute the nominal pitch of
104 | * a note on note-on event. By nature it shouldn't be allowed to be modulated,
105 | * however the specification defines a default modulator having "Initial Pitch"
106 | * as destination (cf. SF2.01 page 57 section 8.4.10 MIDI Pitch Wheel to Initial Pitch).
107 | * Thus it is impossible to cancel this default modulator, which would be required
108 | * to let the MIDI Pitch Wheel controller modulate a different generator.
109 | * In order to provide this flexibility, FluidSynth >= 2.1.0 uses a default modulator
110 | * "Pitch Wheel to Fine Tune", rather than Initial Pitch. The same "compromise" can
111 | * be found on the Audigy 2 ZS for instance.
112 | */
113 | GEN_PITCH,
114 |
115 | GEN_CUSTOM_BALANCE, /**< Balance @note Not a real SoundFont generator */
116 | /* non-standard generator for an additional custom high- or low-pass filter */
117 | GEN_CUSTOM_FILTERFC, /**< Custom filter cutoff frequency */
118 | GEN_CUSTOM_FILTERQ, /**< Custom filter Q */
119 |
120 | #ifndef __DOXYGEN__
121 | GEN_LAST /**< @internal Value defines the count of generators (#fluid_gen_type) @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
122 | #endif
123 | };
124 |
125 |
126 | #ifdef __cplusplus
127 | }
128 | #endif
129 | #endif /* _FLUIDSYNTH_GEN_H */
130 |
131 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/ladspa.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_LADSPA_H
22 | #define _FLUIDSYNTH_LADSPA_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file ladspa.h
30 | * @brief Functions for manipulating the ladspa effects unit
31 | *
32 | * This header defines useful functions for programmatically manipulating the ladspa
33 | * effects unit of the synth that can be retrieved via fluid_synth_get_ladspa_fx().
34 | *
35 | * Using any of those functions requires fluidsynth to be compiled with ladspa support.
36 | * Else all of those functions are useless dummies.
37 | */
38 |
39 | FLUIDSYNTH_API int fluid_ladspa_is_active(fluid_ladspa_fx_t *fx);
40 | FLUIDSYNTH_API int fluid_ladspa_activate(fluid_ladspa_fx_t *fx);
41 | FLUIDSYNTH_API int fluid_ladspa_deactivate(fluid_ladspa_fx_t *fx);
42 | FLUIDSYNTH_API int fluid_ladspa_reset(fluid_ladspa_fx_t *fx);
43 | FLUIDSYNTH_API int fluid_ladspa_check(fluid_ladspa_fx_t *fx, char *err, int err_size);
44 |
45 | FLUIDSYNTH_API int fluid_ladspa_host_port_exists(fluid_ladspa_fx_t *fx, const char *name);
46 |
47 | FLUIDSYNTH_API int fluid_ladspa_add_buffer(fluid_ladspa_fx_t *fx, const char *name);
48 | FLUIDSYNTH_API int fluid_ladspa_buffer_exists(fluid_ladspa_fx_t *fx, const char *name);
49 |
50 | FLUIDSYNTH_API int fluid_ladspa_add_effect(fluid_ladspa_fx_t *fx, const char *effect_name,
51 | const char *lib_name, const char *plugin_name);
52 | FLUIDSYNTH_API int fluid_ladspa_effect_can_mix(fluid_ladspa_fx_t *fx, const char *name);
53 | FLUIDSYNTH_API int fluid_ladspa_effect_set_mix(fluid_ladspa_fx_t *fx, const char *name, int mix, float gain);
54 | FLUIDSYNTH_API int fluid_ladspa_effect_port_exists(fluid_ladspa_fx_t *fx, const char *effect_name, const char *port_name);
55 | FLUIDSYNTH_API int fluid_ladspa_effect_set_control(fluid_ladspa_fx_t *fx, const char *effect_name,
56 | const char *port_name, float val);
57 | FLUIDSYNTH_API int fluid_ladspa_effect_link(fluid_ladspa_fx_t *fx, const char *effect_name,
58 | const char *port_name, const char *name);
59 |
60 | #ifdef __cplusplus
61 | }
62 | #endif
63 |
64 | #endif /* _FLUIDSYNTH_LADSPA_H */
65 |
66 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/log.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_LOG_H
22 | #define _FLUIDSYNTH_LOG_H
23 |
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 |
30 | /**
31 | * @file log.h
32 | * @brief Logging interface
33 | *
34 | * The default logging function of the fluidsynth prints its messages
35 | * to the stderr. The synthesizer uses five level of messages: #FLUID_PANIC,
36 | * #FLUID_ERR, #FLUID_WARN, #FLUID_INFO, and #FLUID_DBG.
37 | *
38 | * A client application can install a new log function to handle the
39 | * messages differently. In the following example, the application
40 | * sets a callback function to display #FLUID_PANIC messages in a dialog,
41 | * and ignores all other messages by setting the log function to
42 | * NULL:
43 | *
44 | * @code
45 | * fluid_set_log_function(FLUID_PANIC, show_dialog, (void*) root_window);
46 | * fluid_set_log_function(FLUID_ERR, NULL, NULL);
47 | * fluid_set_log_function(FLUID_WARN, NULL, NULL);
48 | * fluid_set_log_function(FLUID_DBG, NULL, NULL);
49 | * @endcode
50 | */
51 |
52 | /**
53 | * FluidSynth log levels.
54 | */
55 | enum fluid_log_level
56 | {
57 | FLUID_PANIC, /**< The synth can't function correctly any more */
58 | FLUID_ERR, /**< Serious error occurred */
59 | FLUID_WARN, /**< Warning */
60 | FLUID_INFO, /**< Verbose informational messages */
61 | FLUID_DBG, /**< Debugging messages */
62 | #ifndef __DOXYGEN__
63 | LAST_LOG_LEVEL /**< @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
64 | #endif
65 | };
66 |
67 | /**
68 | * Log function handler callback type used by fluid_set_log_function().
69 | * @param level Log level (#fluid_log_level)
70 | * @param message Log message text
71 | * @param data User data pointer supplied to fluid_set_log_function().
72 | */
73 | typedef void (*fluid_log_function_t)(int level, const char *message, void *data);
74 |
75 | FLUIDSYNTH_API
76 | fluid_log_function_t fluid_set_log_function(int level, fluid_log_function_t fun, void *data);
77 |
78 | FLUIDSYNTH_API void fluid_default_log_function(int level, const char *message, void *data);
79 |
80 | FLUIDSYNTH_API int fluid_log(int level, const char *fmt, ...)
81 | #if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
82 | __attribute__ ((format (printf, 2, 3)))
83 | #endif
84 | ;
85 |
86 |
87 | #ifdef __cplusplus
88 | }
89 | #endif
90 |
91 | #endif /* _FLUIDSYNTH_LOG_H */
92 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/midi.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_MIDI_H
22 | #define _FLUIDSYNTH_MIDI_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file midi.h
30 | * @brief Functions for MIDI events, drivers and MIDI file playback.
31 | */
32 |
33 | FLUIDSYNTH_API fluid_midi_event_t *new_fluid_midi_event(void);
34 | FLUIDSYNTH_API void delete_fluid_midi_event(fluid_midi_event_t *event);
35 |
36 | FLUIDSYNTH_API int fluid_midi_event_set_type(fluid_midi_event_t *evt, int type);
37 | FLUIDSYNTH_API int fluid_midi_event_get_type(fluid_midi_event_t *evt);
38 | FLUIDSYNTH_API int fluid_midi_event_set_channel(fluid_midi_event_t *evt, int chan);
39 | FLUIDSYNTH_API int fluid_midi_event_get_channel(fluid_midi_event_t *evt);
40 | FLUIDSYNTH_API int fluid_midi_event_get_key(fluid_midi_event_t *evt);
41 | FLUIDSYNTH_API int fluid_midi_event_set_key(fluid_midi_event_t *evt, int key);
42 | FLUIDSYNTH_API int fluid_midi_event_get_velocity(fluid_midi_event_t *evt);
43 | FLUIDSYNTH_API int fluid_midi_event_set_velocity(fluid_midi_event_t *evt, int vel);
44 | FLUIDSYNTH_API int fluid_midi_event_get_control(fluid_midi_event_t *evt);
45 | FLUIDSYNTH_API int fluid_midi_event_set_control(fluid_midi_event_t *evt, int ctrl);
46 | FLUIDSYNTH_API int fluid_midi_event_get_value(fluid_midi_event_t *evt);
47 | FLUIDSYNTH_API int fluid_midi_event_set_value(fluid_midi_event_t *evt, int val);
48 | FLUIDSYNTH_API int fluid_midi_event_get_program(fluid_midi_event_t *evt);
49 | FLUIDSYNTH_API int fluid_midi_event_set_program(fluid_midi_event_t *evt, int val);
50 | FLUIDSYNTH_API int fluid_midi_event_get_pitch(fluid_midi_event_t *evt);
51 | FLUIDSYNTH_API int fluid_midi_event_set_pitch(fluid_midi_event_t *evt, int val);
52 | FLUIDSYNTH_API int fluid_midi_event_set_sysex(fluid_midi_event_t *evt, void *data,
53 | int size, int dynamic);
54 | FLUIDSYNTH_API int fluid_midi_event_set_text(fluid_midi_event_t *evt,
55 | void *data, int size, int dynamic);
56 | FLUIDSYNTH_API int fluid_midi_event_get_text(fluid_midi_event_t *evt,
57 | void **data, int *size);
58 | FLUIDSYNTH_API int fluid_midi_event_set_lyrics(fluid_midi_event_t *evt,
59 | void *data, int size, int dynamic);
60 | FLUIDSYNTH_API int fluid_midi_event_get_lyrics(fluid_midi_event_t *evt,
61 | void **data, int *size);
62 |
63 | /**
64 | * MIDI router rule type.
65 | * @since 1.1.0
66 | */
67 | typedef enum
68 | {
69 | FLUID_MIDI_ROUTER_RULE_NOTE, /**< MIDI note rule */
70 | FLUID_MIDI_ROUTER_RULE_CC, /**< MIDI controller rule */
71 | FLUID_MIDI_ROUTER_RULE_PROG_CHANGE, /**< MIDI program change rule */
72 | FLUID_MIDI_ROUTER_RULE_PITCH_BEND, /**< MIDI pitch bend rule */
73 | FLUID_MIDI_ROUTER_RULE_CHANNEL_PRESSURE, /**< MIDI channel pressure rule */
74 | FLUID_MIDI_ROUTER_RULE_KEY_PRESSURE, /**< MIDI key pressure rule */
75 | #ifndef __DOXYGEN__
76 | FLUID_MIDI_ROUTER_RULE_COUNT /**< @internal Total count of rule types @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time!*/
77 | #endif
78 | } fluid_midi_router_rule_type;
79 |
80 | /**
81 | * Generic callback function for MIDI events.
82 | * @param data User defined data pointer
83 | * @param event The MIDI event
84 | * @return Should return #FLUID_OK on success, #FLUID_FAILED otherwise
85 | *
86 | * Will be used between
87 | * - MIDI driver and MIDI router
88 | * - MIDI router and synth
89 | * to communicate events.
90 | * In the not-so-far future...
91 | */
92 | typedef int (*handle_midi_event_func_t)(void *data, fluid_midi_event_t *event);
93 |
94 | FLUIDSYNTH_API fluid_midi_router_t *new_fluid_midi_router(fluid_settings_t *settings,
95 | handle_midi_event_func_t handler,
96 | void *event_handler_data);
97 | FLUIDSYNTH_API void delete_fluid_midi_router(fluid_midi_router_t *handler);
98 | FLUIDSYNTH_API int fluid_midi_router_set_default_rules(fluid_midi_router_t *router);
99 | FLUIDSYNTH_API int fluid_midi_router_clear_rules(fluid_midi_router_t *router);
100 | FLUIDSYNTH_API int fluid_midi_router_add_rule(fluid_midi_router_t *router,
101 | fluid_midi_router_rule_t *rule, int type);
102 | FLUIDSYNTH_API fluid_midi_router_rule_t *new_fluid_midi_router_rule(void);
103 | FLUIDSYNTH_API void delete_fluid_midi_router_rule(fluid_midi_router_rule_t *rule);
104 | FLUIDSYNTH_API void fluid_midi_router_rule_set_chan(fluid_midi_router_rule_t *rule,
105 | int min, int max, float mul, int add);
106 | FLUIDSYNTH_API void fluid_midi_router_rule_set_param1(fluid_midi_router_rule_t *rule,
107 | int min, int max, float mul, int add);
108 | FLUIDSYNTH_API void fluid_midi_router_rule_set_param2(fluid_midi_router_rule_t *rule,
109 | int min, int max, float mul, int add);
110 | FLUIDSYNTH_API int fluid_midi_router_handle_midi_event(void *data, fluid_midi_event_t *event);
111 | FLUIDSYNTH_API int fluid_midi_dump_prerouter(void *data, fluid_midi_event_t *event);
112 | FLUIDSYNTH_API int fluid_midi_dump_postrouter(void *data, fluid_midi_event_t *event);
113 |
114 |
115 | FLUIDSYNTH_API
116 | fluid_midi_driver_t *new_fluid_midi_driver(fluid_settings_t *settings,
117 | handle_midi_event_func_t handler,
118 | void *event_handler_data);
119 |
120 | FLUIDSYNTH_API void delete_fluid_midi_driver(fluid_midi_driver_t *driver);
121 |
122 |
123 | /**
124 | * MIDI player status enum.
125 | * @since 1.1.0
126 | */
127 | enum fluid_player_status
128 | {
129 | FLUID_PLAYER_READY, /**< Player is ready */
130 | FLUID_PLAYER_PLAYING, /**< Player is currently playing */
131 | FLUID_PLAYER_DONE /**< Player is finished playing */
132 | };
133 |
134 | FLUIDSYNTH_API fluid_player_t *new_fluid_player(fluid_synth_t *synth);
135 | FLUIDSYNTH_API void delete_fluid_player(fluid_player_t *player);
136 | FLUIDSYNTH_API int fluid_player_add(fluid_player_t *player, const char *midifile);
137 | FLUIDSYNTH_API int fluid_player_add_mem(fluid_player_t *player, const void *buffer, size_t len);
138 | FLUIDSYNTH_API int fluid_player_play(fluid_player_t *player);
139 | FLUIDSYNTH_API int fluid_player_stop(fluid_player_t *player);
140 | FLUIDSYNTH_API int fluid_player_join(fluid_player_t *player);
141 | FLUIDSYNTH_API int fluid_player_set_loop(fluid_player_t *player, int loop);
142 | FLUIDSYNTH_API int fluid_player_set_midi_tempo(fluid_player_t *player, int tempo);
143 | FLUIDSYNTH_API int fluid_player_set_bpm(fluid_player_t *player, int bpm);
144 | FLUIDSYNTH_API int fluid_player_set_playback_callback(fluid_player_t *player, handle_midi_event_func_t handler, void *handler_data);
145 |
146 | FLUIDSYNTH_API int fluid_player_get_status(fluid_player_t *player);
147 | FLUIDSYNTH_API int fluid_player_get_current_tick(fluid_player_t *player);
148 | FLUIDSYNTH_API int fluid_player_get_total_ticks(fluid_player_t *player);
149 | FLUIDSYNTH_API int fluid_player_get_bpm(fluid_player_t *player);
150 | FLUIDSYNTH_API int fluid_player_get_midi_tempo(fluid_player_t *player);
151 | FLUIDSYNTH_API int fluid_player_seek(fluid_player_t *player, int ticks);
152 |
153 | ///
154 |
155 | #ifdef __cplusplus
156 | }
157 | #endif
158 |
159 | #endif /* _FLUIDSYNTH_MIDI_H */
160 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/misc.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_MISC_H
22 | #define _FLUIDSYNTH_MISC_H
23 |
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 |
30 | /**
31 | * @file misc.h
32 | * @brief Miscellaneous utility functions and defines
33 | */
34 |
35 | /**
36 | * Value that indicates success, used by most libfluidsynth functions.
37 | * @since 1.1.0
38 | *
39 | * @note This was not publicly defined prior to libfluidsynth 1.1.0. When
40 | * writing code which should also be compatible with older versions, something
41 | * like the following can be used:
42 | *
43 | * @code
44 | * #include
45 | *
46 | * #ifndef FLUID_OK
47 | * #define FLUID_OK (0)
48 | * #define FLUID_FAILED (-1)
49 | * #endif
50 | * @endcode
51 | */
52 | #define FLUID_OK (0)
53 |
54 | /**
55 | * Value that indicates failure, used by most libfluidsynth functions.
56 | * @since 1.1.0
57 | *
58 | * @note See #FLUID_OK for more details.
59 | */
60 | #define FLUID_FAILED (-1)
61 |
62 |
63 | FLUIDSYNTH_API int fluid_is_soundfont(const char *filename);
64 | FLUIDSYNTH_API int fluid_is_midifile(const char *filename);
65 | FLUIDSYNTH_API void fluid_free(void* ptr);
66 |
67 |
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 |
72 | #endif /* _FLUIDSYNTH_MISC_H */
73 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/mod.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_MOD_H
22 | #define _FLUIDSYNTH_MOD_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file mod.h
30 | * @brief SoundFont modulator functions and constants.
31 | */
32 |
33 |
34 | /**
35 | * Flags defining the polarity, mapping function and type of a modulator source.
36 | * Compare with SoundFont 2.04 PDF section 8.2.
37 | *
38 | * Note: Bit values do not correspond to the SoundFont spec! Also note that
39 | * #FLUID_MOD_GC and #FLUID_MOD_CC are in the flags field instead of the source field.
40 | */
41 | enum fluid_mod_flags
42 | {
43 | FLUID_MOD_POSITIVE = 0, /**< Mapping function is positive */
44 | FLUID_MOD_NEGATIVE = 1, /**< Mapping function is negative */
45 | FLUID_MOD_UNIPOLAR = 0, /**< Mapping function is unipolar */
46 | FLUID_MOD_BIPOLAR = 2, /**< Mapping function is bipolar */
47 | FLUID_MOD_LINEAR = 0, /**< Linear mapping function */
48 | FLUID_MOD_CONCAVE = 4, /**< Concave mapping function */
49 | FLUID_MOD_CONVEX = 8, /**< Convex mapping function */
50 | FLUID_MOD_SWITCH = 12, /**< Switch (on/off) mapping function */
51 | FLUID_MOD_GC = 0, /**< General controller source type (#fluid_mod_src) */
52 | FLUID_MOD_CC = 16, /**< MIDI CC controller (source will be a MIDI CC number) */
53 |
54 | FLUID_MOD_SIN = 0x80, /**< Custom non-standard sinus mapping function */
55 | };
56 |
57 | /**
58 | * General controller (if #FLUID_MOD_GC in flags). This
59 | * corresponds to SoundFont 2.04 PDF section 8.2.1
60 | */
61 | enum fluid_mod_src
62 | {
63 | FLUID_MOD_NONE = 0, /**< No source controller */
64 | FLUID_MOD_VELOCITY = 2, /**< MIDI note-on velocity */
65 | FLUID_MOD_KEY = 3, /**< MIDI note-on note number */
66 | FLUID_MOD_KEYPRESSURE = 10, /**< MIDI key pressure */
67 | FLUID_MOD_CHANNELPRESSURE = 13, /**< MIDI channel pressure */
68 | FLUID_MOD_PITCHWHEEL = 14, /**< Pitch wheel */
69 | FLUID_MOD_PITCHWHEELSENS = 16 /**< Pitch wheel sensitivity */
70 | };
71 |
72 | FLUIDSYNTH_API fluid_mod_t *new_fluid_mod(void);
73 | FLUIDSYNTH_API void delete_fluid_mod(fluid_mod_t *mod);
74 | FLUIDSYNTH_API size_t fluid_mod_sizeof(void);
75 |
76 | FLUIDSYNTH_API void fluid_mod_set_source1(fluid_mod_t *mod, int src, int flags);
77 | FLUIDSYNTH_API void fluid_mod_set_source2(fluid_mod_t *mod, int src, int flags);
78 | FLUIDSYNTH_API void fluid_mod_set_dest(fluid_mod_t *mod, int dst);
79 | FLUIDSYNTH_API void fluid_mod_set_amount(fluid_mod_t *mod, double amount);
80 |
81 | FLUIDSYNTH_API int fluid_mod_get_source1(const fluid_mod_t *mod);
82 | FLUIDSYNTH_API int fluid_mod_get_flags1(const fluid_mod_t *mod);
83 | FLUIDSYNTH_API int fluid_mod_get_source2(const fluid_mod_t *mod);
84 | FLUIDSYNTH_API int fluid_mod_get_flags2(const fluid_mod_t *mod);
85 | FLUIDSYNTH_API int fluid_mod_get_dest(const fluid_mod_t *mod);
86 | FLUIDSYNTH_API double fluid_mod_get_amount(const fluid_mod_t *mod);
87 |
88 | FLUIDSYNTH_API int fluid_mod_test_identity(const fluid_mod_t *mod1, const fluid_mod_t *mod2);
89 | FLUIDSYNTH_API int fluid_mod_has_source(const fluid_mod_t *mod, int cc, int ctrl);
90 | FLUIDSYNTH_API int fluid_mod_has_dest(const fluid_mod_t *mod, int gen);
91 |
92 | FLUIDSYNTH_API void fluid_mod_clone(fluid_mod_t *mod, const fluid_mod_t *src);
93 |
94 | #ifdef __cplusplus
95 | }
96 | #endif
97 | #endif /* _FLUIDSYNTH_MOD_H */
98 |
99 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/seq.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_SEQ_H
22 | #define _FLUIDSYNTH_SEQ_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file seq.h
30 | * @brief MIDI event sequencer.
31 | */
32 |
33 | /**
34 | * Event callback prototype for destination clients.
35 | * @param time Current sequencer tick value (see fluid_sequencer_get_tick()).
36 | * @param event The event being received
37 | * @param seq The sequencer instance
38 | * @param data User defined data registered with the client
39 | */
40 | typedef void (*fluid_event_callback_t)(unsigned int time, fluid_event_t *event,
41 | fluid_sequencer_t *seq, void *data);
42 |
43 |
44 | FLUID_DEPRECATED FLUIDSYNTH_API fluid_sequencer_t *new_fluid_sequencer(void);
45 | FLUIDSYNTH_API fluid_sequencer_t *new_fluid_sequencer2(int use_system_timer);
46 | FLUIDSYNTH_API void delete_fluid_sequencer(fluid_sequencer_t *seq);
47 | FLUIDSYNTH_API int fluid_sequencer_get_use_system_timer(fluid_sequencer_t *seq);
48 | FLUIDSYNTH_API
49 | fluid_seq_id_t fluid_sequencer_register_client(fluid_sequencer_t *seq, const char *name,
50 | fluid_event_callback_t callback, void *data);
51 | FLUIDSYNTH_API void fluid_sequencer_unregister_client(fluid_sequencer_t *seq, fluid_seq_id_t id);
52 | FLUIDSYNTH_API int fluid_sequencer_count_clients(fluid_sequencer_t *seq);
53 | FLUIDSYNTH_API fluid_seq_id_t fluid_sequencer_get_client_id(fluid_sequencer_t *seq, int index);
54 | FLUIDSYNTH_API char *fluid_sequencer_get_client_name(fluid_sequencer_t *seq, fluid_seq_id_t id);
55 | FLUIDSYNTH_API int fluid_sequencer_client_is_dest(fluid_sequencer_t *seq, fluid_seq_id_t id);
56 | FLUIDSYNTH_API void fluid_sequencer_process(fluid_sequencer_t *seq, unsigned int msec);
57 | FLUIDSYNTH_API void fluid_sequencer_send_now(fluid_sequencer_t *seq, fluid_event_t *evt);
58 | FLUIDSYNTH_API
59 | int fluid_sequencer_send_at(fluid_sequencer_t *seq, fluid_event_t *evt,
60 | unsigned int time, int absolute);
61 | FLUIDSYNTH_API
62 | void fluid_sequencer_remove_events(fluid_sequencer_t *seq, fluid_seq_id_t source, fluid_seq_id_t dest, int type);
63 | FLUIDSYNTH_API unsigned int fluid_sequencer_get_tick(fluid_sequencer_t *seq);
64 | FLUIDSYNTH_API void fluid_sequencer_set_time_scale(fluid_sequencer_t *seq, double scale);
65 | FLUIDSYNTH_API double fluid_sequencer_get_time_scale(fluid_sequencer_t *seq);
66 |
67 | #ifdef __cplusplus
68 | }
69 | #endif
70 |
71 | #endif /* _FLUIDSYNTH_SEQ_H */
72 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/seqbind.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_SEQBIND_H
22 | #define _FLUIDSYNTH_SEQBIND_H
23 |
24 | #include "seq.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | /**
31 | * @file seqbind.h
32 | * @brief Functions for binding sequencer objects to other subsystems.
33 | */
34 |
35 | FLUIDSYNTH_API
36 | fluid_seq_id_t fluid_sequencer_register_fluidsynth(fluid_sequencer_t *seq, fluid_synth_t *synth);
37 | FLUIDSYNTH_API int
38 | fluid_sequencer_add_midi_event_to_buffer(void *data, fluid_midi_event_t *event);
39 |
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 | #endif /* _FLUIDSYNTH_SEQBIND_H */
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/settings.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_SETTINGS_H
22 | #define _FLUIDSYNTH_SETTINGS_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file settings.h
30 | * @brief Synthesizer settings
31 | * @defgroup SettingsFunctions Functions for settings management
32 | *
33 | * To create a synthesizer object you will have to specify its
34 | * settings. These settings are stored in a fluid_settings_t object.
35 | * @code
36 | * void
37 | * my_synthesizer ()
38 | * {
39 | * fluid_settings_t *settings;
40 | * fluid_synth_t *synth;
41 | * fluid_audio_driver_t *adriver;
42 | *
43 | * settings = new_fluid_settings ();
44 | * fluid_settings_setstr(settings, "audio.driver", "alsa");
45 | * // ... change settings ...
46 | * synth = new_fluid_synth (settings);
47 | * adriver = new_fluid_audio_driver (settings, synth);
48 | * // ...
49 | * }
50 | * @endcode
51 | * @sa @ref CreatingSettings
52 | */
53 |
54 | /**
55 | * Hint FLUID_HINT_BOUNDED_BELOW indicates that the LowerBound field
56 | * of the FLUID_PortRangeHint should be considered meaningful. The
57 | * value in this field should be considered the (inclusive) lower
58 | * bound of the valid range. If FLUID_HINT_SAMPLE_RATE is also
59 | * specified then the value of LowerBound should be multiplied by the
60 | * sample rate.
61 | */
62 | #define FLUID_HINT_BOUNDED_BELOW 0x1
63 |
64 | /** Hint FLUID_HINT_BOUNDED_ABOVE indicates that the UpperBound field
65 | of the FLUID_PortRangeHint should be considered meaningful. The
66 | value in this field should be considered the (inclusive) upper
67 | bound of the valid range. If FLUID_HINT_SAMPLE_RATE is also
68 | specified then the value of UpperBound should be multiplied by the
69 | sample rate. */
70 | #define FLUID_HINT_BOUNDED_ABOVE 0x2
71 |
72 | /**
73 | * Hint FLUID_HINT_TOGGLED indicates that the data item should be
74 | * considered a Boolean toggle. Data less than or equal to zero should
75 | * be considered `off' or `false,' and data above zero should be
76 | * considered `on' or `true.' FLUID_HINT_TOGGLED may not be used in
77 | * conjunction with any other hint.
78 | */
79 | #define FLUID_HINT_TOGGLED 0x4
80 |
81 | #define FLUID_HINT_OPTIONLIST 0x02 /**< Setting is a list of string options */
82 |
83 |
84 | /**
85 | * Settings type
86 | *
87 | * Each setting has a defined type: numeric (double), integer, string or a
88 | * set of values. The type of each setting can be retrieved using the
89 | * function fluid_settings_get_type()
90 | */
91 | enum fluid_types_enum
92 | {
93 | FLUID_NO_TYPE = -1, /**< Undefined type */
94 | FLUID_NUM_TYPE, /**< Numeric (double) */
95 | FLUID_INT_TYPE, /**< Integer */
96 | FLUID_STR_TYPE, /**< String */
97 | FLUID_SET_TYPE /**< Set of values */
98 | };
99 |
100 |
101 | FLUIDSYNTH_API fluid_settings_t *new_fluid_settings(void);
102 | FLUIDSYNTH_API void delete_fluid_settings(fluid_settings_t *settings);
103 |
104 | FLUIDSYNTH_API
105 | int fluid_settings_get_type(fluid_settings_t *settings, const char *name);
106 |
107 | FLUIDSYNTH_API
108 | int fluid_settings_get_hints(fluid_settings_t *settings, const char *name, int *val);
109 |
110 | FLUIDSYNTH_API
111 | int fluid_settings_is_realtime(fluid_settings_t *settings, const char *name);
112 |
113 | FLUIDSYNTH_API
114 | int fluid_settings_setstr(fluid_settings_t *settings, const char *name, const char *str);
115 |
116 | FLUIDSYNTH_API
117 | int fluid_settings_copystr(fluid_settings_t *settings, const char *name, char *str, int len);
118 |
119 | FLUIDSYNTH_API
120 | int fluid_settings_dupstr(fluid_settings_t *settings, const char *name, char **str);
121 |
122 | FLUIDSYNTH_API
123 | int fluid_settings_getstr_default(fluid_settings_t *settings, const char *name, char **def);
124 |
125 | FLUIDSYNTH_API
126 | int fluid_settings_str_equal(fluid_settings_t *settings, const char *name, const char *value);
127 |
128 | FLUIDSYNTH_API
129 | int fluid_settings_setnum(fluid_settings_t *settings, const char *name, double val);
130 |
131 | FLUIDSYNTH_API
132 | int fluid_settings_getnum(fluid_settings_t *settings, const char *name, double *val);
133 |
134 | FLUIDSYNTH_API
135 | int fluid_settings_getnum_default(fluid_settings_t *settings, const char *name, double *val);
136 |
137 | FLUIDSYNTH_API
138 | int fluid_settings_getnum_range(fluid_settings_t *settings, const char *name,
139 | double *min, double *max);
140 |
141 | FLUIDSYNTH_API
142 | int fluid_settings_setint(fluid_settings_t *settings, const char *name, int val);
143 |
144 | FLUIDSYNTH_API
145 | int fluid_settings_getint(fluid_settings_t *settings, const char *name, int *val);
146 |
147 | FLUIDSYNTH_API
148 | int fluid_settings_getint_default(fluid_settings_t *settings, const char *name, int *val);
149 |
150 | FLUIDSYNTH_API
151 | int fluid_settings_getint_range(fluid_settings_t *settings, const char *name,
152 | int *min, int *max);
153 |
154 | /**
155 | * Callback function type used with fluid_settings_foreach_option()
156 | * @param data User defined data pointer
157 | * @param name Setting name
158 | * @param option A string option for this setting (iterates through the list)
159 | */
160 | typedef void (*fluid_settings_foreach_option_t)(void *data, const char *name, const char *option);
161 |
162 | FLUIDSYNTH_API
163 | void fluid_settings_foreach_option(fluid_settings_t *settings,
164 | const char *name, void *data,
165 | fluid_settings_foreach_option_t func);
166 | FLUIDSYNTH_API
167 | int fluid_settings_option_count(fluid_settings_t *settings, const char *name);
168 | FLUIDSYNTH_API char *fluid_settings_option_concat(fluid_settings_t *settings,
169 | const char *name,
170 | const char *separator);
171 |
172 | /**
173 | * Callback function type used with fluid_settings_foreach()
174 | * @param data User defined data pointer
175 | * @param name Setting name
176 | * @param type Setting type (#fluid_types_enum)
177 | */
178 | typedef void (*fluid_settings_foreach_t)(void *data, const char *name, int type);
179 |
180 | FLUIDSYNTH_API
181 | void fluid_settings_foreach(fluid_settings_t *settings, void *data,
182 | fluid_settings_foreach_t func);
183 |
184 | #ifdef __cplusplus
185 | }
186 | #endif
187 |
188 | #endif /* _FLUIDSYNTH_SETTINGS_H */
189 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/sfont.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_SFONT_H
22 | #define _FLUIDSYNTH_SFONT_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 |
29 | /**
30 | * @file sfont.h
31 | * @brief SoundFont plugins
32 | *
33 | * It is possible to add new SoundFont loaders to the
34 | * synthesizer. This API allows for virtual SoundFont files to be loaded
35 | * and synthesized, which may not actually be SoundFont files, as long as they
36 | * can be represented by the SoundFont synthesis model.
37 | *
38 | * To add a new SoundFont loader to the synthesizer, call
39 | * fluid_synth_add_sfloader() and pass a pointer to an
40 | * #fluid_sfloader_t instance created by new_fluid_sfloader().
41 | * On creation, you must specify a callback function \p load
42 | * that will be called for every file attempting to load it and
43 | * if successful returns a #fluid_sfont_t instance, or NULL if it fails.
44 | *
45 | * The #fluid_sfont_t structure contains a callback to obtain the
46 | * name of the SoundFont. It contains two functions to iterate
47 | * though the contained presets, and one function to obtain a
48 | * preset corresponding to a bank and preset number. This
49 | * function should return a #fluid_preset_t instance.
50 | *
51 | * The #fluid_preset_t instance contains some functions to obtain
52 | * information from the preset (name, bank, number). The most
53 | * important callback is the noteon function. The noteon function
54 | * is called by fluidsynth internally and
55 | * should call fluid_synth_alloc_voice() for every sample that has
56 | * to be played. fluid_synth_alloc_voice() expects a pointer to a
57 | * #fluid_sample_t instance and returns a pointer to the opaque
58 | * #fluid_voice_t structure. To set or increment the values of a
59 | * generator, use fluid_voice_gen_set() or fluid_voice_gen_incr(). When you are
60 | * finished initializing the voice call fluid_voice_start() to
61 | * start playing the synthesis voice.
62 | */
63 |
64 | /**
65 | * Some notification enums for presets and samples.
66 | */
67 | enum
68 | {
69 | FLUID_PRESET_SELECTED, /**< Preset selected notify */
70 | FLUID_PRESET_UNSELECTED, /**< Preset unselected notify */
71 | FLUID_SAMPLE_DONE /**< Sample no longer needed notify */
72 | };
73 |
74 | /**
75 | * Indicates the type of a sample used by the _fluid_sample_t::sampletype field.
76 | * This enum corresponds to the \c SFSampleLink enum in the SoundFont spec.
77 | * One \c flag may be bit-wise OR-ed with one \c value.
78 | */
79 | enum fluid_sample_type
80 | {
81 | FLUID_SAMPLETYPE_MONO = 0x1, /**< Value used for mono samples */
82 | FLUID_SAMPLETYPE_RIGHT = 0x2, /**< Value used for right samples of a stereo pair */
83 | FLUID_SAMPLETYPE_LEFT = 0x4, /**< Value used for left samples of a stereo pair */
84 | FLUID_SAMPLETYPE_LINKED = 0x8, /**< Value used for linked sample, which is currently not supported */
85 | FLUID_SAMPLETYPE_OGG_VORBIS = 0x10, /**< Flag used for Ogg Vorbis compressed samples (non-standard compliant extension) as found in the program "sftools" developed by Werner Schweer from MuseScore @since 1.1.7 */
86 | FLUID_SAMPLETYPE_ROM = 0x8000 /**< Flag that indicates ROM samples, causing the sample to be ignored */
87 | };
88 |
89 |
90 | /**
91 | * Method to load an instrument file (does not actually need to be a real file name,
92 | * could be another type of string identifier that the \a loader understands).
93 | * @param loader SoundFont loader
94 | * @param filename File name or other string identifier
95 | * @return The loaded instrument file (SoundFont) or NULL if an error occurred.
96 | */
97 | typedef fluid_sfont_t *(*fluid_sfloader_load_t)(fluid_sfloader_t *loader, const char *filename);
98 |
99 | /**
100 | * The free method should free the memory allocated for a fluid_sfloader_t instance in
101 | * addition to any private data. Any custom user provided cleanup function must ultimately call
102 | * delete_fluid_sfloader() to ensure proper cleanup of the #fluid_sfloader_t struct. If no private data
103 | * needs to be freed, setting this to delete_fluid_sfloader() is sufficient.
104 | * @param loader SoundFont loader
105 | */
106 | typedef void (*fluid_sfloader_free_t)(fluid_sfloader_t *loader);
107 |
108 |
109 | FLUIDSYNTH_API fluid_sfloader_t *new_fluid_sfloader(fluid_sfloader_load_t load, fluid_sfloader_free_t free);
110 | FLUIDSYNTH_API void delete_fluid_sfloader(fluid_sfloader_t *loader);
111 |
112 | FLUIDSYNTH_API fluid_sfloader_t *new_fluid_defsfloader(fluid_settings_t *settings);
113 |
114 | /**
115 | * Opens the file or memory indicated by \c filename in binary read mode.
116 | * \c filename matches the string provided during the fluid_synth_sfload() call.
117 | *
118 | * @return returns a file handle on success, NULL otherwise
119 | */
120 | typedef void *(* fluid_sfloader_callback_open_t)(const char *filename);
121 |
122 | /**
123 | * Reads \c count bytes to the specified buffer \c buf.
124 | *
125 | * @return returns #FLUID_OK if exactly \c count bytes were successfully read, else returns #FLUID_FAILED and leaves \a buf unmodified.
126 | */
127 | typedef int (* fluid_sfloader_callback_read_t)(void *buf, int count, void *handle);
128 |
129 | /**
130 | * Same purpose and behaviour as fseek.
131 | *
132 | * @param origin either \c SEEK_SET, \c SEEK_CUR or \c SEEK_END
133 | *
134 | * @return returns #FLUID_OK if the seek was successfully performed while not seeking beyond a buffer or file, #FLUID_FAILED otherwise
135 | */
136 | typedef int (* fluid_sfloader_callback_seek_t)(void *handle, long offset, int origin);
137 |
138 | /**
139 | * Closes the handle returned by #fluid_sfloader_callback_open_t and frees used resources.
140 | *
141 | * @return returns #FLUID_OK on success, #FLUID_FAILED on error
142 | */
143 | typedef int (* fluid_sfloader_callback_close_t)(void *handle);
144 |
145 | /** @return returns current file offset or #FLUID_FAILED on error */
146 | typedef long (* fluid_sfloader_callback_tell_t)(void *handle);
147 |
148 |
149 | FLUIDSYNTH_API int fluid_sfloader_set_callbacks(fluid_sfloader_t *loader,
150 | fluid_sfloader_callback_open_t open,
151 | fluid_sfloader_callback_read_t read,
152 | fluid_sfloader_callback_seek_t seek,
153 | fluid_sfloader_callback_tell_t tell,
154 | fluid_sfloader_callback_close_t close);
155 |
156 | FLUIDSYNTH_API int fluid_sfloader_set_data(fluid_sfloader_t *loader, void *data);
157 | FLUIDSYNTH_API void *fluid_sfloader_get_data(fluid_sfloader_t *loader);
158 |
159 |
160 |
161 | /**
162 | * Method to return the name of a virtual SoundFont.
163 | * @param sfont Virtual SoundFont
164 | * @return The name of the virtual SoundFont.
165 | */
166 | typedef const char *(*fluid_sfont_get_name_t)(fluid_sfont_t *sfont);
167 |
168 | /**
169 | * Get a virtual SoundFont preset by bank and program numbers.
170 | * @param sfont Virtual SoundFont
171 | * @param bank MIDI bank number (0-16383)
172 | * @param prenum MIDI preset number (0-127)
173 | * @return Should return an allocated virtual preset or NULL if it could not
174 | * be found.
175 | */
176 | typedef fluid_preset_t *(*fluid_sfont_get_preset_t)(fluid_sfont_t *sfont, int bank, int prenum);
177 |
178 | /**
179 | * Start virtual SoundFont preset iteration method.
180 | * @param sfont Virtual SoundFont
181 | *
182 | * Starts/re-starts virtual preset iteration in a SoundFont.
183 | */
184 | typedef void (*fluid_sfont_iteration_start_t)(fluid_sfont_t *sfont);
185 |
186 | /**
187 | * Virtual SoundFont preset iteration function.
188 | * @param sfont Virtual SoundFont
189 | * @return NULL when no more presets are available, otherwise the a pointer to the current preset
190 | *
191 | * Returns preset information to the caller. The returned buffer is only valid until a subsequent
192 | * call to this function.
193 | */
194 | typedef fluid_preset_t *(*fluid_sfont_iteration_next_t)(fluid_sfont_t *sfont);
195 |
196 | /**
197 | * Method to free a virtual SoundFont bank. Any custom user provided cleanup function must ultimately call
198 | * delete_fluid_sfont() to ensure proper cleanup of the #fluid_sfont_t struct. If no private data
199 | * needs to be freed, setting this to delete_fluid_sfont() is sufficient.
200 | * @param sfont Virtual SoundFont to free.
201 | * @return Should return 0 when it was able to free all resources or non-zero
202 | * if some of the samples could not be freed because they are still in use,
203 | * in which case the free will be tried again later, until success.
204 | */
205 | typedef int (*fluid_sfont_free_t)(fluid_sfont_t *sfont);
206 |
207 |
208 | FLUIDSYNTH_API fluid_sfont_t *new_fluid_sfont(fluid_sfont_get_name_t get_name,
209 | fluid_sfont_get_preset_t get_preset,
210 | fluid_sfont_iteration_start_t iter_start,
211 | fluid_sfont_iteration_next_t iter_next,
212 | fluid_sfont_free_t free);
213 |
214 | FLUIDSYNTH_API int delete_fluid_sfont(fluid_sfont_t *sfont);
215 |
216 | FLUIDSYNTH_API int fluid_sfont_set_data(fluid_sfont_t *sfont, void *data);
217 | FLUIDSYNTH_API void *fluid_sfont_get_data(fluid_sfont_t *sfont);
218 |
219 | FLUIDSYNTH_API int fluid_sfont_get_id(fluid_sfont_t *sfont);
220 | FLUIDSYNTH_API const char *fluid_sfont_get_name(fluid_sfont_t *sfont);
221 | FLUIDSYNTH_API fluid_preset_t *fluid_sfont_get_preset(fluid_sfont_t *sfont, int bank, int prenum);
222 | FLUIDSYNTH_API void fluid_sfont_iteration_start(fluid_sfont_t *sfont);
223 | FLUIDSYNTH_API fluid_preset_t *fluid_sfont_iteration_next(fluid_sfont_t *sfont);
224 |
225 | /**
226 | * Method to get a virtual SoundFont preset name.
227 | * @param preset Virtual SoundFont preset
228 | * @return Should return the name of the preset. The returned string must be
229 | * valid for the duration of the virtual preset (or the duration of the
230 | * SoundFont, in the case of preset iteration).
231 | */
232 | typedef const char *(*fluid_preset_get_name_t)(fluid_preset_t *preset);
233 |
234 | /**
235 | * Method to get a virtual SoundFont preset MIDI bank number.
236 | * @param preset Virtual SoundFont preset
237 | * @param return The bank number of the preset
238 | */
239 | typedef int (*fluid_preset_get_banknum_t)(fluid_preset_t *preset);
240 |
241 | /**
242 | * Method to get a virtual SoundFont preset MIDI program number.
243 | * @param preset Virtual SoundFont preset
244 | * @param return The program number of the preset
245 | */
246 | typedef int (*fluid_preset_get_num_t)(fluid_preset_t *preset);
247 |
248 | /**
249 | * Method to handle a noteon event (synthesize the instrument).
250 | * @param preset Virtual SoundFont preset
251 | * @param synth Synthesizer instance
252 | * @param chan MIDI channel number of the note on event
253 | * @param key MIDI note number (0-127)
254 | * @param vel MIDI velocity (0-127)
255 | * @return #FLUID_OK on success (0) or #FLUID_FAILED (-1) otherwise
256 | *
257 | * This method may be called from within synthesis context and therefore
258 | * should be as efficient as possible and not perform any operations considered
259 | * bad for realtime audio output (memory allocations and other OS calls).
260 | *
261 | * Call fluid_synth_alloc_voice() for every sample that has
262 | * to be played. fluid_synth_alloc_voice() expects a pointer to a
263 | * #fluid_sample_t structure and returns a pointer to the opaque
264 | * #fluid_voice_t structure. To set or increment the values of a
265 | * generator, use fluid_voice_gen_set() or fluid_voice_gen_incr(). When you are
266 | * finished initializing the voice call fluid_voice_start() to
267 | * start playing the synthesis voice. Starting with FluidSynth 1.1.0 all voices
268 | * created will be started at the same time.
269 | */
270 | typedef int (*fluid_preset_noteon_t)(fluid_preset_t *preset, fluid_synth_t *synth, int chan, int key, int vel);
271 |
272 | /**
273 | * Method to free a virtual SoundFont preset. Any custom user provided cleanup function must ultimately call
274 | * delete_fluid_preset() to ensure proper cleanup of the #fluid_preset_t struct. If no private data
275 | * needs to be freed, setting this to delete_fluid_preset() is sufficient.
276 | * @param preset Virtual SoundFont preset
277 | * @return Should return 0
278 | */
279 | typedef void (*fluid_preset_free_t)(fluid_preset_t *preset);
280 |
281 | FLUIDSYNTH_API fluid_preset_t *new_fluid_preset(fluid_sfont_t *parent_sfont,
282 | fluid_preset_get_name_t get_name,
283 | fluid_preset_get_banknum_t get_bank,
284 | fluid_preset_get_num_t get_num,
285 | fluid_preset_noteon_t noteon,
286 | fluid_preset_free_t free);
287 | FLUIDSYNTH_API void delete_fluid_preset(fluid_preset_t *preset);
288 |
289 | FLUIDSYNTH_API int fluid_preset_set_data(fluid_preset_t *preset, void *data);
290 | FLUIDSYNTH_API void *fluid_preset_get_data(fluid_preset_t *preset);
291 |
292 | FLUIDSYNTH_API const char *fluid_preset_get_name(fluid_preset_t *preset);
293 | FLUIDSYNTH_API int fluid_preset_get_banknum(fluid_preset_t *preset);
294 | FLUIDSYNTH_API int fluid_preset_get_num(fluid_preset_t *preset);
295 | FLUIDSYNTH_API fluid_sfont_t *fluid_preset_get_sfont(fluid_preset_t *preset);
296 |
297 | FLUIDSYNTH_API fluid_sample_t *new_fluid_sample(void);
298 | FLUIDSYNTH_API void delete_fluid_sample(fluid_sample_t *sample);
299 | FLUIDSYNTH_API size_t fluid_sample_sizeof(void);
300 |
301 | FLUIDSYNTH_API int fluid_sample_set_name(fluid_sample_t *sample, const char *name);
302 | FLUIDSYNTH_API int fluid_sample_set_sound_data(fluid_sample_t *sample,
303 | short *data,
304 | char *data24,
305 | unsigned int nbframes,
306 | unsigned int sample_rate,
307 | short copy_data);
308 |
309 | FLUIDSYNTH_API int fluid_sample_set_loop(fluid_sample_t *sample, unsigned int loop_start, unsigned int loop_end);
310 | FLUIDSYNTH_API int fluid_sample_set_pitch(fluid_sample_t *sample, int root_key, int fine_tune);
311 |
312 | #ifdef __cplusplus
313 | }
314 | #endif
315 |
316 | #endif /* _FLUIDSYNTH_SFONT_H */
317 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/shell.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_SHELL_H
22 | #define _FLUIDSYNTH_SHELL_H
23 |
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 |
30 | /**
31 | * @file shell.h
32 | * @brief Command shell interface
33 | *
34 | * The shell interface allows you to send simple textual commands to
35 | * the synthesizer, to parse a command file, or to read commands
36 | * from the stdin or other input streams.
37 | */
38 |
39 | FLUIDSYNTH_API fluid_istream_t fluid_get_stdin(void);
40 | FLUIDSYNTH_API fluid_ostream_t fluid_get_stdout(void);
41 |
42 | FLUIDSYNTH_API char *fluid_get_userconf(char *buf, int len);
43 | FLUIDSYNTH_API char *fluid_get_sysconf(char *buf, int len);
44 |
45 |
46 | /* The command handler */
47 |
48 | FLUIDSYNTH_API
49 | fluid_cmd_handler_t *new_fluid_cmd_handler(fluid_synth_t *synth, fluid_midi_router_t *router);
50 |
51 | FLUIDSYNTH_API
52 | void delete_fluid_cmd_handler(fluid_cmd_handler_t *handler);
53 |
54 | FLUIDSYNTH_API
55 | void fluid_cmd_handler_set_synth(fluid_cmd_handler_t *handler, fluid_synth_t *synth);
56 |
57 |
58 |
59 | /* Command function */
60 |
61 | FLUIDSYNTH_API
62 | int fluid_command(fluid_cmd_handler_t *handler, const char *cmd, fluid_ostream_t out);
63 |
64 | FLUIDSYNTH_API
65 | int fluid_source(fluid_cmd_handler_t *handler, const char *filename);
66 |
67 | FLUIDSYNTH_API
68 | void fluid_usershell(fluid_settings_t *settings, fluid_cmd_handler_t *handler);
69 |
70 |
71 | /* Shell */
72 |
73 | FLUIDSYNTH_API
74 | fluid_shell_t *new_fluid_shell(fluid_settings_t *settings, fluid_cmd_handler_t *handler,
75 | fluid_istream_t in, fluid_ostream_t out, int thread);
76 |
77 | FLUIDSYNTH_API void delete_fluid_shell(fluid_shell_t *shell);
78 |
79 |
80 |
81 | /* TCP/IP server */
82 |
83 |
84 | FLUIDSYNTH_API
85 | fluid_server_t *new_fluid_server(fluid_settings_t *settings,
86 | fluid_synth_t *synth, fluid_midi_router_t *router);
87 |
88 | FLUIDSYNTH_API void delete_fluid_server(fluid_server_t *server);
89 |
90 | FLUIDSYNTH_API int fluid_server_join(fluid_server_t *server);
91 |
92 |
93 | #ifdef __cplusplus
94 | }
95 | #endif
96 |
97 | #endif /* _FLUIDSYNTH_SHELL_H */
98 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/synth.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_SYNTH_H
22 | #define _FLUIDSYNTH_SYNTH_H
23 |
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 |
30 | /**
31 | * @file synth.h
32 | * @brief Embeddable SoundFont synthesizer
33 | *
34 | * You create a new synthesizer with new_fluid_synth() and you destroy
35 | * it with delete_fluid_synth(). Use the fluid_settings_t structure to specify
36 | * the synthesizer characteristics.
37 | *
38 | * You have to load a SoundFont in order to hear any sound. For that
39 | * you use the fluid_synth_sfload() function.
40 | *
41 | * You can use the audio driver functions to open
42 | * the audio device and create a background audio thread.
43 | *
44 | * The API for sending MIDI events is probably what you expect:
45 | * fluid_synth_noteon(), fluid_synth_noteoff(), ...
46 | */
47 |
48 |
49 | FLUIDSYNTH_API fluid_synth_t *new_fluid_synth(fluid_settings_t *settings);
50 | FLUIDSYNTH_API void delete_fluid_synth(fluid_synth_t *synth);
51 | FLUIDSYNTH_API fluid_settings_t *fluid_synth_get_settings(fluid_synth_t *synth);
52 |
53 | /* MIDI channel messages */
54 |
55 | FLUIDSYNTH_API int fluid_synth_noteon(fluid_synth_t *synth, int chan, int key, int vel);
56 | FLUIDSYNTH_API int fluid_synth_noteoff(fluid_synth_t *synth, int chan, int key);
57 | FLUIDSYNTH_API int fluid_synth_cc(fluid_synth_t *synth, int chan, int ctrl, int val);
58 | FLUIDSYNTH_API int fluid_synth_get_cc(fluid_synth_t *synth, int chan, int ctrl, int *pval);
59 | FLUIDSYNTH_API int fluid_synth_sysex(fluid_synth_t *synth, const char *data, int len,
60 | char *response, int *response_len, int *handled, int dryrun);
61 | FLUIDSYNTH_API int fluid_synth_pitch_bend(fluid_synth_t *synth, int chan, int val);
62 | FLUIDSYNTH_API int fluid_synth_get_pitch_bend(fluid_synth_t *synth, int chan, int *ppitch_bend);
63 | FLUIDSYNTH_API int fluid_synth_pitch_wheel_sens(fluid_synth_t *synth, int chan, int val);
64 | FLUIDSYNTH_API int fluid_synth_get_pitch_wheel_sens(fluid_synth_t *synth, int chan, int *pval);
65 | FLUIDSYNTH_API int fluid_synth_program_change(fluid_synth_t *synth, int chan, int program);
66 | FLUIDSYNTH_API int fluid_synth_channel_pressure(fluid_synth_t *synth, int chan, int val);
67 | FLUIDSYNTH_API int fluid_synth_key_pressure(fluid_synth_t *synth, int chan, int key, int val);
68 | FLUIDSYNTH_API int fluid_synth_bank_select(fluid_synth_t *synth, int chan, int bank);
69 | FLUIDSYNTH_API int fluid_synth_sfont_select(fluid_synth_t *synth, int chan, int sfont_id);
70 | FLUIDSYNTH_API
71 | int fluid_synth_program_select(fluid_synth_t *synth, int chan, int sfont_id,
72 | int bank_num, int preset_num);
73 | FLUIDSYNTH_API int
74 | fluid_synth_program_select_by_sfont_name(fluid_synth_t *synth, int chan,
75 | const char *sfont_name, int bank_num,
76 | int preset_num);
77 | FLUIDSYNTH_API
78 | int fluid_synth_get_program(fluid_synth_t *synth, int chan, int *sfont_id,
79 | int *bank_num, int *preset_num);
80 | FLUIDSYNTH_API int fluid_synth_unset_program(fluid_synth_t *synth, int chan);
81 | FLUIDSYNTH_API int fluid_synth_program_reset(fluid_synth_t *synth);
82 | FLUIDSYNTH_API int fluid_synth_system_reset(fluid_synth_t *synth);
83 |
84 | FLUIDSYNTH_API int fluid_synth_all_notes_off(fluid_synth_t *synth, int chan);
85 | FLUIDSYNTH_API int fluid_synth_all_sounds_off(fluid_synth_t *synth, int chan);
86 |
87 | /**
88 | * The midi channel type used by fluid_synth_set_channel_type()
89 | */
90 | enum fluid_midi_channel_type
91 | {
92 | CHANNEL_TYPE_MELODIC = 0, /**< Melodic midi channel */
93 | CHANNEL_TYPE_DRUM = 1 /**< Drum midi channel */
94 | };
95 |
96 | FLUIDSYNTH_API int fluid_synth_set_channel_type(fluid_synth_t *synth, int chan, int type);
97 |
98 |
99 | /* Low level access */
100 | FLUIDSYNTH_API fluid_preset_t *fluid_synth_get_channel_preset(fluid_synth_t *synth, int chan);
101 | FLUIDSYNTH_API int fluid_synth_start(fluid_synth_t *synth, unsigned int id,
102 | fluid_preset_t *preset, int audio_chan,
103 | int midi_chan, int key, int vel);
104 | FLUIDSYNTH_API int fluid_synth_stop(fluid_synth_t *synth, unsigned int id);
105 |
106 |
107 | /* SoundFont management */
108 |
109 | FLUIDSYNTH_API
110 | int fluid_synth_sfload(fluid_synth_t *synth, const char *filename, int reset_presets);
111 | FLUIDSYNTH_API int fluid_synth_sfreload(fluid_synth_t *synth, int id);
112 | FLUIDSYNTH_API int fluid_synth_sfunload(fluid_synth_t *synth, int id, int reset_presets);
113 | FLUIDSYNTH_API int fluid_synth_add_sfont(fluid_synth_t *synth, fluid_sfont_t *sfont);
114 | FLUIDSYNTH_API int fluid_synth_remove_sfont(fluid_synth_t *synth, fluid_sfont_t *sfont);
115 | FLUIDSYNTH_API int fluid_synth_sfcount(fluid_synth_t *synth);
116 | FLUIDSYNTH_API fluid_sfont_t *fluid_synth_get_sfont(fluid_synth_t *synth, unsigned int num);
117 | FLUIDSYNTH_API fluid_sfont_t *fluid_synth_get_sfont_by_id(fluid_synth_t *synth, int id);
118 | FLUIDSYNTH_API fluid_sfont_t *fluid_synth_get_sfont_by_name(fluid_synth_t *synth,
119 | const char *name);
120 | FLUIDSYNTH_API int fluid_synth_set_bank_offset(fluid_synth_t *synth, int sfont_id, int offset);
121 | FLUIDSYNTH_API int fluid_synth_get_bank_offset(fluid_synth_t *synth, int sfont_id);
122 |
123 |
124 | /* Reverb */
125 |
126 |
127 | FLUIDSYNTH_API int fluid_synth_set_reverb(fluid_synth_t *synth, double roomsize,
128 | double damping, double width, double level);
129 | FLUIDSYNTH_API int fluid_synth_set_reverb_roomsize(fluid_synth_t *synth, double roomsize);
130 | FLUIDSYNTH_API int fluid_synth_set_reverb_damp(fluid_synth_t *synth, double damping);
131 | FLUIDSYNTH_API int fluid_synth_set_reverb_width(fluid_synth_t *synth, double width);
132 | FLUIDSYNTH_API int fluid_synth_set_reverb_level(fluid_synth_t *synth, double level);
133 |
134 | FLUIDSYNTH_API void fluid_synth_set_reverb_on(fluid_synth_t *synth, int on);
135 | FLUIDSYNTH_API double fluid_synth_get_reverb_roomsize(fluid_synth_t *synth);
136 | FLUIDSYNTH_API double fluid_synth_get_reverb_damp(fluid_synth_t *synth);
137 | FLUIDSYNTH_API double fluid_synth_get_reverb_level(fluid_synth_t *synth);
138 | FLUIDSYNTH_API double fluid_synth_get_reverb_width(fluid_synth_t *synth);
139 |
140 |
141 | /* Chorus */
142 |
143 | /**
144 | * Chorus modulation waveform type.
145 | */
146 | enum fluid_chorus_mod
147 | {
148 | FLUID_CHORUS_MOD_SINE = 0, /**< Sine wave chorus modulation */
149 | FLUID_CHORUS_MOD_TRIANGLE = 1 /**< Triangle wave chorus modulation */
150 | };
151 |
152 | FLUIDSYNTH_API int fluid_synth_set_chorus(fluid_synth_t *synth, int nr, double level,
153 | double speed, double depth_ms, int type);
154 | FLUIDSYNTH_API int fluid_synth_set_chorus_nr(fluid_synth_t *synth, int nr);
155 | FLUIDSYNTH_API int fluid_synth_set_chorus_level(fluid_synth_t *synth, double level);
156 | FLUIDSYNTH_API int fluid_synth_set_chorus_speed(fluid_synth_t *synth, double speed);
157 | FLUIDSYNTH_API int fluid_synth_set_chorus_depth(fluid_synth_t *synth, double depth_ms);
158 | FLUIDSYNTH_API int fluid_synth_set_chorus_type(fluid_synth_t *synth, int type);
159 |
160 | FLUIDSYNTH_API void fluid_synth_set_chorus_on(fluid_synth_t *synth, int on);
161 | FLUIDSYNTH_API int fluid_synth_get_chorus_nr(fluid_synth_t *synth);
162 | FLUIDSYNTH_API double fluid_synth_get_chorus_level(fluid_synth_t *synth);
163 | FLUIDSYNTH_API double fluid_synth_get_chorus_speed(fluid_synth_t *synth);
164 | FLUIDSYNTH_API double fluid_synth_get_chorus_depth(fluid_synth_t *synth);
165 | FLUIDSYNTH_API int fluid_synth_get_chorus_type(fluid_synth_t *synth); /* see fluid_chorus_mod */
166 |
167 |
168 | /* Audio and MIDI channels */
169 |
170 | FLUIDSYNTH_API int fluid_synth_count_midi_channels(fluid_synth_t *synth);
171 | FLUIDSYNTH_API int fluid_synth_count_audio_channels(fluid_synth_t *synth);
172 | FLUIDSYNTH_API int fluid_synth_count_audio_groups(fluid_synth_t *synth);
173 | FLUIDSYNTH_API int fluid_synth_count_effects_channels(fluid_synth_t *synth);
174 | FLUIDSYNTH_API int fluid_synth_count_effects_groups(fluid_synth_t *synth);
175 |
176 |
177 | /* Synthesis parameters */
178 |
179 | FLUID_DEPRECATED FLUIDSYNTH_API void fluid_synth_set_sample_rate(fluid_synth_t *synth, float sample_rate);
180 | FLUIDSYNTH_API void fluid_synth_set_gain(fluid_synth_t *synth, float gain);
181 | FLUIDSYNTH_API float fluid_synth_get_gain(fluid_synth_t *synth);
182 | FLUIDSYNTH_API int fluid_synth_set_polyphony(fluid_synth_t *synth, int polyphony);
183 | FLUIDSYNTH_API int fluid_synth_get_polyphony(fluid_synth_t *synth);
184 | FLUIDSYNTH_API int fluid_synth_get_active_voice_count(fluid_synth_t *synth);
185 | FLUIDSYNTH_API int fluid_synth_get_internal_bufsize(fluid_synth_t *synth);
186 |
187 | FLUIDSYNTH_API
188 | int fluid_synth_set_interp_method(fluid_synth_t *synth, int chan, int interp_method);
189 |
190 | /**
191 | * Synthesis interpolation method.
192 | */
193 | enum fluid_interp
194 | {
195 | FLUID_INTERP_NONE = 0, /**< No interpolation: Fastest, but questionable audio quality */
196 | FLUID_INTERP_LINEAR = 1, /**< Straight-line interpolation: A bit slower, reasonable audio quality */
197 | FLUID_INTERP_4THORDER = 4, /**< Fourth-order interpolation, good quality, the default */
198 | FLUID_INTERP_7THORDER = 7, /**< Seventh-order interpolation */
199 |
200 | FLUID_INTERP_DEFAULT = FLUID_INTERP_4THORDER, /**< Default interpolation method */
201 | FLUID_INTERP_HIGHEST = FLUID_INTERP_7THORDER, /**< Highest interpolation method */
202 | };
203 |
204 | /* Generator interface */
205 |
206 | FLUIDSYNTH_API int fluid_synth_set_gen(fluid_synth_t *synth, int chan,
207 | int param, float value);
208 | FLUIDSYNTH_API float fluid_synth_get_gen(fluid_synth_t *synth, int chan, int param);
209 |
210 |
211 | /* Tuning */
212 |
213 | FLUIDSYNTH_API
214 | int fluid_synth_activate_key_tuning(fluid_synth_t *synth, int bank, int prog,
215 | const char *name, const double *pitch, int apply);
216 | FLUIDSYNTH_API
217 | int fluid_synth_activate_octave_tuning(fluid_synth_t *synth, int bank, int prog,
218 | const char *name, const double *pitch, int apply);
219 | FLUIDSYNTH_API
220 | int fluid_synth_tune_notes(fluid_synth_t *synth, int bank, int prog,
221 | int len, const int *keys, const double *pitch, int apply);
222 | FLUIDSYNTH_API
223 | int fluid_synth_activate_tuning(fluid_synth_t *synth, int chan, int bank, int prog,
224 | int apply);
225 | FLUIDSYNTH_API
226 | int fluid_synth_deactivate_tuning(fluid_synth_t *synth, int chan, int apply);
227 | FLUIDSYNTH_API void fluid_synth_tuning_iteration_start(fluid_synth_t *synth);
228 | FLUIDSYNTH_API
229 | int fluid_synth_tuning_iteration_next(fluid_synth_t *synth, int *bank, int *prog);
230 | FLUIDSYNTH_API int fluid_synth_tuning_dump(fluid_synth_t *synth, int bank, int prog,
231 | char *name, int len, double *pitch);
232 |
233 | /* Misc */
234 |
235 | FLUIDSYNTH_API double fluid_synth_get_cpu_load(fluid_synth_t *synth);
236 | FLUID_DEPRECATED FLUIDSYNTH_API const char *fluid_synth_error(fluid_synth_t *synth);
237 |
238 |
239 | /* Default modulators */
240 |
241 | /**
242 | * Enum used with fluid_synth_add_default_mod() to specify how to handle duplicate modulators.
243 | */
244 | enum fluid_synth_add_mod
245 | {
246 | FLUID_SYNTH_OVERWRITE, /**< Overwrite any existing matching modulator */
247 | FLUID_SYNTH_ADD, /**< Sum up modulator amounts */
248 | };
249 |
250 | FLUIDSYNTH_API int fluid_synth_add_default_mod(fluid_synth_t *synth, const fluid_mod_t *mod, int mode);
251 | FLUIDSYNTH_API int fluid_synth_remove_default_mod(fluid_synth_t *synth, const fluid_mod_t *mod);
252 |
253 |
254 | /*
255 | * Synthesizer plugin
256 | *
257 | * To create a synthesizer plugin, create the synthesizer as
258 | * explained above. Once the synthesizer is created you can call
259 | * any of the functions below to get the audio.
260 | */
261 |
262 | FLUIDSYNTH_API int fluid_synth_write_s16(fluid_synth_t *synth, int len,
263 | void *lout, int loff, int lincr,
264 | void *rout, int roff, int rincr);
265 | FLUIDSYNTH_API int fluid_synth_write_float(fluid_synth_t *synth, int len,
266 | void *lout, int loff, int lincr,
267 | void *rout, int roff, int rincr);
268 | FLUID_DEPRECATED FLUIDSYNTH_API int fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
269 | float **left, float **right,
270 | float **fx_left, float **fx_right);
271 | FLUIDSYNTH_API int fluid_synth_process(fluid_synth_t *synth, int len,
272 | int nfx, float *fx[],
273 | int nout, float *out[]);
274 |
275 |
276 | /* Synthesizer's interface to handle SoundFont loaders */
277 |
278 | FLUIDSYNTH_API void fluid_synth_add_sfloader(fluid_synth_t *synth, fluid_sfloader_t *loader);
279 | FLUIDSYNTH_API fluid_voice_t *fluid_synth_alloc_voice(fluid_synth_t *synth,
280 | fluid_sample_t *sample,
281 | int channum, int key, int vel);
282 | FLUIDSYNTH_API void fluid_synth_start_voice(fluid_synth_t *synth, fluid_voice_t *voice);
283 | FLUIDSYNTH_API void fluid_synth_get_voicelist(fluid_synth_t *synth,
284 | fluid_voice_t *buf[], int bufsize, int ID);
285 | FLUIDSYNTH_API int fluid_synth_handle_midi_event(void *data, fluid_midi_event_t *event);
286 |
287 | /**
288 | * Specifies the type of filter to use for the custom IIR filter
289 | */
290 | enum fluid_iir_filter_type
291 | {
292 | FLUID_IIR_DISABLED = 0, /**< Custom IIR filter is not operating */
293 | FLUID_IIR_LOWPASS, /**< Custom IIR filter is operating as low-pass filter */
294 | FLUID_IIR_HIGHPASS, /**< Custom IIR filter is operating as high-pass filter */
295 | FLUID_IIR_LAST /**< @internal Value defines the count of filter types (#fluid_iir_filter_type) @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
296 | };
297 |
298 | /**
299 | * Specifies optional settings to use for the custom IIR filter. Can be bitwise ORed.
300 | */
301 | enum fluid_iir_filter_flags
302 | {
303 | FLUID_IIR_Q_LINEAR = 1 << 0, /**< The Soundfont spec requires the filter Q to be interpreted in dB. If this flag is set the filter Q is instead assumed to be in a linear range */
304 | FLUID_IIR_Q_ZERO_OFF = 1 << 1, /**< If this flag the filter is switched off if Q == 0 (prior to any transformation) */
305 | FLUID_IIR_NO_GAIN_AMP = 1 << 2 /**< The Soundfont spec requires to correct the gain of the filter depending on the filter's Q. If this flag is set the filter gain will not be corrected. */
306 | };
307 |
308 | FLUIDSYNTH_API int fluid_synth_set_custom_filter(fluid_synth_t *, int type, int flags);
309 |
310 |
311 | /* LADSPA */
312 |
313 | FLUIDSYNTH_API fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth);
314 |
315 |
316 | /* API: Poly mono mode */
317 |
318 | /** Interface to poly/mono mode variables
319 | *
320 | * Channel mode bits OR-ed together so that it matches with the midi spec: poly omnion (0), mono omnion (1), poly omnioff (2), mono omnioff (3)
321 | */
322 | enum fluid_channel_mode_flags
323 | {
324 | FLUID_CHANNEL_POLY_OFF = 0x01, /**< if flag is set, the basic channel is in mono on state, if not set poly is on */
325 | FLUID_CHANNEL_OMNI_OFF = 0x02, /**< if flag is set, the basic channel is in omni off state, if not set omni is on */
326 | };
327 |
328 | /** Indicates the breath mode a channel is set to */
329 | enum fluid_channel_breath_flags
330 | {
331 | FLUID_CHANNEL_BREATH_POLY = 0x10, /**< when channel is poly, this flag indicates that the default velocity to initial attenuation modulator is replaced by a breath to initial attenuation modulator */
332 | FLUID_CHANNEL_BREATH_MONO = 0x20, /**< when channel is mono, this flag indicates that the default velocity to initial attenuation modulator is replaced by a breath modulator */
333 | FLUID_CHANNEL_BREATH_SYNC = 0x40, /**< when channel is mono, this flag indicates that the breath controller(MSB)triggers noteon/noteoff on the running note */
334 | };
335 |
336 | /** Indicates the mode a basic channel is set to */
337 | enum fluid_basic_channel_modes
338 | {
339 | FLUID_CHANNEL_MODE_MASK = (FLUID_CHANNEL_OMNI_OFF | FLUID_CHANNEL_POLY_OFF), /**< Mask Poly and Omni bits of #fluid_channel_mode_flags, usually only used internally */
340 | FLUID_CHANNEL_MODE_OMNION_POLY = FLUID_CHANNEL_MODE_MASK & (~FLUID_CHANNEL_OMNI_OFF & ~FLUID_CHANNEL_POLY_OFF), /**< corresponds to MIDI mode 0 */
341 | FLUID_CHANNEL_MODE_OMNION_MONO = FLUID_CHANNEL_MODE_MASK & (~FLUID_CHANNEL_OMNI_OFF & FLUID_CHANNEL_POLY_OFF), /**< corresponds to MIDI mode 1 */
342 | FLUID_CHANNEL_MODE_OMNIOFF_POLY = FLUID_CHANNEL_MODE_MASK & (FLUID_CHANNEL_OMNI_OFF & ~FLUID_CHANNEL_POLY_OFF), /**< corresponds to MIDI mode 2 */
343 | FLUID_CHANNEL_MODE_OMNIOFF_MONO = FLUID_CHANNEL_MODE_MASK & (FLUID_CHANNEL_OMNI_OFF | FLUID_CHANNEL_POLY_OFF), /**< corresponds to MIDI mode 3 */
344 | FLUID_CHANNEL_MODE_LAST /**< @internal Value defines the count of basic channel modes (#fluid_basic_channel_modes) @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
345 | };
346 |
347 | FLUIDSYNTH_API int fluid_synth_reset_basic_channel(fluid_synth_t *synth, int chan);
348 |
349 | FLUIDSYNTH_API int fluid_synth_get_basic_channel(fluid_synth_t *synth, int chan,
350 | int *basic_chan_out,
351 | int *mode_chan_out,
352 | int *basic_val_out);
353 | FLUIDSYNTH_API int fluid_synth_set_basic_channel(fluid_synth_t *synth, int chan, int mode, int val);
354 |
355 | /** Interface to mono legato mode
356 | *
357 | * Indicates the legato mode a channel is set to
358 | * n1,n2,n3,.. is a legato passage. n1 is the first note, and n2,n3,n4 are played legato with previous note. */
359 | enum fluid_channel_legato_mode
360 | {
361 | FLUID_CHANNEL_LEGATO_MODE_RETRIGGER, /**< Mode 0 - Release previous note, start a new note */
362 | FLUID_CHANNEL_LEGATO_MODE_MULTI_RETRIGGER, /**< Mode 1 - On contiguous notes retrigger in attack section using current value, shape attack using current dynamic and make use of previous voices if any */
363 | FLUID_CHANNEL_LEGATO_MODE_LAST /**< @internal Value defines the count of legato modes (#fluid_channel_legato_mode) @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
364 | };
365 |
366 | FLUIDSYNTH_API int fluid_synth_set_legato_mode(fluid_synth_t *synth, int chan, int legatomode);
367 | FLUIDSYNTH_API int fluid_synth_get_legato_mode(fluid_synth_t *synth, int chan, int *legatomode);
368 |
369 | /** Interface to portamento mode
370 | *
371 | * Indicates the portamento mode a channel is set to
372 | */
373 | enum fluid_channel_portamento_mode
374 | {
375 | FLUID_CHANNEL_PORTAMENTO_MODE_EACH_NOTE, /**< Mode 0 - Portamento on each note (staccato or legato) */
376 | FLUID_CHANNEL_PORTAMENTO_MODE_LEGATO_ONLY, /**< Mode 1 - Portamento only on legato note */
377 | FLUID_CHANNEL_PORTAMENTO_MODE_STACCATO_ONLY, /**< Mode 2 - Portamento only on staccato note */
378 | FLUID_CHANNEL_PORTAMENTO_MODE_LAST /**< @internal Value defines the count of portamento modes (#fluid_channel_portamento_mode) @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
379 | };
380 |
381 | FLUIDSYNTH_API int fluid_synth_set_portamento_mode(fluid_synth_t *synth,
382 | int chan, int portamentomode);
383 | FLUIDSYNTH_API int fluid_synth_get_portamento_mode(fluid_synth_t *synth,
384 | int chan, int *portamentomode);
385 |
386 | /* Interface to breath mode */
387 | FLUIDSYNTH_API int fluid_synth_set_breath_mode(fluid_synth_t *synth,
388 | int chan, int breathmode);
389 | FLUIDSYNTH_API int fluid_synth_get_breath_mode(fluid_synth_t *synth,
390 | int chan, int *breathmode);
391 |
392 |
393 | #ifdef __cplusplus
394 | }
395 | #endif
396 |
397 | #endif /* _FLUIDSYNTH_SYNTH_H */
398 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/types.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_TYPES_H
22 | #define _FLUIDSYNTH_TYPES_H
23 |
24 |
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 |
31 | /**
32 | * @file types.h
33 | * @brief Type declarations
34 | */
35 |
36 | typedef struct _fluid_hashtable_t fluid_settings_t; /**< Configuration settings instance */
37 | typedef struct _fluid_synth_t fluid_synth_t; /**< Synthesizer instance */
38 | typedef struct _fluid_voice_t fluid_voice_t; /**< Synthesis voice instance */
39 | typedef struct _fluid_sfloader_t fluid_sfloader_t; /**< SoundFont loader plugin */
40 | typedef struct _fluid_sfont_t fluid_sfont_t; /**< SoundFont */
41 | typedef struct _fluid_preset_t fluid_preset_t; /**< SoundFont preset */
42 | typedef struct _fluid_sample_t fluid_sample_t; /**< SoundFont sample */
43 | typedef struct _fluid_mod_t fluid_mod_t; /**< SoundFont modulator */
44 | typedef struct _fluid_audio_driver_t fluid_audio_driver_t; /**< Audio driver instance */
45 | typedef struct _fluid_file_renderer_t fluid_file_renderer_t; /**< Audio file renderer instance */
46 | typedef struct _fluid_player_t fluid_player_t; /**< MIDI player instance */
47 | typedef struct _fluid_midi_event_t fluid_midi_event_t; /**< MIDI event */
48 | typedef struct _fluid_midi_driver_t fluid_midi_driver_t; /**< MIDI driver instance */
49 | typedef struct _fluid_midi_router_t fluid_midi_router_t; /**< MIDI router instance */
50 | typedef struct _fluid_midi_router_rule_t fluid_midi_router_rule_t; /**< MIDI router rule */
51 | typedef struct _fluid_hashtable_t fluid_cmd_hash_t; /**< Command handler hash table */
52 | typedef struct _fluid_shell_t fluid_shell_t; /**< Command shell */
53 | typedef struct _fluid_server_t fluid_server_t; /**< TCP/IP shell server instance */
54 | typedef struct _fluid_event_t fluid_event_t; /**< Sequencer event */
55 | typedef struct _fluid_sequencer_t fluid_sequencer_t; /**< Sequencer instance */
56 | typedef struct _fluid_ramsfont_t fluid_ramsfont_t; /**< RAM SoundFont */
57 | typedef struct _fluid_rampreset_t fluid_rampreset_t; /**< RAM SoundFont preset */
58 | typedef struct _fluid_cmd_handler_t fluid_cmd_handler_t; /**< Shell Command Handler */
59 | typedef struct _fluid_ladspa_fx_t fluid_ladspa_fx_t; /**< LADSPA effects instance */
60 | typedef struct _fluid_file_callbacks_t fluid_file_callbacks_t; /**< Callback struct to perform custom file loading of soundfonts */
61 |
62 | typedef int fluid_istream_t; /**< Input stream descriptor */
63 | typedef int fluid_ostream_t; /**< Output stream descriptor */
64 |
65 | typedef short fluid_seq_id_t; /**< Unique client IDs used by the sequencer and #fluid_event_t, obtained by fluid_sequencer_register_client() and fluid_sequencer_register_fluidsynth() */
66 |
67 | #ifdef __cplusplus
68 | }
69 | #endif
70 |
71 | #endif /* _FLUIDSYNTH_TYPES_H */
72 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/version.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_VERSION_H
22 | #define _FLUIDSYNTH_VERSION_H
23 |
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 | /**
30 | * @file version.h
31 | * @brief Library version functions and defines
32 | */
33 |
34 | #define FLUIDSYNTH_VERSION "2.1.5" /**< String constant of libfluidsynth version. */
35 | #define FLUIDSYNTH_VERSION_MAJOR 2 /**< libfluidsynth major version integer constant. */
36 | #define FLUIDSYNTH_VERSION_MINOR 1 /**< libfluidsynth minor version integer constant. */
37 | #define FLUIDSYNTH_VERSION_MICRO 5 /**< libfluidsynth micro version integer constant. */
38 |
39 | FLUIDSYNTH_API void fluid_version(int *major, int *minor, int *micro);
40 | FLUIDSYNTH_API char* fluid_version_str(void);
41 |
42 |
43 | #ifdef __cplusplus
44 | }
45 | #endif
46 |
47 | #endif /* _FLUIDSYNTH_VERSION_H */
48 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/include/fluidsynth/voice.h:
--------------------------------------------------------------------------------
1 | /* FluidSynth - A Software Synthesizer
2 | *
3 | * Copyright (C) 2003 Peter Hanappe and others.
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public License
7 | * as published by the Free Software Foundation; either version 2.1 of
8 | * the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free
17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 | * 02110-1301, USA
19 | */
20 |
21 | #ifndef _FLUIDSYNTH_VOICE_H
22 | #define _FLUIDSYNTH_VOICE_H
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | /**
29 | * @file voice.h
30 | * @brief Synthesis voice manipulation functions.
31 | *
32 | * The interface to the synthesizer's voices.
33 | * Examples on using them can be found in fluid_defsfont.c.
34 | * Most of these functions should only be called from within synthesis context,
35 | * such as the SoundFont loader's noteon method.
36 | */
37 |
38 |
39 | /**
40 | * Enum used with fluid_voice_add_mod() to specify how to handle duplicate modulators.
41 | */
42 | enum fluid_voice_add_mod
43 | {
44 | FLUID_VOICE_OVERWRITE, /**< Overwrite any existing matching modulator */
45 | FLUID_VOICE_ADD, /**< Add (sum) modulator amounts */
46 | FLUID_VOICE_DEFAULT /**< For default modulators only, no need to check for duplicates */
47 | };
48 |
49 | FLUIDSYNTH_API void fluid_voice_add_mod(fluid_voice_t *voice, fluid_mod_t *mod, int mode);
50 | FLUIDSYNTH_API float fluid_voice_gen_get(fluid_voice_t *voice, int gen);
51 | FLUIDSYNTH_API void fluid_voice_gen_set(fluid_voice_t *voice, int gen, float val);
52 | FLUIDSYNTH_API void fluid_voice_gen_incr(fluid_voice_t *voice, int gen, float val);
53 |
54 | FLUIDSYNTH_API unsigned int fluid_voice_get_id(const fluid_voice_t *voice);
55 | FLUIDSYNTH_API int fluid_voice_get_channel(const fluid_voice_t *voice);
56 | FLUIDSYNTH_API int fluid_voice_get_key(const fluid_voice_t *voice);
57 | FLUIDSYNTH_API int fluid_voice_get_actual_key(const fluid_voice_t *voice);
58 | FLUIDSYNTH_API int fluid_voice_get_velocity(const fluid_voice_t *voice);
59 | FLUIDSYNTH_API int fluid_voice_get_actual_velocity(const fluid_voice_t *voice);
60 | FLUIDSYNTH_API int fluid_voice_is_playing(const fluid_voice_t *voice);
61 | FLUIDSYNTH_API int fluid_voice_is_on(const fluid_voice_t *voice);
62 | FLUIDSYNTH_API int fluid_voice_is_sustained(const fluid_voice_t *voice);
63 | FLUIDSYNTH_API int fluid_voice_is_sostenuto(const fluid_voice_t *voice);
64 | FLUIDSYNTH_API int fluid_voice_optimize_sample(fluid_sample_t *s);
65 | FLUIDSYNTH_API void fluid_voice_update_param(fluid_voice_t *voice, int gen);
66 |
67 |
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 | #endif /* _FLUIDSYNTH_VOICE_H */
72 |
73 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libFLAC.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libFLAC.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libc++_shared.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libc++_shared.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libcharset.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libcharset.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libffi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libffi.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libfluidsynth-assetloader.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libfluidsynth-assetloader.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libfluidsynth.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libfluidsynth.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgio-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgio-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libglib-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libglib-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgmodule-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgmodule-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgobject-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgobject-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgthread-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libgthread-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libintl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libintl.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/liboboe.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/liboboe.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libogg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libogg.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libsndfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libsndfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libvorbis.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libvorbis.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libvorbisenc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libvorbisenc.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libvorbisfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libvorbisfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libz.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/libz.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/arm64-v8a/preloadable_libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/arm64-v8a/preloadable_libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libFLAC.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libFLAC.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libc++_shared.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libc++_shared.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libcharset.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libcharset.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libffi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libffi.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libfluidsynth-assetloader.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libfluidsynth-assetloader.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libfluidsynth.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libfluidsynth.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgio-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgio-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libglib-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libglib-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgmodule-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgmodule-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgobject-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgobject-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgthread-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libgthread-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libintl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libintl.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/liboboe.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/liboboe.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libogg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libogg.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libsndfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libsndfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libvorbis.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libvorbis.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libvorbisenc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libvorbisenc.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libvorbisfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libvorbisfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libz.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/libz.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/preloadable_libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/armeabi-v7a/preloadable_libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libFLAC.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libFLAC.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libc++_shared.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libc++_shared.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libcharset.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libcharset.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libffi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libffi.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libfluidsynth-assetloader.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libfluidsynth-assetloader.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libfluidsynth.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libfluidsynth.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libgio-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libgio-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libglib-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libglib-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libgmodule-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libgmodule-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libgobject-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libgobject-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libgthread-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libgthread-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libintl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libintl.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/liboboe.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/liboboe.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libogg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libogg.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libsndfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libsndfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libvorbis.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libvorbis.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libvorbisenc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libvorbisenc.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libvorbisfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libvorbisfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/libz.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/libz.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86/preloadable_libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86/preloadable_libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libFLAC.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libFLAC.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libc++_shared.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libc++_shared.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libcharset.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libcharset.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libffi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libffi.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libfluidsynth-assetloader.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libfluidsynth-assetloader.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libfluidsynth.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libfluidsynth.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libgio-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libgio-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libglib-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libglib-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libgmodule-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libgmodule-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libgobject-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libgobject-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libgthread-2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libgthread-2.0.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libintl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libintl.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/liboboe.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/liboboe.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libogg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libogg.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libsndfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libsndfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libvorbis.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libvorbis.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libvorbisenc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libvorbisenc.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libvorbisfile.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libvorbisfile.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/libz.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/libz.so
--------------------------------------------------------------------------------
/app/src/main/cpp/fluidsynth/lib/x86_64/preloadable_libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/cpp/fluidsynth/lib/x86_64/preloadable_libiconv.so
--------------------------------------------------------------------------------
/app/src/main/cpp/native-lib.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | extern "C" JNIEXPORT void JNICALL Java_com_example_fluidsynthandroidhelloworld_MainActivity_fluidsynthHelloWorld(JNIEnv* env, jobject, jstring jSoundfontPath) {
7 | // Setup synthesizer
8 | fluid_settings_t *settings = new_fluid_settings();
9 | fluid_synth_t *synth = new_fluid_synth(settings);
10 | fluid_audio_driver_t *adriver = new_fluid_audio_driver(settings, synth);
11 |
12 | // Load sample soundfont
13 | const char* soundfontPath = env->GetStringUTFChars(jSoundfontPath, nullptr);
14 | fluid_synth_sfload(synth, soundfontPath, 1);
15 |
16 | fluid_synth_noteon(synth, 0, 60, 127); // play middle C
17 | sleep(1); // sleep for 1 second
18 | fluid_synth_noteoff(synth, 0, 60); // stop playing middle C
19 |
20 | fluid_synth_noteon(synth, 0, 62, 127);
21 | sleep(1);
22 | fluid_synth_noteoff(synth, 0, 62);
23 |
24 | fluid_synth_noteon(synth, 0, 64, 127);
25 | sleep(1);
26 | fluid_synth_noteoff(synth, 0, 64);
27 |
28 | // Clean up
29 | delete_fluid_audio_driver(adriver);
30 | delete_fluid_synth(synth);
31 | delete_fluid_settings(settings);
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/fluidsynthandroidhelloworld/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.fluidsynthandroidhelloworld;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Context;
6 | import android.os.Bundle;
7 |
8 | import java.io.FileOutputStream;
9 | import java.io.IOException;
10 | import java.io.InputStream;
11 |
12 | public class MainActivity extends AppCompatActivity {
13 |
14 | // Used to load the 'native-lib' library on application startup.
15 | static {
16 | System.loadLibrary("native-lib");
17 | }
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.activity_main);
23 |
24 | try {
25 | String tempSoundfontPath = copyAssetToTmpFile("sndfnt.sf2");
26 | fluidsynthHelloWorld(tempSoundfontPath);
27 | } catch (IOException e) {
28 | throw new RuntimeException(e);
29 | }
30 | }
31 |
32 | private String copyAssetToTmpFile(String fileName) throws IOException {
33 | try (InputStream is = getAssets().open(fileName)) {
34 | String tempFileName = "tmp_" + fileName;
35 | try (FileOutputStream fos = openFileOutput(tempFileName, Context.MODE_PRIVATE)) {
36 | int bytes_read;
37 | byte[] buffer = new byte[4096];
38 | while ((bytes_read = is.read(buffer)) != -1) {
39 | fos.write(buffer, 0, bytes_read);
40 | }
41 | }
42 | return getFilesDir() + "/" + tempFileName;
43 | }
44 | }
45 |
46 | /**
47 | * A native method that is implemented by the 'native-lib' native library,
48 | * which is packaged with this application.
49 | */
50 | public native void fluidsynthHelloWorld(String soundfontPath);
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6200EE
4 | #3700B3
5 | #03DAC5
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Fluidsynth Android Hello World
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/fluidsynthandroidhelloworld/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.fluidsynthandroidhelloworld;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath "com.android.tools.build:gradle:4.0.2"
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | jcenter()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HectorRicardo/fluidsynth-android-hello-world/7a01fc8f1bf5bcad3382bcddbda216c479d63ce3/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Oct 10 21:25:44 CDT 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "Fluidsynth Android Hello World"
--------------------------------------------------------------------------------