Skip to content

Commit e25048d

Browse files
authored
Feature/json UI (#12)
* 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.
1 parent c7d2ca0 commit e25048d

20 files changed

+669
-545
lines changed

.github/workflows/all.yml

+73-38
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Compile
22
on:
3+
pull_request: {}
34
push:
4-
tags:
5-
- '*'
5+
branches:
6+
- main
67
jobs:
78

89
build-windows:
@@ -31,7 +32,7 @@ jobs:
3132
- name: Build LLVM
3233
run: |
3334
cd thirdparty/llvm-project/llvm
34-
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
35+
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
3536
msbuild build/LLVM.sln /property:Configuration=Release
3637
3738
- name: Build TD-Faust (Release)
@@ -47,6 +48,8 @@ jobs:
4748
move ${{ github.workspace }}/Plugins/TD-Faust.dll TD-Faust_dist
4849
move ${{ github.workspace }}/Plugins/faust.dll TD-Faust_dist
4950
cp ${{ github.workspace }}/thirdparty/libsndfile-1.0.31-win64/bin/sndfile.dll TD-Faust_dist
51+
cp -v -r ${{ github.workspace }}/Plugins/faustlibraries TD-Faust_dist
52+
Remove-Item -Recurse -Force "TD-Faust_dist/faustlibraries/.git"
5053
tar.exe -c -f TD-Faust-${{ matrix.os }}.zip TD-Faust_dist
5154
5255
- name: Upload artifact
@@ -61,62 +64,94 @@ jobs:
6164
include:
6265
- name: macos-x86_64
6366
os: macos-latest
67+
68+
runs-on: macos-latest
69+
steps:
70+
- uses: actions/checkout@v2
71+
with:
72+
submodules: true
73+
74+
- name: Build Everything
75+
run: |
76+
sh -v build_macos.sh
77+
78+
- name: Make distribution
79+
run: |
80+
rm -rf Plugins/faustlibraries/.git
81+
zip -r TD-Faust-${{ matrix.name }}.zip Plugins
82+
83+
- name: Upload artifact
84+
uses: actions/upload-artifact@v2
85+
with:
86+
name: my-artifact-${{ matrix.name }}
87+
path: TD-Faust-${{ matrix.name }}.zip
88+
89+
build-ubuntu:
90+
strategy:
91+
matrix:
92+
include:
93+
- name: ubuntu-x86_64
94+
theContainer: docker://quay.io/pypa/manylinux2014_x86_64
95+
os: ubuntu-latest
6496
cmake-options: >-
6597
-DCMAKE_BUILD_TYPE=Release
6698
-DCMAKE_VERBOSE_MAKEFILE=ON
67-
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
68-
-DCMAKE_OSX_ARCHITECTURES="x86_64"
6999
llvm-options: >-
70100
-DLLVM_TARGETS_TO_BUILD="X86"
71-
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-apple-darwin19.6.0"
72-
# # todo: we can't build arm64 LLVM yet on GitHub
73-
# # because the compiling procedure involves
74-
# # running what we compile?
75-
# # /bin/sh: ../../../bin/llvm-tblgen: Bad CPU type in executable
76-
# - name: macos-arm64
77-
# os: macos-latest
78-
# cmake-options: >-
79-
# -DCMAKE_BUILD_TYPE=Release
80-
# -DCMAKE_VERBOSE_MAKEFILE=ON
81-
# -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
82-
# -DCMAKE_OSX_ARCHITECTURES="arm64"
83-
# llvm-options: >-
84-
# -DLLVM_TARGETS_TO_BUILD="AArch64"
85-
# -DLLVM_DEFAULT_TARGET_TRIPLE="arm64-apple-darwin19.6.0"
86-
runs-on: macos-latest
101+
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-linux-gnu"
102+
- name: ubuntu-aarch64
103+
theContainer: docker://quay.io/pypa/manylinux2014_aarch64
104+
os: ubuntu-latest
105+
cmake-options: >-
106+
-DCMAKE_BUILD_TYPE=Release
107+
-DCMAKE_VERBOSE_MAKEFILE=ON
108+
llvm-options: >-
109+
-DLLVM_TARGETS_TO_BUILD="AArch64"
110+
-DLLVM_DEFAULT_TARGET_TRIPLE="aarch64-linux-gnu"
111+
112+
runs-on: ubuntu-latest
87113
steps:
88114
- uses: actions/checkout@v2
89115
with:
90116
submodules: true
117+
- name: Set up QEMU for aarch64 on Linux
118+
if: runner.os == 'Linux'
119+
uses: docker/setup-qemu-action@v1
120+
with:
121+
platforms: all
91122

123+
- name: Checkout ncurses
124+
uses: actions/checkout@v2
125+
with:
126+
repository: mirror/ncurses
127+
path: ncurses
128+
129+
- name: ncurses install
130+
run: |
131+
cd ncurses
132+
./configure --prefix=/usr/local/ncurses/6_3 --with-shared --with-pkg-config-libdir=/usr/local/ncurses/6_3/lib/pkgconfig --enable-pc-files
133+
make
134+
sudo make install
92135
- name: Build libsndfile
93-
# brew install autoconf autogen automake flac libogg libtool libvorbis opus mpg123 pkg-config speex
94136
run: |
95137
cd thirdparty/libsndfile
96-
mkdir build && cd build
97-
cmake .. -G "Unix Makefiles" ${{matrix.cmake-options}} -DENABLE_EXTERNAL_LIBS=off
98-
cmake --build . --config Release
99-
138+
cmake -Bbuild -G "Unix Makefiles" ${{matrix.cmake-options}} -DENABLE_EXTERNAL_LIBS=off
139+
cmake --build build --config Release
100140
- name: Build LLVM
101141
run: |
102142
cd thirdparty/llvm-project/llvm
103-
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="./llvm" ${{matrix.cmake-options}} ${{matrix.llvm-options}} -DLLVM_ENABLE_ZLIB=off
104-
cmake --build build
143+
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="./llvm" ${{matrix.cmake-options}} ${{matrix.llvm-options}} -DLLVM_ENABLE_ZLIB=off -DLLVM_OPTIMIZED_TABLEGEN=ON
144+
cmake --build build --config Release
105145
106146
- name: Use CMake for TD-Faust
107147
run: |
108-
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
109-
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
110-
- name: Build TD-Faust (Release)
111-
run: |
112-
xcodebuild -configuration Release -project build/TD-Faust.xcodeproj
113-
install_name_tool -change @rpath/libfaust.2.dylib @loader_path/../../../libfaust.2.dylib Release/TD-Faust.plugin/Contents/MacOS/TD-Faust
114-
148+
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
149+
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
150+
cmake --build build --config Release
115151
- name: Make distribution
116152
run: |
117153
mkdir TD-Faust_dist
118-
cp ${{ github.workspace }}/thirdparty/faust/build/lib/Release/libfaust.2.dylib TD-Faust_dist
119-
mv ${{ github.workspace }}/Release/TD-Faust.plugin TD-Faust_dist
154+
cp -v -r thirdparty/faust/build/lib TD-Faust_dist
120155
zip -r TD-Faust-${{ matrix.name }}.zip TD-Faust_dist
121156
122157
- name: Upload artifact
@@ -127,7 +162,7 @@ jobs:
127162

128163
create-release:
129164
if: startsWith(github.ref, 'refs/tags/v')
130-
needs: [build-windows, build-macos]
165+
needs: [build-windows, build-macos, build-ubuntu]
131166
runs-on: ubuntu-latest
132167
name: "Create Release on GitHub"
133168
steps:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea
12
.DS_STORE
23
CrashAutoSave*
34
Backup/*

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "thirdparty/faust"]
88
path = thirdparty/faust
99
url = https://github.com/grame-cncm/faust.git
10+
[submodule "Plugins/faustlibraries"]
11+
path = Plugins/faustlibraries
12+
url = https://github.com/grame-cncm/faustlibraries

CMakeLists.txt

+14-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
4242
################################################################################
4343
# Sub-projects
4444
################################################################################
45+
4546
project(TD-Faust VERSION 0.0.1)
4647

48+
if(APPLE OR MSVC)
49+
4750
set(TOUCHDESIGNER_INC ${PROJECT_SOURCE_DIR}/thirdparty/TouchDesigner/)
4851

4952
set(Headers
@@ -81,7 +84,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
8184
# MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/src/Info.plist
8285
)
8386

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

@@ -111,10 +114,18 @@ if(WIN32)
111114
target_link_libraries(${PROJECT_NAME} ws2_32)
112115
# windows multimedia for rt midi
113116
target_link_libraries(${PROJECT_NAME} winmm)
114-
else()
117+
elseif(APPLE)
115118
target_link_libraries(${PROJECT_NAME} "-framework CoreFoundation" "-framework CoreMIDI" "-framework CoreAudio")
116119
endif()
117120

121+
else()
122+
## pretend we're building on Linux
123+
add_library(TD-Faust MODULE "${PROJECT_SOURCE_DIR}/TD-Faust/null.cpp")
124+
add_dependencies(${PROJECT_NAME} dynamiclib)
125+
target_link_libraries(${PROJECT_NAME} dynamiclib)
126+
127+
endif()
128+
118129
if(MSVC)
119130
set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS " /ignore:4099 ")
120131
endif()
@@ -217,4 +228,4 @@ endif()
217228
POST_BUILD
218229
COMMAND ${CMAKE_COMMAND} -E copy_if_different
219230
"$<TARGET_FILE:dynamiclib>"
220-
${CMAKE_SOURCE_DIR}/Plugins)
231+
${CMAKE_SOURCE_DIR}/Plugins)

FaustLib.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ else()
6868

6969
########## <SndFile>
7070
include (CMakeFindDependencyMacro)
71-
if (APPLE)
71+
if (!WIN32)
7272
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libsndfile/cmake)
7373
endif()
7474
find_package(SndFile REQUIRED)

Plugins/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
*
1+
Plugins.json
2+
*.pdb
3+
*.dll
24
!.gitignore

Plugins/faustlibraries

Submodule faustlibraries added at 7a42e2f

0 commit comments

Comments
 (0)