Skip to content

Commit

Permalink
Feature/json UI (#12)
Browse files Browse the repository at this point in the history
* use Faust to generate JSON and then automatically create UI in TouchDesigner. This replaces the XML-based system.
* Add horizontal and vertical bargraphs to UI
* Add tab groups, horizontal groups, and vertical groups
* `faustlibraries` directory should now be sibling the the TD-Faust plugin.
  • Loading branch information
DBraun authored May 3, 2022
1 parent c7d2ca0 commit e25048d
Show file tree
Hide file tree
Showing 20 changed files with 669 additions and 545 deletions.
111 changes: 73 additions & 38 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Compile
on:
pull_request: {}
push:
tags:
- '*'
branches:
- main
jobs:

build-windows:
Expand Down Expand Up @@ -31,7 +32,7 @@ jobs:
- name: Build LLVM
run: |
cd thirdparty/llvm-project/llvm
cmake -Bbuild -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MD -DLLVM_BUILD_TESTS=Off -DCMAKE_INSTALL_PREFIX="./llvm" -Thost=x64 -DLLVM_ENABLE_ZLIB=off
cmake -Bbuild -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MD -DLLVM_BUILD_TESTS=Off -DCMAKE_INSTALL_PREFIX="./llvm" -Thost=x64 -DLLVM_ENABLE_ZLIB=off -DLLVM_OPTIMIZED_TABLEGEN=ON
msbuild build/LLVM.sln /property:Configuration=Release
- name: Build TD-Faust (Release)
Expand All @@ -47,6 +48,8 @@ jobs:
move ${{ github.workspace }}/Plugins/TD-Faust.dll TD-Faust_dist
move ${{ github.workspace }}/Plugins/faust.dll TD-Faust_dist
cp ${{ github.workspace }}/thirdparty/libsndfile-1.0.31-win64/bin/sndfile.dll TD-Faust_dist
cp -v -r ${{ github.workspace }}/Plugins/faustlibraries TD-Faust_dist
Remove-Item -Recurse -Force "TD-Faust_dist/faustlibraries/.git"
tar.exe -c -f TD-Faust-${{ matrix.os }}.zip TD-Faust_dist
- name: Upload artifact
Expand All @@ -61,62 +64,94 @@ jobs:
include:
- name: macos-x86_64
os: macos-latest

runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Build Everything
run: |
sh -v build_macos.sh
- name: Make distribution
run: |
rm -rf Plugins/faustlibraries/.git
zip -r TD-Faust-${{ matrix.name }}.zip Plugins
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: my-artifact-${{ matrix.name }}
path: TD-Faust-${{ matrix.name }}.zip

build-ubuntu:
strategy:
matrix:
include:
- name: ubuntu-x86_64
theContainer: docker://quay.io/pypa/manylinux2014_x86_64
os: ubuntu-latest
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
-DCMAKE_OSX_ARCHITECTURES="x86_64"
llvm-options: >-
-DLLVM_TARGETS_TO_BUILD="X86"
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-apple-darwin19.6.0"
# # todo: we can't build arm64 LLVM yet on GitHub
# # because the compiling procedure involves
# # running what we compile?
# # /bin/sh: ../../../bin/llvm-tblgen: Bad CPU type in executable
# - name: macos-arm64
# os: macos-latest
# cmake-options: >-
# -DCMAKE_BUILD_TYPE=Release
# -DCMAKE_VERBOSE_MAKEFILE=ON
# -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
# -DCMAKE_OSX_ARCHITECTURES="arm64"
# llvm-options: >-
# -DLLVM_TARGETS_TO_BUILD="AArch64"
# -DLLVM_DEFAULT_TARGET_TRIPLE="arm64-apple-darwin19.6.0"
runs-on: macos-latest
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-linux-gnu"
- name: ubuntu-aarch64
theContainer: docker://quay.io/pypa/manylinux2014_aarch64
os: ubuntu-latest
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_VERBOSE_MAKEFILE=ON
llvm-options: >-
-DLLVM_TARGETS_TO_BUILD="AArch64"
-DLLVM_DEFAULT_TARGET_TRIPLE="aarch64-linux-gnu"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up QEMU for aarch64 on Linux
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Checkout ncurses
uses: actions/checkout@v2
with:
repository: mirror/ncurses
path: ncurses

- name: ncurses install
run: |
cd ncurses
./configure --prefix=/usr/local/ncurses/6_3 --with-shared --with-pkg-config-libdir=/usr/local/ncurses/6_3/lib/pkgconfig --enable-pc-files
make
sudo make install
- name: Build libsndfile
# brew install autoconf autogen automake flac libogg libtool libvorbis opus mpg123 pkg-config speex
run: |
cd thirdparty/libsndfile
mkdir build && cd build
cmake .. -G "Unix Makefiles" ${{matrix.cmake-options}} -DENABLE_EXTERNAL_LIBS=off
cmake --build . --config Release
cmake -Bbuild -G "Unix Makefiles" ${{matrix.cmake-options}} -DENABLE_EXTERNAL_LIBS=off
cmake --build build --config Release
- name: Build LLVM
run: |
cd thirdparty/llvm-project/llvm
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="./llvm" ${{matrix.cmake-options}} ${{matrix.llvm-options}} -DLLVM_ENABLE_ZLIB=off
cmake --build build
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="./llvm" ${{matrix.cmake-options}} ${{matrix.llvm-options}} -DLLVM_ENABLE_ZLIB=off -DLLVM_OPTIMIZED_TABLEGEN=ON
cmake --build build --config Release
- name: Use CMake for TD-Faust
run: |
cmake -Bbuild -G "Xcode" ${{matrix.cmake-options}} -DUSE_LLVM_CONFIG=off -DCMAKE_PREFIX_PATH=${{ github.workspace }}/thirdparty/llvm-project/llvm/build/lib/cmake/llvm -DSndFile_DIR=${{ github.workspace }}/thirdparty/libsndfile/build
cmake -Bbuild -G "Xcode" ${{matrix.cmake-options}} -DUSE_LLVM_CONFIG=off -DCMAKE_PREFIX_PATH=${{ github.workspace }}/thirdparty/llvm-project/llvm/build/lib/cmake/llvm -DSndFile_DIR=${{ github.workspace }}/thirdparty/libsndfile/build
- name: Build TD-Faust (Release)
run: |
xcodebuild -configuration Release -project build/TD-Faust.xcodeproj
install_name_tool -change @rpath/libfaust.2.dylib @loader_path/../../../libfaust.2.dylib Release/TD-Faust.plugin/Contents/MacOS/TD-Faust
cmake -Bbuild -DUSE_LLVM_CONFIG=off -DCMAKE_PREFIX_PATH="$PWD/thirdparty/llvm-project/llvm/build/lib/cmake/llvm;/usr/local/ncurses/6_3/lib/pkgconfig" -DSndFile_DIR=$PWD/thirdparty/libsndfile/build -DCURSES_LIBRARY=/usr/local/ncurses/6_3/lib -DCURSES_INCLUDE_PATH=/usr/local/ncurses/6_3/include/ncurses
cmake -Bbuild -DUSE_LLVM_CONFIG=off -DCMAKE_PREFIX_PATH="$PWD/thirdparty/llvm-project/llvm/build/lib/cmake/llvm;/usr/local/ncurses/6_3/lib/pkgconfig" -DSndFile_DIR=$PWD/thirdparty/libsndfile/build -DCURSES_LIBRARY=/usr/local/ncurses/6_3/lib -DCURSES_INCLUDE_PATH=/usr/local/ncurses/6_3/include/ncurses
cmake --build build --config Release
- name: Make distribution
run: |
mkdir TD-Faust_dist
cp ${{ github.workspace }}/thirdparty/faust/build/lib/Release/libfaust.2.dylib TD-Faust_dist
mv ${{ github.workspace }}/Release/TD-Faust.plugin TD-Faust_dist
cp -v -r thirdparty/faust/build/lib TD-Faust_dist
zip -r TD-Faust-${{ matrix.name }}.zip TD-Faust_dist
- name: Upload artifact
Expand All @@ -127,7 +162,7 @@ jobs:

create-release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build-windows, build-macos]
needs: [build-windows, build-macos, build-ubuntu]
runs-on: ubuntu-latest
name: "Create Release on GitHub"
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.DS_STORE
CrashAutoSave*
Backup/*
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "thirdparty/faust"]
path = thirdparty/faust
url = https://github.com/grame-cncm/faust.git
[submodule "Plugins/faustlibraries"]
path = Plugins/faustlibraries
url = https://github.com/grame-cncm/faustlibraries
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################
# Sub-projects
################################################################################

project(TD-Faust VERSION 0.0.1)

if(APPLE OR MSVC)

set(TOUCHDESIGNER_INC ${PROJECT_SOURCE_DIR}/thirdparty/TouchDesigner/)

set(Headers
Expand Down Expand Up @@ -81,7 +84,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
# MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/src/Info.plist
)

if (APPLE)
if (!WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++")
endif()

Expand Down Expand Up @@ -111,10 +114,18 @@ if(WIN32)
target_link_libraries(${PROJECT_NAME} ws2_32)
# windows multimedia for rt midi
target_link_libraries(${PROJECT_NAME} winmm)
else()
elseif(APPLE)
target_link_libraries(${PROJECT_NAME} "-framework CoreFoundation" "-framework CoreMIDI" "-framework CoreAudio")
endif()

else()
## pretend we're building on Linux
add_library(TD-Faust MODULE "${PROJECT_SOURCE_DIR}/TD-Faust/null.cpp")
add_dependencies(${PROJECT_NAME} dynamiclib)
target_link_libraries(${PROJECT_NAME} dynamiclib)

endif()

if(MSVC)
set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS " /ignore:4099 ")
endif()
Expand Down Expand Up @@ -217,4 +228,4 @@ endif()
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:dynamiclib>"
${CMAKE_SOURCE_DIR}/Plugins)
${CMAKE_SOURCE_DIR}/Plugins)
2 changes: 1 addition & 1 deletion FaustLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ else()

########## <SndFile>
include (CMakeFindDependencyMacro)
if (APPLE)
if (!WIN32)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libsndfile/cmake)
endif()
find_package(SndFile REQUIRED)
Expand Down
4 changes: 3 additions & 1 deletion Plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*
Plugins.json
*.pdb
*.dll
!.gitignore
1 change: 1 addition & 0 deletions Plugins/faustlibraries
Submodule faustlibraries added at 7a42e2
Loading

0 comments on commit e25048d

Please sign in to comment.