8000 fix everything to get DDSPSynth working. · atsushieno/aap-juce-ddsp@73b84a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
fix everything to get DDSPSynth working.
Browse files Browse the repository at this point in the history
  • Loading branch information
atsushieno committed May 16, 2023
1 parent f597e59 commit 73b84a3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 69 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ local.properties
build
.gradle
dist
.DS_store
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
url = https://github.com/atsushieno/aap-juce.git
[submodule "external/ddsp-vst"]
path = external/ddsp-vst
url = https://github.com/magenta/ddsp-vst.git
url = https://github.com/tank-trax/ddsp-vst.git
32 changes: 3 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
# {project name}: your project descirption goes here

## Remove this section in your project

### How to use this project template

This project template is designed to incorporate *existing* CMake-based JUCE
plugin project. Here is the repository structure:

- `app`: it will be the AAP project i.e. it contains AudioPluginService
- `external`
- `aap-core` : AAP core submodule. It will be updated every time we release a new version
- `aap-juce` : ditto for aap-juce repository.
- `aap-juce-support.patch` : your patch to the JUCE plugin project you are importing.

There are couple of things you are supposed to do:

- `cd external` and `git add submodule [the-JUCE-plugin-project]` there.
- You will have to make changes to the JUCE plugin project you are going to
import. Once you are done, run `cd external/{the-repo}` and then
`git diff > ../../aap-juce-support.patch` to generate the patch

For further information about aap-juce, see https://github.com/atsushieno/aap-juce

### LICENSE

We do not claim any copyright on the template itself. But note that JUCE and aap-juce are released under the GPLv3 license.

----

## What is this?

It is a port of --THE-PLUGIN-NAME-GOES-HERE-- to [AAP (Audio Plugins For Android)](https://github.com/atsushieno/aap-core).
It is a port of [magenta/ddsp-vst](https://github.com/magenta/ddsp-vst) to [AAP (Audio Plugins For Android)](https://github.com/atsushieno/aap-core).

We are actually using [tank-trax/ddsp-vst](https://github.com/tank-trax/ddsp-vst) which perfectly builds on Linux for better CI setup.

## How to build

Expand Down
41 changes: 6 additions & 35 deletions aap-juce-support.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b24687..914ad35 100644
index 7b92e52..f226d70 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,18 +44,23 @@ add_subdirectory(externals/JUCE "${CMAKE_CURRENT_BINARY_DIR}/juce-bin" EXCLUDE_F
add_subdirectory(externals/tensorflow/tensorflow/lite "${CMAKE_CURRENT_BINARY_DIR}/tensorflow-lite-bin" EXCLUDE_FROM_ALL)
# TFLite CXX std needs to be explicitly set to C++20 in Visual Studio.
target_compile_features(tensorflow-lite PUBLIC ${DDSP_CXX_STD})
+if(APPLE)
target_compile_options(tensorflow-lite PUBLIC -stdlib=libc++)
+endif()

# ------------------------- DDSP Binary Assets ------------------------ #

juce_add_binary_data(Assets SOURCES ${DDSP_ASSETS})
+if("${CMAKE_SYSTEM}" MATCHES "Linux")
+ set_target_properties(Assets PROPERTIES POSITION_INDEPENDENT_CODE ON)
+endif()

# ---------------------------- DDSP Effect ---------------------------- #

@@ -61,7 +61,7 @@ endif()
set(DDSP_EFFECT_TARGET DDSPEffect)

juce_add_plugin(${DDSP_EFFECT_TARGET}
Expand All @@ -27,7 +11,7 @@ index 6b24687..914ad35 100644
COMPANY_NAME ${DDSP_COMPANY_NAME}
MICROPHONE_PERMISSION_ENABLED TRUE
IS_SYNTH FALSE
@@ -93,7 +98,7 @@ endif()
@@ -99,7 +99,7 @@ endif()
set(DDSP_SYNTH_TARGET DDSPSynth)

juce_add_plugin(${DDSP_SYNTH_TARGET}
Expand All @@ -36,7 +20,7 @@ index 6b24687..914ad35 100644
COMPANY_NAME ${DDSP_COMPANY_NAME}
IS_SYNTH TRUE
NEEDS_MIDI_INPUT TRUE
@@ -127,6 +132,8 @@ endif()
@@ -133,6 +133,8 @@ endif()

# ----------------------- DDSP Unit Test Runner ----------------------- #

Expand All @@ -45,7 +29,7 @@ index 6b24687..914ad35 100644
enable_testing()

set(DDSP_UNIT_TEST_TARGET DDSPUnitTestRunner)
@@ -161,4 +168,79 @@ set_target_properties(${DDSP_UNIT_TEST_TARGET} PROPERTIES XCODE_GENERATE_SCHEME
@@ -167,4 +169,79 @@ set_target_properties(${DDSP_UNIT_TEST_TARGET} PROPERTIES XCODE_GENERATE_SCHEME
include(GoogleTest)
gtest_discover_tests(${DDSP_UNIT_TEST_TARGET})

Expand Down Expand Up @@ -127,7 +111,7 @@ index 6b24687..914ad35 100644
# --------------------------------------------------------------------- #
Submodule externals/tensorflow contains modified content
diff --git a/externals/tensorflow/tensorflow/lite/CMakeLists.txt b/externals/tensorflow/tensorflow/lite/CMakeLists.txt
index 40f9485b5..42fa22c1b 100644
index 40f9485b5d6..42fa22c1bdc 100644
--- a/externals/tensorflow/tensorflow/lite/CMakeLists.txt
+++ b/externals/tensorflow/tensorflow/lite/CMakeLists.txt
@@ -532,6 +532,7 @@ if(TFLITE_KERNEL_TEST)
Expand All @@ -143,16 +127,3 @@ index 40f9485b5..42fa22c1b 100644
PRIVATE ${TFLITE_TARGET_PRIVATE_OPTIONS}
)
+endif()
diff --git a/src/audio/tflite/PredictControlsModel.cpp b/src/audio/tflite/PredictControlsModel.cpp
index 4dcf3a5..00061ae 100644
--- a/src/audio/tflite/PredictControlsModel.cpp
+++ b/src/audio/tflite/PredictControlsModel.cpp
@@ -96,7 +96,7 @@ void PredictControlsModel::call (const AudioFeatures& input, SynthesisControls&

for (int i = 0; i < kHarmonicsSize; ++i)
{
- if (isnan (output.harmonics[i]))
+ if (std::isnan (output.harmonics[i]))
{
DBG ("is_nan");
output.harmonics[i] = 0.f;
2 changes: 1 addition & 1 deletion app/src/main/java/com/rmsl/juce/Java.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Java
{
companion object {
init {
System.loadLibrary("DDSPEffect_Standalone")
System.loadLibrary("DDSPSynth_Standalone")
}

@JvmStatic
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/string.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="app_name">AAP DDSP-VST</string>
<string name="app_name">AAP DDSPSynth</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/xml/midi_device_info.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<devices>
<device name="Dexed" manufacturer="androidaudioplugin.org" product="Dexed">
<device name="DDSPSynth" manufacturer="androidaudioplugin.org" product="DDSP-VST">
<input-port name="input" />
</device>
</devices>
Expand Down
2 changes: 1 addition & 1 deletion external/ddsp-vst

0 comments on commit 73b84a3

Please sign in to comment.
0