Skip to content

Commit cea51e3

Browse files
Merge branch 'fixes' into faust2clap-joss
2 parents 4d167ff + 5dde825 commit cea51e3

136 files changed

Lines changed: 11300 additions & 2299 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/libfaust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: libfaust
22

33
env:
4-
FAUST_VERSION: 2.81.6
5-
FAUSTGEN_VERSION: "1.78"
4+
FAUST_VERSION: 2.82.0
5+
FAUSTGEN_VERSION: "1.79"
66
LLVM_PACKAGE_VERSION: "18.1.8"
77
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
88
LLVM_COMMIT: 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@
2525
[submodule "external/clap-sdk"]
2626
path = external/clap-sdk
2727
url = https://github.com/free-audio/clap.git
28+
[submodule "external/efsw"]
29+
path = external/efsw
30+
url = https://github.com/SpartanJ/efsw

COPYING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FAUST compiler, Version 2.81.6
1+
FAUST compiler, Version 2.82.0
22
Copyright (C) 2003-2024 GRAME, Centre National de Creation Musicale
33
Copyright (C) 2023-2024 INRIA
44
---------------------------------------------------------------------

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version := 2.81.6
1+
version := 2.82.0
22

33
system ?= $(shell uname -s)
44

architecture/ca-qt.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
#include "faust/gui/JSONUI.h"
4848
#include "faust/gui/PresetUI.h"
4949
#include "faust/gui/QTUI.h"
50+
#ifdef MCP
5051
#include "faust/gui/McpUI.h"
52+
#endif
5153
#include "faust/misc.h"
5254

5355
#ifdef IOS
@@ -257,8 +259,9 @@ int main(int argc, char* argv[])
257259
bool midi = false;
258260
int nvoices = 0;
259261
bool control = true;
260-
bool mcp = isopt(argv, "--mcp");
261-
262+
#ifdef MCP
263+
bool mcp = isopt(argv, "--mcp");
264+
#endif
262265
if (isopt(argv, "-help") || isopt(argv, "-h")) {
263266
cout << argv[0]
264267
<< " [--sample-rate <val>] [--buffer <val>] [--nvoices <val>] [--control <0/1>] "
@@ -347,6 +350,7 @@ int main(int argc, char* argv[])
347350
QTGUI* interface = new QTGUI();
348351
FUI finterface;
349352

353+
#ifdef MCP
350354
// MCP operations
351355
McpUI myMcpUI;
352356
std::thread mcpThread;
@@ -355,7 +359,7 @@ int main(int argc, char* argv[])
355359
DSP->buildUserInterface(&myMcpUI);
356360
mcpThread = std::thread([&myMcpUI]() { myMcpUI.run(); });
357361
}
358-
362+
#endif
359363
#ifdef PRESETUI
360364
PresetUI pinterface(interface,
361365
string(PRESETDIR) + string(name) + ((nvoices > 0) ? "_poly" : ""));
@@ -405,12 +409,17 @@ int main(int argc, char* argv[])
405409
DSP->buildUserInterface(&oscinterface);
406410
cout << "OSC is on" << endl;
407411
#endif
412+
#ifdef MCP
408413
if (!mcp) {
409414
// If MCP we don't want a non protocol message to be sent
410415
cout << "ins " << audio.getNumInputs() << endl;
411416
cout << "outs " << audio.getNumOutputs() << endl;
412417
}
418+
#else
419+
cout << "ins " << audio.getNumInputs() << endl;
420+
cout << "outs " << audio.getNumOutputs() << endl;
413421

422+
#endif
414423
#ifdef HTTPCTRL
415424
httpdinterface.run();
416425
#ifdef QRCODECTRL
@@ -448,12 +457,12 @@ int main(int argc, char* argv[])
448457

449458
audio.stop();
450459
finterface.saveState(rcfilename);
451-
460+
#ifdef MCP
452461
// Forcer la terminaison du thread MCP si actif
453462
if (mcp && mcpThread.joinable()) {
454463
mcpThread.detach();
455464
}
456-
465+
#endif
457466
delete DSP;
458467
return 0;
459468
}

architecture/clap/Makefile.simple

Lines changed: 69 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,75 +13,95 @@
1313
# - CLAP SDK and helpers in ../../external/
1414
# - C++17 compatible compiler
1515

