Pure Data added to VCV Prototype

So with Faust I’m stuck on this:

g++ -o plugin.so build/src/Prototype.cpp.o build/src/QuickJSEngine.cpp.o build/src/LuaJITEngine.cpp.o build/src/SuperColliderEngine.cpp.o build/src/VultEngine.cpp.o build/src/LibPDEngine.cpp.o build/src/FaustEngine.cpp.o dep/lib/libefsw-static-release.a dep/lib/quickjs/libquickjs.a dep/lib/libluajit-5.1.a dep/supercollider/build/lang/libsclang.a dep/supercollider/build/external_libraries/libtlsf.a dep/supercollider/build/external_libraries/hidapi/linux/libhidapi.a dep/supercollider/build/external_libraries/hidapi/hidapi_parser/libhidapi_parser.a dep/supercollider/build/external_libraries/libboost_thread_lib.a dep/supercollider/build/external_libraries/libboost_system_lib.a dep/supercollider/build/external_libraries/libboost_regex_lib.a dep/supercollider/build/external_libraries/libboost_filesystem_lib.a dep/supercollider/build/external_libraries/libyaml.a dep/lib/libpd.a dep/lib/libfaust.a -lpthread -lasound -ludev -shared -L../Rack/ -lRack -Wl,-rpath=/tmp/Rack2 -static-libstdc++ -static-libgcc 
/usr/bin/ld: dep/lib/libfaust.a(errormsg.cpp.o): in function `yyerror(char const*)':
/home/dreamer/Sources/_audio/_rack/VCV-Prototype/dep/faust/compiler/errors/errormsg.cpp:64: multiple definition of `yyerror(char const*)'; dep/supercollider/build/lang/libsclang.a(PyrLexer.cpp.o):/home/dreamer/Sources/_audio/_rack/VCV-Prototype/dep/supercollider/lang/LangSource/PyrLexer.cpp:1293: first defined here
/usr/bin/ld: dep/lib/libfaust.a(faustlexer.cpp.o):/home/dreamer/Sources/_audio/_rack/VCV-Prototype/dep/faust/build/faustdir/faustlexer.cpp:819: multiple definition of `yytext'; dep/supercollider/build/lang/libsclang.a(PyrLexer.cpp.o):/home/dreamer/Sources/_audio/_rack/VCV-Prototype/dep/supercollider/lang/LangSource/PyrLexer.cpp:104: first defined here
/usr/bin/ld: dep/lib/libfaust.a(faustlexer.cpp.o): in function `yylex()':
/home/dreamer/Sources/_audio/_rack/VCV-Prototype/dep/faust/build/faustdir/faustlexer.cpp:1033: multiple definition of `yylex()'; dep/supercollider/build/lang/libsclang.a(PyrLexer.cpp.o):/home/dreamer/Sources/_audio/_rack/VCV-Prototype/dep/supercollider/lang/LangSource/PyrLexer.cpp:359: first defined here
collect2: error: ld returned 1 exit status
make: *** [../Rack//compile.mk:62: plugin.so] Error 1

Vult just gets stuck on Compiling... so also not functional yet for me.

The rest (Pd, JS, Supercollider) seem to work fine after adding the . to their extensions.

That was helpful. I managed to compile a working windows version without Faust and Supercollider. PureData works. So does lua and js. Loading a vult script results in the message “Compiling…”. The error I get on Supercollider when running make after make dep is:

fatal: destination path 'supercollider' already exists and is not an empty directory.

Here’s what I changed:

diff --git a/Makefile b/Makefile
index c1e56bb..b8da746 100644
--- a/Makefile
+++ b/Makefile
@@ -16,10 +16,10 @@ DUKTAPE ?= 0
 QUICKJS ?= 1
 LUAJIT ?= 1
 PYTHON ?= 0
-SUPERCOLLIDER ?= 1
+SUPERCOLLIDER ?= 0
 VULT ?= 1
 LIBPD ?= 1
-FAUST ?= 1
+FAUST ?= 0
 
 # Vult depends on both LuaJIT and QuickJS
 ifeq ($(VULT), 1)
@@ -29,14 +29,27 @@ endif
 
 
 # Entropia File System Watcher
-efsw := dep/lib/libefsw-static-release.a
+ifdef ARCH_WIN
+	efsw := dep/lib/efsw-static-release.lib
+else
+	efsw := dep/lib/libefsw-static-release.a
+endif
 DEPS += $(efsw)
 OBJECTS += $(efsw)
 $(efsw):
+ifdef ARCH_WIN
+	cd efsw && premake5 gmake
+	cd efsw && $(MAKE) -C make/* config=release_x86_64 efsw-static-lib
+else
 	cd efsw && premake4 gmake
 	cd efsw && $(MAKE) -C make/* config=release efsw-static-lib
+endif
 	mkdir -p dep/lib dep/include
+ifdef ARCH_WIN
+	cd efsw && cp lib/efsw-static-release.lib $(DEP_PATH)/lib/
+else
 	cd efsw && cp lib/libefsw-static-release.a $(DEP_PATH)/lib/
+endif
 	cd efsw && cp -R include/efsw $(DEP_PATH)/include/
 
 
@@ -195,7 +208,7 @@ SOURCES += src/VultEngine.cpp
 vult := dep/vult/vultc.h
 $(vult):
 	cd dep && mkdir -p vult
-	cd dep/vult && $(WGET) "https://github.com/modlfo/vult/releases/download/v0.4.12/vultc.h"
+	cd dep/vult && $(WGET) "https://github.com/vult-dsp/vult/releases/download/v0.4.12/vultc.h"
 	$(SHA256) $(vult) 3e80f6d30defe7df2804568f0314dbb33e6bf69d53d18a804c8b8132cf5ad146
 FLAGS += -Idep/vult
 DEPS += $(vult)
@@ -223,7 +236,7 @@ endif
 
 $(libpd):
 	cd dep && git clone "https://github.com/libpd/libpd.git" --recursive
-	cd dep/libpd && git checkout 5772a612527f06597d44d195843307ad0e3578fe
+	cd dep/libpd && git checkout 49a12f048c4e4b6089e185d5946dcd51e05becd3
 	
 ifdef ARCH_MAC
 	# libpd's Makefile is handmade, and it doesn't honor CFLAGS and LDFLAGS environments.
diff --git a/src/DuktapeEngine.cpp b/src/DuktapeEngine.cpp
index d9db2b9..b4ac027 100644
--- a/src/DuktapeEngine.cpp
+++ b/src/DuktapeEngine.cpp
@@ -219,5 +219,5 @@ struct DuktapeEngine : ScriptEngine {
 
 __attribute__((constructor(1000)))
 static void constructor() {
-	addScriptEngine<DuktapeEngine>("js");
+	addScriptEngine<DuktapeEngine>(".js");
 }
diff --git a/src/FaustEngine.cpp b/src/FaustEngine.cpp
index 6d6a987..3803c8c 100644
--- a/src/FaustEngine.cpp
+++ b/src/FaustEngine.cpp
@@ -369,5 +369,5 @@ private:
 
 __attribute__((constructor(1000)))
 static void constructor() {
-	addScriptEngine<FaustEngine>("dsp");
+	addScriptEngine<FaustEngine>(".dsp");
 }
diff --git a/src/LibPDEngine.cpp b/src/LibPDEngine.cpp
index 7be549f..1786ce2 100644
--- a/src/LibPDEngine.cpp
+++ b/src/LibPDEngine.cpp
@@ -331,5 +331,5 @@ void LibPDEngine::sendInitialStates(const ProcessBlock* block) {
 
 __attribute__((constructor(1000)))
 static void constructor() {
-	addScriptEngine<LibPDEngine>("pd");
+	addScriptEngine<LibPDEngine>(".pd");
 }
diff --git a/src/LuaJITEngine.cpp b/src/LuaJITEngine.cpp
index 0ec77ef..a2167a6 100644
--- a/src/LuaJITEngine.cpp
+++ b/src/LuaJITEngine.cpp
@@ -246,5 +246,5 @@ struct LuaJITEngine : ScriptEngine {
 
 __attribute__((constructor(1000)))
 static void constructor() {
-	addScriptEngine<LuaJITEngine>("lua");
+	addScriptEngine<LuaJITEngine>(".lua");
 }
diff --git a/src/Prototype.cpp b/src/Prototype.cpp
index 71c0673..ddaa511 100644
--- a/src/Prototype.cpp
+++ b/src/Prototype.cpp
@@ -504,7 +504,7 @@ struct Prototype : Module {
 		(void) std::system(command.c_str());
 #elif defined ARCH_WIN
 		std::string command = editorPath + " \"" + path + "\"";
-		std::wstring commandW = string::toWstring(command);
+		std::wstring commandW = rack::string::UTF8toUTF16(command);
 		STARTUPINFOW startupInfo;
 		std::memset(&startupInfo, 0, sizeof(startupInfo));
 		startupInfo.cb = sizeof(startupInfo);
diff --git a/src/PythonEngine.cpp b/src/PythonEngine.cpp
index edcb0ec..022699f 100644
--- a/src/PythonEngine.cpp
+++ b/src/PythonEngine.cpp
@@ -252,5 +252,5 @@ struct PythonEngine : ScriptEngine {
 
 __attribute__((constructor(1000)))
 static void constructor() {
-	addScriptEngine<PythonEngine>("py");
+	addScriptEngine<PythonEngine>(".py");
 }
diff --git a/src/QuickJSEngine.cpp b/src/QuickJSEngine.cpp
index d137d9b..b1de404 100644
--- a/src/QuickJSEngine.cpp
+++ b/src/QuickJSEngine.cpp
@@ -329,5 +329,5 @@ struct QuickJSEngine : ScriptEngine {
 
 __attribute__((constructor(1000)))
 static void constructor() {
-  addScriptEngine<QuickJSEngine>("js");
+  addScriptEngine<QuickJSEngine>(".js");
 }
diff --git a/src/SuperColliderEngine.cpp b/src/SuperColliderEngine.cpp
index 6db72b1..910c0df 100644
--- a/src/SuperColliderEngine.cpp
+++ b/src/SuperColliderEngine.cpp
@@ -405,6 +405,6 @@ bool SC_VcvPrototypeClient::copyArrayOfFloatArrays(const PyrSlot& inSlot, const
 
 __attribute__((constructor(1000)))
 static void constructor() {
-	addScriptEngine<SuperColliderEngine>("sc");
-	addScriptEngine<SuperColliderEngine>("scd");
+	addScriptEngine<SuperColliderEngine>(".sc");
+	addScriptEngine<SuperColliderEngine>(".scd");
 }
diff --git a/src/VultEngine.cpp b/src/VultEngine.cpp
index 4370f53..d911aa7 100644
--- a/src/VultEngine.cpp
+++ b/src/VultEngine.cpp
@@ -150,5 +150,5 @@ struct VultEngine : ScriptEngine {
 
 __attribute__((constructor(1000)))
 static void constructor() {
-	addScriptEngine<VultEngine>("vult");
+	addScriptEngine<VultEngine>(".vult");
 }
1 Like

Note that in order to run Vult scripts you need to have enabled the Js and Lua engines. If any of those are disabled the Vult scripts will not work.

I did, as it’s enabled by default and I didn’t disable it :wink:

Is there some other way to debug Vult stuck on “compiling” ?

1 Like

Hi, are there any news on Prototype version 2?

See here: Vult on VCV-Prototype works again - #37 by Steve_Russell

Thanks @Steve_Russell … no news since March tho

Is VCV Prototype no longer available? Is there another way to run scripts in VCV Rack? Thanks!

IIRC Prototype can only be built from source, because some variants for which language(s) is available can’t coexist, and in some case, dependencies must be installed separately.

what does that mean exactly? i dont speak code-speak… is there a way to get prototype running on mac? is there instructions some where online for me to try and follow to build it or somethin

It seems to me that the biggest advantage of Prototype is that it allows people to use a scripting language so that they don’t have to compile and build modules themselves. Requiring people to build it themselves defeats that purpose.

Since different languages can’t coexist, wouldn’t make sense to have different pre-built versions of Prototype for different languages, rather than requiring each user to build their own?

Sure, that would be great. Just needs someone to do the work.

I wasn’t saying it has to be this way – I’m just describing the current state of affairs. It doesn’t appear to be a high priority for the originator (Vortico), given its current state, and that the last commit on the v2 branch was 3 years ago.

By its very name, it seems to be meant for prototyping - that is, making low-effort proof-of-concept before building the real thing (real thing being a full-fledged module).

There are other “scripting” modules, for example BASIC-ally, Monome Teletype.

You might want to check out VCV Library - PdArray Array (vcvrack.com), which appears to be pretty much the ~array part of pd.

I’ve seen a variety of attempts to lower the bar to making modules (I think Cabbage at one time had a way to generate Rack modules).

Ultimately, scripting is still programming and writing code. In a lot of ways, Rack patches can be considered scripts - Rack is visual programming language like other low-code/no-code scripting things.

1 Like

Prototype comes with many engines - 5 on Win atm, 6 on Mac/Linux.

If you want, as an example, to use PD, add a module and load a PD file. If you want to use JS use another copy of Prototype and load your JS script. No need for separate modules.

The project hasn’t been maintained fully for v2 to be added to the Rack library, so atm the only choice is to build it yourself - this is not a design choice. In fact Andrew will eventually re-write Prototype, so either wait for that or build the current repo.

Maybe I misunderstood the comments I saw that seemed to indicate that you couldn’t build it with both pd and some other support.

The current repo for Prototype is multi engine, here’s the thread for the work some of us done nearly a year ago

The correct GitHub branch for building is this one:

Cool! - Just hard to follow, since the prs don’t appear to be getting merged.

Yeah, a few of us one Sunday pitched in and updated various parts and got it going. Andrew eventually noticed and decided to create a branch with the PRs we’d done - as you see not actually complete e.g. a fix of mine Fix Faust engine on Windows by SteveRussell33 · Pull Request #76 · VCVRack/VCV-Prototype · GitHub wasn’t included and has to be added manually if building for Win.