diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml
index 803dee09..7b985bce 100644
--- a/.github/workflows/all.yml
+++ b/.github/workflows/all.yml
@@ -74,12 +74,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
- pip install setuptools wheel pytest numpy librosa scipy
-
- - name: Test with pytest
- run: |
- cd tests
- pytest .
+ pip install setuptools wheel numpy librosa scipy
- name: Checkout faustlibraries
uses: actions/checkout@v2
@@ -94,7 +89,7 @@ jobs:
rm -rf dawdreamer/faustlibraries/.git
- name: Install cibuildwheel
- run: python -m pip install cibuildwheel>=2.1.1
+ run: python -m pip install cibuildwheel>=2.3.1
# # I think the audit is failing because the build links against local LLVM-related things.
# # or https://cibuildwheel.readthedocs.io/en/stable/faq/#linux-builds-on-docker
@@ -107,7 +102,7 @@ jobs:
# CIBW_BUILD_VERBOSITY: 1
# CIBW_REPAIR_WHEEL_COMMAND_LINUX: pip install auditwheel-symbols && (auditwheel repair -w {dest_dir} {wheel} || auditwheel-symbols --manylinux 2010 {wheel})
# CIBW_TEST_REQUIRES: -r test-requirements.txt
- # CIBW_TEST_COMMAND: "cd {project}/tests && pytest ."
+ # CIBW_TEST_COMMAND: "cd {project}/tests && python -m pytest ."
# CIBW_ARCHS: auto64
# CIBW_SKIP: "*pp* *p36-* *p37-* *p38-* *p310-*"
@@ -149,14 +144,16 @@ jobs:
# run: |
# echo "Running tests"
# cd /DawDreamer/tests
- # pytest .
+ # python -m pytest -s .
build-windows:
- runs-on: windows-latest
-
+ runs-on: ${{ matrix.os }}
strategy:
matrix:
- python-version: [3.7, 3.8, 3.9]
+ include:
+ - { os: windows-latest, python-version: "3.7", CIBW-BUILD: "cp37*"}
+ - { os: windows-latest, python-version: "3.8", CIBW-BUILD: "cp38*"}
+ - { os: windows-latest, python-version: "3.9", CIBW-BUILD: "cp39*"}
steps:
- uses: actions/checkout@v2
@@ -171,7 +168,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
- pip install setuptools wheel pytest numpy librosa scipy
+ pip install setuptools wheel numpy librosa scipy
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.3
@@ -189,8 +186,6 @@ jobs:
# necessary for setup.py to work.
run: |
cp -v -r faustlibraries dawdreamer
- mkdir ${{env.pythonLocation}}/../share/faust
- cp -v faustlibraries/*.lib ${{env.pythonLocation}}/../share/faust
- name: Build libsamplerate
run: |
@@ -204,49 +199,19 @@ jobs:
run: |
msbuild Builds/VisualStudio2019/DawDreamer.sln /property:Configuration=Release
- - name: Test with pytest
- run: |
- cd tests
- pytest .
-
- name: Install cibuildwheel
- run: python -m pip install cibuildwheel>=2.1.1
-
- - name: Build wheels 3.7
- if: ${{ matrix.python-version == '3.7' }}
- run: |
- python -m cibuildwheel --output-dir wheelhouse
- env:
- PYTHONMAJOR: ${{ matrix.python-version }}
- CIBW_BUILD_VERBOSITY: 1
- CIBW_TEST_REQUIRES: -r test-requirements.txt
- # CIBW_TEST_COMMAND: "cd /D {project}\\tests && pytest ."
- CIBW_ARCHS: auto64
- CIBW_BUILD: "cp37*"
-
- - name: Build wheels 3.8
- if: ${{ matrix.python-version == '3.8' }}
- run: |
- python -m cibuildwheel --output-dir wheelhouse
- env:
- PYTHONMAJOR: ${{ matrix.python-version }}
- CIBW_BUILD_VERBOSITY: 1
- CIBW_TEST_REQUIRES: -r test-requirements.txt
- # CIBW_TEST_COMMAND: "cd /D {project}\\tests && pytest ."
- CIBW_ARCHS: auto64
- CIBW_BUILD: "cp38*"
+ run: python -m pip install cibuildwheel>=2.3.1
- - name: Build wheels 3.9
- if: ${{ matrix.python-version == '3.9' }}
+ - name: Build Wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
PYTHONMAJOR: ${{ matrix.python-version }}
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: -r test-requirements.txt
- # CIBW_TEST_COMMAND: "cd /D {project}\\tests && pytest ."
+ CIBW_TEST_COMMAND: "cd /D {project}\\tests && python -m pytest ."
CIBW_ARCHS: auto64
- CIBW_BUILD: "cp39*"
+ CIBW_BUILD: ${{matrix.CIBW-BUILD}}
- uses: actions/upload-artifact@v2
with:
@@ -270,38 +235,17 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- python-version: [3.8, 3.9]
- os: [macos-10.15]
+ include:
+ - { os: macos-latest, build: cp37-macosx_x86_64, archs-macos: "x86_64", python-version: "3.7", osx-archs: "x86_64", ARCHS: "x86_64", python-major: "3.7m" }
+ - { os: macos-latest, build: cp38-macosx_universal2, archs-macos: "universal2", python-version: "3.8", osx-archs: "x86_64;arm64", ARCHS: "x86_64 arm64", python-major: "3.8" }
+ - { os: macos-latest, build: cp39-macosx_universal2, archs-macos: "universal2", python-version: "3.9", osx-archs: "x86_64;arm64", ARCHS: "x86_64 arm64", python-major: "3.9" }
+ - { os: macos-latest, build: cp310-macosx_universal2, archs-macos: "universal2", python-version: "3.10", osx-archs: "x86_64;arm64", ARCHS: "x86_64 arm64", python-major: "3.10" }
+
steps:
- uses: actions/checkout@v2
with:
submodules: true
- - name: Setup Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Install Python dependencies
- run: |
- python -m pip install --upgrade pip
- pip install setuptools wheel pytest numpy librosa scipy
-
- - name: Checkout faustlibraries
- uses: actions/checkout@v2
- with:
- repository: grame-cncm/faustlibraries
- path: faustlibraries
-
- - name: copy faust libraries
- run: |
- mkdir -p ${{env.pythonLocation}}/../share/faust
- cp $GITHUB_WORKSPACE/faustlibraries/*.lib ${{env.pythonLocation}}/../share/faust/
- mkdir -p ${{env.pythonLocation}}/share/faust
- cp $GITHUB_WORKSPACE/faustlibraries/*.lib ${{env.pythonLocation}}/share/faust/
- mkdir -p /usr/local/share/faust/
- cp $GITHUB_WORKSPACE/faustlibraries/*.lib /usr/local/share/faust/
-
- name: Get CMake
uses: lukka/get-cmake@latest
@@ -309,40 +253,15 @@ jobs:
run: |
cd thirdparty/libsamplerate
mkdir build_release
- cmake -DCMAKE_BUILD_TYPE=Release -Bbuild_release
+ cmake -DCMAKE_BUILD_TYPE=Release -Bbuild_release -DCMAKE_OSX_ARCHITECTURES="${{matrix.osx-archs}}" -DLIBSAMPLERATE_EXAMPLES=off -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
make --directory=build_release
+ cd ../..
- - name: Build MacOS (Release)
- # the Projucer refers to PYTHONMAJOR
- env:
- PYTHONMAJOR: ${{ matrix.python-version }}
- run: |
- xcodebuild -configuration Release -project Builds/MacOSX/DawDreamer.xcodeproj/
- mv Builds/MacOSX/build/Release/dawdreamer.so.dylib Builds/MacOSX/build/Release/dawdreamer.so
- otool -L Builds/MacOSX/build/Release/dawdreamer.so
- install_name_tool -change @rpath/libfaust.2.dylib @loader_path/libfaust.2.dylib Builds/MacOSX/build/Release/dawdreamer.so
- otool -L Builds/MacOSX/build/Release/dawdreamer.so
-
- - name: Test with pytest
- run: |
- cp Builds/MacOSX/build/Release/dawdreamer.so ${{env.pythonLocation}}/bin/dawdreamer.so
- cp thirdparty/libfaust/darwin-x64/Release/libfaust.a ${{env.pythonLocation}}/bin/libfaust.2.dylib
- cd tests
- pytest .
-
- - name: otool shenanigans
- # Note: on an ordinary consumer macOS system, the env var $pythonLocation should be /Library/Frameworks/Python.framework/Versions/3.8
- # This section assumes there is a Unix Executable file at /Library/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python
- # making @executable_path resolve to /Library/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/
- # However, I was hoping @executable_path would just be /Library/Frameworks/Python.framework/Versions/3.8/bin
- # because of the executable at /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 which is itself a reference to
- # /Library/Frameworks/Python.framework/Versions/3.8/Python
- env:
- PYTHONMAJOR: ${{ matrix.python-version }}
- run: |
- otool -L Builds/MacOSX/build/Release/dawdreamer.so
- install_name_tool -change ${{env.pythonLocation}}/lib/libpython${{env.PYTHONMAJOR}}.dylib @executable_path/../../../../Python Builds/MacOSX/build/Release/dawdreamer.so
- otool -L Builds/MacOSX/build/Release/dawdreamer.so
+ - name: Checkout faustlibraries
+ uses: actions/checkout@v2
+ with:
+ repository: grame-cncm/faustlibraries
+ path: faustlibraries
- name: copy faust libraries
# necessary for setup.py to work.
@@ -350,38 +269,28 @@ jobs:
cp -v -r faustlibraries dawdreamer
rm -rf dawdreamer/faustlibraries/.git
- - name: Install cibuildwheel
- run: python -m pip install cibuildwheel==2.1.1
-
- - name: Build wheels 3.8
- if: ${{ matrix.python-version == '3.8' }}
- run: |
- python -m cibuildwheel --output-dir wheelhouse
+ - name: Build wheels ${{ matrix.python-version }}
+ uses: pypa/cibuildwheel@v2.3.1
env:
- PYTHONMAJOR: ${{ matrix.python-version }}
- CIBW_BUILD_VERBOSITY: 1
- CIBW_TEST_REQUIRES: -r test-requirements.txt
- # # Might need to compile libfaust in Github action for tests to work
- # CIBW_TEST_COMMAND: "cd {project}/tests && pytest ."
- CIBW_BUILD: "cp38*"
+ # note that the Projucer project refers to PYTHONMAJOR and pythonLocation, so they must be set here
+ PYTHONMAJOR: ${{ matrix.python-major }}
MACOSX_DEPLOYMENT_TARGET: 10.15
- CIBW_ARCHS: auto64
- CIBW_ARCHS_MACOS: x86_64 universal2 # Support Apple Silicon
-
- - name: Build wheels 3.9
- if: ${{ matrix.python-version == '3.9' }}
- run: |
- python -m cibuildwheel --output-dir wheelhouse
- env:
- PYTHONMAJOR: ${{ matrix.python-version }}
CIBW_BUILD_VERBOSITY: 1
+ CIBW_BEFORE_BUILD: |
+ export pythonLocation=$(python3-config --prefix)
+ otool -L $pythonLocation/bin/python3
+ xcodebuild ARCHS="${{matrix.ARCHS}}" ONLY_ACTIVE_ARCH=NO -configuration Release -project Builds/MacOSX/DawDreamer.xcodeproj/
+ mv Builds/MacOSX/build/Release/dawdreamer.so.dylib Builds/MacOSX/build/Release/dawdreamer.so
+ otool -L Builds/MacOSX/build/Release/dawdreamer.so
+ install_name_tool -change @rpath/libfaust.2.dylib @loader_path/libfaust.2.dylib Builds/MacOSX/build/Release/dawdreamer.so
+ otool -L Builds/MacOSX/build/Release/dawdreamer.so
CIBW_TEST_REQUIRES: -r test-requirements.txt
- # # Might need to compile libfaust in Github action for tests to work
- # CIBW_TEST_COMMAND: "cd {project}/tests && pytest ."
- CIBW_BUILD: "cp39*"
- MACOSX_DEPLOYMENT_TARGET: 10.15
+ CIBW_TEST_COMMAND: "cd {project}/tests; python -m pytest -s ."
+ CIBW_BUILD: ${{matrix.build}}
CIBW_ARCHS: auto64
- CIBW_ARCHS_MACOS: x86_64 universal2 # Support Apple Silicon
+ CIBW_ARCHS_MACOS: ${{matrix.archs-macos}}
+ # todo: want to test Python 3.10
+ CIBW_TEST_SKIP: "*310*"
- uses: actions/upload-artifact@v2
with:
@@ -402,4 +311,4 @@ jobs:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
- password: ${{ secrets.PYPI_API_TOKEN }}
\ No newline at end of file
+ password: ${{ secrets.PYPI_API_TOKEN }}
diff --git a/Builds/LinuxMakefile/Makefile b/Builds/LinuxMakefile/Makefile
index 3126cf66..a97b81b1 100644
--- a/Builds/LinuxMakefile/Makefile
+++ b/Builds/LinuxMakefile/Makefile
@@ -35,7 +35,7 @@ ifeq ($(CONFIG),Debug)
TARGET_ARCH :=
endif
- JUCE_CPPFLAGS := $(DEPFLAGS) "-DLINUX=1" "-DDEBUG=1" "-D_DEBUG=1" "-DPIP_JUCE_EXAMPLES_DIRECTORY=QzpcdG9vbHNcSlVDRVxleGFtcGxlcw==" "-DSAMPLER_SKIP_UI" "-DHAVE_LIBSAMPLERATE" "-DUSE_BUILTIN_FFT" "-DUSE_PTHREADS" "-DBUILD_DAWDREAMER_FAUST" "-DBUILD_DAWDREAMER_RUBBERBAND" "-DJUCER_LINUX_MAKE_6D53C8B4=1" "-DJUCE_APP_VERSION=1.0.0" "-DJUCE_APP_VERSION_HEX=0x10000" $(shell pkg-config --cflags alsa freetype2 libcurl) -pthread -I../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK -I../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK -I../../JuceLibraryCode -I../../JuceLibraryCode/modules -I/usr/include/python3.9 -I../../thirdparty/pybind11/include -I../../thirdparty/faust/architecture -I../../thirdparty/faust/compiler -I../../thirdparty/libsamplerate/src -I../../thirdparty/libsamplerate/include -I../../thirdparty/rubberband -I../../thirdparty/rubberband/rubberband -I../../thirdparty/rubberband/src/kissfft -I../../thirdparty/rubberband/src -I../../thirdparty/portable_endian/include $(CPPFLAGS)
+ JUCE_CPPFLAGS := $(DEPFLAGS) "-DLINUX=1" "-DDEBUG=1" "-D_DEBUG=1" "-DPIP_JUCE_EXAMPLES_DIRECTORY=QzpcdG9vbHNcSlVDRVxleGFtcGxlcw==" "-DSAMPLER_SKIP_UI" "-DHAVE_LIBSAMPLERATE" "-DUSE_BUILTIN_FFT" "-DUSE_PTHREADS" "-DBUILD_DAWDREAMER_FAUST" "-DBUILD_DAWDREAMER_RUBBERBAND" "-DJUCER_LINUX_MAKE_6D53C8B4=1" "-DJUCE_APP_VERSION=1.0.0" "-DJUCE_APP_VERSION_HEX=0x10000" $(shell pkg-config --cflags alsa freetype2 libcurl) -pthread -I../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK -I../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK -I../../JuceLibraryCode -I../../JuceLibraryCode/modules -I/usr/include/python3.9 -I../../thirdparty/pybind11/include -I../../thirdparty/faust/architecture -I../../thirdparty/faust/compiler -I../../thirdparty/faust/compiler/utils -I../../thirdparty/libsamplerate/src -I../../thirdparty/libsamplerate/include -I../../thirdparty/rubberband -I../../thirdparty/rubberband/rubberband -I../../thirdparty/rubberband/src/kissfft -I../../thirdparty/rubberband/src -I../../thirdparty/portable_endian/include $(CPPFLAGS)
JUCE_CPPFLAGS_DYNAMIC_LIBRARY := "-DJucePlugin_Build_VST=0" "-DJucePlugin_Build_VST3=0" "-DJucePlugin_Build_AU=0" "-DJucePlugin_Build_AUv3=0" "-DJucePlugin_Build_RTAS=0" "-DJucePlugin_Build_AAX=0" "-DJucePlugin_Build_Standalone=0" "-DJucePlugin_Build_Unity=0"
JUCE_CFLAGS_DYNAMIC_LIBRARY := -fPIC -fvisibility=hidden
JUCE_LDFLAGS_DYNAMIC_LIBRARY := -shared
@@ -58,7 +58,7 @@ ifeq ($(CONFIG),Release)
TARGET_ARCH :=
endif
- JUCE_CPPFLAGS := $(DEPFLAGS) "-DLINUX=1" "-DNDEBUG=1" "-DPIP_JUCE_EXAMPLES_DIRECTORY=QzpcdG9vbHNcSlVDRVxleGFtcGxlcw==" "-DSAMPLER_SKIP_UI" "-DHAVE_LIBSAMPLERATE" "-DUSE_BUILTIN_FFT" "-DUSE_PTHREADS" "-DBUILD_DAWDREAMER_FAUST" "-DBUILD_DAWDREAMER_RUBBERBAND" "-DJUCER_LINUX_MAKE_6D53C8B4=1" "-DJUCE_APP_VERSION=1.0.0" "-DJUCE_APP_VERSION_HEX=0x10000" $(shell pkg-config --cflags alsa freetype2 libcurl) -pthread -I../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK -I../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK -I../../JuceLibraryCode -I../../JuceLibraryCode/modules -I/usr/include/python3.9 -I../../thirdparty/pybind11/include -I../../thirdparty/faust/architecture -I../../thirdparty/faust/compiler -I../../thirdparty/libsamplerate/src -I../../thirdparty/libsamplerate/include -I../../thirdparty/rubberband -I../../thirdparty/rubberband/rubberband -I../../thirdparty/rubberband/src/kissfft -I../../thirdparty/rubberband/src -I../../thirdparty/portable_endian/include $(CPPFLAGS)
+ JUCE_CPPFLAGS := $(DEPFLAGS) "-DLINUX=1" "-DNDEBUG=1" "-DPIP_JUCE_EXAMPLES_DIRECTORY=QzpcdG9vbHNcSlVDRVxleGFtcGxlcw==" "-DSAMPLER_SKIP_UI" "-DHAVE_LIBSAMPLERATE" "-DUSE_BUILTIN_FFT" "-DUSE_PTHREADS" "-DBUILD_DAWDREAMER_FAUST" "-DBUILD_DAWDREAMER_RUBBERBAND" "-DJUCER_LINUX_MAKE_6D53C8B4=1" "-DJUCE_APP_VERSION=1.0.0" "-DJUCE_APP_VERSION_HEX=0x10000" $(shell pkg-config --cflags alsa freetype2 libcurl) -pthread -I../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK -I../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK -I../../JuceLibraryCode -I../../JuceLibraryCode/modules -I/usr/include/python3.9 -I../../thirdparty/pybind11/include -I../../thirdparty/faust/architecture -I../../thirdparty/faust/compiler -I../../thirdparty/faust/compiler/utils -I../../thirdparty/libsamplerate/src -I../../thirdparty/libsamplerate/include -I../../thirdparty/rubberband -I../../thirdparty/rubberband/rubberband -I../../thirdparty/rubberband/src/kissfft -I../../thirdparty/rubberband/src -I../../thirdparty/portable_endian/include $(CPPFLAGS)
JUCE_CPPFLAGS_DYNAMIC_LIBRARY := "-DJucePlugin_Build_VST=0" "-DJucePlugin_Build_VST3=0" "-DJucePlugin_Build_AU=0" "-DJucePlugin_Build_AUv3=0" "-DJucePlugin_Build_RTAS=0" "-DJucePlugin_Build_AAX=0" "-DJucePlugin_Build_Standalone=0" "-DJucePlugin_Build_Unity=0"
JUCE_CFLAGS_DYNAMIC_LIBRARY := -fPIC -fvisibility=hidden
JUCE_LDFLAGS_DYNAMIC_LIBRARY := -shared
diff --git a/Builds/MacOSX/DawDreamer.xcodeproj/project.pbxproj b/Builds/MacOSX/DawDreamer.xcodeproj/project.pbxproj
index 5c0a6ee1..64a0055b 100644
--- a/Builds/MacOSX/DawDreamer.xcodeproj/project.pbxproj
+++ b/Builds/MacOSX/DawDreamer.xcodeproj/project.pbxproj
@@ -181,7 +181,6 @@
9ABCCF2DBAA01DE762D8BD60 /* FaustProcessor.h */ /* FaustProcessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FaustProcessor.h; path = ../../Source/FaustProcessor.h; sourceTree = SOURCE_ROOT; };
9B17E0333F55A9D2F7686E6B /* Allocators.h */ /* Allocators.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Allocators.h; path = ../../thirdparty/rubberband/src/system/Allocators.h; sourceTree = SOURCE_ROOT; };
9BDB3F17F6111E9FDF1761B4 /* MPESettingsDataModel.h */ /* MPESettingsDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MPESettingsDataModel.h; path = ../../Source/Sampler/Source/DataModels/MPESettingsDataModel.h; sourceTree = SOURCE_ROOT; };
- 9BF0B18CB113A977D0117997 /* RecorderProcessor.h */ /* RecorderProcessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RecorderProcessor.h; path = ../../Source/RecorderProcessor.h; sourceTree = SOURCE_ROOT; };
9C07609F0F8527BD049E1A07 /* AudioCurveCalculator.h */ /* AudioCurveCalculator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AudioCurveCalculator.h; path = ../../thirdparty/rubberband/src/dsp/AudioCurveCalculator.h; sourceTree = SOURCE_ROOT; };
9F37A0F01B91ECF513361AD0 /* MPELegacySettingsComponent.h */ /* MPELegacySettingsComponent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MPELegacySettingsComponent.h; path = ../../Source/Sampler/Source/Components/MPELegacySettingsComponent.h; sourceTree = SOURCE_ROOT; };
9FDB1268E8AD800788F80B72 /* include_juce_gui_basics.mm */ /* include_juce_gui_basics.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_gui_basics.mm; path = ../../JuceLibraryCode/include_juce_gui_basics.mm; sourceTree = SOURCE_ROOT; };
@@ -580,7 +579,6 @@
2F962B6F6EA479E59F083A16,
D68C9F4F1959369550A30E40,
253FF1803B46DE27BAFE0B1E,
- 9BF0B18CB113A977D0117997,
);
name = Processors;
sourceTree = "";
@@ -670,7 +668,7 @@
4A73310BAAAEBD94149F5709 = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1300;
+ LastUpgradeCheck = 1320;
ORGANIZATIONNAME = "";
};
buildConfigurationList = 2DB318F4D74C3E6033F2C720;
@@ -764,7 +762,6 @@
0B1D4C0B3A54E25448D24D59 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_LINK_OBJC_RUNTIME = NO;
@@ -772,6 +769,7 @@
COMBINE_HIDPI_IMAGES = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/build/$(CONFIGURATION)";
COPY_PHASE_STRIP = NO;
+ EXCLUDED_ARCHS = "i386 arm64e";
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -807,6 +805,7 @@
"/usr/local/include",
"$(SRCROOT)/../../thirdparty/faust/architecture",
"$(SRCROOT)/../../thirdparty/faust/compiler",
+ "$(SRCROOT)/../../thirdparty/faust/compiler/utils",
"$(SRCROOT)/../../thirdparty/libsamplerate/src",
"$(SRCROOT)/../../thirdparty/libsamplerate/include",
"$(SRCROOT)/../../thirdparty/rubberband",
@@ -824,14 +823,15 @@
"\"../../thirdparty/libsamplerate/build_debug/src\"",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
- MTL_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../JuceLibraryCode $(SRCROOT)/../../JuceLibraryCode/modules $(pythonLocation)/include/python$(PYTHONMAJOR) $(SRCROOT)/../../thirdparty/pybind11/include /usr/local/include $(SRCROOT)/../../thirdparty/faust/architecture $(SRCROOT)/../../thirdparty/faust/compiler $(SRCROOT)/../../thirdparty/libsamplerate/src $(SRCROOT)/../../thirdparty/libsamplerate/include $(SRCROOT)/../../thirdparty/rubberband $(SRCROOT)/../../thirdparty/rubberband/rubberband $(SRCROOT)/../../thirdparty/rubberband/src/kissfft $(SRCROOT)/../../thirdparty/rubberband/src $(SRCROOT)/../../thirdparty/portable_endian/include";
+ MTL_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../JuceLibraryCode $(SRCROOT)/../../JuceLibraryCode/modules $(pythonLocation)/include/python$(PYTHONMAJOR) $(SRCROOT)/../../thirdparty/pybind11/include /usr/local/include $(SRCROOT)/../../thirdparty/faust/architecture $(SRCROOT)/../../thirdparty/faust/compiler $(SRCROOT)/../../thirdparty/faust/compiler/utils $(SRCROOT)/../../thirdparty/libsamplerate/src $(SRCROOT)/../../thirdparty/libsamplerate/include $(SRCROOT)/../../thirdparty/rubberband $(SRCROOT)/../../thirdparty/rubberband/rubberband $(SRCROOT)/../../thirdparty/rubberband/src/kissfft $(SRCROOT)/../../thirdparty/rubberband/src $(SRCROOT)/../../thirdparty/portable_endian/include";
+ OTHER_CFLAGS = "-fPIC";
OTHER_CPLUSPLUSFLAGS = "-fPIC";
- OTHER_LDFLAGS = "-lsamplerate -lfaust -shared -lpython$(PYTHONMAJOR)";
- PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.DawDreamer;
+ OTHER_LDFLAGS = "-lsamplerate -lfaust -shared -Wl,-undefined,dynamic_lookup";
+ PRODUCT_BUNDLE_IDENTIFIER = design.dirt.DawDreamer;
PRODUCT_NAME = "dawdreamer.so";
USE_HEADERMAP = NO;
VALIDATE_WORKSPACE_SKIPPED_SDK_FRAMEWORKS = OpenGL;
- VALID_ARCHS = "i386 x86_64 arm64 arm64e";
+ VALID_ARCHS = "arm64 x86_64";
};
name = Debug;
};
@@ -876,6 +876,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "dawdreamer.so";
SDKROOT = macosx;
WARNING_CFLAGS = "-Wreorder";
@@ -886,7 +887,6 @@
7D16F0F72A8F9DD6F7543FE8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_LINK_OBJC_RUNTIME = NO;
@@ -894,6 +894,7 @@
COMBINE_HIDPI_IMAGES = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/build/$(CONFIGURATION)";
DEAD_CODE_STRIPPING = YES;
+ EXCLUDED_ARCHS = "i386 arm64e";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -929,6 +930,7 @@
"/usr/local/include",
"$(SRCROOT)/../../thirdparty/faust/architecture",
"$(SRCROOT)/../../thirdparty/faust/compiler",
+ "$(SRCROOT)/../../thirdparty/faust/compiler/utils",
"$(SRCROOT)/../../thirdparty/libsamplerate/src",
"$(SRCROOT)/../../thirdparty/libsamplerate/include",
"$(SRCROOT)/../../thirdparty/rubberband",
@@ -947,14 +949,15 @@
);
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
- MTL_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../JuceLibraryCode $(SRCROOT)/../../JuceLibraryCode/modules $(pythonLocation)/include/python$(PYTHONMAJOR) $(SRCROOT)/../../thirdparty/pybind11/include /usr/local/include $(SRCROOT)/../../thirdparty/faust/architecture $(SRCROOT)/../../thirdparty/faust/compiler $(SRCROOT)/../../thirdparty/libsamplerate/src $(SRCROOT)/../../thirdparty/libsamplerate/include $(SRCROOT)/../../thirdparty/rubberband $(SRCROOT)/../../thirdparty/rubberband/rubberband $(SRCROOT)/../../thirdparty/rubberband/src/kissfft $(SRCROOT)/../../thirdparty/rubberband/src $(SRCROOT)/../../thirdparty/portable_endian/include";
+ MTL_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../JuceLibraryCode/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../thirdparty/JUCE/modules/juce_audio_processors/format_types/VST3_SDK $(SRCROOT)/../../JuceLibraryCode $(SRCROOT)/../../JuceLibraryCode/modules $(pythonLocation)/include/python$(PYTHONMAJOR) $(SRCROOT)/../../thirdparty/pybind11/include /usr/local/include $(SRCROOT)/../../thirdparty/faust/architecture $(SRCROOT)/../../thirdparty/faust/compiler $(SRCROOT)/../../thirdparty/faust/compiler/utils $(SRCROOT)/../../thirdparty/libsamplerate/src $(SRCROOT)/../../thirdparty/libsamplerate/include $(SRCROOT)/../../thirdparty/rubberband $(SRCROOT)/../../thirdparty/rubberband/rubberband $(SRCROOT)/../../thirdparty/rubberband/src/kissfft $(SRCROOT)/../../thirdparty/rubberband/src $(SRCROOT)/../../thirdparty/portable_endian/include";
+ OTHER_CFLAGS = "-fPIC";
OTHER_CPLUSPLUSFLAGS = "-fPIC";
- OTHER_LDFLAGS = "-lsamplerate -lfaust -shared -lpython$(PYTHONMAJOR)";
- PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.DawDreamer;
+ OTHER_LDFLAGS = "-lsamplerate -lfaust -shared -Wl,-undefined,dynamic_lookup";
+ PRODUCT_BUNDLE_IDENTIFIER = design.dirt.DawDreamer;
PRODUCT_NAME = "dawdreamer.so";
USE_HEADERMAP = NO;
VALIDATE_WORKSPACE_SKIPPED_SDK_FRAMEWORKS = OpenGL;
- VALID_ARCHS = "i386 x86_64 arm64 arm64e";
+ VALID_ARCHS = "arm64 x86_64";
};
name = Release;
};
diff --git a/Builds/MacOSX/DawDreamer.xcodeproj/project.xcworkspace/xcuserdata/davidbraun.xcuserdatad/UserInterfaceState.xcuserstate b/Builds/MacOSX/DawDreamer.xcodeproj/project.xcworkspace/xcuserdata/davidbraun.xcuserdatad/UserInterfaceState.xcuserstate
index 0cb47c84..ff48f421 100644
Binary files a/Builds/MacOSX/DawDreamer.xcodeproj/project.xcworkspace/xcuserdata/davidbraun.xcuserdatad/UserInterfaceState.xcuserstate and b/Builds/MacOSX/DawDreamer.xcodeproj/project.xcworkspace/xcuserdata/davidbraun.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/Builds/VisualStudio2019/DawDreamer.sln b/Builds/VisualStudio2019/DawDreamer.sln
index b303ab63..8a25fbc8 100644
--- a/Builds/VisualStudio2019/DawDreamer.sln
+++ b/Builds/VisualStudio2019/DawDreamer.sln
@@ -1,5 +1,6 @@
+
Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2019
+# Visual Studio Version 16
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DawDreamer - Dynamic Library", "DawDreamer_DynamicLibrary.vcxproj", "{3319B6CA-AD36-2186-0C27-DF21B3E5CAC8}"
EndProject
diff --git a/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj b/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj
index 6a5c9277..0a28d96a 100644
--- a/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj
+++ b/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj
@@ -65,7 +65,7 @@
Disabled
ProgramDatabase
- ..\..\JuceLibraryCode\modules\juce_audio_processors\format_types\VST3_SDK;..\..\thirdparty\JUCE\modules\juce_audio_processors\format_types\VST3_SDK;..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;$(pythonLocation)\include;..\..\thirdparty\pybind11\include;..\..\thirdparty\faust\architecture;..\..\thirdparty\faust\compiler;..\..\thirdparty\libsamplerate\src;..\..\thirdparty\libsamplerate\include;..\..\thirdparty\rubberband;..\..\thirdparty\rubberband\rubberband;..\..\thirdparty\rubberband\src\kissfft;..\..\thirdparty\rubberband\src;..\..\thirdparty\portable_endian\include;%(AdditionalIncludeDirectories)
+ ..\..\JuceLibraryCode\modules\juce_audio_processors\format_types\VST3_SDK;..\..\thirdparty\JUCE\modules\juce_audio_processors\format_types\VST3_SDK;..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;$(pythonLocation)\include;..\..\thirdparty\pybind11\include;..\..\thirdparty\faust\architecture;..\..\thirdparty\faust\compiler;..\..\thirdparty\faust\compiler\utils;..\..\thirdparty\libsamplerate\src;..\..\thirdparty\libsamplerate\include;..\..\thirdparty\rubberband;..\..\thirdparty\rubberband\rubberband;..\..\thirdparty\rubberband\src\kissfft;..\..\thirdparty\rubberband\src;..\..\thirdparty\portable_endian\include;%(AdditionalIncludeDirectories)
_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;PIP_JUCE_EXAMPLES_DIRECTORY=QzpcdG9vbHNcSlVDRVxleGFtcGxlcw==;SAMPLER_SKIP_UI;_WIN32;__SSE__;__SSE2__;BUILD_DAWDREAMER_FAUST;BUILD_DAWDREAMER_RUBBERBAND;NOMINMAX;HAVE_LIBSAMPLERATE;HAVE_KISSFFT;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;_LIB;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
true
@@ -115,7 +115,7 @@ copy "..\..\thirdparty\libfaust\win-x64\Debug\bin\faust.dll" "$(p
Full
- ..\..\JuceLibraryCode\modules\juce_audio_processors\format_types\VST3_SDK;..\..\thirdparty\JUCE\modules\juce_audio_processors\format_types\VST3_SDK;..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;$(pythonLocation)\include;..\..\thirdparty\pybind11\include;..\..\thirdparty\faust\architecture;..\..\thirdparty\faust\compiler;..\..\thirdparty\libsamplerate\src;..\..\thirdparty\libsamplerate\include;..\..\thirdparty\rubberband;..\..\thirdparty\rubberband\rubberband;..\..\thirdparty\rubberband\src\kissfft;..\..\thirdparty\rubberband\src;..\..\thirdparty\portable_endian\include;%(AdditionalIncludeDirectories)
+ ..\..\JuceLibraryCode\modules\juce_audio_processors\format_types\VST3_SDK;..\..\thirdparty\JUCE\modules\juce_audio_processors\format_types\VST3_SDK;..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;$(pythonLocation)\include;..\..\thirdparty\pybind11\include;..\..\thirdparty\faust\architecture;..\..\thirdparty\faust\compiler;..\..\thirdparty\faust\compiler\utils;..\..\thirdparty\libsamplerate\src;..\..\thirdparty\libsamplerate\include;..\..\thirdparty\rubberband;..\..\thirdparty\rubberband\rubberband;..\..\thirdparty\rubberband\src\kissfft;..\..\thirdparty\rubberband\src;..\..\thirdparty\portable_endian\include;%(AdditionalIncludeDirectories)
_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;PIP_JUCE_EXAMPLES_DIRECTORY=QzpcdG9vbHNcSlVDRVxleGFtcGxlcw==;SAMPLER_SKIP_UI;_WIN32;__SSE__;__SSE2__;BUILD_DAWDREAMER_FAUST;BUILD_DAWDREAMER_RUBBERBAND;NOMINMAX;HAVE_LIBSAMPLERATE;HAVE_KISSFFT;JUCER_VS2019_78A5026=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;_LIB;%(PreprocessorDefinitions)
MultiThreadedDLL
true
@@ -2356,7 +2356,6 @@ copy "..\..\thirdparty\libfaust\win-x64\Release\bin\faust.dll" "$
-
diff --git a/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj.filters b/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj.filters
index 6567954a..e52b812d 100644
--- a/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj.filters
+++ b/Builds/VisualStudio2019/DawDreamer_DynamicLibrary.vcxproj.filters
@@ -3099,9 +3099,6 @@
DawDreamer\Processors
-
- DawDreamer\Processors
-
DawDreamer
diff --git a/CITATION.cff b/CITATION.cff
index b75c466e..05fe6df8 100644
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -4,5 +4,8 @@ authors:
- family-names: "Braun"
given-names: "David"
orcid: "https://orcid.org/0000-0001-8866-0756"
-title: "DawDreamer"
-url: "https://github.com/DBraun/DawDreamer"
\ No newline at end of file
+title: "DawDreamer: Bridging the Gap Between Digital Audio Workstations and Python Interfaces"
+journal: "Late-Breaking/Demo ISMIR"
+volume: 2021
+year: 2021
+url: "https://archives.ismir.net/ismir2021/latebreaking/000001.pdf"
\ No newline at end of file
diff --git a/DawDreamer.jucer b/DawDreamer.jucer
index 181a2e0c..64d01f42 100644
--- a/DawDreamer.jucer
+++ b/DawDreamer.jucer
@@ -1,7 +1,7 @@
-
+ extraLinkerFlags="-shared -Wl,-undefined,dynamic_lookup" externalLibraries="samplerate
faust"
+ extraDefs="SAMPLER_SKIP_UI
HAVE_LIBSAMPLERATE
HAVE_VDSP
USE_PTHREADS
BUILD_DAWDREAMER_FAUST
BUILD_DAWDREAMER_RUBBERBAND"
+ xcodeValidArchs="arm64,x86_64">
@@ -278,10 +277,10 @@
externalLibraries="samplerate
faust
LLVM-11">
@@ -306,10 +305,10 @@
extraDefs="SAMPLER_SKIP_UI
WIN32
_WIN32
_WINDOWS
__SSE__
__SSE2__
BUILD_DAWDREAMER_FAUST
BUILD_DAWDREAMER_RUBBERBAND
NOMINMAX
HAVE_LIBSAMPLERATE
HAVE_KISSFFT"
externalLibraries="faust.lib
samplerate.lib">
-
-
diff --git a/JuceLibraryCode/AppConfig.h b/JuceLibraryCode/AppConfig.h
index a4c4210d..3be304b9 100644
--- a/JuceLibraryCode/AppConfig.h
+++ b/JuceLibraryCode/AppConfig.h
@@ -43,7 +43,7 @@
#define JUCE_USE_DARK_SPLASH_SCREEN 1
-#define JUCE_PROJUCER_VERSION 0x60100
+#define JUCE_PROJUCER_VERSION 0x60104
//==============================================================================
#define JUCE_MODULE_AVAILABLE_juce_audio_basics 1
diff --git a/README.md b/README.md
index 505b7d9e..8797282e 100644
--- a/README.md
+++ b/README.md
@@ -18,11 +18,12 @@
# DawDreamer
+Read the [introduction](https://arxiv.org/abs/2111.09931) to DawDreamer, which was presented as a Late-Breaking Demo at the [2021 ISMIR Conference](https://ismir2021.ismir.net/lbd/).
+
DawDreamer is an audio-processing Python framework supporting core [DAW](https://en.wikipedia.org/wiki/Digital_audio_workstation) features:
-* Composing graphs of audio processors
+* Composing graphs of multi-channel audio processors
* Audio playback
-* VST instruments
-* VST effects
+* VST instruments and effects
* [FAUST](http://faust.grame.fr/) effects and [polyphonic instruments](https://faustdoc.grame.fr/manual/midi/#standard-polyphony-parameters)
* Time-stretching and looping according to Ableton Live warp markers
* Pitch-warping
@@ -44,7 +45,7 @@ from scipy.io import wavfile
import librosa
SAMPLE_RATE = 44100
-BUFFER_SIZE = 128 # For speed when not using automation, choose a larger buffer such as 512.
+BUFFER_SIZE = 128 # Parameters will undergo automation at this block size.
SYNTH_PLUGIN = "C:/path/to/synth.dll" # for instruments, DLLs work.
SYNTH_PRESET = "C:/path/to/preset.fxp"
REVERB_PLUGIN = "C:/path/to/reverb.dll" # for effects, both DLLs and .vst3 files work
@@ -68,6 +69,7 @@ engine.set_bpm(120.) # default is 120.
DURATION = 10 # How many seconds we want to render.
+# Load audio into a numpy array shaped (Number Channels, Number Samples)
vocals = load_audio_file(VOCALS_PATH, duration=10.)
piano = load_audio_file(PIANO_PATH, duration=10.)
@@ -86,6 +88,10 @@ print(synth.get_parameter_name(1)) # For Serum, returns "A Pan" (the panning of
# The Plugin Processor can set automation according to a parameter index.
synth.set_automation(1, make_sine(.5, DURATION)) # 0.5 Hz sine wave.
+# For any processor type, we can get the number of inputs and outputs
+print("synth num inputs: ", synth.get_num_input_channels())
+print("synth num outputs: ", synth.get_num_output_channels())
+
# The sampler processor works like the plugin processor.
# Provide audio for the sample, and then provide MIDI.
# The note value affects the pitch and playback speed of the sample.
@@ -130,7 +136,7 @@ engine.load_graph(graph)
engine.render(DURATION) # Render 10 seconds audio.
# Return the audio from the graph's last processor, even if its recording wasn't enabled.
-# The shape will be numpy.ndarray shaped (2, NUM_SAMPLES)
+# The shape will be numpy.ndarray shaped (chans, samples)
audio = engine.get_audio()
wavfile.write('my_song.wav', SAMPLE_RATE, audio.transpose()) # don't forget to transpose!
@@ -156,7 +162,7 @@ engine.render(DURATION) # render audio again!
### Using FAUST processors
-Let's start by looking at FAUST DSP files, which end in `.dsp`. For convenience, the standard library is always imported, so you don't need to `import("stdfaust.lib");` All code must result in a `process` with 2 outputs and an even number of inputs. Here's an example using a demo stereo reverb:
+Let's start by looking at FAUST DSP files, which end in `.dsp`. For convenience, the standard library is always imported, so you don't need to `import("stdfaust.lib");` Here's an example using a demo stereo reverb:
#### **faust_reverb.dsp:**
```dsp
@@ -232,7 +238,7 @@ Faust code in DawDreamer can use the [soundfile](https://faustdoc.grame.fr/manua
**soundfile_test.py**
```python
-# suppose audio1, audio2, and audio3 are np.array shaped (2, N samples)
+# suppose audio1, audio2, and audio3 are np.array shaped (Channels, Samples)
soundfiles = {
'mySound': [audio1, audio2, audio3]
}
diff --git a/Source/AddProcessor.h b/Source/AddProcessor.h
index fd3904aa..b114888c 100644
--- a/Source/AddProcessor.h
+++ b/Source/AddProcessor.h
@@ -6,6 +6,7 @@ class AddProcessor : public ProcessorBase
{
public:
AddProcessor(std::string newUniqueName, std::vector gainLevels) : ProcessorBase(newUniqueName), myGainLevels{ gainLevels } {
+ setMainBusInputsAndOutputs(gainLevels.size()*2, gainLevels.size()*2);
}
void prepareToPlay(double, int) {
@@ -51,7 +52,10 @@ class AddProcessor : public ProcessorBase
const juce::String getName() { return "AddProcessor"; };
- void setGainLevels(const std::vector gainLevels) { myGainLevels = gainLevels; }
+ void setGainLevels(const std::vector gainLevels) {
+ myGainLevels = gainLevels;
+ setMainBusInputsAndOutputs(gainLevels.size()*2, gainLevels.size()*2);
+ }
const std::vector getGainLevels() { return myGainLevels; }
@@ -66,4 +70,4 @@ class AddProcessor : public ProcessorBase
return myGainLevels.at(index);
}
-};
\ No newline at end of file
+};
diff --git a/Source/AllProcessors.h b/Source/AllProcessors.h
index 27d1af24..c11d03ac 100644
--- a/Source/AllProcessors.h
+++ b/Source/AllProcessors.h
@@ -10,7 +10,6 @@
#include "PlaybackProcessor.h"
#include "PlaybackWarpProcessor.h"
#include "PluginProcessor.h"
-#include "RecorderProcessor.h"
#include "ReverbProcessor.h"
#include "PannerProcessor.h"
-#include "SamplerProcessor.h"
\ No newline at end of file
+#include "SamplerProcessor.h"
diff --git a/Source/CompressorProcessor.h b/Source/CompressorProcessor.h
index 0e3d218a..079b6114 100644
--- a/Source/CompressorProcessor.h
+++ b/Source/CompressorProcessor.h
@@ -19,6 +19,7 @@ class CompressorProcessor : public ProcessorBase
myRelease = myParameters.getRawParameterValue("release");
updateParameters();
+ setMainBusInputsAndOutputs(2, 2);
}
void prepareToPlay(double sampleRate, int samplesPerBlock) {
@@ -92,4 +93,4 @@ class CompressorProcessor : public ProcessorBase
return params;
}
-};
\ No newline at end of file
+};
diff --git a/Source/DelayProcessor.h b/Source/DelayProcessor.h
index 0330e309..91324b04 100644
--- a/Source/DelayProcessor.h
+++ b/Source/DelayProcessor.h
@@ -13,7 +13,7 @@ class DelayProcessor : public ProcessorBase
myDelaySize = myParameters.getRawParameterValue("delay");
myWetLevel = myParameters.getRawParameterValue("wet_level");
-
+ setMainBusInputsAndOutputs(2, 2);
}
void prepareToPlay(double sampleRate, int samplesPerBlock) {
@@ -111,4 +111,4 @@ class DelayProcessor : public ProcessorBase
return params;
}
-};
\ No newline at end of file
+};
diff --git a/Source/FaustProcessor.cpp b/Source/FaustProcessor.cpp
index 926301ea..51771be4 100644
--- a/Source/FaustProcessor.cpp
+++ b/Source/FaustProcessor.cpp
@@ -37,11 +37,6 @@ FaustProcessor::FaustProcessor(std::string newUniqueName, double sampleRate, int
m_numOutputChannels = 0;
// auto import
m_autoImport = "// FaustProcessor (DawDreamer) auto import:\nimport(\"stdfaust.lib\");\n";
-
-#ifdef WIN32
- // At the start of every process
- guiUpdateMutex = CreateMutex(NULL, FALSE, "Faust gui::update Mutex"); // todo: enable mutex on linux and macOS
-#endif
}
FaustProcessor::~FaustProcessor() {
@@ -49,6 +44,11 @@ FaustProcessor::~FaustProcessor() {
deleteAllDSPFactories();
}
+bool
+FaustProcessor::canApplyBusesLayout(const juce::AudioProcessor::BusesLayout& layout) {
+ return (layout.getMainInputChannels() == m_numInputChannels) && (layout.getMainOutputChannels() == m_numOutputChannels);
+}
+
void
FaustProcessor::prepareToPlay(double sampleRate, int samplesPerBlock)
{
@@ -159,28 +159,13 @@ FaustProcessor::automateParameters() {
// several voices might share the same parameters in a group.
// Therefore we have to call updateAllGuis to update all dependent parameters.
if (m_nvoices > 0 && m_groupVoices) {
-#ifdef WIN32
// When you want to access shared memory:
- DWORD dwWaitResult = WaitForSingleObject(guiUpdateMutex, INFINITE);
-
- if (dwWaitResult == WAIT_OBJECT_0 || dwWaitResult == WAIT_ABANDONED)
- {
- if (dwWaitResult == WAIT_ABANDONED)
- {
- // todo:
- // Shared memory is maybe in inconsistent state because other program
- // crashed while holding the mutex. Check the memory for consistency
- }
-
- // Have Faust update all GUIs.
- GUI::updateAllGuis();
-
- // After this line other processes can access shared memory
- ReleaseMutex(guiUpdateMutex);
- }
-#else
- GUI::updateAllGuis(); // todo: enable mutex on linux and macOS
-#endif
+ if (guiUpdateMutex.Lock()) {
+ // Have Faust update all GUIs.
+ GUI::updateAllGuis();
+
+ guiUpdateMutex.Unlock();
+ }
}
}
@@ -295,16 +280,28 @@ FaustProcessor::compile()
auto theCode = m_autoImport + "\n" + m_code;
std::string m_errorString;
-
+
+#if __APPLE__
+ // on macOS, specifying the target like this helps us handle LLVM on both x86_64 and arm64.
+ // Crucially, LLVM must have been compiled separately for each architecture.
+ // A different libfaust must have also been compiled for the corresponding LLVM architecture
+ // and the `LLVM_BUILD_UNIVERSAL` preprocessor must have been set while building libfaust.
+ // Then the two libfaust.2.dylib can get combined with
+ // `lipo x86_64.libfaust.2.dylib arm64.libfaust.2.dylib -create -output libfaust.2.dylib`
+ auto target = getDSPMachineTarget();
+#else
+ auto target = std::string("");
+#endif
+
// create new factory
bool is_polyphonic = m_nvoices > 0;
if (is_polyphonic) {
m_poly_factory = createPolyDSPFactoryFromString("DawDreamer", theCode,
- argc, argv, "", m_errorString, optimize);
+ argc, argv, target.c_str(), m_errorString, optimize);
}
else {
m_factory = createDSPFactoryFromString("DawDreamer", theCode,
- argc, argv, "", m_errorString, optimize);
+ argc, argv, target.c_str(), m_errorString, optimize);
}
// check for error
@@ -338,7 +335,7 @@ FaustProcessor::compile()
// (false, true) works
m_dsp_poly = m_poly_factory->createPolyDSPInstance(m_nvoices, true, m_groupVoices);
if (!m_dsp_poly) {
- std::cerr << "FaustProcessor::compile(): Cannot create instance." << std::endl;
+ std::cerr << "FaustProcessor::compile(): Cannot create Poly DSP instance." << std::endl;
FAUSTPROCESSOR_FAIL_COMPILE
}
}
@@ -346,7 +343,7 @@ FaustProcessor::compile()
// create DSP instance
m_dsp = m_factory->createDSPInstance();
if (!m_dsp) {
- std::cerr << "FaustProcessor::compile(): Cannot create instance." << std::endl;
+ std::cerr << "FaustProcessor::compile(): Cannot create DSP instance." << std::endl;
FAUSTPROCESSOR_FAIL_COMPILE
}
}
@@ -357,14 +354,11 @@ FaustProcessor::compile()
int inputs = theDsp->getNumInputs();
int outputs = theDsp->getNumOutputs();
- if (outputs != 2) {
- std::cerr << "FaustProcessor::compile(): FaustProcessor must have DSP code with 2 output channels but was compiled for " << m_numOutputChannels << "." << std::endl;
- FAUSTPROCESSOR_FAIL_COMPILE
- }
-
m_numInputChannels = inputs;
m_numOutputChannels = outputs;
-
+
+ setMainBusInputsAndOutputs(inputs, outputs);
+
// make new UI
if (is_polyphonic)
{
@@ -809,4 +803,4 @@ FaustProcessor::setSoundfiles(py::dict d) {
}
}
-#endif
\ No newline at end of file
+#endif
diff --git a/Source/FaustProcessor.h b/Source/FaustProcessor.h
index d041b41d..ae235bcd 100644
--- a/Source/FaustProcessor.h
+++ b/Source/FaustProcessor.h
@@ -12,6 +12,7 @@
#include "faust/gui/SoundUI.h"
#include "faust/midi/rt-midi.h"
+#include "TMutex.h"
#include
#include