16-
CXX = g++
17-
CXXFLAGS = -std=c++17 -fPIC -O2 -Wall -Wextra
18-
INCLUDES = -I../../architecture \
19-
-I../../external/clap-sdk/include \
20-
-I../../external/clap-helpers/include \
21-
-I/usr/local/include \
22-
-I/opt/homebrew/include \
23-
-Iefsw/include \
24-
-Iefsw/src
25-
26-
LIBS = -L/usr/local/lib -L/opt/homebrew/lib -lfaust -ldl -framework CoreServices -framework CoreFoundation
27-
28-
TARGET = FaustDynamic.clap
29-
SOURCE = simple-faust.cpp
30-
HELPER_OBJS = clap-helpers-impl.o interpreter-clap.o
31-
MAIN_OBJ = faust-dynamic.o
32-
EFSW_LIB = efsw/build/libefsw-static.a
16+
CXX := /usr/bin/clang++
17+
CXXFLAGS := -std=c++17 -fPIC -O2 -Wall -Wextra -fvisibility=default
18+
19+
# Detect whether we're inside an installed faust2clap tree or building in-repo
20+
SCRIPT_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
21+
TOP_DIR := $(abspath $(SCRIPT_DIR)/../..)
22+
23+
# Allow override via env, useful for installed tree
24+
FAUST2CLAP_ROOT ?= $(TOP_DIR)
25+
26+
# External dependencies
27+
CLAP_SDK_INC := $(FAUST2CLAP_ROOT)/external/clap-sdk/include
28+
CLAP_HELPERS_INC := $(FAUST2CLAP_ROOT)/external/clap-helpers/include
29+
EFSW_INC := $(FAUST2CLAP_ROOT)/external/efsw/include
30+
EFSW_SRC := $(FAUST2CLAP_ROOT)/external/efsw/src
31+
EFSW_LIB := $(FAUST2CLAP_ROOT)/external/efsw/build/libefsw-static.a
32+
33+
INCLUDES = \
34+
-I$(FAUST2CLAP_ROOT)/architecture \
35+
-I$(FAUST2CLAP_ROOT)/external/clap-sdk/include \
36+
-I$(FAUST2CLAP_ROOT)/external/clap-helpers/include \
37+
-I$(FAUST2CLAP_ROOT)/external/efsw/include \
38+
-I$(FAUST2CLAP_ROOT)/external/efsw/src \
39+
-I/usr/local/include \
40+
-I/opt/homebrew/include
41+
42+
LIBS := -L$(FAUST2CLAP_ROOT)/external/efsw/build \
43+
-lfaust -ldl \
44+
-framework CoreServices -framework CoreFoundation
45+
46+
# Output target
47+
TARGET := FaustDynamic.clap
48+
49+
# Source files
50+
SOURCE := simple-faust.cpp
51+
MAIN_OBJ := faust-dynamic.o
52+
HELPER_OBJS := clap-helpers-impl.o interpreter-clap.o
3353

3454
all: $(TARGET)
3555

3656
$(TARGET): $(MAIN_OBJ) $(HELPER_OBJS) $(EFSW_LIB)
3757
@echo "🔗 Linking $(TARGET)..."
38-
$(CXX) -shared $(MAIN_OBJ) $(HELPER_OBJS) $(EFSW_LIB) $(LIBS) -o $@
58+
$(CXX) -bundle -undefined dynamic_lookup \
59+
$(MAIN_OBJ) $(HELPER_OBJS) $(EFSW_LIB) $(LIBS) \
60+
-Wl,-headerpad_max_install_names \
61+
-Wl,-exported_symbol,_clap_entry \
62+
-Wl,-rpath,/usr/local/lib \
63+
-o $@
3964
@echo "✅ Built $(TARGET) successfully"
4065

4166
$(MAIN_OBJ): $(SOURCE)
4267
@echo "🔨 Compiling main plugin source..."
43-
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $(SOURCE) -o $@
68+
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
4469

4570
clap-helpers-impl.o: clap-helpers-impl.cpp
4671
@echo "🔨 Compiling CLAP helpers..."
47-
$(CXX) $(CXXFLAGS) $(INCLUDES) -c clap-helpers-impl.cpp -o $@
72+
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
4873

4974
interpreter-clap.o: interpreter-clap.cpp interpreter-clap.h
5075
@echo "🔨 Compiling Faust interpreter interface..."
5176
$(CXX) $(CXXFLAGS) $(INCLUDES) -c interpreter-clap.cpp -o $@
5277

78+
79+
# Build efsw automatically if missing
80+
ifeq ("$(wildcard $(EFSW_LIB))","")
81+
$(info ⚠️ efsw not built yet – will build it now)
82+
NEED_EFSW := 1
83+
endif
84+
85+
5386
$(EFSW_LIB):
54-
@echo "🔨 Building efsw library..."
55-
@cd efsw && mkdir -p build && cd build && cmake .. && make efsw-static
87+
@echo "🔨 Building efsw..."
88+
cd $(FAUST2CLAP_ROOT)/external/efsw && \
89+
mkdir -p build && \
90+
cd build && \
91+
cmake .. && \
92+
make efsw-static
93+
94+
install: $(TARGET)
95+
@echo "📦 Installing $(TARGET)..."
96+
mkdir -p $(HOME)/Library/Audio/Plug-Ins/CLAP/
97+
mkdir -p $(HOME)/.clap/plugins/
98+
cp -f $(TARGET) $(HOME)/Library/Audio/Plug-Ins/CLAP/
99+
cp -f $(TARGET) $(HOME)/.clap/plugins/
100+
@echo "✅ Plugin installed to user plugin directories"
56101

