From cc2deac82bb7a43bdc0f0d56ac794f223f36fb5b Mon Sep 17 00:00:00 2001 From: Stephane Letz Date: Wed, 26 May 2021 17:48:17 +0200 Subject: [PATCH] Add -edit option in dynamic-jack-gtk. Set version to 2.32.14. --- COPYING.txt | 2 +- Makefile | 2 +- build/CMakeLists.txt | 2 +- build/MakeRelease.bat | 2 +- build/Makefile | 2 +- compiler/README.md | 2 +- compiler/generator/export.hh | 2 +- documentation/man/README.md | 2 +- documentation/man/man-header.txt | 2 +- documentation/man/man1/faust.1 | 2 +- embedded/faustgen/README.md | 2 +- tools/benchmark/README.md | 16 +- tools/benchmark/dynamic-jack-gtk.cpp | 432 +++++++++---------- tools/benchmark/dynamic-machine-jack-gtk.cpp | 2 +- windows/faust.rc | 8 +- windows/faustdll.rc | 8 +- 16 files changed, 227 insertions(+), 261 deletions(-) diff --git a/COPYING.txt b/COPYING.txt index 515f58afc9..b0dc10566d 100644 --- a/COPYING.txt +++ b/COPYING.txt @@ -1,4 +1,4 @@ - FAUST compiler, Version 2.32.13 + FAUST compiler, Version 2.32.14 Copyright (C) 2003-2019 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This program is free software; you can redistribute it and/or modify diff --git a/Makefile b/Makefile index d1956d4115..903f384f81 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -version := 2.32.13 +version := 2.32.14 system ?= $(shell uname -s) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 4ad954bcce..c1cf355f82 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -3,7 +3,7 @@ project (faust) ####################################### # versions management -set (VERSION 2.32.13) +set (VERSION 2.32.14) macro (get_major_minor_patch version) string( REGEX REPLACE "([0-9]*)\\.([0-9]*)\\.([0-9]*)" "\\1" VERSION_MAJOR ${version} ) string( REGEX REPLACE "([0-9]*)\\.([0-9]*)\\.([0-9]*)" "\\2" VERSION_MINOR ${version} ) diff --git a/build/MakeRelease.bat b/build/MakeRelease.bat index f262652094..3201b1c3cc 100644 --- a/build/MakeRelease.bat +++ b/build/MakeRelease.bat @@ -3,7 +3,7 @@ echo off IF [%1]==[] GOTO USAGE IF NOT EXIST %1 GOTO USAGE -SET VERSION=2.32.13 +SET VERSION=2.32.14 SET BUILD=%1 SET FAUSTGENVERSION=1.48 SET FAUSTLIVE=../../faustlive diff --git a/build/Makefile b/build/Makefile index f4158f9eff..804e8e7d4e 100644 --- a/build/Makefile +++ b/build/Makefile @@ -11,7 +11,7 @@ system := $(shell echo $(system) | grep MINGW > /dev/null && echo MINGW || echo # output directories FAUSTDIR ?= faustdir IOSDIR := iosdir -VERSION := 2.32.13 +VERSION := 2.32.14 #=============================================================== # current generator and backends diff --git a/compiler/README.md b/compiler/README.md index e3b9663a3d..134f75c152 100644 --- a/compiler/README.md +++ b/compiler/README.md @@ -1,4 +1,4 @@ -% man(1) Version 2.32.13 (22-May-2021) | Faust man page +% man(1) Version 2.32.14 (26-May-2021) | Faust man page NAME ==== diff --git a/compiler/generator/export.hh b/compiler/generator/export.hh index 775d6e836e..170517849d 100644 --- a/compiler/generator/export.hh +++ b/compiler/generator/export.hh @@ -22,7 +22,7 @@ #ifndef __export__ #define __export__ -#define FAUSTVERSION "2.32.13" +#define FAUSTVERSION "2.32.14" #ifdef _WIN32 #define EXPORT __declspec(dllexport) diff --git a/documentation/man/README.md b/documentation/man/README.md index e3b9663a3d..134f75c152 100644 --- a/documentation/man/README.md +++ b/documentation/man/README.md @@ -1,4 +1,4 @@ -% man(1) Version 2.32.13 (22-May-2021) | Faust man page +% man(1) Version 2.32.14 (26-May-2021) | Faust man page NAME ==== diff --git a/documentation/man/man-header.txt b/documentation/man/man-header.txt index f1a6209c0a..82f79d7266 100644 --- a/documentation/man/man-header.txt +++ b/documentation/man/man-header.txt @@ -1,4 +1,4 @@ -% man(1) Version 2.32.13 (22-May-2021) | Faust man page +% man(1) Version 2.32.14 (26-May-2021) | Faust man page NAME ==== diff --git a/documentation/man/man1/faust.1 b/documentation/man/man1/faust.1 index b550d91b3b..ef8c34983a 100644 --- a/documentation/man/man1/faust.1 +++ b/documentation/man/man1/faust.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 2.13 .\" -.TH "man" "1" "" "Version 2.32.13 (22-May-2021)" "Faust man page" +.TH "man" "1" "" "Version 2.32.14 (26-May-2021)" "Faust man page" .hy .SH NAME .PP diff --git a/embedded/faustgen/README.md b/embedded/faustgen/README.md index 2a3b847168..03666d9d32 100644 --- a/embedded/faustgen/README.md +++ b/embedded/faustgen/README.md @@ -4,7 +4,7 @@ faustgen~ ## The swiss knife for [Faust](https://faust.grame.fr) development in Max/MSP. -------------- -[Faust](https://faust.grame.fr) (Functional Audio Stream) is a functional programming language for sound synthesis and audio processing with a strong focus on the design of synthesizers, musical instruments, audio effects, etc. Faust targets high-performance signal processing applications and audio plug-ins for a variety of platforms and standards, and is distributed with a [huge library]( https://faustlibraries.grame.fr) of various DSP algorithms. +[Faust](https://faust.grame.fr) (Functional Audio Stream) is a functional programming language for sound synthesis and audio processing with a strong focus on the design of synthesizers, musical instruments, audio effects, etc. Faust targets high-performance signal processing applications and audio plug-ins for a variety of platforms and standards, and is distributed with a [huge library](https://faustlibraries.grame.fr) of various DSP algorithms. **faustgen~** is a Max external prototyping environment for the Faust programming language with an ultra-short edit-compile-run cycle. It is based on the [libfaust](https://faust.grame.fr) library (the embeddable version of the Faust compiler) and on [LLVM](http://llvm.org). The DSP code can be edited in an embedded editor and will be JIT compiled in native code using LLVM when the editor is closed. For faster reloading, the compiled code is saved in the patch and re-loaded when the patch is opened again. The **faustgen~** external contains all standard Faust libraries, but additional ones can be used by adding the `-I ` option in the `compileoptions` message, or using the `librarypath`message. diff --git a/tools/benchmark/README.md b/tools/benchmark/README.md index 08b9256dd3..ad4bbe56a1 100644 --- a/tools/benchmark/README.md +++ b/tools/benchmark/README.md @@ -72,13 +72,15 @@ Note that using the `-inj foo.cpp` option allows to compile any C++ class contai The **dynamic-jack-gtk** tool uses the dynamic compilation chain, compiles a Faust DSP source, and runs it with the LLVM or Interpreter backend. It can also read a precompiled DSP factory, either in IR (.ll), bitcode (.bc), or machine code (.mc) when using the LLVM backend, or byte code (.bc) when using the Interpreter backend. -`dynamic-jack-gtk [-llvm|interp] [-nvoices N] [-all] [-midi] [-osc] [-httpd] [-resample] [additional Faust options (-vec -vs 8...)] foo.dsp/foo.fbc/foo.ll/foo.bc/foo.mc` +`dynamic-jack-gtk [-llvm|interp] [-edit] [-generic] [-nvoices ] [-all] [-midi] [-osc] [-httpd] [-resample] [additional Faust options (-vec -vs 8...)] foo.dsp/foo.fbc/foo.ll/foo.bc/foo.mc` Here are the available options: -- `-llvm/interp to choose either LLVM or Interpreter backend` +- `-llvm' to use LLVM backend- ` +- `-interp' to use Interpreter backend, using either .dsp or .fbc (Faust Byte Code) files)` +- `-edit' to start an edit/compile/run loop: closing the window will reopen a new one with the new compiled code` - `-generic to JIT for a generic CPU (otherwise 'native' mode is used)` -- `-nvoices N to start the DSP in polyphonic mode with N voices` +- `-nvoices to start the DSP in polyphonic mode with voices` - `-all' to active the 'all voices always playing' mode` - `-midi to activate MIDI control` - `-osc to activate OSC control` @@ -91,12 +93,12 @@ Additional Faust compiler options can be given. Note that the Interpreter backen The **poly-dynamic-jack-gtk** tool uses the dynamic compilation chain, compiles a Faust DSP source, activate the -effect auto model by default, and runs it with the LLVM or Interpreter backend. -`poly-dynamic-jack-gtk [-llvm|interp] [-nvoices N] [-midi] [-osc] [-httpd] [-resample] [additional Faust options (-vec -vs 8...)] foo.dsp` +`poly-dynamic-jack-gtk [-llvm|interp] [-nvoices ] [-midi] [-osc] [-httpd] [-resample] [additional Faust options (-vec -vs 8...)] foo.dsp` Here are the available options: - `-llvm/interp to choose either LLVM or Interpreter backend` -- `-nvoices N to start the DSP in polyphonic mode with N voices` +- `-nvoices to start the DSP in polyphonic mode with voices` - `-midi to activate MIDI control` - `-osc to activate OSC control` - `-httpd to activate HTTPD control` @@ -108,11 +110,11 @@ Additional Faust compiler options can be given. Note that the Interpreter backen The **dynamic-machine-jack-gtk** tool runs a previously compiled Faust program (as FBC, that is as 'Faust Byte Code') in the Interpreter backend, configurated to use the FBC => LLVM IR => executable code chain. -`dynamic-machine-jack-gtk [-nvoices N] [-midi] [-osc] [-httpd] foo.fbc` +`dynamic-machine-jack-gtk [-nvoices ] [-midi] [-osc] [-httpd] foo.fbc` Here are the available options: -- `-nvoices N to start the DSP in polyphonic mode with N voices` +- `-nvoices to start the DSP in polyphonic mode with voices` - `-midi to activate MIDI control` - `-osc to activate OSC control` - `-httpd to activate HTTPD control` diff --git a/tools/benchmark/dynamic-jack-gtk.cpp b/tools/benchmark/dynamic-jack-gtk.cpp index a51a0b41d9..207b7f6514 100644 --- a/tools/benchmark/dynamic-jack-gtk.cpp +++ b/tools/benchmark/dynamic-jack-gtk.cpp @@ -1,6 +1,6 @@ /************************************************************************ FAUST Architecture File - Copyright (C) 2016 GRAME, Centre National de Creation Musicale + Copyright (C) 2016-2021 GRAME, Centre National de Creation Musicale --------------------------------------------------------------------- This Architecture section is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -30,11 +30,9 @@ #include #include "faust/audio/jack-dsp.h" -#include "faust/dsp/dsp-optimizer.h" #include "faust/dsp/llvm-dsp.h" #include "faust/dsp/interpreter-dsp.h" #include "faust/dsp/dsp-adapter.h" -#include "faust/dsp/proxy-dsp.h" #include "faust/dsp/poly-dsp.h" #include "faust/gui/meta.h" #include "faust/gui/FUI.h" @@ -45,29 +43,11 @@ #include "faust/gui/SoundUI.h" #include "faust/misc.h" -#include "faust/dsp/dsp-compute-adapter.h" - using namespace std; list GUI::fGuiList; ztimedmap GUI::gTimedZoneMap; -struct malloc_memory_manager : public dsp_memory_manager { - - void* allocate(size_t size) - { - void* res = malloc(size); - //cout << "malloc_manager : " << size << " " << res << endl; - return res; - } - virtual void destroy(void* ptr) - { - //cout << "free_manager : " << ptr << endl; - free(ptr); - } - -}; - static void printList(const vector& list) { for (int i = 0; i < list.size(); i++) { @@ -84,243 +64,227 @@ static void splitTarget(const string& target, string& triple, string& cpu) } } -int main(int argc, char* argv[]) -{ - char name[256]; - char filename[256]; - char rcfilename[256]; - char* home = getenv("HOME"); - int nvoices = 0; - bool midi_sync = false; - - snprintf(name, 255, "%s", basename(argv[0])); - snprintf(filename, 255, "%s", basename(argv[argc-1])); - snprintf(rcfilename, 255, "%s/.%s-%src", home, name, filename); +struct DynamicDSP { - bool is_llvm = isopt(argv, "-llvm"); - bool is_interp = isopt(argv, "-interp"); - bool is_midi = isopt(argv, "-midi"); - bool is_osc = isopt(argv, "-osc"); - bool is_all = isopt(argv, "-all"); - bool is_generic = isopt(argv, "-generic"); - bool is_httpd = isopt(argv, "-httpd"); - bool is_resample = isopt(argv, "-resample"); - bool is_double = isopt(argv, "-double"); + dsp_factory* fFactory = nullptr; + dsp* fDSP = nullptr; + MidiUI* fMIDIInterface = nullptr; + httpdUI* fHTTPDinterface = nullptr; + GUI* fInterface = nullptr; + GUI* fOSCinterface = nullptr; + FUI* fFInterface = nullptr; + SoundUI* fSoundinterface = nullptr; + jackaudio_midi fAudio; - malloc_memory_manager manager; + bool is_llvm = false; - if (isopt(argv, "-h") || isopt(argv, "-help") || (!is_llvm && !is_interp)) { - cout << "dynamic-jack-gtk [-llvm|interp] [-generic] [-nvoices ] [-all] [-midi] [-osc] [-httpd] [-resample] [additional Faust options (-vec -vs 8...)] foo.dsp/foo.fbc/foo.ll/foo.bc/foo.mc" << endl; - cout << "Use '-llvm' to use LLVM backend\n"; - cout << "Use '-interp' to use Interpreter backend (using either .dsp or .fbc (Faust Byte Code) files\n"; - cout << "Use '-generic' to JIT for a generic CPU (otherwise 'native' mode is used)\n"; - cout << "Use '-nvoices ' to produce a polyphonic self-contained DSP with voices, ready to be used with MIDI or OSC\n"; - cout << "Use '-all' to active the 'all voices always playing' mode\n"; - cout << "Use '-midi' to activate MIDI control\n"; - cout << "Use '-osc' to activate OSC control\n"; - cout << "Use '-httpd' to activate HTTP control\n"; - cout << "Use '-resample' to resample soundfiles to the audio driver sample rate\n"; - exit(EXIT_FAILURE); - } - - dsp_factory* factory = nullptr; - dsp* DSP = nullptr; - MidiUI* midiinterface = nullptr; - httpdUI* httpdinterface = nullptr; - GUI* oscinterface = nullptr; - jackaudio_midi audio; - string error_msg; - - cout << "Libfaust version : " << getCLibFaustVersion() << endl; - - int argc1 = 0; - const char* argv1[64]; - - cout << "Compiled with additional options : "; - for (int i = 1; i < argc-1; i++) { - if ((string(argv[i]) == "-llvm") - || (string(argv[i]) == "-interp") - || (string(argv[i]) == "-generic") - || (string(argv[i]) == "-midi") - || (string(argv[i]) == "-osc") - || (string(argv[i]) == "-all") - || (string(argv[i]) == "-httpd") - || (string(argv[i]) == "-resample")) { - continue; - } else if (string(argv[i]) == "-nvoices") { - i++; - continue; + DynamicDSP(int argc, char* argv[]) + { + char name[256]; + char filename[256]; + char rcfilename[256]; + char* home = getenv("HOME"); + int nvoices = 0; + bool midi_sync = false; + string error_msg; + + snprintf(name, 255, "%s", basename(argv[0])); + snprintf(filename, 255, "%s", basename(argv[argc-1])); + snprintf(rcfilename, 255, "%s/.%s-%src", home, name, filename); + + is_llvm = isopt(argv, "-llvm"); + bool is_interp = isopt(argv, "-interp"); + bool is_midi = isopt(argv, "-midi"); + bool is_osc = isopt(argv, "-osc"); + bool is_all = isopt(argv, "-all"); + bool is_generic = isopt(argv, "-generic"); + bool is_httpd = isopt(argv, "-httpd"); + bool is_resample = isopt(argv, "-resample"); + bool is_double = isopt(argv, "-double"); + + if (isopt(argv, "-h") || isopt(argv, "-help") || (!is_llvm && !is_interp)) { + cout << "dynamic-jack-gtk [-llvm|interp] [-edit] [-generic] [-nvoices ] [-all] [-midi] [-osc] [-httpd] [-resample] [additional Faust options (-vec -vs 8...)] foo.dsp/foo.fbc/foo.ll/foo.bc/foo.mc" << endl; + cout << "Use '-llvm' to use LLVM backend\n"; + cout << "Use '-interp' to use Interpreter backend, using either .dsp or .fbc (Faust Byte Code) files\n"; + cout << "Use '-edit' to start an edit/compile/run loop: closing the window will reopen a new one with the new compiled code\n"; + cout << "Use '-generic' to JIT for a generic CPU (otherwise 'native' mode is used)\n"; + cout << "Use '-nvoices ' to produce a polyphonic self-contained DSP with voices, ready to be used with MIDI or OSC\n"; + cout << "Use '-all' to active the 'all voices always playing' mode\n"; + cout << "Use '-midi' to activate MIDI control\n"; + cout << "Use '-osc' to activate OSC control\n"; + cout << "Use '-httpd' to activate HTTP control\n"; + cout << "Use '-resample' to resample soundfiles to the audio driver sample rate\n"; + exit(EXIT_FAILURE); } - argv1[argc1++] = argv[i]; - cout << argv[i] << " "; - } - cout << endl; - argv1[argc1] = nullptr; // NULL terminated argv - - if (is_llvm) { - string opt_target; - if (is_generic) { - string triple, cpu; - splitTarget(getDSPMachineTarget(), triple, cpu); - opt_target = triple + ":generic"; - cout << "Using LLVM backend in 'generic' mode\n"; - } else { - cout << "Using LLVM backend in 'native' mode\n"; + cout << "Libfaust version : " << getCLibFaustVersion() << endl; + + int argc1 = 0; + const char* argv1[64]; + + cout << "Compiled with additional options : "; + for (int i = 1; i < argc-1; i++) { + if ((string(argv[i]) == "-llvm") + || (string(argv[i]) == "-interp") + || (string(argv[i]) == "-edit") + || (string(argv[i]) == "-generic") + || (string(argv[i]) == "-midi") + || (string(argv[i]) == "-osc") + || (string(argv[i]) == "-all") + || (string(argv[i]) == "-httpd") + || (string(argv[i]) == "-resample")) { + continue; + } else if (string(argv[i]) == "-nvoices") { + i++; + continue; + } + argv1[argc1++] = argv[i]; + cout << argv[i] << " "; } + cout << endl; + argv1[argc1] = nullptr; // NULL terminated argv - // argc : without the filename (last element); - factory = createDSPFactoryFromFile(argv[argc-1], argc1, argv1, opt_target, error_msg, -1); + if (is_llvm) { + + string opt_target; + if (is_generic) { + string triple, cpu; + splitTarget(getDSPMachineTarget(), triple, cpu); + opt_target = triple + ":generic"; + cout << "Using LLVM backend in 'generic' mode\n"; + } else { + cout << "Using LLVM backend in 'native' mode\n"; + } + + // argc : without the filename (last element); + fFactory = createDSPFactoryFromFile(argv[argc-1], argc1, argv1, opt_target, error_msg, -1); + + if (!fFactory) { + cerr << error_msg; + return; + } + + } else { + cout << "Using interpreter backend" << endl; + // argc : without the filename (last element); + fFactory = createInterpreterDSPFactoryFromFile(argv[argc-1], argc1, argv1, error_msg); + } - if (!factory) { + if (!fFactory) { cerr << error_msg; - cout << "Trying to use readDSPFactoryFromIRFile..." << endl; - factory = readDSPFactoryFromIRFile(argv[argc-1], "", error_msg, -1); + return; } - if (!factory) { - cerr << error_msg; - cout << "Trying to use readDSPFactoryFromIRFile..." << endl; - factory = readDSPFactoryFromBitcodeFile(argv[argc-1], "", error_msg, -1); + cout << "getCompileOptions " << fFactory->getCompileOptions() << endl; + printList(fFactory->getLibraryList()); + printList(fFactory->getIncludePathnames()); + + fDSP = fFactory->createDSPInstance(); + if (!fDSP) { + cerr << "Cannot create instance "<< endl; + return; } - if (!factory) { - cerr << error_msg; - cout << "Trying to use readDSPFactoryFromMachineFile..." << endl; - factory = readDSPFactoryFromMachineFile(argv[argc-1], "", error_msg); + if (is_double) { + cout << "Running in double..." << endl; + fDSP = new dsp_sample_adapter(fDSP); } - //cout << "getDSPMachineTarget " << getDSPMachineTarget() << endl; + cout << "getName " << fFactory->getName() << endl; + cout << "getSHAKey " << fFactory->getSHAKey() << endl; - /* - // Test Write/Read - string path_name = factory->getName(); - - cout << "Test writeDSPFactoryToBitcodeFile/readDSPFactoryFromBitcodeFile" << endl; - writeDSPFactoryToBitcodeFile(static_cast(factory), path_name); - deleteDSPFactory(static_cast(factory)); - factory = readDSPFactoryFromBitcodeFile(path_name, "", -1); - cout << "getCompileOptions " << factory->getCompileOptions() << endl; - - printList(factory->getLibraryList()); - printList(factory->getIncludePathnames()); - */ + // Before reading the -nvoices parameter + MidiMeta::analyse(fDSP, midi_sync, nvoices); + nvoices = lopt(argv, "-nvoices", nvoices); - } else { - cout << "Using interpreter backend" << endl; - // argc : without the filename (last element); - factory = createInterpreterDSPFactoryFromFile(argv[argc-1], argc1, argv1, error_msg); + if (nvoices > 0) { + cout << "Starting polyphonic mode 'nvoices' : " << nvoices << " and 'all' : " << is_all << endl; + fDSP = new mydsp_poly(fDSP, nvoices, !is_all, true); + } - if (!factory) { - cerr << error_msg; - cout << "Trying to use createInterpreterDSPFactoryFromFile..." << endl; - factory = readInterpreterDSPFactoryFromBitcodeFile(argv[argc-1], error_msg); + fInterface = new GTKUI(filename, &argc, &argv); + fDSP->buildUserInterface(fInterface); + + fFInterface = new FUI(); + fDSP->buildUserInterface(fFInterface); + + if (!fAudio.init(filename, fDSP)) { + return; } + + // After audio init to get SR + if (is_resample) { + fSoundinterface = new SoundUI("", fAudio.getSampleRate(), nullptr, is_double); + } else { + fSoundinterface = new SoundUI("", -1, nullptr, is_double); + } + fDSP->buildUserInterface(fSoundinterface); + + if (is_httpd) { + fHTTPDinterface = new httpdUI(name, fDSP->getNumInputs(), fDSP->getNumOutputs(), argc, argv); + fDSP->buildUserInterface(fHTTPDinterface); + } + + if (is_osc) { + fOSCinterface = new OSCUI(filename, argc, argv); + fDSP->buildUserInterface(fOSCinterface); + } + + if (is_midi) { + fMIDIInterface = new MidiUI(&fAudio); + fDSP->buildUserInterface(fMIDIInterface); + } + + // State (after UI construction) + fFInterface->recallState(rcfilename); + fAudio.start(); + + if (is_httpd) { + fHTTPDinterface->run(); + } + + if (is_osc) { + fOSCinterface->run(); + } + + if (is_midi) { + fMIDIInterface->run(); + } + + fInterface->run(); + + fAudio.stop(); + fFInterface->saveState(rcfilename); } - if (!factory) { - cerr << error_msg; - exit(EXIT_FAILURE); - } - - cout << "getCompileOptions " << factory->getCompileOptions() << endl; - printList(factory->getLibraryList()); - printList(factory->getIncludePathnames()); - - //factory->setMemoryManager(&manager); causes crash in -fm mode - DSP = factory->createDSPInstance(); - if (!DSP) { - cerr << "Cannot create instance "<< endl; - exit(EXIT_FAILURE); - } - - if (is_double) { - cout << "Running in double..." << endl; - DSP = new dsp_sample_adapter(DSP); - } - - cout << "getName " << factory->getName() << endl; - cout << "getSHAKey " << factory->getSHAKey() << endl; - - // Before reading the -nvoices parameter - MidiMeta::analyse(DSP, midi_sync, nvoices); - nvoices = lopt(argv, "-nvoices", nvoices); - - if (nvoices > 0) { - cout << "Starting polyphonic mode 'nvoices' : " << nvoices << " and 'all' : " << is_all << endl; - DSP = new mydsp_poly(DSP, nvoices, !is_all, true); - } - - GUI* interface = new GTKUI(filename, &argc, &argv); - DSP->buildUserInterface(interface); - - FUI* finterface = new FUI(); - DSP->buildUserInterface(finterface); - - if (!audio.init(filename, DSP)) { - exit(EXIT_FAILURE); - } - - // After audio init to get SR - SoundUI* soundinterface = nullptr; - if (is_resample) { - soundinterface = new SoundUI("", audio.getSampleRate(), nullptr, is_double); - } else { - soundinterface = new SoundUI("", -1, nullptr, is_double); - } - DSP->buildUserInterface(soundinterface); - - if (is_httpd) { - httpdinterface = new httpdUI(name, DSP->getNumInputs(), DSP->getNumOutputs(), argc, argv); - DSP->buildUserInterface(httpdinterface); - } - - if (is_osc) { - oscinterface = new OSCUI(filename, argc, argv); - DSP->buildUserInterface(oscinterface); - } - - if (is_midi) { - midiinterface = new MidiUI(&audio); - DSP->buildUserInterface(midiinterface); - } - - // State (after UI construction) - finterface->recallState(rcfilename); - audio.start(); - - if (is_httpd) { - httpdinterface->run(); - } - - if (is_osc) { - oscinterface->run(); - } - - if (is_midi) { - midiinterface->run(); + ~DynamicDSP() + { + delete fDSP; + delete fInterface; + delete fFInterface; + delete fMIDIInterface; + delete fHTTPDinterface; + delete fOSCinterface; + delete fSoundinterface; + + if (is_llvm) { + deleteDSPFactory(static_cast(fFactory)); + } else { + deleteInterpreterDSPFactory(static_cast(fFactory)); + } } - - interface->run(); - - audio.stop(); - - finterface->saveState(rcfilename); - - delete DSP; - delete interface; - delete finterface; - delete midiinterface; - delete httpdinterface; - delete oscinterface; - delete soundinterface; - - if (is_llvm) { - deleteDSPFactory(static_cast(factory)); + +}; + +int main(int argc, char* argv[]) +{ + if (isopt(argv, "-edit")) { + // A very harsh way of updating the DSP code... + while (true) DynamicDSP(argc, argv); } else { - deleteInterpreterDSPFactory(static_cast(factory)); + // Run once + DynamicDSP(argc, argv); } - return 0; } diff --git a/tools/benchmark/dynamic-machine-jack-gtk.cpp b/tools/benchmark/dynamic-machine-jack-gtk.cpp index 85a4d98d6b..0f9ccd4cee 100644 --- a/tools/benchmark/dynamic-machine-jack-gtk.cpp +++ b/tools/benchmark/dynamic-machine-jack-gtk.cpp @@ -61,7 +61,7 @@ int main(int argc, char* argv[]) bool is_httpd = isopt(argv, "-httpd"); if (isopt(argv, "-h") || isopt(argv, "-help")) { - cout << "dynamic-machine-jack-gtk [-nvoices N] [-midi] [-osc] [-httpd] foo.fbc" << endl; + cout << "dynamic-machine-jack-gtk [-nvoices ] [-midi] [-osc] [-httpd] foo.fbc" << endl; cout << "Use '-nvoices ' to produce a polyphonic self-contained DSP with voices, ready to be used with MIDI or OSC\n"; cout << "Use '-midi' to activate MIDI control\n"; cout << "Use '-osc' to activate OSC control\n"; diff --git a/windows/faust.rc b/windows/faust.rc index e6d144a15b..d85d44b18d 100644 --- a/windows/faust.rc +++ b/windows/faust.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,32,13,0 - PRODUCTVERSION 2,32,13,0 + FILEVERSION 2,32,14,0 + PRODUCTVERSION 2,32,14,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BLOCK "040c04b0" BEGIN VALUE "FileDescription", "Faust compiler" - VALUE "FileVersion", "2, 32, 13, 0" + VALUE "FileVersion", "2, 32, 14, 0" VALUE "InternalName", "Faust" VALUE "LegalCopyright", "Copyright (C) 2009-2019 - Grame" VALUE "OriginalFilename", "faust.exe" VALUE "ProductName", "Faust" - VALUE "ProductVersion", "2, 32, 13, 0" + VALUE "ProductVersion", "2, 32, 14, 0" END END BLOCK "VarFileInfo" diff --git a/windows/faustdll.rc b/windows/faustdll.rc index e6d144a15b..d85d44b18d 100644 --- a/windows/faustdll.rc +++ b/windows/faustdll.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,32,13,0 - PRODUCTVERSION 2,32,13,0 + FILEVERSION 2,32,14,0 + PRODUCTVERSION 2,32,14,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BLOCK "040c04b0" BEGIN VALUE "FileDescription", "Faust compiler" - VALUE "FileVersion", "2, 32, 13, 0" + VALUE "FileVersion", "2, 32, 14, 0" VALUE "InternalName", "Faust" VALUE "LegalCopyright", "Copyright (C) 2009-2019 - Grame" VALUE "OriginalFilename", "faust.exe" VALUE "ProductName", "Faust" - VALUE "ProductVersion", "2, 32, 13, 0" + VALUE "ProductVersion", "2, 32, 14, 0" END END BLOCK "VarFileInfo"