57102
clean:
58103
@echo "🧹 Cleaning build artifacts..."
59-
rm -f $(MAIN_OBJ) $(HELPER_OBJS) $(TARGET)
104+
rm -f *.o $(TARGET)
60105
@echo "✅ Clean complete"
61106

62-
install: $(TARGET)
63-
@echo "📦 Installing $(TARGET)..."
64-
@mkdir -p $(HOME)/Library/Audio/Plug-Ins/CLAP/
65-
@mkdir -p $(HOME)/.clap/plugins/
66-
cp $(TARGET) $(HOME)/Library/Audio/Plug-Ins/CLAP/
67-
cp $(TARGET) $(HOME)/.clap/plugins/
68-
@echo "✅ Installed $(TARGET) to system plugin directories"
69-
70-
# Development targets
71-
test: $(TARGET)
72-
@echo "🧪 Testing plugin load..."
73-
@if [ -n "$(CLAP_VALIDATOR)" ]; then \
74-
$(CLAP_VALIDATOR) $(TARGET); \
75-
else \
76-
echo "⚠️ CLAP_VALIDATOR not set, skipping validation"; \
77-
fi
78-
79-
# Show build info
80-
info:
81-
@echo "🛠️ Faust Dynamic CLAP Plugin Build Configuration:"
82-
@echo " Compiler: $(CXX)"
83-
@echo " Flags: $(CXXFLAGS)"
84-
@echo " Target: $(TARGET)"
85-
@echo " Dependencies: libfaust (with interpreter), CLAP SDK"
86-
87-
.PHONY: all clean install test info
107+
.PHONY: all install clean
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// Created by Facundo Franchino on 18/06/2025.
3+
//
4+
5+
#include <faust/gui/GUI.h>
6+
7+
ztimedmap GUI::gTimedZoneMap;
8+
std::list<GUI*> GUI::fGuiList;
9+
200 KB
Binary file not shown.

architecture/clap/plugin.cc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//modified by Facundo Franchino
2+
//explicit template instantiations for clap::helpers::Plugin and HostProxy
3+
4+
#include <clap/helpers/host-proxy.hxx>
5+
#include <clap/helpers/param-queue.hh>
6+
#include <clap/helpers/plugin.hh>
7+
#include <clap/helpers/plugin.hxx>
8+
#include <clap/helpers/reducing-param-queue.hh>
9+
#include <clap/helpers/reducing-param-queue.hxx>
10+
11+
//instantiate combinations of Plugin<MisbehaviourHandler, CheckingLevel>
12+
13+
template class clap::helpers::Plugin<clap::helpers::MisbehaviourHandler::Terminate,
14+
clap::helpers::CheckingLevel::Maximal>;
15+
template class clap::helpers::Plugin<clap::helpers::MisbehaviourHandler::Terminate,
16+
clap::helpers::CheckingLevel::Minimal>;
17+
template class clap::helpers::Plugin<clap::helpers::MisbehaviourHandler::Terminate,
18+
clap::helpers::CheckingLevel::None>;
19+
template class clap::helpers::Plugin<clap::helpers::MisbehaviourHandler::Ignore,
20+
clap::helpers::CheckingLevel::Maximal>;
21+
22+
//instantiate combinations of HostProxy<MisbehaviourHandler, CheckingLevel>
23+
24+
template class clap::helpers::HostProxy<clap::helpers::MisbehaviourHandler::Terminate,
25+
clap::helpers::CheckingLevel::Maximal>;
26+
template class clap::helpers::HostProxy<clap::helpers::MisbehaviourHandler::Terminate,
27+
clap::helpers::CheckingLevel::Minimal>;
28+
template class clap::helpers::HostProxy<clap::helpers::MisbehaviourHandler::Terminate,
29+
clap::helpers::CheckingLevel::None>;
30+
template class clap::helpers::HostProxy<clap::helpers::MisbehaviourHandler::Ignore,
31+
clap::helpers::CheckingLevel::Maximal>;

architecture/faust/dsp/interpreter-dsp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,12 @@ extern "C" LIBFAUST_API void stopMTDSPFactories();
319319
* the same (reference counted) factory pointer. You will have to explicitly use deleteInterpreterDSPFactory to properly
320320
* decrement reference counter when the factory is no more needed.
321321
*
322-
* @param bitcode - the bitcode string
322+
* @param bit_code - the bitcode string
323323
* @param error_msg - the error string to be filled
324324
*
325325
* @return the DSP factory on success, otherwise a null pointer.
326326
*/
327-
LIBFAUST_API interpreter_dsp_factory* readInterpreterDSPFactoryFromBitcode(const std::string& bitcode, std::string& error_msg);
327+
LIBFAUST_API interpreter_dsp_factory* readInterpreterDSPFactoryFromBitcode(const std::string& bit_code, std::string& error_msg);
328328

329329
/**
330330
* Write a Faust DSP factory into a bitcode string.

0 commit comments

Comments
 (0)