diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..ddae5b8
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "Resources/Libs"]
+ path = Resources/Libs
+ url = https://github.com/grame-cncm/faustlibraries.git
diff --git a/Build/Darwin/Distributions/DefaultDSP.dsp b/Build/Darwin/Distributions/DefaultDSP.dsp
deleted file mode 100644
index b247342..0000000
--- a/Build/Darwin/Distributions/DefaultDSP.dsp
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Darwin/Distributions/DefaultDSP.lib b/Build/Darwin/Distributions/DefaultDSP.lib
deleted file mode 100644
index b247342..0000000
--- a/Build/Darwin/Distributions/DefaultDSP.lib
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Darwin/Distributions/JackOSX.0.92_b3.pkg b/Build/Darwin/Distributions/JackOSX.0.92_b3.pkg
deleted file mode 100644
index 71efb2a..0000000
Binary files a/Build/Darwin/Distributions/JackOSX.0.92_b3.pkg and /dev/null differ
diff --git a/Build/Darwin/Distributions/READ_ME_BEFORE_YOU_START.docx b/Build/Darwin/Distributions/READ_ME_BEFORE_YOU_START.docx
deleted file mode 100644
index 12b9a50..0000000
Binary files a/Build/Darwin/Distributions/READ_ME_BEFORE_YOU_START.docx and /dev/null differ
diff --git a/Build/Darwin/Distributions/READ_ME_BEFORE_YOU_START.pdf b/Build/Darwin/Distributions/READ_ME_BEFORE_YOU_START.pdf
deleted file mode 100644
index 8a391a5..0000000
Binary files a/Build/Darwin/Distributions/READ_ME_BEFORE_YOU_START.pdf and /dev/null differ
diff --git a/Build/Darwin/Distributions/Whats_New.docx b/Build/Darwin/Distributions/Whats_New.docx
deleted file mode 100644
index 6093896..0000000
Binary files a/Build/Darwin/Distributions/Whats_New.docx and /dev/null differ
diff --git a/Build/Darwin/Distributions/Whats_New.pdf b/Build/Darwin/Distributions/Whats_New.pdf
deleted file mode 100644
index 8193c20..0000000
Binary files a/Build/Darwin/Distributions/Whats_New.pdf and /dev/null differ
diff --git a/Build/Darwin/Distributions/process.svg b/Build/Darwin/Distributions/process.svg
deleted file mode 100644
index ffef805..0000000
--- a/Build/Darwin/Distributions/process.svg
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
diff --git a/Build/Darwin/FaustLive.pro b/Build/Darwin/FaustLive.pro
deleted file mode 100755
index b3f4900..0000000
--- a/Build/Darwin/FaustLive.pro
+++ /dev/null
@@ -1,298 +0,0 @@
-######################################################################
-# FAUSTLIVE.PRO
-######################################################################
-
-# THANKS TO QMAKE, THIS FILE WILL PRODUCE THE MAKEFILE OF FAUSTLIVE APPLICATION
-# IT DESCRIBES ALL THE LINKED LIBRAIRIES, COMPILATION OPTIONS, THE SOURCES TO BE COMPILED
-
-TEMPLATE = app
-
-isEmpty(FAUSTDIR) {
- FAUSTDIR = /usr/local
-}
-
-isEmpty(LLVM_CONFIG) {
- LLVM_CONFIG = llvm-config
-}
-
-## The LLVM version we are building against, for the Version popup.
-isEmpty(LLVM_VERSION) {
- LLVM_VERSION = $$system($$LLVM_CONFIG --version)
-}
-
-## Application Settings
-OBJECTS_DIR += ../../src/objectsFolder
-MOC_DIR += ../../src/objectsFolder
-RCC_DIR += ../../src/Utilities
-
-QMAKE_EXTRA_TARGETS += all
-#QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
-
-CONFIG -= x86_64
-CONFIG += exceptions rtti
-
-equals(platform, target_10_9){
-## This needs to be set correctly for OS X 10.9 and later.
-##QMAKE_MAC_SDK = macosx10.11 ## comment out this line with xcode 7
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
-}
-
-equals(platform, target_10_10){
-## This needs to be set correctly for OS X 10.10 and later.
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
-equals(spec, macx-clang){
-QMAKE_MAC_SDK = macosx10.11
-}
-}
-
-## QT libraries needed
-QT+=widgets
-QT+=core
-QT+=gui
-QT+=network
-
-TARGET = FaustLive
-DEFINES += APP_VERSION=\\\"2.0\\\" LLVM_VERSION=\\\"$$LLVM_VERSION\\\"
-
-## Images/Examples and other needed resources
-RESOURCES = ../../Resources/application.qrc
-RESOURCES += ../../Resources/styles.qrc
-#RESOURCES += ../../Resources/scheduler.qrc
-ICON = ../../Resources/Images/FaustLiveIcon.icns
-QMAKE_INFO_PLIST = FaustLiveInfo.plist
-
-####### INCLUDES PATHS && LIBS PATHS
-
-DEPENDPATH += $$FAUSTDIR/include/faust/gui
-INCLUDEPATH += .
-INCLUDEPATH += /opt/local/include
-INCLUDEPATH += /usr/local/include
-INCLUDEPATH += ../../src/Audio
-INCLUDEPATH += ../../src/MenusAndDialogs
-INCLUDEPATH += ../../src/MainStructure
-INCLUDEPATH += ../../src/Network
-INCLUDEPATH += ../../src/Utilities
-
-LIBS+=-L/usr/local/lib
-equals(static, 1){
-LIBS+=$$FAUSTDIR/lib/libfaust.a
-} else {
-LIBS+=-lfaust
-}
-
-# Make sure to include --ldflags twice, once for the -L flags, and once for
-# the system libraries (LLVM 3.4 and earlier have these both in --ldflags).
-LIBS+=$$system($$LLVM_CONFIG --ldflags --libs)
-LIBS+=$$system($$LLVM_CONFIG --ldflags)
-# The system libraries need a different option in LLVM 3.5 and later.
-LIBS+=$$system($$LLVM_CONFIG --system-libs 2>/dev/null)
-
-
-equals(static, 1){
-LIBS+=$$FAUSTDIR/lib/libHTTPDFaust.a
-LIBS+=$$FAUSTDIR/lib/libOSCFaust.a
-} else {
-LIBS+=-lHTTPDFaust
-LIBS+=-lOSCFaust
-}
-
-LIBS+=-lqrencode
-LIBS+=-lmicrohttpd
-LIBS+=-lcrypto
-
-LIBS+=-lcurl
-LIBS+=-L/opt/local/lib
-
-DEFINES += HTTPCTRL
-DEFINES += QRCODECTRL
-
-########## DEFINES/LIBS/SOURCES/...
-########## depending on audio drivers | remote processing feature
-
-equals(REMVAR, 1){
- DEFINES += REMOTE
- LIBS+=-lfaustremote
- LIBS+=-lcurl
- LIBS+=-llo
-
-# HEADER += ../../src/Network/Server.h
-# SOURCES += ../../src/Network/Server.cpp
-
-# INCLUDEPATH += /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote
-#
- HEADERS += ../../src/MenusAndDialogs/FLStatusBar.h
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/tempName.h \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/TMutex.h \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/Slave_DSP.h \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/server_netjackaudio.h \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/Slave_Factory.h \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/Server.h
-#
- SOURCES += ../../src/MenusAndDialogs/FLStatusBar.cpp
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/Slave_DSP.cpp \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/server_netjackaudio.cpp \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/Slave_Factory.cpp \
-# /Users/denoux/faudiostream-code_FAUST2/embedded/faustremote/RemoteServer/Server.cpp
-}
-
-equals(CAVAR, 1){
- message("COREAUDIO LINKED")
- LIBS+= -L/opt/local/lib -framework CoreAudio -framework AudioUnit -framework CoreServices -framework CoreMIDI
- DEFINES += COREAUDIO
- INCLUDEPATH += ../../src/Audio/CA
-
- HEADERS += ../../src/Audio/CA/CA_audioFactory.h\
- ../../src/Audio/CA/CA_audioSettings.h\
- ../../src/Audio/CA/CA_audioManager.h\
- ../../src/Audio/CA/CA_audioFader.h
-
- SOURCES += ../../src/Audio/CA/CA_audioFactory.cpp \
- ../../src/Audio/CA/CA_audioSettings.cpp \
- ../../src/Audio/CA/CA_audioManager.cpp
-}else{
- message("COREAUDIO NOT LINKED")
-}
-
-equals(JVAR, 1){
- message("JACK LINKED")
- LIBS+= -ljack
- DEFINES += JACK
-
- INCLUDEPATH += ../../src/Audio/JA
-
- HEADERS += ../../src/Audio/JA/JA_audioFactory.h \
- ../../src/Audio/JA/JA_audioSettings.h \
- ../../src/Audio/JA/JA_audioManager.h \
- ../../src/Audio/JA/JA_audioFader.h \
-
- SOURCES += ../../src/Audio/JA/JA_audioSettings.cpp \
- ../../src/Audio/JA/JA_audioManager.cpp \
- ../../src/Audio/JA/JA_audioFactory.cpp \
- ../../src/Audio/JA/JA_audioFader.cpp
-}else{
- message("JACK NOT LINKED")
-}
-
-equals(NJVAR, 1){
- message("NETJACK LINKED")
- LIBS += -ljacknet
- DEFINES += NETJACK
-
- INCLUDEPATH += ../../src/Audio/NJ_Master \
- ../../src/Audio/NJ_Slave
-
- HEADERS += ../../src/Audio/NJ_Master/NJm_audioFactory.h \
- ../../src/Audio/NJ_Master/NJm_audioSettings.h \
- ../../src/Audio/NJ_Master/NJm_audioManager.h \
- ../../src/Audio/NJ_Master/NJm_audioFader.h \
- ../../src/Audio/NJ_Slave/NJs_audioFactory.h \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.h \
- ../../src/Audio/NJ_Slave/NJs_audioManager.h \
- ../../src/Audio/NJ_Slave/NJs_audioFader.h
-
- SOURCES += ../../src/Audio/NJ_Master/NJm_audioFactory.cpp \
- ../../src/Audio/NJ_Master/NJm_audioSettings.cpp \
- ../../src/Audio/NJ_Master/NJm_audioManager.cpp \
- ../../src/Audio/NJ_Master/NJm_audioFader.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioFactory.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioManager.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioFader.cpp
-}else{
- message("NETJACK NOT LINKED")
-}
-
-equals(ALVAR, 1){
- message("ALSA LINKED")
- LIBS += -lasound
- DEFINES += ALSA
-
- INCLUDEPATH += ../../src/Audio/AL
-
- HEADERS += ../../src/Audio/AL/AL_audioFactory.h \
- ../../src/Audio/AL/AL_audioSettings.h \
- ../../src/Audio/AL/AL_audioManager.h \
- ../../src/Audio/AL/AL_audioFader.h \
-
- SOURCES += ../../src/Audio/AL/AL_audioFactory.cpp \
- ../../src/Audio/AL/AL_audioSettings.cpp \
- ../../src/Audio/AL/AL_audioManager.cpp
-}else{
- message("ALSA NOT LINKED")
-}
-
-
-equals(PAVAR, 1){
- message("PORT AUDIO LINKED")
-
- LIBS += -lportaudio
- DEFINES += PORTAUDIO
-
- INCLUDEPATH += ../../src/Audio/PA
-
- HEADERS += ../../src/Audio/PA/PA_audioFactory.h \
- ../../src/Audio/PA/PA_audioSettings.h \
- ../../src/Audio/PA/PA_audioManager.h \
- ../../src/Audio/PA/PA_audioFader.h \
-
- SOURCES += ../../src/Audio/PA/PA_audioFader.cpp \
- ../../src/Audio/PA/PA_audioFactory.cpp \
- ../../src/Audio/PA/PA_audioSettings.cpp \
- ../../src/Audio/PA/PA_audioManager.cpp
-}else{
- message("PORT AUDIO NOT LINKED")
-}
-
-########## HEADERS AND SOURCES OF PROJECT
-
-HEADERS += ../../src/Utilities/utilities.h \
- ../../src/Audio/AudioSettings.h \
- ../../src/Audio/AudioManager.h \
- ../../src/Audio/AudioFactory.h \
- ../../src/Audio/AudioCreator.h \
- ../../src/Audio/AudioFader_Interface.h \
- ../../src/Audio/AudioFader_Implementation.h \
- ../../src/Audio/FJUI.h \
- ../../src/MenusAndDialogs/FLToolBar.h \
- ../../src/MenusAndDialogs/FLHelpWindow.h \
- ../../src/MenusAndDialogs/FLPresentationWindow.h \
- ../../src/MenusAndDialogs/FLErrorWindow.h \
- ../../src/MenusAndDialogs/FLMessageWindow.h \
- ../../src/MenusAndDialogs/FLExportManager.h \
- ../../src/MenusAndDialogs/FLPreferenceWindow.h \
- ../../src/MainStructure/FLWindow.h \
- ../../src/MainStructure/FLComponentWindow.h \
- ../../src/MainStructure/FLSettings.h \
- ../../src/MainStructure/FLWinSettings.h \
- ../../src/MainStructure/FLFileWatcher.h \
- ../../src/Network/FLServerHttp.h \
- ../../src/MainStructure/FLSessionManager.h \
- ../../src/MainStructure/FLApp.h \
- ../../src/MainStructure/FLInterfaceManager.h \
- ../../src/MenusAndDialogs/SimpleParser.h \
- ../../src/Network/HTTPWindow.h \
- $$FAUSTDIR/include/faust/gui/faustqt.h
-
-SOURCES += ../../src/Utilities/utilities.cpp \
- ../../src/Audio/AudioCreator.cpp \
- ../../src/Audio/AudioFader_Implementation.cpp \
- ../../src/MenusAndDialogs/FLToolBar.cpp \
- ../../src/MenusAndDialogs/FLHelpWindow.cpp \
- ../../src/MenusAndDialogs/FLPresentationWindow.cpp \
- ../../src/MenusAndDialogs/FLErrorWindow.cpp \
- ../../src/MenusAndDialogs/FLMessageWindow.cpp \
- ../../src/MenusAndDialogs/FLExportManager.cpp \
- ../../src/MainStructure/FLWindow.cpp \
- ../../src/MainStructure/FLComponentWindow.cpp \
- ../../src/MainStructure/FLSettings.cpp \
- ../../src/MainStructure/FLWinSettings.cpp \
- ../../src/MainStructure/FLFileWatcher.cpp \
- ../../src/MenusAndDialogs/FLPreferenceWindow.cpp \
- ../../src/MainStructure/FLSessionManager.cpp \
- ../../src/MainStructure/FLApp.cpp \
- ../../src/MainStructure/FLInterfaceManager.cpp \
- ../../src/Network/FLServerHttp.cpp \
- ../../src/Network/HTTPWindow.cpp \
- ../../src/MenusAndDialogs/SimpleParser.cpp \
- ../../src/Utilities/main.cpp
diff --git a/Build/Darwin/Makefile b/Build/Darwin/Makefile
deleted file mode 100644
index 0915fd1..0000000
--- a/Build/Darwin/Makefile
+++ /dev/null
@@ -1,126 +0,0 @@
-### Defining some variables
-qm := $(shell which qmake)
-##qm := $(if $(qm4),$(qm4),qmake)
-
-# This needs to be set correctly for OS X 10.9 and later.
-platform = $(shell test `uname -v | cut -d : -f1 | cut -d. -f1 | cut -d' ' -f4` -gt 12 && echo target_10_9)
-platform = $(shell test `uname -v | cut -d : -f1 | cut -d. -f1 | cut -d' ' -f4` -gt 13 && echo target_10_10)
-# Figure out the right makespec for the Qt version that we have.
-spec = $(shell test `$(qm) --version | tail -1 | sed -e 's/^.*version \([0-9]*\).*$$/\1/'` -gt 4 && echo macx-clang || echo macx-g++)
-
-SPEC := -spec $(spec)
-DST := "FaustLive.app/Contents/MacOS"
-QM-DEFS := "platform=$(platform)" "spec=$(spec)" "CAVAR=1"
-
-# The following FAUSTDIR and LLVM_CONFIG variables also override defaults set
-# in the project file.
-
-# We need to know where Faust lives. This will be detected automatically if
-# the faust executable is on the PATH, otherwise you may have to set this
-# manually.
-FAUSTDIR = $(patsubst %/bin/faust,%,$(shell which faust 2>/dev/null))
-ifeq ($(strip $(FAUSTDIR)),)
-# Fall back to /usr/local.
-FAUSTDIR = /usr/local
-endif
-
-# We also need the name of the llvm-config command for the LLVM version that
-# you want to use. By default, we assume just llvm-config, which must be on
-# the system PATH. Otherwise you'll have to specify the full pathname of the
-# llvm-config executable that you want to use.
-LLVM_CONFIG = llvm-config
-
-### Defining qmake variables
-ifeq ($(JACK), 1)
- QM-DEFS += "JVAR=1"
-endif
-ifeq ($(REMOTE), 1)
- QM-DEFS += "JVAR=1"
- QM-DEFS += "NJVAR=1"
- QM-DEFS += "REMVAR=1"
-endif
-ifeq ($(NETJACK), 1)
- QM-DEFS += "NJVAR=1"
-endif
-ifeq ($(COREAUDIO), 1)
- QM-DEFS += "CAVAR=1"
-endif
-ifeq ($(PORTAUDIO), 1)
- QM-DEFS += "PAVAR=1"
-endif
-ifeq ($(STATIC), 1)
- QM-DEFS += "static=1"
-endif
-
-ifneq ($(FAUSTDIR),)
- QM-DEFS += "FAUSTDIR=$(FAUSTDIR)"
-endif
-ifneq ($(LLVM_CONFIG),)
- QM-DEFS += "LLVM_CONFIG=$(LLVM_CONFIG)"
-endif
-####### Targets
-
-all : Makefile-qt
- ./buildversion
- make -f Makefile-qt
-
-help :
- @echo "Usage : 'make; sudo make install'"
- @echo "To enable Jack or NetJack driver : 'make JACK=1 NETJACK=1'"
- @echo "To enable remote processing : 'make REMOTE=1'"
- @echo "make or make all : compile FaustLive"
- @echo "make clean : remove all object files"
- @echo "make install : install FaustLive and its resources in Applications"
- @echo "make uninstall : undo what install did"
- @echo "make dist : make a FaustLive distribution as a .dmg file"
-
-###### Creates LLVM Library containing math float functions like "powf" (not existing on windows)
-math_lib :
- $(shell $(shell llvm-config --prefix)/bin/clang -emit-llvm ../../src/Utilities/llvm_math.c -c -S -o ../../Resources/Libs/llvm_math.ll)
-
-####### Packages
-
-# Solve FaustLive's dependencies
-deploy:
- macdeployqt FaustLive.app
-
-
-# make a binary distribution .dmg file for OSX
-dist:
- rm -rf FaustLive.app
- make
- cp $(FAUSTDIR)/bin/sound2faust FaustLive.app/Contents/MacOS
- macdeployqt FaustLive.app
- ./distribution
- #./distversion
-
-####### Install
-
-# The OSX application usually gets installed under /Applications, but MacPorts
-# mandates an installation in /Applications/MacPorts, so we make the
-# installation directory configurable here. Also, DESTDIR is supported for
-# staging purposes. - ag
-APPDIR = /Applications
-
-install:
- cp $(FAUSTDIR)/bin/sound2faust FaustLive.app/Contents/MacOS
- rm -rf $(DESTDIR)$(APPDIR)/FaustLive.app
- cp -R FaustLive.app $(DESTDIR)$(APPDIR)
-
-uninstall:
- rm -rf $(DESTDIR)$(APPDIR)/FaustLive.app
-
-####### MAKE MAKEFILE-qt
-
-clean : Makefile-qt
- make -f Makefile-qt clean
- rm -f FaustLive.pro.user
- rm -rf FaustLive.app
- rm -f Makefile-qt
- rm -f ../../Resources/styles.qrc
-
-../../Resources/styles.qrc: ../../Resources/styles.qrc.in
- sed -e 's?@FAUSTDIR@?$(FAUSTDIR)?g' < $< > $@
-
-Makefile-qt: ../../Resources/styles.qrc
- $(qm) $(SPEC) -o Makefile-qt $(QM-DEFS)
diff --git a/Build/Darwin/README.txt b/Build/Darwin/README.txt
deleted file mode 100644
index b358552..0000000
--- a/Build/Darwin/README.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-
-============================== FAUSTLIVE =========================
-
-The goal of this project is to build an application that embeds Faust and LLVM compiler to provide dynamical compilation of the Faust programming language.
-
-----------------LINKED LIBRARIES------------------
-
-In order to compile FaustLive, the following libraries are needed:
-
-Through MacPorts on OSX:
-- llvm (3.1 and higher)
-- clang (same version than llvm)
-- qt (4.8 and higher)
-- qrencode
-- libmicrohttpd
-
-For remote processing :
-- libcurl
-- liblo (0.28 and higher)
-
-Other Packages
-- JackOSX http://jackaudio.org/downloads/
-- Faust2 https://sourceforge.net/projects/faudiostream/files/ (the "dynamic" version must be compiled)
- cd FAUSTDIRECTORY
- make dynamic
- make httpd
- sudo make install
- (if you want to use remote processing
- make remote
- sudo make install)
- (if you want to use waveforms
- make sound2faust ('static' : mandatory for libsndfile to be statically linked)
- sudo make install)
-
-Make sure to download the current development trunk of these libraries.
-
-----------------PROJECT COMPILATION---------------
-
-cd projetDIR
-
-make
-sudo make install
-
-OSX default audio = CoreAudio
-
-To add Jack/NetJack or PortAudio to compilation
-make JACK=1 NETJACK=1 PORTAUDIO=1
-
-To enable remote processing option
-make REMOTE=1
-
------------------WARNINGS---------------
-
-1) If you want to recompile with new compilation options, you will have to execute
- "make clean" before doing "make"
- & "make uninstall" before "make install"
-
-2) If you use the remote control through httpd and you want to use a port < 100, you will have to start FaustLive in sudo mode.
-
-3) To use remote processing through wi-fi, set network parameters MTU on standard 1500.
-
----------------TO ADD A NEW AUDIO ARCHITECTURE---------------
-
-1) Implement the classes :
- - _audioFader
- - _audioFactory
- - _audioManager
- - _audioSettings
-
-2) Modify AudioCreator to add the architecture in
- - enum audioArchitecture
- - add item in fAudioArchitecture
- - add case in createFactory
- - add case in read/write Settings
-
-3) Modify FaustLive.pro to add the libraries through conditional Compilation
-
-----------------TO ADD FAUST LIBRAIRIES---------------
-
-1) Add the library in "Resources" folder
-2) Add the library in application.qrc
-
----------------TO CREATE the final DMG file---------------
-
-make dist
diff --git a/Build/Darwin/buildversion b/Build/Darwin/buildversion
deleted file mode 100755
index 693dd57..0000000
--- a/Build/Darwin/buildversion
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-filename="../../Resources/buildVersion.txt"
-
-if [ -f "$filename" ]
-then
- while read line
- do
- echo $(echo "$line+0.0001" | bc -l) > "$filename"
- done < "$filename"
-else
- echo "0.0001" > "$filename"
-fi
-
-rm -f ../../src/Utilities/qrc_application.cpp
diff --git a/Build/Darwin/distribution b/Build/Darwin/distribution
deleted file mode 100755
index 4bf7c5d..0000000
--- a/Build/Darwin/distribution
+++ /dev/null
@@ -1,27 +0,0 @@
-#Upgrading number version in Info.plist
-bN=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" FaustLiveInfo.plist)
-
-nameDist="Distributions/FaustLive-OSX-$bN"
-$(mkdir $nameDist)
-$(mkdir $nameDist/Documentation)
-$(mkdir $nameDist/FaustLive)
-$(mkdir $nameDist/FilesToConfigure)
-$(mkdir $nameDist/Jack)
-
-cp Distributions/READ_ME_BEFORE_YOU_START.pdf $nameDist
-cp Distributions/Whats_New.pdf $nameDist
-
-cp Distributions/DefaultDSP.dsp $nameDist/FilesToConfigure
-cp Distributions/DefaultDSP.lib $nameDist/FilesToConfigure
-cp Distributions/process.svg $nameDist/FilesToConfigure
-cp Distributions/JackOSX.*.pkg $nameDist/Jack
-
-cp ../../Documentation/faust-quick-reference.pdf $nameDist/Documentation
-cp ../../Documentation/UserManual.pdf $nameDist/Documentation/UserManual-$bN.pdf
-
-cp -R FaustLive.app $nameDist/FaustLive
-hdiutil create -volname $nameDist.dmg -srcfolder $nameDist -ov -format UDZO $nameDist.dmg
-
-cp $nameDist.dmg FaustLive-OSX-$bN.dmg
-
-rm -r $nameDist
\ No newline at end of file
diff --git a/Build/Darwin/distversion b/Build/Darwin/distversion
deleted file mode 100755
index 7a2aecc..0000000
--- a/Build/Darwin/distversion
+++ /dev/null
@@ -1,6 +0,0 @@
-#Upgrading number version in Info.plist
-bN=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" FaustLiveInfo.plist)
-bN=$(echo "$bN+0.01" | bc -l)
-/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bN" FaustLiveInfo.plist
-
-echo $bN > "../../Resources/distVersion.txt"
diff --git a/Build/FaustLive.pro b/Build/FaustLive.pro
new file mode 100755
index 0000000..17b3d37
--- /dev/null
+++ b/Build/FaustLive.pro
@@ -0,0 +1,212 @@
+######################################################################
+# FAUSTLIVE.PRO
+######################################################################
+TARGET = FaustLive
+win32:!msys:!mingw {
+ TEMPLATE = vcapp
+}
+else {
+ TEMPLATE = app
+}
+ROOT = $$PWD/..
+BUILD = $$PWD
+SRC = $$ROOT/src
+DESTDIR = $$PWD/FaustLive
+
+LOCALLIB = $$ROOT/lib
+
+VERSION = $$cat($$ROOT/version.txt)
+isEmpty(FAUSTLIB) { FAUSTLIB = "$$system(faust -libdir)" }
+isEmpty(FAUSTINC) { FAUSTINC = "$$system(faust -includedir)" }
+
+message ("Using Faust libs from $$FAUSTLIB")
+message ("Using Faust incl from $$FAUSTINC")
+
+
+isEmpty(LLVM_CONFIG) { LLVM_CONFIG = llvm-config }
+## The LLVM version we are building against, for the Version popup.
+isEmpty(LLVM_VERSION) { LLVM_VERSION = $$system($$LLVM_CONFIG --version) }
+LLVM_LIBS = $$system($$LLVM_CONFIG --libnames)
+
+## Output settings
+OBJECTS_DIR = tmp
+MOC_DIR = tmp
+RCC_DIR = tmp
+
+CONFIG += exceptions rtti c++11
+
+## QT libraries needed
+QT += core gui widgets network
+DEFINES += VERSION=\\\"$$VERSION\\\"
+DEFINES += APP_VERSION=\\\"2.0\\\"
+DEFINES += LLVM_VERSION=\\\"$$LLVM_VERSION\\\"
+
+## Images/Examples and other needed resources
+RESOURCES += $$ROOT/Resources/application.qrc
+RESOURCES += $$ROOT/Resources/styles.qrc
+ICON = $$ROOT/Resources/Images/FaustLiveIcon.icns
+macx {
+ QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
+ QMAKE_INFO_PLIST = rsrc/FaustLiveInfo.plist
+ RSRC.files = $$ROOT/Resources/Images/FaustLiveIcon.icns
+ RSRC.path = Contents/Resources
+ QMAKE_BUNDLE_DATA += RSRC
+}
+win32 {
+ RC_FILE = rsrc/FaustLive.rc
+}
+
+####### INCLUDES PATHS && LIBS PATHS
+DEPENDPATH += $$FAUSTINC/faust/gui
+INCLUDEPATH += . $$SRC/Audio $$SRC/MainStructure $$SRC/MenusAndDialogs $$SRC/Network $$SRC/Utilities $$FAUSTINC
+
+unix {
+ LIBS += -L/usr/local/lib
+ QMAKE_CXX_FLAGS +== -Wno-unused-parameter -Wno-unused-variable
+ INCLUDEPATH += /usr/local/include
+}
+
+####### windows config
+win32 {
+ msys|mingw {
+ DEFINES += USEWINMAIN
+ DEFINES += GCC
+ LIBS += $$FAUSTLIB/libfaust.a
+ LIBS += $$FAUSTLIB/libHTTPDFaust.a
+ LIBS += $$FAUSTLIB/libOSCFaust.a
+ LIBS += $$system($$LLVM_CONFIG --ldflags) $$system($$LLVM_CONFIG --libs)
+ LIBS += $$LOCALLIB/libmicrohttpd/x64/MSYS/libmicrohttpd.lib
+ LIBS += -lwinmm -lws2_32
+ }
+ else {
+ DEFINES += _WIN32
+ defined(LIBSNDFILE) {}
+ else { LIBSNDFILE = "C:\Program Files\Mega-Nerd\libsndfile" }
+ message ("Using libsndfile from $$LIBSNDFILE")
+ CONSOLE {
+ CONFIG += console
+ message ("Generates FaustLive with console")
+ }
+ else {
+ CONFIG -= console
+ DEFINES += USEWINMAIN
+ }
+ LLVM_LD_FLAGS= "$$system($$LLVM_CONFIG --ldflags)"
+ QMAKE_LFLAGS += "$$replace(LLVM_LD_FLAGS, "-", "/")"
+ LIBS += winmm.lib ws2_32.lib $$LIBSNDFILE/lib/libsndfile-1.lib
+ LIBS += $$FAUSTLIB/libfaust.lib
+ LIBS += $$FAUSTLIB/libHTTPDFaust.lib
+ LIBS += $$FAUSTLIB/libOSCFaust.lib
+ LIBS += $$LOCALLIB/libmicrohttpd/x64/libmicrohttpd.lib
+ LIBS += $$LLVM_LIBS
+ CONFIG += portaudio
+ }
+ INCLUDEPATH += $$LIBSNDFILE/include $$LOCALLIB/libmicrohttpd
+}
+else {
+ LIBS += $$system($$LLVM_CONFIG --ldflags) $$system($$LLVM_CONFIG --libs)
+ LIBS += $$system(pkg-config --libs libmicrohttpd) -lsndfile -lcurl -lz -ldl
+ static {
+ message("Uses static link for Faust libs")
+ LIBS += $$FAUSTLIB/libfaust.a
+ LIBS += $$FAUSTLIB/libHTTPDFaust.a
+ LIBS += $$FAUSTLIB/libOSCFaust.a
+ } else {
+ message("Uses dynamic link for Faust libs")
+ LIBS += -L$$FAUSTLIB -lHTTPDFaust -lOSCFaust -lfaust
+ LIBS += -Wl,-rpath,$$FAUSTLIB
+ }
+}
+
+DEFINES += HTTPCTRL
+DEFINES += QRCODECTRL
+
+##############################
+# common source and headers
+##############################
+HEADERS += $$files($$SRC/Utilities/*.h)
+HEADERS += $$files($$SRC/Audio/*.h)
+HEADERS += $$files($$SRC/MenusAndDialogs/*.h)
+HEADERS += $$files($$SRC/MainStructure/*.h)
+HEADERS += $$SRC/Network/FLServerHttp.h \
+ $$SRC/Network/HTTPWindow.h \
+ $$FAUSTINC/faust/gui/faustqt.h
+
+SOURCES += $$files($$SRC/Utilities/*.cpp)
+SOURCES += $$files($$SRC/Audio/*.cpp)
+SOURCES += $$files($$SRC/MenusAndDialogs/*.cpp)
+SOURCES += $$files($$SRC/MainStructure/*.cpp)
+SOURCES += $$SRC/Network/FLServerHttp.cpp \
+ $$SRC/Network/HTTPWindow.cpp
+
+##############################
+# platform settings
+##############################
+macx {
+ message("MacOS CoreAudio driver")
+ LIBS += -framework CoreAudio -framework AudioUnit -framework CoreServices -framework CoreMIDI
+ DEFINES += COREAUDIO
+ INCLUDEPATH += $$SRC/Audio/CA $$system(pkg-config --cflags libmicrohttpd)
+ HEADERS += $$files($$SRC/Audio/CA/*.h)
+ SOURCES += $$files($$SRC/Audio/CA/*.cpp)
+}
+
+unix:!macx {
+ CONFIG += jack
+ LIBS += -lasound -ltinfo
+}
+
+LIBS += $$system(llvm-config --system-libs)
+
+##############################
+# optional settings
+##############################
+alsa {
+ message("Linux Alsa audio driver")
+ LIBS += -lasound
+ DEFINES += ALSA
+ INCLUDEPATH += $$SRC/Audio/AL
+ HEADERS += $$files($$SRC/Audio/AL/*.h)
+ SOURCES += $$files($$SRC/Audio/AL/*.cpp)
+}
+
+
+portaudio {
+ message("Portaudio included")
+ win32 { LIBS += $$ROOT/lib/portaudio/lib/portaudio.lib}
+ else { LIBS += -lportaudio}
+ DEFINES += PORTAUDIO
+ INCLUDEPATH += $$SRC/Audio/PA $$ROOT/lib/portaudio/include
+ HEADERS += $$files($$SRC/Audio/PA/*.h)
+ SOURCES += $$files($$SRC/Audio/PA/*.cpp)
+}
+
+jack {
+ message("Jack included")
+ LIBS += -ljack
+ DEFINES += JACK
+ INCLUDEPATH += $$SRC/Audio/JA
+ HEADERS += $$files($$SRC/Audio/JA/*.h)
+ SOURCES += $$files($$SRC/Audio/JA/*.cpp)
+}
+
+netjack {
+ message("NetJack included")
+ LIBS += -ljacknet
+ DEFINES += NETJACK
+ INCLUDEPATH += $$SRC/Audio/NJ_Master \
+ $$SRC/Audio/NJ_Slave
+ HEADERS += $$files($$SRC/Audio/NJ_Master/*.h) \
+ $$files($$SRC/Audio/NJ_Slave/*.h)
+ SOURCES += $$files($$SRC/Audio/NJ_Master/*.cpp) \
+ $$files($$SRC/Audio/NJ_Slave/*.cpp)
+}
+
+remote { # remote processing feature
+ message("Remote processing included")
+ DEFINES += REMOTE
+ LIBS +=-lfaustremote -lcurl -llo
+ HEADERS += $$SRC/MenusAndDialogs/FLStatusBar.h
+ SOURCES += $$SRC/MenusAndDialogs/FLStatusBar.cpp
+}
+
diff --git a/Build/Linux/Distributions/DefaultDSP.dsp b/Build/Linux/Distributions/DefaultDSP.dsp
deleted file mode 100644
index b247342..0000000
--- a/Build/Linux/Distributions/DefaultDSP.dsp
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Linux/Distributions/DefaultDSP.lib b/Build/Linux/Distributions/DefaultDSP.lib
deleted file mode 100644
index b247342..0000000
--- a/Build/Linux/Distributions/DefaultDSP.lib
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Linux/Distributions/READ_ME_BEFORE_YOU_START.docx b/Build/Linux/Distributions/READ_ME_BEFORE_YOU_START.docx
deleted file mode 100644
index 3520e4f..0000000
Binary files a/Build/Linux/Distributions/READ_ME_BEFORE_YOU_START.docx and /dev/null differ
diff --git a/Build/Linux/Distributions/READ_ME_BEFORE_YOU_START.pdf b/Build/Linux/Distributions/READ_ME_BEFORE_YOU_START.pdf
deleted file mode 100644
index 2ac26ee..0000000
Binary files a/Build/Linux/Distributions/READ_ME_BEFORE_YOU_START.pdf and /dev/null differ
diff --git a/Build/Linux/Distributions/Whats_New.docx b/Build/Linux/Distributions/Whats_New.docx
deleted file mode 100644
index 0ffa477..0000000
Binary files a/Build/Linux/Distributions/Whats_New.docx and /dev/null differ
diff --git a/Build/Linux/Distributions/Whats_New.pdf b/Build/Linux/Distributions/Whats_New.pdf
deleted file mode 100644
index 28630de..0000000
Binary files a/Build/Linux/Distributions/Whats_New.pdf and /dev/null differ
diff --git a/Build/Linux/Distributions/process.svg b/Build/Linux/Distributions/process.svg
deleted file mode 100644
index ffef805..0000000
--- a/Build/Linux/Distributions/process.svg
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
diff --git a/Build/Linux/FaustLive.pro b/Build/Linux/FaustLive.pro
deleted file mode 100755
index 1fc6709..0000000
--- a/Build/Linux/FaustLive.pro
+++ /dev/null
@@ -1,252 +0,0 @@
-######################################################################
-# FAUSTLIVE.PRO
-######################################################################
-
-# THANKS TO QMAKE, THIS FILE WILL PRODUCE THE MAKEFILE OF FAUSTLIVE APPLICATION
-# IT DESCRIBES ALL THE LINKED LIBRAIRIES, COMPILATION OPTIONS, THE SOURCES TO BE COMPILED
-
-TEMPLATE = app
-
-isEmpty(FAUSTDIR) {
- FAUSTDIR = /usr/local
-}
-
-isEmpty(LLVM_CONFIG) {
- LLVM_CONFIG = llvm-config
-}
-
-isEmpty(CURL_CONFIG) {
- CURL_CONFIG = curl-config
-}
-
-## The LLVM version we are building against, for the Version popup.
-isEmpty(LLVM_VERSION) {
- LLVM_VERSION = $$system($$LLVM_CONFIG --version)
-}
-
-## Application Settings
-OBJECTS_DIR += ../../src/objectsFolder
-MOC_DIR += ../../src/objectsFolder
-RCC_DIR += ../../src/Utilities
-
-QMAKE_EXTRA_TARGETS += all
-
-CONFIG -= x86_64
-CONFIG += exceptions rtti
-
-## QT libraries needed
-QT+=widgets
-QT+=core
-QT+=gui
-QT+=network
-
-TARGET = FaustLive
-DEFINES += APP_VERSION=\\\"2.0\\\" LLVM_VERSION=\\\"$$LLVM_VERSION\\\"
-
-## Images/Examples and other needed resources
-RESOURCES = ../../Resources/application.qrc
-RESOURCES += ../../Resources/styles.qrc
-ICON = Resources/Images/FaustLiveIcon.icns
-QMAKE_INFO_PLIST = FaustLiveInfo.plist
-
-####### INCLUDES PATHS && LIBS PATHS
-
-DEPENDPATH += $$FAUSTDIR/include/faust/gui
-INCLUDEPATH += .
-INCLUDEPATH += /opt/local/include
-INCLUDEPATH += ../../src/Audio
-INCLUDEPATH += ../../src/MenusAndDialogs
-INCLUDEPATH += ../../src/MainStructure
-INCLUDEPATH += ../../src/Network
-INCLUDEPATH += ../../src/Utilities
-
-LIBS+=-L$$FAUSTDIR/lib/ -L/usr/lib/ -L/opt/local/lib
-
-equals(static, 1){
- LIBS+=-Wl,-static -lHTTPDFaust -lOSCFaust -lfaust -lqrencode -lmicrohttpd -Wl,-Bdynamic
-} else {
- LIBS+=-lHTTPDFaust -lOSCFaust -lfaust -lqrencode -lmicrohttpd
-}
-
-
-equals(static, 1){
- #LIBS+=/usr/local/lib/libqrencode.a
- #LIBS+=/usr/local/lib/libmicrohttpd.a
- #LIBS+=-lgnutls
- #LIBS+=/usr/lib/x86_64-linux-gnu/libgnutls.a
- #LIBS+=/lib/x86_64-linux-gnu/libgcrypt.a
- #LIBS+=/usr/lib/x86_64-linux-gnu/libgpg-error.a
- #LIBS+=/usr/lib/x86_64-linux-gnu/libtasn1.a
- #LIBS+=-lp11-kit
- #LIBS+=-lcurl
- #LIBS+=-Wl,-static
-}
-
-# LIBS+=-lqrencode
-# LIBS+=-lmicrohttpd
- LIBS+=-lcrypto
- LIBS+=-lcurl
- LIBS+=-lasound
-
-DEFINES += HTTPCTRL
-DEFINES += QRCODECTRL
-
-########## DEFINES/LIBS/SOURCES/... depending on audio drivers | remote processing feature
-
-equals(REMVAR, 1){
- DEFINES += REMOTE
- LIBS+=-lfaustremote
- LIBS+=-lcurl
- LIBS+=-llo
- LIBS+=-ldbus-1 -lrt
-
- HEADERS += ../../src/MenusAndDialogs/FLStatusBar.h
- SOURCES += ../../src/MenusAndDialogs/FLStatusBar.cpp
-
- #HEADERS += ../../src/Network/Server.h
- #SOURCES += ../../src/Network/Server.cpp
-}
-
-equals(JVAR, 1){
- message("JACK LINKED")
- LIBS+= -ljack
- DEFINES += JACK
-
- INCLUDEPATH += ../../src/Audio/JA
-
- HEADERS += ../../src/Audio/JA/JA_audioFactory.h \
- ../../src/Audio/JA/JA_audioSettings.h \
- ../../src/Audio/JA/JA_audioManager.h \
- ../../src/Audio/JA/JA_audioFader.h \
-
- SOURCES += ../../src/Audio/JA/JA_audioSettings.cpp \
- ../../src/Audio/JA/JA_audioManager.cpp \
- ../../src/Audio/JA/JA_audioFactory.cpp \
- ../../src/Audio/JA/JA_audioFader.cpp
-}else{
- message("JACK NOT LINKED")
-}
-
-equals(NJVAR, 1){
- message("NETJACK LINKED")
- LIBS += -ljacknet
- DEFINES += NETJACK
-
- INCLUDEPATH += ../../src/Audio/NJ_Slave
-
- HEADERS += ../../src/Audio/NJ_Slave/NJs_audioFactory.h \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.h \
- ../../src/Audio/NJ_Slave/NJs_audioManager.h \
- ../../src/Audio/NJ_Slave/NJs_audioFader.h
-
- SOURCES += ../../src/Audio/NJ_Slave/NJs_audioFactory.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioManager.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioFader.cpp
-}else{
- message("NETJACK NOT LINKED")
-}
-
-equals(ALVAR, 1){
- message("ALSA LINKED")
- LIBS += -lasound
- DEFINES += ALSA
-
- INCLUDEPATH += ../../src/Audio/AL
-
- HEADERS += ../../src/Audio/AL/AL_audioFactory.h \
- ../../src/Audio/AL/AL_audioSettings.h \
- ../../src/Audio/AL/AL_audioManager.h \
- ../../src/Audio/AL/AL_audioFader.h \
-
- SOURCES += ../../src/Audio/AL/AL_audioFactory.cpp \
- ../../src/Audio/AL/AL_audioSettings.cpp \
- ../../src/Audio/AL/AL_audioManager.cpp
-}else{
- message("ALSA NOT LINKED")
-}
-
-equals(PAVAR, 1){
- message("PORT AUDIO LINKED")
-
-## LIBS += -lportaudio_x86
- LIBS += -lportaudio
-
- DEFINES += PORTAUDIO
-
- INCLUDEPATH += ../../src/Audio/PA
-
- HEADERS += ../../src/Audio/PA/PA_audioFactory.h \
- ../../src/Audio/PA/PA_audioSettings.h \
- ../../src/Audio/PA/PA_audioManager.h \
- ../../src/Audio/PA/PA_audioFader.h \
-
- SOURCES += ../../src/Audio/PA/PA_audioFader.cpp \
- ../../src/Audio/PA/PA_audioFactory.cpp \
- ../../src/Audio/PA/PA_audioSettings.cpp \
- ../../src/Audio/PA/PA_audioManager.cpp
-}else{
- message("PORT AUDIO NOT LINKED")
-}
-
-########## LIBS AND FLAGS
-
-# Make sure to include --ldflags twice, once for the -L flags, and once for
-# the system libraries (LLVM 3.4 and earlier have these both in --ldflags).
-LIBS+=$$system($$LLVM_CONFIG --ldflags --libs)
-LIBS+=$$system($$LLVM_CONFIG --ldflags)
-# The system libraries need a different option in LLVM 3.5 and later.
-LIBS+=$$system($$LLVM_CONFIG --system-libs 2>/dev/null)
-
-########## HEADERS AND SOURCES OF PROJECT
-
-HEADERS += ../../src/Utilities/utilities.h \
- ../../src/Audio/AudioSettings.h \
- ../../src/Audio/AudioManager.h \
- ../../src/Audio/AudioFactory.h \
- ../../src/Audio/AudioCreator.h \
- ../../src/Audio/AudioFader_Interface.h \
- ../../src/Audio/AudioFader_Implementation.h \
- ../../src/Audio/FJUI.h \
- ../../src/MenusAndDialogs/FLToolBar.h \
- ../../src/MenusAndDialogs/FLHelpWindow.h \
- ../../src/MenusAndDialogs/FLPresentationWindow.h \
- ../../src/MenusAndDialogs/FLErrorWindow.h \
- ../../src/MenusAndDialogs/FLMessageWindow.h \
- ../../src/MenusAndDialogs/FLExportManager.h \
- ../../src/MenusAndDialogs/FLPreferenceWindow.h \
- ../../src/MainStructure/FLWindow.h \
- ../../src/MainStructure/FLComponentWindow.h \
- ../../src/MainStructure/FLSettings.h \
- ../../src/MainStructure/FLWinSettings.h \
- ../../src/MainStructure/FLFileWatcher.h \
- ../../src/Network/FLServerHttp.h \
- ../../src/MainStructure/FLSessionManager.h \
- ../../src/MainStructure/FLApp.h \
- ../../src/MainStructure/FLInterfaceManager.h \
- ../../src/MenusAndDialogs/SimpleParser.h \
- ../../src/Network/HTTPWindow.h \
- $$FAUSTDIR/include/faust/gui/faustqt.h
-
-SOURCES += ../../src/Utilities/utilities.cpp \
- ../../src/Audio/AudioCreator.cpp \
- ../../src/Audio/AudioFader_Implementation.cpp \
- ../../src/MenusAndDialogs/FLToolBar.cpp \
- ../../src/MenusAndDialogs/FLHelpWindow.cpp \
- ../../src/MenusAndDialogs/FLPresentationWindow.cpp \
- ../../src/MenusAndDialogs/FLErrorWindow.cpp \
- ../../src/MenusAndDialogs/FLMessageWindow.cpp \
- ../../src/MenusAndDialogs/FLExportManager.cpp \
- ../../src/MainStructure/FLWindow.cpp \
- ../../src/MainStructure/FLComponentWindow.cpp \
- ../../src/MainStructure/FLSettings.cpp \
- ../../src/MainStructure/FLWinSettings.cpp \
- ../../src/MainStructure/FLFileWatcher.cpp \
- ../../src/MenusAndDialogs/FLPreferenceWindow.cpp \
- ../../src/MainStructure/FLSessionManager.cpp \
- ../../src/MainStructure/FLApp.cpp \
- ../../src/MainStructure/FLInterfaceManager.cpp \
- ../../src/Network/FLServerHttp.cpp \
- ../../src/Network/HTTPWindow.cpp \
- ../../src/MenusAndDialogs/SimpleParser.cpp \
- ../../src/Utilities/main.cpp
diff --git a/Build/Linux/Makefile b/Build/Linux/Makefile
deleted file mode 100644
index 6c24cd4..0000000
--- a/Build/Linux/Makefile
+++ /dev/null
@@ -1,124 +0,0 @@
-### Defining some variables
-qm := $(shell which qmake)
-##qm := $(if $(qm4),$(qm4),qmake)
-
-SPEC := ""
-PREFIX := /usr
-DESTDIR :=
-QM-DEFS := "JVAR=1"
-
-# The following FAUSTDIR and LLVM_CONFIG variables also override defaults set
-# in the project file.
-
-# We need to know where Faust lives. This will be detected automatically if
-# the faust executable is on the PATH, otherwise you may have to set this
-# manually.
-FAUSTDIR = $(patsubst %/bin/faust,%,$(shell which faust 2>/dev/null))
-ifeq ($(strip $(FAUSTDIR)),)
-# Fall back to /usr/local.
-FAUSTDIR = /usr/local
-endif
-
-# We also need the name of the llvm-config command for the LLVM version that
-# you want to use. By default, we assume just llvm-config, which must be on
-# the system PATH. Otherwise you'll have to specify the full pathname of the
-# llvm-config executable that you want to use.
-LLVM_CONFIG = llvm-config
-
-### Defining qmake variables
-ifeq ($(JACK), 1)
- QM-DEFS += "JVAR=1"
-endif
-ifeq ($(REMOTE), 1)
- QM-DEFS += "JVAR=1"
- QM-DEFS += "NJVAR=1"
- QM-DEFS += "REMVAR=1"
-endif
-ifeq ($(NETJACK), 1)
- QM-DEFS += "NJVAR=1"
-endif
-ifeq ($(PORTAUDIO), 1)
- QM-DEFS += "PAVAR=1"
-endif
-ifeq ($(STATIC), 1)
- QM-DEFS += "static=1"
-endif
-ifneq ($(FAUSTDIR),)
- QM-DEFS += "FAUSTDIR=$(FAUSTDIR)"
-endif
-ifneq ($(LLVM_CONFIG),)
- QM-DEFS += "LLVM_CONFIG=$(LLVM_CONFIG)"
-endif
-ifneq ($(CURL_CONFIG),)
- QM-DEFS += "CURL_CONFIG=$(CURL_CONFIG)"
-endif
-
-####### Targets
-
-all : Makefile-qt
- ./buildversion
- mkdir -p src/objectsFolder
- $(MAKE) -f Makefile-qt
-
-####### List of targets
-
-help :
- @echo "Usage : 'make; sudo make install'"
- @echo "To enable NetJack driver : 'make NETJACK=1'"
- @echo "To enable remote processing : 'make REMOTE=1'"
- @echo "make or make all : compile FaustLive"
- @echo "make clean : remove all object files"
- @echo "make install : install FaustLive and its resources in $(DESTDIR)$(PREFIX)"
- @echo "make uninstall : undo what install did"
- @echo "make dist & ./distribution {platform}: make a FaustLive distribution as a .zip file"
-
-###### Creates LLVM Library containing math float functions like "powf" (not existing on windows)
-math_lib :
- $(shell $(shell llvm-config --prefix)/bin/clang -emit-llvm ../../src/Utilities/llvm_math.c -c -S -o ../../Resources/Libs/llvm_math.ll)
-
-####### Packages
-
-# make a source distribution .zip file
-dist:
- make clean
- make NETJACK=1 STATIC=1
- #./distribution ${platform}
- #./distversion
-
-# make a distribution .zip file for FaustLive sources
-dist-sources :
- git archive --format=tar.gz -o FaustLive-sources.tgz --prefix=FaustLive-sources/ HEAD
-
-####### Install
-installdirs = $(PREFIX)/bin $(PREFIX)/share $(PREFIX)/share/applications $(PREFIX)/share/pixmaps $(PREFIX)/share/icons/hicolor/32x32/apps $(PREFIX)/share/icons/hicolor/scalable/apps
-
-install:
- install -d $(addprefix $(DESTDIR), $(installdirs))
- install FaustLive $(DESTDIR)$(PREFIX)/bin
- install FaustLive.desktop $(DESTDIR)$(PREFIX)/share/applications/
- install -m 0644 ../../Resources/Images/Faustlive.xpm $(DESTDIR)$(PREFIX)/share/pixmaps/
- install -m 0644 ../../Resources/Images/Faustlive.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/
- install -m 0644 ../../Resources/Images/Faustlive.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
-
-uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/FaustLive
- rm -f $(DESTDIR)$(PREFIX)/share/applications/FaustLive.desktop
- rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/Faustlive.xpm
- rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/Faustlive.png
- rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/Faustlive.svg
-
-####### MAKE MAKEFILE-QT
-
-clean : Makefile-qt
- make -f Makefile-qt clean
- rm -f FaustLive.pro.user
- rm -f FaustLive
- rm -f Makefile-qt
- rm -f ../../Resources/styles.qrc
-
-../../Resources/styles.qrc: ../../Resources/styles.qrc.in
- sed -e 's?@FAUSTDIR@?$(FAUSTDIR)?g' < $< > $@
-
-Makefile-qt: FaustLive.pro ../../Resources/styles.qrc
- $(qm) $(SPEC) -o Makefile-qt $(QM-DEFS)
-
diff --git a/Build/Linux/README.txt b/Build/Linux/README.txt
deleted file mode 100644
index d8dc4e3..0000000
--- a/Build/Linux/README.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-
-============================== FAUSTLIVE =========================
-
-The goal of this project is to build an application that embeds Faust and LLVM compilers to provide dynamical compilation of the Faust programming language.
-
-----------------LINKED LIBRARIES------------------
-
-In order to compile FaustLive, the following libraries are needed:
-
-Available in package manager :
-- llvm (3.1 and higher)
-- clang (same version than llvm)
-- qt (4.8 and higher)
-- libqrencode
-- libmicrohttpd
-- libjack
-- libjacknet
-
-Available on sourceforge.net:
-- libfaust (from branch Faust2)
-- libHTTPDFaust (make httpd in faust distribution)
-
-For Remote Processing Features :
-- libfaustremote (make remote in faust distribution)
-- libcurl
-- liblo (0.28 and higher)
-
-
-Make sure to download the current development trunk of these libraries.
-
-----------------PROJECT COMPILATION---------------
-
-cd projetDIR
-
-make
-sudo make install
-
-Linux default audio driver = Jack
-
-To add NetJack to compilation
-make NETJACK=1
-
-To enable remote processing option
-make REMOTE=1
-
------------------WARNINGS
-
-1) If you want to recompile with new compilation options, you will have to execute
- "make clean" before doing "make"
- & "make uninstall" before "make install"
-
-2) If you use the remote control through httpd and you want to use a port < 100, you will have to start FaustLive in sudo mode.
-
-3) To use remote processing through wi-fi, set network parameters MTU on standard 1500.
-
----------------TO ADD A NEW AUDIO ARCHITECTURE
-
-1) Implement the classes :
- - _audioFader
- - _audioFactory
- - _audioManager
- - _audioSettings
-
-2) Modify AudioCreator to add the architecture in
- - enum audioArchitecture
- - add item in fAudioArchitecture
- - add case in createFactory
- - add case in read/write Settings
-
-3) Modify FaustLive.pro to add the libraries through conditional Compilation
-
-----------------TO ADD FAUST LIBRAIRIES
-
-1) Add the library in "Resources" folder
-2) Add the library in application.qrc
-
-
diff --git a/Build/Linux/buildversion b/Build/Linux/buildversion
deleted file mode 100755
index 72d46b8..0000000
--- a/Build/Linux/buildversion
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-filename="../../Resources/buildVersion.txt"
-
-if [ -f "$filename" ]
-then
- while read line
- do
- echo $(echo "$line+0.0001" | bc -l) > "$filename"
- done < "$filename"
-else
- echo "0.0001" > "$filename"
-fi
-
-rm -f ../../src/Utilities/qrc_application.cpp
-
diff --git a/Build/Linux/configure b/Build/Linux/configure
deleted file mode 100755
index ef5af05..0000000
--- a/Build/Linux/configure
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-numberDep=10
-libraries=(libLLVM libQt libqrencode libmicrohttpd libcurl libjack libfaust libOSCFaust libHTTPDFaust)
-
-packages=(llvm3.i build-essential libqrencode-dev libmicrohttpd-dev libssl-dev libcurl-dev jackd2 http://sourceforge.net/projects/faudiostream/files http://sourceforge.net/projects/faudiostream/files http://sourceforge.net/projects/faudiostream/files)
-
-count=0
-
-while [ "$count" != "$numberDep" ]
-do
- lib=${libraries[$count]}
- toto=`locate /usr*$lib*`
-
- if [ -z "$toto" ]; then
- echo "$lib -------- Please install package ${packages[$count]} "
- else
- echo "$lib -------- Check"
- fi
-
- count=$(($count+1))
-done
diff --git a/Build/Linux/distribution b/Build/Linux/distribution
deleted file mode 100755
index 724b585..0000000
--- a/Build/Linux/distribution
+++ /dev/null
@@ -1,37 +0,0 @@
-if [ -z $1 ]
- then
- echo "Please specify the targeted platform. For example : Ubuntu"
- exit
-fi
-
-
-bN=$(<../../Resources/distVersion.txt)
-
-echo $bN
-
-arch=$(uname -m)
-
-nameDist="Distributions/FaustLive-$1-$arch-$bN"
-$(mkdir $nameDist)
-$(mkdir $nameDist/Documentation)
-$(mkdir $nameDist/FaustLive)
-$(mkdir $nameDist/FilesToConfigure)
-
-cp Distributions/READ_ME_BEFORE_YOU_START.pdf $nameDist
-cp Distributions/Whats_New.pdf $nameDist
-
-cp Distributions/DefaultDSP.dsp $nameDist/FilesToConfigure
-cp Distributions/DefaultDSP.lib $nameDist/FilesToConfigure
-cp Distributions/process.svg $nameDist/FilesToConfigure
-
-cp ../../Documentation/faust-quick-reference.pdf $nameDist/Documentation
-cp ../../Documentation/UserManual.pdf $nameDist/Documentation/UserManual-$bN.pdf
-
-cp FaustLive $nameDist/FaustLive
-cd Distributions
-zip -r FaustLive-$1-$arch-$bN.zip FaustLive-$1-$arch-$bN
-
-cd ..
-cp $nameDist.zip FaustLive-$1-$arch-$bN.zip
-
-rm -r $nameDist
diff --git a/Build/Makefile b/Build/Makefile
new file mode 100644
index 0000000..cc792f3
--- /dev/null
+++ b/Build/Makefile
@@ -0,0 +1,63 @@
+
+system := $(shell uname -s)
+system := $(shell echo $(system) | grep MINGW > /dev/null && echo MINGW || echo $(system))
+ifeq ($(system), Darwin)
+ TARGET ?= unix
+ SPEC ?= -spec macx-clang
+ DEPLOY ?= macdeployqt
+else
+ifeq ($(system), MINGW)
+ TARGET ?= windows
+ DEPLOY ?= macdeployqt
+else
+ifeq ($(system), Linux)
+ TARGET ?= unix
+ DEPLOY ?= echo no deployment on Linux for
+else
+ TARGET = undefined
+endif
+endif
+endif
+
+OUTDIR = fldir
+MAKE ?= make
+
+
+all :
+ $(MAKE) $(TARGET)
+
+unix: $(OUTDIR)/Makefile
+ $(MAKE) -C $(OUTDIR) -j 4
+
+help:
+ @echo "----- FaustLive Makefile -----"
+ @echo "Available target are:"
+ @echo " 'all' (default) : compiles FaustLive."
+ @echo " 'deploy' : call $(DEPLOY)."
+ @echo " 'clean' : remove the $(OUTDIR) and FaustLive folders."
+ @echo " 'mathlib' : generate or update llvm_math.ll."
+
+windows:
+ @echo Compiling on Windows MSYS might work but has not been tested.
+ @echo Proceed manually.
+
+$(OUTDIR)/Makefile : $(OUTDIR) FaustLive.pro
+ cd $(OUTDIR) && qmake .. $(SPEC)
+
+$(OUTDIR) :
+ mkdir $(OUTDIR)
+
+mathlib : ../Resources/Libs/llvm_math.ll
+
+../Resources/Libs/llvm_math.ll : ../src/Utilities/llvm_math.c
+ clang -emit-llvm ../src/Utilities/llvm_math.c -c -S -o ../Resources/Libs/llvm_math.ll
+
+deploy:
+ $(DEPLOY) FaustLive/FaustLive.???
+
+clean :
+ rm -rf $(OUTDIR) FaustLive
+
+undefined:
+ $(error System is undefined, not target available)
+
diff --git a/Build/MinGW32/Distributions/DefaultDSP.dsp b/Build/MinGW32/Distributions/DefaultDSP.dsp
deleted file mode 100644
index b247342..0000000
--- a/Build/MinGW32/Distributions/DefaultDSP.dsp
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/MinGW32/Distributions/DefaultDSP.lib b/Build/MinGW32/Distributions/DefaultDSP.lib
deleted file mode 100644
index b247342..0000000
--- a/Build/MinGW32/Distributions/DefaultDSP.lib
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/MinGW32/Distributions/READ_ME_BEFORE_YOU_START.docx b/Build/MinGW32/Distributions/READ_ME_BEFORE_YOU_START.docx
deleted file mode 100644
index 3520e4f..0000000
Binary files a/Build/MinGW32/Distributions/READ_ME_BEFORE_YOU_START.docx and /dev/null differ
diff --git a/Build/MinGW32/Distributions/READ_ME_BEFORE_YOU_START.pdf b/Build/MinGW32/Distributions/READ_ME_BEFORE_YOU_START.pdf
deleted file mode 100644
index 2ac26ee..0000000
Binary files a/Build/MinGW32/Distributions/READ_ME_BEFORE_YOU_START.pdf and /dev/null differ
diff --git a/Build/MinGW32/Distributions/Whats_New.docx b/Build/MinGW32/Distributions/Whats_New.docx
deleted file mode 100644
index 0ffa477..0000000
Binary files a/Build/MinGW32/Distributions/Whats_New.docx and /dev/null differ
diff --git a/Build/MinGW32/Distributions/Whats_New.pdf b/Build/MinGW32/Distributions/Whats_New.pdf
deleted file mode 100644
index 28630de..0000000
Binary files a/Build/MinGW32/Distributions/Whats_New.pdf and /dev/null differ
diff --git a/Build/MinGW32/Distributions/process.svg b/Build/MinGW32/Distributions/process.svg
deleted file mode 100644
index ffef805..0000000
--- a/Build/MinGW32/Distributions/process.svg
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
diff --git a/Build/MinGW32/FaustLive.desktop b/Build/MinGW32/FaustLive.desktop
deleted file mode 100644
index 49280c6..0000000
--- a/Build/MinGW32/FaustLive.desktop
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=FaustLive
-GenericName=Faust Dynamic Compiler
-Comment=Embbeded Faust and LLVM Compiler in a QT application
-Version=1.0
-Terminal=false
-Exec=FaustLive
-Icon=Faustlive
-Categories=Development;
-
-
diff --git a/Build/MinGW32/FaustLive.pro b/Build/MinGW32/FaustLive.pro
deleted file mode 100644
index bfe6128..0000000
--- a/Build/MinGW32/FaustLive.pro
+++ /dev/null
@@ -1,252 +0,0 @@
-######################################################################
-# FAUSTLIVE.PRO
-######################################################################
-
-# THANKS TO QMAKE, THIS FILE WILL PRODUCE THE MAKEFILE OF FAUSTLIVE APPLICATION
-# IT DESCRIBES ALL THE LINKED LIBRAIRIES, COMPILATION OPTIONS, THE SOURCES TO BE COMPILED
-
-TEMPLATE = app
-
-isEmpty(FAUSTDIR) {
- FAUSTDIR = /usr/local
-}
-
-isEmpty(LLVM_CONFIG) {
- LLVM_CONFIG = llvm-config
-}
-
-## The LLVM version we are building against, for the Version popup.
-isEmpty(LLVM_VERSION) {
- LLVM_VERSION = $$system($$LLVM_CONFIG --version)
-}
-
-## Application Settings
-OBJECTS_DIR += ../../src/objectsFolder
-MOC_DIR += ../../src/objectsFolder
-RCC_DIR += ../../src/Utilities
-
-QMAKE_EXTRA_TARGETS += all
-
-CONFIG -= x86_64
-CONFIG += exceptions rtti
-#CONFIG += console
-
-## QT libraries needed
-QT+=widgets
-QT+=core
-QT+=gui
-QT+=network
-
-TARGET = FaustLive
-DEFINES += APP_VERSION=\\\"2.0\\\" LLVM_VERSION=\\\"$$LLVM_VERSION\\\"
-
-## Images/Examples and other needed resources
-RESOURCES = ../../Resources/application.qrc
-RESOURCES += ../../Resources/styles.qrc
-ICON = Resources/Images/FaustLiveIcon.icns
-QMAKE_INFO_PLIST = FaustLiveInfo.plist
-
-####### INCLUDES PATHS && LIBS PATHS
-
-DEPENDPATH += $$FAUSTDIR/include/faust/gui
-INCLUDEPATH += .
-INCLUDEPATH += /opt/local/include
-INCLUDEPATH += ../../src/Audio
-INCLUDEPATH += ../../src/MenusAndDialogs
-INCLUDEPATH += ../../src/MainStructure
-INCLUDEPATH += ../../src/Network
-INCLUDEPATH += ../../src/Utilities
-
-LIBS+=-L$$FAUSTDIR/lib/ -L/usr/lib/ -L/opt/local/lib
-
-equals(static, 1){
- LIBS+=-Wl,-static -lHTTPDFaust -lOSCFaust -lfaust -Wl,-Bdynamic
-} else {
- LIBS+=-lHTTPDFaust -lOSCFaust -lfaust
-}
-
-
-equals(static, 1){
- #LIBS+=/usr/local/lib/libqrencode.a
- #LIBS+=/usr/local/lib/libmicrohttpd.a
- #LIBS+=-lgnutls
- #LIBS+=/usr/lib/x86_64-linux-gnu/libgnutls.a
- #LIBS+=/lib/x86_64-linux-gnu/libgcrypt.a
- #LIBS+=/usr/lib/x86_64-linux-gnu/libgpg-error.a
- #LIBS+=/usr/lib/x86_64-linux-gnu/libtasn1.a
- #LIBS+=-lp11-kit
- #LIBS+=-lcurl
- #LIBS+=-Wl,-static
-}
-
- LIBS+=-lqrencode
- LIBS+=-lmicrohttpd
- LIBS+=-lcrypto
- LIBS+=-lcurl
-
-DEFINES += HTTPCTRL
-DEFINES += QRCODECTRL
-
-########## DEFINES/LIBS/SOURCES/... depending on audio drivers | remote processing feature
-
-equals(REMVAR, 1){
- DEFINES += REMOTE
- LIBS+=-lfaustremote
- LIBS+=-lcurl
- LIBS+=-llo
- LIBS+=-ldbus-1 -lrt
-
- HEADERS += ../../src/MenusAndDialogs/FLStatusBar.h
- SOURCES += ../../src/MenusAndDialogs/FLStatusBar.cpp
-
- #HEADERS += ../../src/Network/Server.h
- #SOURCES += ../../src/Network/Server.cpp
-}
-
-equals(JVAR, 1){
- message("JACK LINKED")
- LIBS+= -ljack
- DEFINES += JACK
-
- INCLUDEPATH += ../../src/Audio/JA
-
- HEADERS += ../../src/Audio/JA/JA_audioFactory.h \
- ../../src/Audio/JA/JA_audioSettings.h \
- ../../src/Audio/JA/JA_audioManager.h \
- ../../src/Audio/JA/JA_audioFader.h \
-
- SOURCES += ../../src/Audio/JA/JA_audioSettings.cpp \
- ../../src/Audio/JA/JA_audioManager.cpp \
- ../../src/Audio/JA/JA_audioFactory.cpp \
- ../../src/Audio/JA/JA_audioFader.cpp
-}else{
- message("JACK NOT LINKED")
-}
-
-equals(NJVAR, 1){
- message("NETJACK LINKED")
- LIBS += -ljacknet
- DEFINES += NETJACK
-
- INCLUDEPATH += ../../src/Audio/NJ_Slave
-
- HEADERS += ../../src/Audio/NJ_Slave/NJs_audioFactory.h \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.h \
- ../../src/Audio/NJ_Slave/NJs_audioManager.h \
- ../../src/Audio/NJ_Slave/NJs_audioFader.h
-
- SOURCES += ../../src/Audio/NJ_Slave/NJs_audioFactory.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioManager.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioFader.cpp
-}else{
- message("NETJACK NOT LINKED")
-}
-
-equals(ALVAR, 1){
- message("ALSA LINKED")
- LIBS += -lasound
- DEFINES += ALSA
-
- INCLUDEPATH += ../../src/Audio/AL
-
- HEADERS += ../../src/Audio/AL/AL_audioFactory.h \
- ../../src/Audio/AL/AL_audioSettings.h \
- ../../src/Audio/AL/AL_audioManager.h \
- ../../src/Audio/AL/AL_audioFader.h \
-
- SOURCES += ../../src/Audio/AL/AL_audioFactory.cpp \
- ../../src/Audio/AL/AL_audioSettings.cpp \
- ../../src/Audio/AL/AL_audioManager.cpp
-}else{
- message("ALSA NOT LINKED")
-}
-
-equals(PAVAR, 1){
- message("PORT AUDIO LINKED")
-
- LIBS += -lportaudio
-
- DEFINES += PORTAUDIO
-
- INCLUDEPATH += ../../src/Audio/PA
-
- HEADERS += ../../src/Audio/PA/PA_audioFactory.h \
- ../../src/Audio/PA/PA_audioSettings.h \
- ../../src/Audio/PA/PA_audioManager.h \
- ../../src/Audio/PA/PA_audioFader.h \
-
- SOURCES += ../../src/Audio/PA/PA_audioFader.cpp \
- ../../src/Audio/PA/PA_audioFactory.cpp \
- ../../src/Audio/PA/PA_audioSettings.cpp \
- ../../src/Audio/PA/PA_audioManager.cpp
-}else{
- message("PORT AUDIO NOT LINKED")
-}
-
-########## LIBS AND FLAGS
-
-# Make sure to include --ldflags twice, once for the -L flags, and once for
-# the system libraries (LLVM 3.4 and earlier have these both in --ldflags).
-LIBS+=$$system(C:\\MinGW\\msys\\1.0\\local\\bin\\llvm-config --ldflags --libs)
-LIBS+=$$system(C:\\MinGW\\msys\\1.0\\local\\bin\\llvm-config --ldflags)
-# The system libraries need a different option in LLVM 3.5 and later.
-LIBS+=$$system(C:\\MinGW\\msys\\1.0\\local\\bin\\llvm-config --system-libs)
-
-LIBS+=-lcurldll -lwsock32 -lws2_32 -lwinmm
-
-########## HEADERS AND SOURCES OF PROJECT
-
-HEADERS += ../../src/Utilities/utilities.h \
- ../../src/Audio/AudioSettings.h \
- ../../src/Audio/AudioManager.h \
- ../../src/Audio/AudioFactory.h \
- ../../src/Audio/AudioCreator.h \
- ../../src/Audio/AudioFader_Interface.h \
- ../../src/Audio/AudioFader_Implementation.h \
- ../../src/Audio/FJUI.h \
- ../../src/MenusAndDialogs/FLToolBar.h \
- ../../src/MenusAndDialogs/FLHelpWindow.h \
- ../../src/MenusAndDialogs/FLPresentationWindow.h \
- ../../src/MenusAndDialogs/FLErrorWindow.h \
- ../../src/MenusAndDialogs/FLMessageWindow.h \
- ../../src/MenusAndDialogs/FLExportManager.h \
- ../../src/MenusAndDialogs/FLPreferenceWindow.h \
- ../../src/MainStructure/FLWindow.h \
- ../../src/MainStructure/FLComponentWindow.h \
- ../../src/MainStructure/FLSettings.h \
- ../../src/MainStructure/FLWinSettings.h \
- ../../src/MainStructure/FLFileWatcher.h \
- ../../src/Network/FLServerHttp.h \
- ../../src/MainStructure/FLSessionManager.h \
- ../../src/MainStructure/FLApp.h \
- ../../src/MainStructure/FLInterfaceManager.h \
- ../../src/MenusAndDialogs/SimpleParser.h \
- ../../src/Network/HTTPWindow.h \
- $$FAUSTDIR/include/faust/gui/faustqt.h
-
-SOURCES += ../../src/Utilities/utilities.cpp \
- ../../src/Audio/AudioCreator.cpp \
- ../../src/Audio/AudioFader_Implementation.cpp \
- ../../src/MenusAndDialogs/FLToolBar.cpp \
- ../../src/MenusAndDialogs/FLHelpWindow.cpp \
- ../../src/MenusAndDialogs/FLPresentationWindow.cpp \
- ../../src/MenusAndDialogs/FLErrorWindow.cpp \
- ../../src/MenusAndDialogs/FLMessageWindow.cpp \
- ../../src/MenusAndDialogs/FLExportManager.cpp \
- ../../src/MainStructure/FLWindow.cpp \
- ../../src/MainStructure/FLComponentWindow.cpp \
- ../../src/MainStructure/FLSettings.cpp \
- ../../src/MainStructure/FLWinSettings.cpp \
- ../../src/MainStructure/FLFileWatcher.cpp \
- ../../src/MenusAndDialogs/FLPreferenceWindow.cpp \
- ../../src/MainStructure/FLSessionManager.cpp \
- ../../src/MainStructure/FLApp.cpp \
- ../../src/MainStructure/FLInterfaceManager.cpp \
- ../../src/Network/FLServerHttp.cpp \
- ../../src/Network/HTTPWindow.cpp \
- ../../src/MenusAndDialogs/SimpleParser.cpp \
- ../../src/Utilities/main.cpp
-
-
-
diff --git a/Build/MinGW32/Makefile b/Build/MinGW32/Makefile
deleted file mode 100644
index 6859a47..0000000
--- a/Build/MinGW32/Makefile
+++ /dev/null
@@ -1,126 +0,0 @@
-### Defining some variables
-qm := $(shell which qmake)
-##qm := $(if $(qm4),$(qm4),qmake)
-
-SPEC := ""
-PREFIX := /usr
-DESTDIR :=
-QM-DEFS := "PAVAR=1"
-
-# The following FAUSTDIR and LLVM_CONFIG variables also override defaults set
-# in the project file.
-
-# We need to know where Faust lives. This will be detected automatically if
-# the faust executable is on the PATH, otherwise you may have to set this
-# manually.
-FAUSTDIR = $(patsubst %/bin/faust.exe,%,$(shell which faust 2>/dev/null))
-ifeq ($(strip $(FAUSTDIR)),)
-# Fall back to /usr/local.
-FAUSTDIR = /usr/local
-endif
-
-# We also need the name of the llvm-config command for the LLVM version that
-# you want to use. By default, we assume just llvm-config, which must be on
-# the system PATH. Otherwise you'll have to specify the full pathname of the
-# llvm-config executable that you want to use.
-LLVM_CONFIG = llvm-config
-
-### Defining qmake variables
-ifeq ($(JACK), 1)
- QM-DEFS += "JVAR=1"
-endif
-ifeq ($(REMOTE), 1)
- QM-DEFS += "JVAR=1"
- QM-DEFS += "NJVAR=1"
- QM-DEFS += "REMVAR=1"
-endif
-ifeq ($(NETJACK), 1)
- QM-DEFS += "NJVAR=1"
-endif
-ifeq ($(PORTAUDIO), 1)
- QM-DEFS += "PAVAR=1"
-endif
-ifeq ($(STATIC), 1)
- QM-DEFS += "static=1"
-endif
-ifneq ($(FAUSTDIR),)
- QM-DEFS += "FAUSTDIR=$(FAUSTDIR)"
-endif
-ifneq ($(LLVM_CONFIG),)
- QM-DEFS += "LLVM_CONFIG=$(LLVM_CONFIG)"
-endif
-ifneq ($(CURL_CONFIG),)
- QM-DEFS += "CURL_CONFIG=$(CURL_CONFIG)"
-endif
-
-####### Targets
-
-all : Makefile-qt
- ./buildversion
- mkdir -p src/objectsFolder
- $(MAKE) -f Makefile-qt
- cp debug/FaustLive.exe .
-
-####### List of targets
-
-help :
- @echo "Usage : 'make; sudo make install'"
- @echo "To enable NetJack driver : 'make NETJACK=1'"
- @echo "To enable remote processing : 'make REMOTE=1'"
- @echo "make or make all : compile FaustLive"
- @echo "make clean : remove all object files"
- @echo "make install : install FaustLive and its resources in $(DESTDIR)$(PREFIX)"
- @echo "make uninstall : undo what install did"
- @echo "make dist & ./distribution {platform}: make a FaustLive distribution as a .zip file"
-
-###### Creates LLVM Library containing math float functions like "powf" (not existing on windows)
-math_lib :
- $(shell $(shell llvm-config --prefix)/bin/clang -emit-llvm ../../src/Utilities/llvm_math.c -c -S -o ../../Resources/Libs/llvm_math.ll)
-
-####### Packages
-
-# make a source distribution .zip file
-dist:
- make clean
- make NETJACK=1 STATIC=1
- #./distribution ${platform}
- #./distversion
-
-# make a distribution .zip file for FaustLive sources
-dist-sources :
- git archive --format=tar.gz -o FaustLive-sources.tgz --prefix=FaustLive-sources/ HEAD
-
-####### Install
-installdirs = $(PREFIX)/bin $(PREFIX)/share $(PREFIX)/share/applications $(PREFIX)/share/pixmaps $(PREFIX)/share/icons/hicolor/32x32/apps $(PREFIX)/share/icons/hicolor/scalable/apps
-
-install:
- install -d $(addprefix $(DESTDIR), $(installdirs))
- install FaustLive.exe $(DESTDIR)$(PREFIX)/bin
- install FaustLive.desktop $(DESTDIR)$(PREFIX)/share/applications/
- install -m 0644 ../../Resources/Images/Faustlive.xpm $(DESTDIR)$(PREFIX)/share/pixmaps/
- install -m 0644 ../../Resources/Images/Faustlive.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/
- install -m 0644 ../../Resources/Images/Faustlive.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
-
-uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/FaustLive.exe
- rm -f $(DESTDIR)$(PREFIX)/share/applications/FaustLive.desktop
- rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/Faustlive.xpm
- rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/Faustlive.png
- rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/Faustlive.svg
-
-####### MAKE MAKEFILE-QT
-
-clean : Makefile-qt
- make -f Makefile-qt clean
- rm -f FaustLive.pro.user
- rm -f FaustLive.exe
- rm -f Makefile-qt
- rm -f ../../Resources/styles.qrc
- rm -rf debug release
-
-../../Resources/styles.qrc: ../../Resources/styles.qrc.in
- sed -e 's?@FAUSTDIR@?C:/MinGW/msys/1.0/local?g' < $< > $@
-
-Makefile-qt: ../../Resources/styles.qrc
- $(qm) $(SPEC) -o Makefile-qt $(QM-DEFS)
-
diff --git a/Build/MinGW32/README.txt b/Build/MinGW32/README.txt
deleted file mode 100644
index c1b61a6..0000000
--- a/Build/MinGW32/README.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-
-============================== FAUSTLIVE =========================
-
-The goal of this project is to build an application that embeds Faust and LLVM compilers to provide dynamical compilation of the Faust programming language.
-
-----------------MINGW PORT------------------------
-
-MinGW port by Albert Graef 2014-10-16
-
-This is basically the Linux build, with some adjustments to make it work with MinGW (4.4 has been tested). Besides MinGW itself (available from http://www.mingw.org/), you'll need Qt (Windows binaries available from http://qt-project.org/, Qt 4.8 has been tested) and a bunch of additional libraries as detailed below, which you'll either have to compile from source or find on the web. This build uses PortAudio as the default audio architecture, but Jack should work as well if you have it installed. The build procedure is the same as on Linux (MSys shell required), although you may run into the usual Windows-specific quirks and peculiarities.
-
-----------------LINKED LIBRARIES------------------
-
-In order to compile FaustLive, the following libraries are needed:
-
-Available in package manager :
-- llvm (3.1 and higher)
-- clang (same version than llvm)
-- qt (4.8 and higher)
-- libqrencode
-- libmicrohttpd
-- libjack
-- libjacknet
-
-Available on sourceforge.net:
-- libfaust (from branch faust2)
-- libHTTPDFaust (make httpd in faust distribution)
-
-
-For Remote Processing Features :
-- libfaustremote (make remote in faust distribution)
-- libcurl
-- liblo (0.28 and higher)
-
-
-Make sure to download the current development trunk of these libraries.
-
-----------------PROJECT COMPILATION---------------
-
-cd projetDIR
-
-make
-sudo make install
-
-Linux default audio driver = Jack
-
-To add NetJack to compilation
-make NETJACK=1
-
-To enable remote processing option
-make REMOTE=1
-
------------------WARNINGS
-
-1) If you want to recompile with new compilation options, you will have to execute
- "make clean" before doing "make"
- & "make uninstall" before "make install"
-
-2) If you use the remote control through httpd and you want to use a port < 100, you will have to start FaustLive in sudo mode.
-
-3) To use remote processing through wi-fi, set network parameters MTU on standard 1500.
-
----------------TO ADD A NEW AUDIO ARCHITECTURE
-
-1) Implement the classes :
- - _audioFader
- - _audioFactory
- - _audioManager
- - _audioSettings
-
-2) Modify AudioCreator to add the architecture in
- - enum audioArchitecture
- - add item in fAudioArchitecture
- - add case in createFactory
- - add case in read/write Settings
-
-3) Modify FaustLive.pro to add the libraries through conditional Compilation
-
-----------------TO ADD FAUST LIBRAIRIES
-
-1) Add the library in "Resources" folder
-2) Add the library in application.qrc
-
-
diff --git a/Build/MinGW32/buildversion b/Build/MinGW32/buildversion
deleted file mode 100644
index 72d46b8..0000000
--- a/Build/MinGW32/buildversion
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-filename="../../Resources/buildVersion.txt"
-
-if [ -f "$filename" ]
-then
- while read line
- do
- echo $(echo "$line+0.0001" | bc -l) > "$filename"
- done < "$filename"
-else
- echo "0.0001" > "$filename"
-fi
-
-rm -f ../../src/Utilities/qrc_application.cpp
-
diff --git a/Build/MinGW32/configure b/Build/MinGW32/configure
deleted file mode 100644
index ef5af05..0000000
--- a/Build/MinGW32/configure
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-numberDep=10
-libraries=(libLLVM libQt libqrencode libmicrohttpd libcurl libjack libfaust libOSCFaust libHTTPDFaust)
-
-packages=(llvm3.i build-essential libqrencode-dev libmicrohttpd-dev libssl-dev libcurl-dev jackd2 http://sourceforge.net/projects/faudiostream/files http://sourceforge.net/projects/faudiostream/files http://sourceforge.net/projects/faudiostream/files)
-
-count=0
-
-while [ "$count" != "$numberDep" ]
-do
- lib=${libraries[$count]}
- toto=`locate /usr*$lib*`
-
- if [ -z "$toto" ]; then
- echo "$lib -------- Please install package ${packages[$count]} "
- else
- echo "$lib -------- Check"
- fi
-
- count=$(($count+1))
-done
diff --git a/Build/MinGW32/distribution b/Build/MinGW32/distribution
deleted file mode 100644
index 724b585..0000000
--- a/Build/MinGW32/distribution
+++ /dev/null
@@ -1,37 +0,0 @@
-if [ -z $1 ]
- then
- echo "Please specify the targeted platform. For example : Ubuntu"
- exit
-fi
-
-
-bN=$(<../../Resources/distVersion.txt)
-
-echo $bN
-
-arch=$(uname -m)
-
-nameDist="Distributions/FaustLive-$1-$arch-$bN"
-$(mkdir $nameDist)
-$(mkdir $nameDist/Documentation)
-$(mkdir $nameDist/FaustLive)
-$(mkdir $nameDist/FilesToConfigure)
-
-cp Distributions/READ_ME_BEFORE_YOU_START.pdf $nameDist
-cp Distributions/Whats_New.pdf $nameDist
-
-cp Distributions/DefaultDSP.dsp $nameDist/FilesToConfigure
-cp Distributions/DefaultDSP.lib $nameDist/FilesToConfigure
-cp Distributions/process.svg $nameDist/FilesToConfigure
-
-cp ../../Documentation/faust-quick-reference.pdf $nameDist/Documentation
-cp ../../Documentation/UserManual.pdf $nameDist/Documentation/UserManual-$bN.pdf
-
-cp FaustLive $nameDist/FaustLive
-cd Distributions
-zip -r FaustLive-$1-$arch-$bN.zip FaustLive-$1-$arch-$bN
-
-cd ..
-cp $nameDist.zip FaustLive-$1-$arch-$bN.zip
-
-rm -r $nameDist
diff --git a/Build/README.html b/Build/README.html
new file mode 100644
index 0000000..37d5ff6
--- /dev/null
+++ b/Build/README.html
@@ -0,0 +1,84 @@
+
+
+
+
+FaustLive - How to compile
+============================
+
+
+### Prerequisites
+- you must have [Faust](https://faust.grame.fr/) installed and the `faust` command available from the command line.
+- you must have [Qt](https://www.qt.io/) installed and the `qmake` command available from the command line..
+- you must have [LLVM](http://llvm.org/) installed and the `llvm-config` command available from the command line..
+- you must have [libmicrohttpd](https://www.gnu.org/software/libmicrohttpd/) installed.
+- you must have [libsndfile](http://www.mega-nerd.com/libsndfile/) installed.
+- [Linux] you must have [JACK](http://jackaudio.org/) installed.
+- [Windows] you must have [PortAudio](http://www.portaudio.com/) installed.
+
+
+## Compilation steps
+
+It is recommended to build the project in a separate subfolder. It isolates the compilation process from the rest of the project.
+
+### Project generation
+Assuming that you compile in a subfolder named `fldir`, simply do the following:
+
+~~~~
+$ cd fldir
+$ qmake .. [an optionnal project specification]
+~~~~
+
+The project specification determines the output project type: a Makefile, an Xcode project, a Visual Studio project etc. The specification has the following form:
+
+`-spec` __qmake-spec__
+
+where __qmake-spec__ depends on your platform. You should find a folder named `mkspecs` in your Qt distribution, that contains all the supported Qt spec (e.g. macx-xcode, win32-msvc, linux-g++,...). `qmake` has default values for the -spec option (generates a Makefile on Unix like platforms).
+
+
+### Compilation
+
+It depends on your project type. On most cases you'll only have to type `make`.
+Otherwise open the project with the chosen IDE and proceed as usual with your IDE.
+
+The **FaustLive** application is generated in a subfolder name FaustLive.
+
+
+### Finalisation
+
+The finalisation step ensures that all the resources and libraries necessary to FaustLive are present for distribution. This finalisation step is required on Windows, required on MacOS for distribution and doesn'texist on Linux. Qt includes tools for that.
+
+On MacOS type :
+
+~~~~
+$ macdeployqt FaustLive/FaustLive.app
+~~~~
+
+On Windows type :
+
+~~~~
+$ windeployqt FaustLive/FaustLive.exe
+~~~~
+
+
+## Compilation using the Makefile
+
+Works on Unix like platforms. It performs all the above steps with 2 targets:
+
+~~~~
+$ make
+$ make deploy
+~~~~
+
+## Note for Windows
+
+You must make sure you're using the same compilation environment than the one used by Faust and LLVM. The current Faust distribution is based on LLVM 7.0.0, both build with MS Visual Studio 14 2015. If you want to use another environment, you'll have to recompile Faust and LLVM with this environment.
+
+To generate a Visual Studio project with qmake, it is recommended to run `qmake` from a command.com
+
+--------------
+#### [Grame](http://www.grame.fr) - Centre National de Creation Musicale
+
+
+
+
+
diff --git a/Build/README.md b/Build/README.md
new file mode 100644
index 0000000..3d9ba52
--- /dev/null
+++ b/Build/README.md
@@ -0,0 +1,75 @@
+FaustLive - How to compile
+============================
+
+
+### Prerequisites
+- you must have [Faust](https://faust.grame.fr/) installed and the `faust` command available from the command line.
+- you must have [Qt](https://www.qt.io/) installed and the `qmake` command available from the command line..
+- you must have [LLVM](http://llvm.org/) installed and the `llvm-config` command available from the command line..
+- you must have [libmicrohttpd](https://www.gnu.org/software/libmicrohttpd/) installed.
+- you must have [libsndfile](http://www.mega-nerd.com/libsndfile/) installed.
+- [Linux] you must have [JACK](http://jackaudio.org/) installed.
+- [Windows] you must have [PortAudio](http://www.portaudio.com/) installed.
+
+
+## Compilation steps
+
+It is recommended to build the project in a separate subfolder. It isolates the compilation process from the rest of the project.
+
+### Project generation
+Assuming that you compile in a subfolder named `fldir`, simply do the following:
+
+~~~~
+$ cd fldir
+$ qmake .. [an optionnal project specification]
+~~~~
+
+The project specification determines the output project type: a Makefile, an Xcode project, a Visual Studio project etc. The specification has the following form:
+
+`-spec` __qmake-spec__
+
+where __qmake-spec__ depends on your platform. You should find a folder named `mkspecs` in your Qt distribution, that contains all the supported Qt spec (e.g. macx-xcode, win32-msvc, linux-g++,...). `qmake` has default values for the -spec option (generates a Makefile on Unix like platforms).
+
+
+### Compilation
+
+It depends on your project type. On most cases you'll only have to type `make`.
+Otherwise open the project with the chosen IDE and proceed as usual with your IDE.
+
+The **FaustLive** application is generated in a subfolder name FaustLive.
+
+
+### Finalisation
+
+The finalisation step ensures that all the resources and libraries necessary to FaustLive are present for distribution. This finalisation step is required on Windows, required on MacOS for distribution and doesn'texist on Linux. Qt includes tools for that.
+
+On MacOS type :
+
+~~~~
+$ macdeployqt FaustLive/FaustLive.app
+~~~~
+
+On Windows type :
+
+~~~~
+$ windeployqt FaustLive/FaustLive.exe
+~~~~
+
+
+## Compilation using the Makefile
+
+Works on Unix like platforms. It performs all the above steps with 2 targets:
+
+~~~~
+$ make
+$ make deploy
+~~~~
+
+## Note for Windows
+
+You must make sure you're using the same compilation environment than the one used by Faust and LLVM. The current Faust distribution is based on LLVM 7.0.0, both build with MS Visual Studio 14 2015. If you want to use another environment, you'll have to recompile Faust and LLVM with this environment.
+
+To generate a Visual Studio project with qmake, it is recommended to run `qmake` from a command.com
+
+--------------
+#### [Grame](http://www.grame.fr) - Centre National de Creation Musicale
diff --git a/Build/Windows/FaustLive-Windows-2.30/Documentation/UserManual-2.0.pdf b/Build/Windows/FaustLive-Windows-2.30/Documentation/UserManual-2.0.pdf
deleted file mode 100644
index 82079f7..0000000
Binary files a/Build/Windows/FaustLive-Windows-2.30/Documentation/UserManual-2.0.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive-Windows-2.30/Documentation/faust-quick-reference.pdf b/Build/Windows/FaustLive-Windows-2.30/Documentation/faust-quick-reference.pdf
deleted file mode 100644
index 5657326..0000000
Binary files a/Build/Windows/FaustLive-Windows-2.30/Documentation/faust-quick-reference.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/DefaultDSP.dsp b/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/DefaultDSP.dsp
deleted file mode 100644
index b247342..0000000
--- a/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/DefaultDSP.dsp
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/DefaultDSP.lib b/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/DefaultDSP.lib
deleted file mode 100644
index b247342..0000000
--- a/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/DefaultDSP.lib
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/process.svg b/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/process.svg
deleted file mode 100644
index ffef805..0000000
--- a/Build/Windows/FaustLive-Windows-2.30/FilesToConfigure/process.svg
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
diff --git a/Build/Windows/FaustLive-Windows-2.30/READ_ME_BEFORE_YOU_START.pdf b/Build/Windows/FaustLive-Windows-2.30/READ_ME_BEFORE_YOU_START.pdf
deleted file mode 100644
index aacd2d6..0000000
Binary files a/Build/Windows/FaustLive-Windows-2.30/READ_ME_BEFORE_YOU_START.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive-Windows-2.30/Whats_New_2.0.pdf b/Build/Windows/FaustLive-Windows-2.30/Whats_New_2.0.pdf
deleted file mode 100644
index 58d7dc3..0000000
Binary files a/Build/Windows/FaustLive-Windows-2.30/Whats_New_2.0.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive-Windows-Jack-2.30/Documentation/UserManual-2.0.pdf b/Build/Windows/FaustLive-Windows-Jack-2.30/Documentation/UserManual-2.0.pdf
deleted file mode 100644
index 82079f7..0000000
Binary files a/Build/Windows/FaustLive-Windows-Jack-2.30/Documentation/UserManual-2.0.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive-Windows-Jack-2.30/Documentation/faust-quick-reference.pdf b/Build/Windows/FaustLive-Windows-Jack-2.30/Documentation/faust-quick-reference.pdf
deleted file mode 100644
index 5657326..0000000
Binary files a/Build/Windows/FaustLive-Windows-Jack-2.30/Documentation/faust-quick-reference.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/DefaultDSP.dsp b/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/DefaultDSP.dsp
deleted file mode 100644
index b247342..0000000
--- a/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/DefaultDSP.dsp
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/DefaultDSP.lib b/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/DefaultDSP.lib
deleted file mode 100644
index b247342..0000000
--- a/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/DefaultDSP.lib
+++ /dev/null
@@ -1 +0,0 @@
-process = !,!:0,0;
\ No newline at end of file
diff --git a/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/process.svg b/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/process.svg
deleted file mode 100644
index ffef805..0000000
--- a/Build/Windows/FaustLive-Windows-Jack-2.30/FilesToConfigure/process.svg
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
diff --git a/Build/Windows/FaustLive-Windows-Jack-2.30/READ_ME_BEFORE_YOU_START.pdf b/Build/Windows/FaustLive-Windows-Jack-2.30/READ_ME_BEFORE_YOU_START.pdf
deleted file mode 100644
index 2a2d920..0000000
Binary files a/Build/Windows/FaustLive-Windows-Jack-2.30/READ_ME_BEFORE_YOU_START.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive-Windows-Jack-2.30/Whats_New_2.0.pdf b/Build/Windows/FaustLive-Windows-Jack-2.30/Whats_New_2.0.pdf
deleted file mode 100644
index 58d7dc3..0000000
Binary files a/Build/Windows/FaustLive-Windows-Jack-2.30/Whats_New_2.0.pdf and /dev/null differ
diff --git a/Build/Windows/FaustLive.pro b/Build/Windows/FaustLive.pro
deleted file mode 100755
index 40fdd5d..0000000
--- a/Build/Windows/FaustLive.pro
+++ /dev/null
@@ -1,252 +0,0 @@
-######################################################################
-# FAUSTLIVE.PRO
-######################################################################
-
-# THANKS TO QMAKE, THIS FILE WILL PRODUCE THE MAKEFILE OF FAUSTLIVE APPLICATION
-# IT DESCRIBES ALL THE LINKED LIBRAIRIES, COMPILATION OPTIONS, THE SOURCES TO BE COMPILED
-
-## Application Settings
-OBJECTS_DIR += ../../src/objectsFolder
-
-MOC_DIR += ../../src/objectsFolder
-
-RCC_DIR += ../../src/Utilities
-
-QMAKE_EXTRA_TARGETS += all
-
-CONFIG -= x86_64
-CONFIG += exceptions rtti
-
-QMAKE_LFLAGS +=/SAFESEH:NO
-
-## QT libraries needed
-QT+=widgets
-QT+=core
-QT+=gui
-QT+=network
-
-TARGET = FaustLive
-#VERSION = 1.1
-DEFINES += APP_VERSION=\\\"2.0\\\"
-
-## Images/Examples and other needed resources
-RESOURCES += ../../Resources/application.qrc
-RESOURCES += ../../Resources/windows.qrc
-
-####### INCLUDES PATHS && LIBS PATHS
-
-RC_FILE = FaustLive.rc
-
-## VISUAL STUDIO PROJECT
-TEMPLATE = vcapp
-INCLUDEPATH += C:\Qt\Qt5.2.0\msvc\include
-INCLUDEPATH += C:\Users\Sarah\faudiostream-code\architecture
-INCLUDEPATH += C:\Users\Sarah\faudiostream-code\architecture\osclib\faust
-INCLUDEPATH += C:\Qt\Qt5.2.0\msvc\include\QtWidgets
-INCLUDEPATH += C:\Users\Sarah\DevTools\portaudio\include
-INCLUDEPATH += C:\Users\Sarah\DevTools\qrencode-win32-681f2ea7a41f\qrencode-win32
-INCLUDEPATH += C:\Users\Sarah\DevTools\libmicrohttpd\include
-INCLUDEPATH += C:\Users\Sarah\DevTools\curl-7.35.0-win32\include
-INCLUDEPATH += C:\Users\Sarah\DevTools\libopenssl\include
-INCLUDEPATH += ../../src/Audio
-INCLUDEPATH += ../../src/MenusAndDialogs
-INCLUDEPATH += ../../src/MainStructure
-INCLUDEPATH += ../../src/Network
-INCLUDEPATH += ../../src/Utilities
-
-LLVMLIBS = $$system(C:\Users\Sarah\DevTools\llvm-3.4\bin\Release\llvm-config --libs)
-#LLVMDIR = $$system(C:\Users\Sarah\DevTools\llvm-3.4\bin\Release\llvm-config --ldflags)
-
-Debug{
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\libfaust_vs2012\Debug
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\libOSCFaust\Debug
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\liboscpack\Debug
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\libHTTPD\Debug
- LIBS+=-LC:\Users\Sarah\DevTools\llvm-3.4\lib\Debug
- LIBS+=-LC:\Users\Sarah\DevTools\portaudio\build\msvc\Win32\Debug
- LIBS+=-LC:\Users\Sarah\DevTools\qrencode-win32-681f2ea7a41f\qrencode-win32\vc8\.build\Debug-Lib
- LIBS+=-LC:\Users\Sarah\DevTools\curl-7.35.0-win32\lib
- LIBS+=-LC:\Users\Sarah\DevTools\libopenssl\lib
- LIBS+=-LC:\Users\Sarah\DevTools\libmicrohttpd\lib
- CONFIG += console
-}
-Release{
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\libfaust_vs2012\Release
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\libOSCFaust\Release
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\liboscpack\Release
- LIBS+=-LC:\Users\Sarah\faudiostream-code\windows\_output\Win32\libHTTPD\Release
- LIBS+=-LC:\Users\Sarah\DevTools\libmicrohttpd\lib
- LIBS+=-LC:\Users\Sarah\DevTools\llvm-3.4\lib\Release
- LIBS+=-LC:\Users\Sarah\DevTools\portaudio\build\msvc\Win32\Release
- LIBS+=-LC:\Users\Sarah\DevTools\qrencode-win32-681f2ea7a41f\qrencode-win32\vc8\.build\Release-Lib
- LIBS+=-LC:\Users\Sarah\DevTools\curl-7.35.0-win32\lib
- LIBS+=-LC:\Users\Sarah\DevTools\libopenssl\lib
-}
-
-LIBS+=-llibeay32
-LIBS+=-lssleay32
-
-LIBS+=-lfaust
-LIBS+= $$LLVMLIBS
-LIBS+=-llibOSCFaust
-LIBS+=-lliboscpack
-
-LIBS+=-llibHTTPDFaust
-LIBS+=-lqrcodelib
-LIBS+=-llibcurl
-LIBS+=-llibmicrohttpd
-DEFINES += HTTPCTRL
-DEFINES += QRCODECTRL
-
-LIBS+=-lWs2_32
-LIBS+=-lwinmm
-
-HEADERS += ../../src/Utilities/utilities.h \
- ../../src/Utilities/TMutex.h
-SOURCES += ../../src/Utilities/utilities.cpp
-
-########## DEFINES/LIBS/SOURCES/... depending on audio drivers | remote processing feature
-
-equals(REMVAR, 1){
- DEFINES += REMOTE
- LIBS+=-lfaustremote
- LIBS+=-lcurl
- LIBS+=-llo
-}
-
-equals(JVAR, 1){
- message("JACK LINKED")
- LIBS+= -L"C:\Program Files (x86)\Jack\lib"
- LIBS+= -llibjack
- DEFINES += JACK
-
- INCLUDEPATH+= "C:\Program Files (x86)\Jack\includes"
- INCLUDEPATH += ../../src/Audio/JA
-
- HEADERS += ../../src/Audio/JA/JA_audioFactory.h \
- ../../src/Audio/JA/JA_audioSettings.h \
- ../../src/Audio/JA/JA_audioManager.h \
- ../../src/Audio/JA/JA_audioFader.h \
-
- SOURCES += ../../src/Audio/JA/JA_audioSettings.cpp \
- ../../src/Audio/JA/JA_audioManager.cpp \
- ../../src/Audio/JA/JA_audioFactory.cpp \
- ../../src/Audio/JA/JA_audioFader.cpp
-}else{
- message("JACK NOT LINKED")
-}
-
-equals(NJVAR, 1){
- message("NETJACK LINKED")
- LIBS+= -LC:\Users\Sarah\DevTools\libjacknet\lib
- LIBS += -llibjacknet
- DEFINES += NETJACK
-
- INCLUDEPATH+= C:\Users\Sarah\DevTools\libjacknet\include
- INCLUDEPATH += ../../src/Audio/NJ_Master \
- ../../src/Audio/NJ_Slave
-
- HEADERS += ../../src/Audio/NJ_Master/NJm_audioFactory.h \
- ../../src/Audio/NJ_Master/NJm_audioSettings.h \
- ../../src/Audio/NJ_Master/NJm_audioManager.h \
- ../../src/Audio/NJ_Master/NJm_audioFader.h \
- ../../src/Audio/NJ_Slave/NJs_audioFactory.h \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.h \
- ../../src/Audio/NJ_Slave/NJs_audioManager.h \
- ../../src/Audio/NJ_Slave/NJs_audioFader.h
-
- SOURCES += ../../src/Audio/NJ_Master/NJm_audioFactory.cpp \
- ../../src/Audio/NJ_Master/NJm_audioSettings.cpp \
- ../../src/Audio/NJ_Master/NJm_audioManager.cpp \
- ../../src/Audio/NJ_Master/NJm_audioFader.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioFactory.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioSettings.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioManager.cpp \
- ../../src/Audio/NJ_Slave/NJs_audioFader.cpp
-}else{
- message("NETJACK NOT LINKED")
-}
-
-win32{
- PAVAR = 1
-}
-
-equals(PAVAR, 1){
- message("PORT AUDIO LINKED")
-
- LIBS += -lportaudio_x86
-
- DEFINES += PORTAUDIO
-
- INCLUDEPATH += ../../src/Audio/PA
-
- HEADERS += ../../src/Audio/PA/PA_audioFactory.h \
- ../../src/Audio/PA/PA_audioSettings.h \
- ../../src/Audio/PA/PA_audioManager.h \
- ../../src/Audio/PA/PA_audioFader.h
-
- SOURCES += ../../src/Audio/PA/PA_audioFader.cpp \
- ../../src/Audio/PA/PA_audioFactory.cpp \
- ../../src/Audio/PA/PA_audioSettings.cpp \
- ../../src/Audio/PA/PA_audioManager.cpp
-}else{
- message("PORT AUDIO NOT LINKED")
-}
-
-########## HEADERS AND SOURCES OF PROJECT
-
-HEADERS += ../../src/Audio/AudioSettings.h \
- ../../src/Audio/AudioManager.h \
- ../../src/Audio/AudioFactory.h \
- ../../src/Audio/AudioCreator.h \
- ../../src/Audio/AudioFader_Interface.h \
- ../../src/Audio/AudioFader_Implementation.h \
- ../../src/Audio/FJUI.h \
- ../../src/MenusAndDialogs/FLToolBar.h \
- ../../src/MenusAndDialogs/FLHelpWindow.h \
- ../../src/MenusAndDialogs/FLPresentationWindow.h \
- ../../src/MenusAndDialogs/FLErrorWindow.h \
- ../../src/MenusAndDialogs/FLExportManager.h \
- ../../src/MenusAndDialogs/FLMessageWindow.h \
- ../../src/MenusAndDialogs/FLPreferenceWindow.h \
- ../../src/MenusAndDialogs/FLPresentationWindow.h \
- ../../src/MenusAndDialogs/FLStatusBar.h \
- ../../src/MenusAndDialogs/SimpleParser.h \
- ../../src/MainStructure/FLComponentWindow.h \
- ../../src/MainStructure/FLFileWatcher.h \
- ../../src/MainStructure/FLSessionManager.h \
- ../../src/MainStructure/FLWinSettings.h \
- ../../src/MainStructure/FLWindow.h \
- ../../src/Network/FLServerHttp.h \
- ../../src/Network/HTTPWindow.h \
- ../../src/MainStructure/FLInterfaceManager.h \
- ../../src/MainStructure/FLSettings.h \
- ../../src/MainStructure/FLApp.h \
- C:\Users\Sarah\faudiostream-code\architecture\faust\gui\faustqt.h
-
-SOURCES += ../../src/Audio/AudioCreator.cpp \
- ../../src/Audio/AudioFader_Implementation.cpp \
- ../../src/MenusAndDialogs/FLToolBar.cpp \
- ../../src/MenusAndDialogs/FLHelpWindow.cpp \
- ../../src/MenusAndDialogs/FLPresentationWindow.cpp \
- ../../src/MenusAndDialogs/FLErrorWindow.cpp \
- ../../src/MenusAndDialogs/FLMessageWindow.cpp \
- ../../src/MenusAndDialogs/FLExportManager.cpp \
- ../../src/MenusAndDialogs/FLHelpWindow.cpp \
- ../../src/MenusAndDialogs/FLStatusBar.cpp \
- ../../src/MainStructure/FLWindow.cpp \
- ../../src/Network/FLServerHttp.cpp \
- ../../src/Network/HTTPWindow.cpp \
- ../../src/MainStructure/FLInterfaceManager.cpp \
- ../../src/MainStructure/FLSettings.cpp \
- ../../src/MenusAndDialogs/FLPreferenceWindow.cpp \
- ../../src/MainStructure/FLApp.cpp \
- ../../src/MainStructure/FLComponentWindow.cpp \
- ../../src/MainStructure/FLFileWatcher.cpp \
- ../../src/MainStructure/FLSessionManager.cpp \
- ../../src/MainStructure/FLWinSettings.cpp \
- ../../src/MenusAndDialogs/SimpleParser.cpp \
- ../../src/Utilities/main.cpp
-
-
-
diff --git a/Build/Windows/FaustLive.rc b/Build/Windows/FaustLive.rc
deleted file mode 100644
index ef73095..0000000
--- a/Build/Windows/FaustLive.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "../../Resources/Images/FaustLiveIcon.ico"
\ No newline at end of file
diff --git a/Build/Windows/README.txt b/Build/Windows/README.txt
deleted file mode 100644
index 6b713d1..0000000
--- a/Build/Windows/README.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-
-============================== FAUSTLIVE =========================
-
-The goal of this project is to build an application that embeds Faust and LLVM compiler to provide dynamical compilation of the Faust programming language.
-
-----------------LINKED LIBRARIES------------------
-
-In order to compile FaustLive, the following libraries are needed:
-
-dlls are included for Win32/Debug architecture
-- llvm (3.1 and higher)
-- clang (same version than llvm)
-- qt (4.8 and higher)
-- qrencode
-- libmicrohttpd
-
-Other Packages
-- jackosx http://jackaudio.org/
-- faust https://sourceforge.net/projects/faudiostream/files/
- Copy template.props and name it faust.props
- Modify faust.props with the paths to your dependencies
- Build the Visual Studio project
-
-
-Make sure to download the current development trunk of these libraries.
-
-----------------PROJECT COMPILATION---------------
-
-cd projetDIR
-
-In FaustLive.pro, change paths to your libs and includes.
-
-qmake -spec win32-msvc2012 (or your version of Visual Studio)
-
-In Visual Studio : create a new empty solution and add the created project in it.
-Once it is built, add the dlls in executable folder and execute folder.
-
-
----------------TO ADD A NEW AUDIO ARCHITECTURE
-
-1) Implement the classes :
- - _audioFader
- - _audioFactory
- - _audioManager
- - _audioSettings
-
-2) Modify AudioCreator to add the architecture in
- - enum audioArchitecture
- - add item in fAudioArchitecture
- - add case in createFactory
- - add case in read/write Settings
-
-3) Modify FaustLive.pro to add the libraries through conditional Compilation
-
-----------------TO ADD FAUST LIBRAIRIES
-
-1) Add the library in "Resources" folder
-2) Add the library in application.qrc
diff --git a/Build/Windows/READ_ME_BEFORE_YOU_START-Jack.docx b/Build/Windows/READ_ME_BEFORE_YOU_START-Jack.docx
deleted file mode 100644
index 0362d83..0000000
Binary files a/Build/Windows/READ_ME_BEFORE_YOU_START-Jack.docx and /dev/null differ
diff --git a/Build/Windows/READ_ME_BEFORE_YOU_START.docx b/Build/Windows/READ_ME_BEFORE_YOU_START.docx
deleted file mode 100644
index f860841..0000000
Binary files a/Build/Windows/READ_ME_BEFORE_YOU_START.docx and /dev/null differ
diff --git a/Build/Windows/Whats_New.docx b/Build/Windows/Whats_New.docx
deleted file mode 100644
index d6ab4a8..0000000
Binary files a/Build/Windows/Whats_New.docx and /dev/null differ
diff --git a/Build/Windows/setup_file.iss b/Build/Windows/setup_file.iss
deleted file mode 100644
index a40dfaa..0000000
--- a/Build/Windows/setup_file.iss
+++ /dev/null
@@ -1,85 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-#define MyAppName "FaustLive"
-#define MyAppVersion "2.30"
-#define MyAppPublisher "Grame"
-#define MyAppURL "http://faust.grame.fr"
-#define MyAppExeName "FaustLive.exe"
-
-[Setup]
-; NOTE: The value of AppId uniquely identifies this application.
-; Do not use the same AppId value in installers for other applications.
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-AppId={{4CFD7F48-8B15-420A-8F2E-B212832CE9EF}
-AppName={#MyAppName}
-AppVersion={#MyAppVersion}
-;AppVerName={#MyAppName} {#MyAppVersion}
-AppPublisher={#MyAppPublisher}
-AppPublisherURL={#MyAppURL}
-AppSupportURL={#MyAppURL}
-AppUpdatesURL={#MyAppURL}
-DefaultDirName={pf}\{#MyAppName}
-DefaultGroupName={#MyAppName}
-LicenseFile=C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\GPL_License.txt
-InfoAfterFile=C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\README_BEFORE_YOU_START.txt
-OutputDir=C:\Users\Sarah\faudiostream-faustlive\Build\Windows\FaustLive-Windows-Jack-2.30\FaustLive
-OutputBaseFilename=setup_FaustLive
-SetupIconFile=C:\Users\Sarah\faudiostream-faustlive\Resources\Images\FaustLiveIcon.ico
-Compression=lzma
-SolidCompression=yes
-
-[Languages]
-Name: "english"; MessagesFile: "compiler:Default.isl"
-Name: "french"; MessagesFile: "compiler:Languages\French.isl"
-
-[Tasks]
-Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-
-[Files]
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\FaustLive.exe"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\vcredist_x86.exe"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libsndfile-1.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\sound2faust.exe"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\icudt51.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\icuin51.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\icuuc51.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libcurl.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libmicrohttpd-10.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libgnutls-28.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libgcrypt-11.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libgmp.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libgpg-error-0.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libjacknet.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libplibc-1.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\pthreadGC2.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libintl-8.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libpng15.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libiconv-2.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\qrcodelib.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libeay32.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\libssh2.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\msvcr120.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\portaudio_x86.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\Projet1.vcxprojResolveAssemblyReference.cache"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\qt.conf"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\Qt5Network.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\ssleay32.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "C:\Users\Sarah\faudiostream-faustlive\Build\Windows\release\plugins\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-
-[Icons]
-Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
-Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
-Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
-
-[Run]
-Filename: "{app}\vcredist_x86.exe"; Flags: runascurrentuser
-Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
-
diff --git a/Build/Linux/FaustLive.desktop b/Build/rsrc/FaustLive.desktop
similarity index 100%
rename from Build/Linux/FaustLive.desktop
rename to Build/rsrc/FaustLive.desktop
diff --git a/Build/rsrc/FaustLive.rc b/Build/rsrc/FaustLive.rc
new file mode 100644
index 0000000..9d0181e
--- /dev/null
+++ b/Build/rsrc/FaustLive.rc
@@ -0,0 +1,98 @@
+// Microsoft Visual C++ generated resource script.
+//
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "windows.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 2,5,0,0
+ PRODUCTVERSION 2,5,0,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040c04b0"
+ BEGIN
+ VALUE "FileDescription", "Faust Live Environment"
+ VALUE "FileVersion", "2, 5, 0, 0"
+ VALUE "InternalName", "FaustLive"
+ VALUE "LegalCopyright", "Copyright (C) 2009-2018 - Grame"
+ VALUE "OriginalFilename", "FaustLive.exe"
+ VALUE "ProductName", "FaustLive"
+ VALUE "ProductVersion", "2, 5, 0, 0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x40c, 1200
+ END
+END
+
+#endif
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Build/Darwin/FaustLiveInfo.plist b/Build/rsrc/FaustLiveInfo.plist
old mode 100755
new mode 100644
similarity index 80%
rename from Build/Darwin/FaustLiveInfo.plist
rename to Build/rsrc/FaustLiveInfo.plist
index a521493..b034865
--- a/Build/Darwin/FaustLiveInfo.plist
+++ b/Build/rsrc/FaustLiveInfo.plist
@@ -11,7 +11,7 @@
dspCFBundleTypeIconFile
- application.icns
+ FaustLiveIcon.icnsCFBundleTypeMIMETypes
@@ -34,10 +34,14 @@
com.grame.FaustLiveCFBundlePackageTypeAPPL
+ CFBundleLongVersionString
+
+ CFBundleShortVersionString
+ 2.5.0CFBundleVersion
- 2.46
- NOTE
- This file was generated by Qt/QMake.
+ 2.5.0
+ NSHumanReadableCopyright
+ Copyright 2009-2019 GrameNSHighResolutionCapableUILaunchImageFile
diff --git a/Makefile b/Makefile
index c54d22e..85705a9 100644
--- a/Makefile
+++ b/Makefile
@@ -13,11 +13,14 @@ EXT =
endif
endif
-all:
+all: updatesubmodules
$(MAKE) -C Build/$(arch)
rm -rf FaustLive$(EXT)
cp -R Build/$(arch)/FaustLive$(EXT) .
+updatesubmodules:
+ if test -d .git; then git submodule update --init; fi
+
help:
@echo "Usage : 'make; sudo make install'"
@echo "To enable Jack or NetJack driver : 'make JACK=1 NETJACK=1'"
diff --git a/README.md b/README.md
index 8bb90c2..ea117ed 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,27 @@
-# FaustLive
-## Grame, Centre National de Creation Musicale:
-The goal of this project is to build a standalone application that embeds Faust (as the libfaust library) and LLVM compiler to provide dynamical compilation for the Faust programming language.
+FaustLive
+============================
+## The swiss knife for [Faust](https://faust.grame.fr) development.
+--------------
-To build FaustLive, you’ll have to go to the folder "Build" and follow the platform specific README.
+FaustLive is an advanced self-contained prototyping environment for the Faust programming language with an ultra-short edit-compile-run cycle. Thanks to its fully embedded compilation chain, FaustLive is simple to install and doesn't require any external compiler, development toolchain or SDK to run.
+
+FaustLive is the ideal tool for fast prototyping. Faust programs can be compiled and run on the fly by simple drag and drop. They can even be edited and recompiled while running, without sound interruption.
+It supports also native applications generation using the [Faust online compiler](https://faust.grame.fr/tools/onlinecompiler/).
+
+FaustLive is based on the [Faust](https://faust.grame.fr) library and on [LLVM](http://llvm.org).
+
+
+### Limitations and known bugs
+
+ - crashes on Windows when compiling a dsp with input signals, on a machine without input audio device
+ - may crash on startup due to incorrect cache. In this case, find the `FaustLive-CurrentSession-2.0` folder in your home folder, remove it and restart. On Unix like stations (Linux, MacOS), this folder is hidden and located at `$HOME/.FaustLive-CurrentSession-2.0`
+
+
+
+--------------
+#### [Grame](http://www.grame.fr) - Centre National de Creation Musicale
diff --git a/Resources/Libs/TestLibs.dsp b/Resources/Examples/TestLibs.dsp
similarity index 67%
rename from Resources/Libs/TestLibs.dsp
rename to Resources/Examples/TestLibs.dsp
index 53d3233..d018216 100644
--- a/Resources/Libs/TestLibs.dsp
+++ b/Resources/Examples/TestLibs.dsp
@@ -1,3 +1,3 @@
import("stdfaust.lib");
-process =+;
+process = !;
\ No newline at end of file
diff --git a/Resources/Examples/blowBottle.dsp b/Resources/Examples/blowBottle.dsp
index f8e407d..e4504f8 100644
--- a/Resources/Examples/blowBottle.dsp
+++ b/Resources/Examples/blowBottle.dsp
@@ -58,7 +58,7 @@ envelopeRelease = hslider("h:Envelopes_and_Vibrato/v:Envelope_Parameters/Envelop
nlfOrder = 6;
//attack - sustain - release envelope for nonlinearity (declared in instruments.lib)
-envelopeMod = en.asr(nonLinAttack,100,envelopeRelease,gate);
+envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate);
//nonLinearModultor is declared in instruments.lib, it adapts allpassnn from miscfilter.lib
//for using it with waveguide instruments
@@ -79,13 +79,13 @@ bandPassFilter = bandPass(freq,bottleRadius);
//----------------------- Algorithm implementation ----------------------------
//global envelope is of type attack - decay - sustain - release
-envelopeG = gain*en.adsr(gain*envelopeAttack,envelopeDecay,100,envelopeRelease,gate);
+envelopeG = gain*en.adsr(gain*envelopeAttack,envelopeDecay,1,envelopeRelease,gate);
//pressure envelope is also ADSR
-envelope = pressure*en.adsr(gain*0.02,0.01,100,gain*0.2,gate);
+envelope = pressure*en.adsr(gain*0.02,0.01,1,gain*0.2,gate);
//vibrato
-vibrato = os.osc(vibratoFreq)*vibratoGain*envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*os.osc(vibratoFreq);
+vibrato = os.osc(vibratoFreq)*vibratoGain*envVibrato(vibratoBegin,vibratoAttack,1,vibratoRelease,gate)*os.osc(vibratoFreq);
//breat pressure
breathPressure = envelope + vibrato;
diff --git a/Resources/Examples/clarinet.dsp b/Resources/Examples/clarinet.dsp
index 4b493a9..6dd38df 100644
--- a/Resources/Examples/clarinet.dsp
+++ b/Resources/Examples/clarinet.dsp
@@ -58,7 +58,7 @@ envelopeRelease = hslider("h:Envelopes_and_Vibrato/v:Envelope_Parameters/Envelop
nlfOrder = 6;
//attack - sustain - release envelope for nonlinearity (declared in instruments.lib)
-envelopeMod = en.asr(nonLinAttack,100,envelopeRelease,gate);
+envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate);
//nonLinearModultor is declared in instruments.lib, it adapts allpassnn from miscfilter.lib
//for using it with waveguide instruments
@@ -88,10 +88,10 @@ stereo = stereoizer(ma.SR/freq);
//----------------------- Algorithm implementation ----------------------------
//Breath pressure + vibrato + breath noise + envelope (Attack / Decay / Sustain / Release)
-envelope = en.adsr(envelopeAttack,envelopeDecay,100,envelopeRelease,gate)*pressure*0.9;
+envelope = en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate)*pressure*0.9;
vibrato = os.osc(vibratoFreq)*vibratoGain*
- envVibrato(0.1*2*vibratoAttack,0.9*2*vibratoAttack,100,vibratoRelease,gate);
+ envVibrato(0.1*2*vibratoAttack,0.9*2*vibratoAttack,1,vibratoRelease,gate);
breath = envelope + envelope*no.noise*noiseGain;
breathPressure = breath + breath*vibrato;
diff --git a/Resources/Examples/flute.dsp b/Resources/Examples/flute.dsp
index dc032bb..fa90cba 100644
--- a/Resources/Examples/flute.dsp
+++ b/Resources/Examples/flute.dsp
@@ -64,7 +64,7 @@ env2Release = hslider("h:Envelopes_and_Vibrato/v:Global_Envelope_Parameters/Glob
nlfOrder = 6;
//attack - sustain - release envelope for nonlinearity (declared in instruments.lib)
-envelopeMod = en.asr(nonLinAttack,100,0.1,gate);
+envelopeMod = en.asr(nonLinAttack,1,0.1,gate);
//nonLinearModultor is declared in instruments.lib, it adapts allpassnn from miscfilter.lib
//for using it with waveguide instruments
@@ -96,13 +96,13 @@ stereo = stereoizer(ma.SR/freq);
//----------------------- Algorithm implementation ----------------------------
//Pressure envelope
-env1 = en.adsr(env1Attack,env1Decay,90,env1Release,(gate | pressureEnvelope))*pressure*1.1;
+env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1;
//Global envelope
-env2 = en.asr(env2Attack,100,env2Release,gate)*0.5;
+env2 = en.asr(env2Attack,1,env2Release,gate)*0.5;
//Vibrato Envelope
-vibratoEnvelope = envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain;
+vibratoEnvelope = envVibrato(vibratoBegin,vibratoAttack,1,vibratoRelease,gate)*vibratoGain;
vibrato = os.osc(vibratoFreq)*vibratoEnvelope;
diff --git a/Resources/Examples/fluteStk.dsp b/Resources/Examples/fluteStk.dsp
index 9374ffe..9d1a371 100644
--- a/Resources/Examples/fluteStk.dsp
+++ b/Resources/Examples/fluteStk.dsp
@@ -60,7 +60,7 @@ envelopeRelease = hslider("h:Envelopes_and_Vibrato/v:Envelope_Parameters/Envelop
nlfOrder = 6;
//attack - sustain - release envelope for nonlinearity (declared in instruments.lib)
-envelopeMod = en.asr(nonLinAttack,100,envelopeRelease,gate);
+envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate);
//nonLinearModultor is declared in instruments.lib, it adapts allpassnn from miscfilter.lib
//for using it with waveguide instruments
@@ -97,10 +97,10 @@ stereo = stereoizer(ma.SR/freq);
//----------------------- Algorithm implementation ----------------------------
//the vibrato amplitude is controled by an envelope generator (declared in instruments.lib)
-vibrato = vibratoGain*envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*os.osc(vibratoFreq);
+vibrato = vibratoGain*envVibrato(vibratoBegin,vibratoAttack,1,vibratoRelease,gate)*os.osc(vibratoFreq);
//Breath pressure is controlled by an Attack / Decay / Sustain / Release envelope
-envelopeBreath = pressure*en.adsr(pressure*envelopeAttack,envelopeDecay,80,envelopeRelease,gate);
+envelopeBreath = pressure*en.adsr(pressure*envelopeAttack,envelopeDecay,0.8,envelopeRelease,gate);
breathPressure = envelopeBreath + envelopeBreath*(noiseGain*no.noise + vibrato) + 10.0^(-15.0);
//delay lines
diff --git a/Resources/Examples/glassHarmonica.dsp b/Resources/Examples/glassHarmonica.dsp
index 75d0b18..24acf5c 100644
--- a/Resources/Examples/glassHarmonica.dsp
+++ b/Resources/Examples/glassHarmonica.dsp
@@ -107,7 +107,7 @@ velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp
//Bow velocity is controled by an ADSR envelope
maxVelocity = 0.03 + 0.1*gain;
-bowVelocity = maxVelocity*en.adsr(0.02,0.005,100,0.01,gate);
+bowVelocity = maxVelocity*en.adsr(0.02,0.005,1,0.01,gate);
//stereoizer is declared in instruments.lib and implement a stereo spacialisation in function of
//the frequency period in number of samples
diff --git a/Resources/Examples/saxophony.dsp b/Resources/Examples/saxophony.dsp
index b1a6838..1f71555 100644
--- a/Resources/Examples/saxophony.dsp
+++ b/Resources/Examples/saxophony.dsp
@@ -59,7 +59,7 @@ envelopeRelease = hslider("h:Envelopes_and_Vibrato/v:Envelope_Parameters/Envelop
nlfOrder = 6;
//attack - sustain - release envelope for nonlinearity (declared in instruments.lib)
-envelopeMod = en.asr(nonLinAttack,100,envelopeRelease,gate);
+envelopeMod = en.asr(nonLinAttack,1,envelopeRelease,gate);
//nonLinearModultor is declared in instruments.lib, it adapts allpassnn from miscfilter.lib
//for using it with waveguide instruments
@@ -88,11 +88,11 @@ delay1 = de.fdelay(4096,fdel1);
delay2 = de.fdelay(4096,fdel2);
//Breath pressure is controlled by an attack / sustain / release envelope (asr is declared in instruments.lib)
-envelope = (0.55+pressure*0.3)*en.asr(pressure*envelopeAttack,100,pressure*envelopeRelease,gate);
+envelope = (0.55+pressure*0.3)*en.asr(pressure*envelopeAttack,1,pressure*envelopeRelease,gate);
breath = envelope + envelope*noiseGain*no.noise;
//envVibrato is decalred in instruments.lib
-vibrato = vibratoGain*envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*osc(vibratoFreq);
+vibrato = vibratoGain*envVibrato(vibratoBegin,vibratoAttack,1,vibratoRelease,gate)*osc(vibratoFreq);
breathPressure = breath + breath*vibratoGain*os.osc(vibratoFreq);
//Body filter is a one zero filter (declared in instruments.lib)
diff --git a/Resources/Examples/sitar.dsp b/Resources/Examples/sitar.dsp
index 9571ea4..0b4b1af 100644
--- a/Resources/Examples/sitar.dsp
+++ b/Resources/Examples/sitar.dsp
@@ -24,7 +24,7 @@ resonance = hslider("v:Physical_Parameters/Resonance
stereo = stereoizer(ma.SR/freq);
//excitation envelope (adsr)
-envelope = en.adsr(0.001,0.04,100,0.5,gate);
+envelope = en.adsr(0.001,0.04,1,0.5,gate);
//the delay length is randomly modulated
targetDelay = ma.SR/freq;
diff --git a/Resources/Examples/tibetanBowl.dsp b/Resources/Examples/tibetanBowl.dsp
index 7a47005..63b55ad 100644
--- a/Resources/Examples/tibetanBowl.dsp
+++ b/Resources/Examples/tibetanBowl.dsp
@@ -131,7 +131,7 @@ velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp
//Bow velocity is controled by an ADSR envelope
maxVelocity = 0.03 + 0.1*gain;
-bowVelocity = maxVelocity*en.adsr(0.02,0.005,100,0.01,gate);
+bowVelocity = maxVelocity*en.adsr(0.02,0.005,1,0.01,gate);
//stereoizer is declared in instruments.lib and implement a stereo spacialisation in function of
//the frequency period in number of samples
diff --git a/Resources/FaustLive.png b/Resources/FaustLive.png
new file mode 100644
index 0000000..afcc2b5
Binary files /dev/null and b/Resources/FaustLive.png differ
diff --git a/Resources/FaustLiveIcon.png b/Resources/FaustLiveIcon.png
new file mode 100644
index 0000000..68728ce
Binary files /dev/null and b/Resources/FaustLiveIcon.png differ
diff --git a/Resources/Libs/llvm_math.ll b/Resources/LLVM/llvm_math.ll
similarity index 100%
rename from Resources/Libs/llvm_math.ll
rename to Resources/LLVM/llvm_math.ll
diff --git a/Resources/Libs b/Resources/Libs
new file mode 160000
index 0000000..552b78c
--- /dev/null
+++ b/Resources/Libs
@@ -0,0 +1 @@
+Subproject commit 552b78c6502192b6fbc93ceeaa05c8b1093530f2
diff --git a/Resources/Libs/all.lib b/Resources/Libs/all.lib
deleted file mode 100644
index 3183287..0000000
--- a/Resources/Libs/all.lib
+++ /dev/null
@@ -1,26 +0,0 @@
-//##################################### all.lib ##########################################
-// The purpose of this library is to give access to all the Faust standard libraries
-// from a single point.
-//########################################################################################
-
-import("analyzers.lib");
-import("basics.lib");
-import("compressors.lib");
-import("delays.lib");
-import("demos.lib");
-import("dx7.lib");
-import("envelopes.lib");
-import("filters.lib");
-import("hoa.lib");
-import("maths.lib");
-import("misceffects.lib");
-import("oscillators.lib");
-import("noises.lib");
-import("phaflangers.lib");
-import("physmodels.lib");
-import("reverbs.lib");
-import("routes.lib");
-import("spats.lib");
-import("signals.lib");
-import("synths.lib");
-import("vaeffects.lib");
diff --git a/Resources/Libs/analyzers.lib b/Resources/Libs/analyzers.lib
deleted file mode 100644
index bfd5312..0000000
--- a/Resources/Libs/analyzers.lib
+++ /dev/null
@@ -1,492 +0,0 @@
-//################################ analyzers.lib ##########################################
-// Faust Analyzers library. Its official prefix is `an`.
-//########################################################################################
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-ro = library("routes.lib");
-si = library("signals.lib");
-fi = library("filters.lib");
-an = library("analyzers.lib"); // for compatible copy/paste out of this file
-
-declare name "Faust Analyzer Library";
-declare version "0.0";
-
-/************************************************************************
-FAUST library file, jos section
-
-Except where noted otherwise, The Faust functions below in this
-section are Copyright (C) 2003-2017 by Julius O. Smith III
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section is Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and is released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees)
-
-************************************************************************/
-
-//==============================Amplitude Tracking========================================
-//========================================================================================
-
-//---------------------------`(an.)amp_follower`---------------------------
-// Classic analog audio envelope follower with infinitely fast rise and
-// exponential decay. The amplitude envelope instantaneously follows
-// the absolute value going up, but then floats down exponentially.
-// `amp_follower` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : amp_follower(rel) : _
-// ```
-//
-// Where:
-//
-// * `rel`: release time = amplitude-envelope time-constant (sec) going down
-//
-// #### Reference
-//
-// * Musical Engineer's Handbook, Bernie Hutchins, Ithaca NY, 1975 Electronotes
-// Newsletter, Bernie Hutchins
-//------------------------------------------------------------
-amp_follower(rel) = abs : env with {
- p = ba.tau2pole(rel);
- env(x) = x * (1.0 - p) : (+ : max(x,_)) ~ *(p);
-};
-
-
-//---------------------------`(an.)amp_follower_ud`---------------------------
-// Envelope follower with different up and down time-constants
-// (also called a "peak detector").
-//
-// #### Usage
-//
-// ```
-// _ : amp_follower_ud(att,rel) : _
-// ```
-//
-// Where:
-//
-// * `att`: attack time = amplitude-envelope time constant (sec) going up
-// * `rel`: release time = amplitude-envelope time constant (sec) going down
-//
-// #### Note
-//
-// We assume rel >> att. Otherwise, consider rel ~ max(rel,att).
-// For audio, att is normally faster (smaller) than rel (e.g., 0.001 and 0.01).
-// Use `amp_follower_ar` below to remove this restriction.
-//
-// #### Reference
-//
-// * "Digital Dynamic Range Compressor Design --- A Tutorial and Analysis", by
-// Dimitrios Giannoulis, Michael Massberg, and Joshua D. Reiss
-//
-//------------------------------------------------------------
-amp_follower_ud(att,rel) = amp_follower(rel) : si.smooth(ba.tau2pole(att));
-
-
-//=============================Spectrum-Analyzers=========================================
-// Spectrum-analyzers split the input signal into a bank of parallel signals, one for
-// each spectral band. They are related to the Mth-Octave Filter-Banks in `filters.lib`.
-// The documentation of this library contains more details about the implementation.
-// The parameters are:
-//
-// * `M`: number of band-slices per octave (>1)
-// * `N`: total number of bands (>2)
-// * `ftop` = upper bandlimit of the Mth-octave bands (_):attach with {
- display = par(i,N,dbmeter(i));
- dbmeter(i) = abs : si.smooth(ba.tau2pole(tau)) : max(1.0e-7) : ba.linear2db : +(dB_offset) :
- meter(N-i-1);
- meter(i) = speclevel_group(vbargraph("[%2i] [unit:dB]
- [tooltip: Spectral Band Level in dB]", -50, 10));
- O = int(((N-2)/M)+0.4999);
- speclevel_group(x) = hgroup("[0] CONSTANT-Q SPECTRUM ANALYZER (6E), %N bands spanning
- LP, %O octaves below %ftop Hz, HP
- [tooltip: See Faust's filters.lib for documentation and references]", x);
-};
-
-mth_octave_spectral_level_default = mth_octave_spectral_level6e;
-spectral_level = mth_octave_spectral_level(2,10000,20); // simple default
-
-
-//---------------`(an.)[third|half]_octave_[analyzer|filterbank]`----------------
-// A bunch of special cases based on the different analyzer functions described above:
-//
-// ```
-// third_octave_analyzer(N) = mth_octave_analyzer_default(3,10000,N);
-// third_octave_filterbank(N) = mth_octave_filterbank_default(3,10000,N);
-// half_octave_analyzer(N) = mth_octave_analyzer_default(2,10000,N);
-// half_octave_filterbank(N) = mth_octave_filterbank_default(2,10000,N);
-// octave_filterbank(N) = mth_octave_filterbank_default(1,10000,N);
-// octave_analyzer(N) = mth_octave_analyzer_default(1,10000,N);
-// ```
-//
-// #### Usage
-//
-// See `mth_octave_spectral_level_demo` in `demos.lib`.
-//------------------------------------------------------------
-third_octave_analyzer(N) = mth_octave_analyzer_default(3,10000,N);
-third_octave_filterbank(N) = mth_octave_filterbank_default(3,10000,N);
-// Third-Octave Filter-Banks have been used in audio for over a century.
-// See, e.g.,
-// Acoustics [the book], by L. L. Beranek
-// Amer. Inst. Physics for the Acoustical Soc. America,
-// http://asa.aip.org/publications.html, 1986 (1st ed.1954)
-
-// Third-octave bands across the audio spectrum are too wide for current
-// typical computer screens, so half-octave bands are the default:
-half_octave_analyzer(N) = mth_octave_analyzer_default(2,10000,N);
-half_octave_filterbank(N) = mth_octave_filterbank_default(2,10000,N);
-
-octave_filterbank(N) = mth_octave_filterbank_default(1,10000,N);
-octave_analyzer(N) = mth_octave_analyzer_default(1,10000,N);
-
-
-//===============Arbritary-Crossover Filter-Banks and Spectrum Analyzers==================
-// These are similar to the Mth-octave analyzers above, except that the
-// band-split frequencies are passed explicitly as arguments.
-//========================================================================================
-
-// ACKNOWLEDGMENT
-// Technique for processing a variable number of signal arguments due
-// to Yann Orlarey (as is the entire Faust framework!)
-
-//---------------`(an.)analyzer`--------------------------
-// Analyzer.
-//
-// #### Usage
-//
-// ```
-// _ : analyzer(O,freqs) : par(i,N,_); // No delay equalizer
-// ```
-//
-// Where:
-//
-// * `O`: band-split filter order (ODD integer required for filterbank[i])
-// * `freqs`: (fc1,fc2,...,fcNs) [in numerically ascending order], where
-// Ns=N-1 is the number of octave band-splits
-// (total number of bands N=Ns+1).
-//
-// If frequencies are listed explicitly as arguments, enclose them in parens:
-//
-// ```
-// _ : analyzer(3,(fc1,fc2)) : _,_,_
-// ```
-//---------------------------------------------------
-analyzer(O,lfreqs) = _ <: bsplit(nb) with
-{
- nb = ba.count(lfreqs);
- fc(n) = ba.take(n, lfreqs);
- lp(n) = fi.lowpass(O,fc(n));
- hp(n) = fi.highpass(O,fc(n));
- bsplit(0) = _;
- bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
-};
-
-//================ Fast Fourier Transform (fft) and its Inverse (ifft) ===================
-// Sliding FFTs that compute a rectangularly windowed FFT each sample
-//========================================================================================
-
-// Undocumented utility functions used by fft and ifft:
-
-c_magsq(N) = si.cbus(N) : par(i,N,(par(j,2,abs<:_*_):>_)) :> si.bus(N);
-c_magdb(N) = si.cbus(N) : an.c_magsq(N) : par(i,N,(max(1.0e-7):log10:*(10.0)));
-c_select_pos_freqs(2) = (_,_), (_,_); // both dc and SR/2 included with "positive frequencies"
-c_select_pos_freqs(N) = si.cbus(N) : par(i,N/2+1,(_,_)),par(i,N/2-1,(!,!)) : si.cbus(N/2+1); // for complex spectra
- select_pos_freqs(2) = _,_; // both dc and SR/2 included
- select_pos_freqs(N) = si. bus(N) : par(i,N/2+1, _), par(i,N/2-1, !) : si. bus(N/2+1); // real power spectra etc.
-
-rtorv(N,x) = par(i,N,x@i); // convert real scalar signal to length N real vector
-rtocv(N,x) = par(i,N,(x@i,0)); // convert real scalar signal to length N complex vector with 0 imag part
-rvtocv(N) = si.bus(N), par(i,N,0) : ro.interleave(N,2); // convert real N-vector to complex with 0 imag part
-
-bit_reverse_selector(N,0) = 0;
-bit_reverse_selector(N,i) = int(int(N)>>1)*(i&1) + bit_reverse_selector(int(N)>>1,(i>>1));
-
-// decimation in time does this to the input:
-bit_reverse_shuffle(N) = si.bus(N) <: par(i,N,bit_reverse_permuter(N,i)) with {
- bit_reverse_permuter(N,k) = ba.selector(bit_reverse_selector(N,k),N);
-};
-
-c_bit_reverse_shuffle(N) = si.cbus(N) <: par(i,N,c_bit_reverse_permuter(N,i)) with {
- c_bit_reverse_permuter(N,k) = ba.cselector(bit_reverse_selector(N,k),N);
-};
-
-
-//---------------`(an.)fft` --------------------------
-// Fast Fourier Transform (FFT)
-//
-// #### Usage
-//
-// ```
-// si.cbus(N) : fft(N) : si.cbus(N);
-// ```
-//
-// Where:
-//
-// * `si.cbus(N)` is a bus of N complex signals, each specified by real and imaginary parts:
-// (r0,i0), (r1,i1), (r2,i2), ...
-// * `N` is the FFT size (must be a power of 2: 2,4,8,16,...)
-// * `fft(N)` performs a length `N` FFT for complex signals (radix 2)
-// * The output is a bank of N complex signals containing the complex spectrum over time:
-// (R0, I0), (R1,I1), ...
-// - The dc component is (R0,I0), where I0=0 for real input signals.
-//
-// FFTs of Real Signals:
-//
-// * To perform a sliding FFT over a real input signal, you can say
-// ```
-// process = signal : an.rtocv(N) : an.fft(N);
-// ```
-// where `an.rtocv` converts a real (scalar) signal to a complex vector signal having a zero imaginary part.
-//
-// * See `an.rfft_analyzer_c` (in `analyzers.lib`) and related functions for more detailed usage examples.
-//
-// * Use `an.rfft_spectral_level(N,tau,dB_offset)` to display the power spectrum of a real signal.
-//
-// * See `dm.fft_spectral_level_demo(N)` in `demos.lib` for an example GUI driving `an.rfft_spectral_level()`.
-//
-// #### Reference
-//
-// * [Decimation-in-time (DIT) Radix-2 FFT](https://cnx.org/contents/zmcmahhR@7/Decimation-in-time-DIT-Radix-2)
-//
-//---------------------------------------------------
-fft(N) = si.cbus(N) : an.c_bit_reverse_shuffle(N) : an.fftb(N); // shuffle off to the butterflies:
-fftb(1) = _,_; // each complex number is represented as (real,imag)
-fftb(N) = si.cbus(N) : (fftb(No2) <: (si.cbus(No2), si.cbus(No2))), (fftb(No2)
- <: (si.cbus(N):twiddleOdd(N))) :> si.cbus(N)
-with {
- No2 = int(N)>>1;
- // Half of these multiplies can go away since w(k) = - w(k+N/2), and others as well (1,j,-j,-1,...)
- twiddleOdd(N) = par(k,N,si.cmul(cos(w(k)),0-sin(w(k))))
- with {
- w(k) = 2.0*ma.PI*float(k)/float(N);
- };
-};
-
-// `rfft`
-// Slow to compile: rfft(N) = si.bus(N) : an.bit_reverse_shuffle(N) : an.rvtocv(N) : an.fftb(N);
-// Order of magnitude faster to compile but takes a scalar input, so too different from fft:
-// rfft(N) = an.rtocv(N) : an.fft(N);
-
-//---------------`(an.)ifft`--------------------------
-// Inverse Fast Fourier Transform (IFFT)
-//
-// #### Usage
-//
-// ```
-// si.cbus(N) : ifft(N) : si.cbus(N);
-// ```
-//
-// Where:
-//
-// * N is the IFFT size (power of 2)
-// * Input is a complex spectrum represented as interleaved real and imaginary parts:
-// (R0, I0), (R1,I1), (R2,I2), ...
-// * Output is a bank of N complex signals giving the complex signal in the time domain:
-// (r0, i0), (r1,i1), (r2,i2), ...
-//---------------------------------------------------
-ifft(N) = si.cbus(N) : an.c_bit_reverse_shuffle(N) : an.ifftb(N); // input is shuffled off to the butterflies:
-ifftb(1) = _,_;
-ifftb(N) = si.cbus(N) : (ifftb(No2) <: (si.cbus(No2), si.cbus(No2))), (ifftb(No2)
- <: (si.cbus(N):twiddleOddConj(N))) :> si.cbus(N) : par(i,2*N,/(2.0))
-with {
- No2 = int(N)>>1;
- // Half of these multiplies can go away since w(k) = - w(k+N/2), and others as well (1,j,-j,-1,...)
- twiddleOddConj(N) = par(k,N,si.cmul(cos(w(k)),sin(w(k))))
- with {
- w(k) = 2.0*ma.PI*float(k)/float(N);
- };
-};
-
-// ========== FFT Analyzers ==========
-rfft_analyzer_c(N) = an.rtocv(N) : an.fft(N) : an.c_select_pos_freqs(N); // complex spectral bins 0 to N/2
-rfft_analyzer_db(N) = an.rfft_analyzer_c(N) : an.c_magdb(N/2+1); // assumes real input
-rfft_analyzer_magsq(N) = an.rfft_analyzer_c(N) : an.c_magsq(N/2+1); // assumes real input
-
-rfft_spectral_level(N,tau,dB_offset) = _<: _, an.rfft_analyzer_db(N) : _,(display:>_):attach with {
- display = par(i,N/2+1,dbmeter(i));
- dbmeter(i) = si.smooth(ba.tau2pole(tau)) : +(dB_offset) : meter(i);
- meter(i) = speclevel_group(vbargraph("[%2i] [unit:dB]
- [tooltip: FFT Spectral Band Level in dB]", -50, 10));
- speclevel_group(x) = hgroup("[0] FFT SPECTRUM ANALYZER, %N bands
- [tooltip: fft_spectral_level in Faust's analyzers.lib]", x);
-};
-
-// end jos section
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-// TODO: Add GRAME functions here
-
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
-
-//---------------`(an.)amp_follower_ar`----------------
-// Envelope follower with independent attack and release times. The
-// release can be shorter than the attack (unlike in `amp_follower_ud`
-// above).
-//
-// #### Usage
-//
-// ```
-// _ : amp_follower_ar(att,rel) : _;
-// ```
-// * Author Jonatan Liljedahl, revised by RM
-//---------------------------------------------------------
-amp_follower_ar(att,rel) = abs : si.lag_ud(att,rel);
diff --git a/Resources/Libs/basics.lib b/Resources/Libs/basics.lib
deleted file mode 100644
index 4356f6f..0000000
--- a/Resources/Libs/basics.lib
+++ /dev/null
@@ -1,1060 +0,0 @@
-//#################################### basics.lib ########################################
-// A library of basic elements. Its official prefix is `ba`.
-//########################################################################################
-// A library of basic elements for Faust organized in 5 sections:
-//
-// * Conversion Tools
-// * Counters and Time/Tempo Tools
-// * Array Processing/Pattern Matching
-// * Selectors (Conditions)
-// * Other Tools (Misc)
-
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-ma = library("maths.lib");
-ro = library("routes.lib");
-ba = library("basics.lib"); // so functions here can be copy/pasted out
-
-declare name "Faust Basic Element Library";
-declare version "0.0";
-
-//=============================Conversion Tools===========================================
-//========================================================================================
-
-
-//-------`(ba.)samp2sec`----------
-// Converts a number of samples to a duration in seconds.
-// `samp2sec` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// samp2sec(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: number of samples
-//----------------------------
-samp2sec = /(ma.SR);
-
-
-//-------`(ba.)sec2samp`----------
-// Converts a duration in seconds to a number of samples.
-// `samp2sec` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// sec2samp(d) : _
-// ```
-//
-// Where:
-//
-// * `d`: duration in seconds
-//----------------------------
-sec2samp = *(ma.SR);
-
-
-//-------`(ba.)db2linear`----------
-// Converts a loudness in dB to a linear gain (0-1).
-// `db2linear` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// db2linear(l) : _
-// ```
-//
-// Where:
-//
-// * `l`: loudness in dB
-//-----------------------------
-db2linear(n) = pow(10, n/20.0);
-
-
-//-------`(ba.)linear2db`----------
-// Converts a linear gain (0-1) to a loudness in dB.
-// `linear2db` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// linear2db(g) : _
-// ```
-//
-// Where:
-//
-// * `g`: a linear gain
-//-----------------------------
-linear2db(n) = 20*log10(n);
-
-
-//----------`(ba.)lin2LogGain`------------------
-// Converts a linear gain (0-1) to a log gain (0-1).
-//
-// #### Usage
-//
-// ```
-// _ : lin2LogGain : _
-// ```
-//---------------------------------------------
-lin2LogGain = _ <: _*_;
-
-
-//----------`(ba.)log2LinGain`------------------
-// Converts a log gain (0-1) to a linear gain (0-1).
-//
-// #### Usage
-//
-// ```
-// _ : log2LinGain : _
-// ```
-//---------------------------------------------
-log2LinGain = sqrt;
-
-// end GRAME section
-//########################################################################################
-/************************************************************************
-FAUST library file, jos section
-
-Except where noted otherwise, The Faust functions below in this
-section are Copyright (C) 2003-2017 by Julius O. Smith III
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-The MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees)
-
-************************************************************************/
-
-//-------`(ba.)tau2pole`----------
-// Returns a real pole giving exponential decay.
-// Note that t60 (time to decay 60 dB) is ~6.91 time constants.
-// `tau2pole` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : smooth(tau2pole(tau)) : _
-// ```
-//
-// Where:
-//
-// * `tau`: time-constant in seconds
-//-----------------------------
- tau2pole(tau) = exp(-1.0/(tau*ma.SR));
-
-
-//-------`(ba.)pole2tau`----------
-// Returns the time-constant, in seconds, corresponding to the given real,
-// positive pole in (0,1).
-// `pole2tau` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// pole2tau(pole) : _
-// ```
-//
-// Where:
-//
-// * `pole`: the pole
-//-----------------------------
- pole2tau(pole) = -1.0/(log(pole)*ma.SR);
-
-
-//-------`(ba.)midikey2hz`----------
-// Converts a MIDI key number to a frequency in Hz (MIDI key 69 = A440).
-// `midikey2hz` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// midikey2hz(mk) : _
-// ```
-//
-// Where:
-//
-// * `mk`: the MIDI key number
-//-----------------------------
- midikey2hz(mk) = 440.0*pow(2.0, (mk-69.0)/12);
-
-
-//-------`(ba.)hz2midikey`----------
-// Converts a frequency in Hz to a MIDI key number (MIDI key 69 = A440).
-// `hz2midikey` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// hz2midikey(f) : _
-// ```
-//
-// Where:
-//
-// * `f`: frequency in Hz
-//-----------------------------
- hz2midikey(f) = 12*ma.log2(f/440.0) + 69.0;
-
-
-//-------`(ba.)pianokey2hz`----------
-// Converts a piano key number to a frequency in Hz (piano key 49 = A440).
-//
-// #### Usage
-//
-// ```
-// pianokey2hz(pk) : _
-// ```
-//
-// Where:
-//
-// * `pk`: the piano key number
-//-----------------------------
- pianokey2hz(pk) = 440.0*pow(2.0, (pk-49.0)/12);
-
-
-//-------`(ba.)hz2pianokey`----------
-// Converts a frequency in Hz to a piano key number (piano key 49 = A440).
-//
-// #### Usage
-//
-// ```
-// hz2pianokey(f) : _
-// ```
-//
-// Where:
-//
-// * `f`: frequency in Hz
-//-----------------------------
- hz2pianokey(f) = 12*ma.log2(f/440.0) + 49.0;
-
-// end jos section
-//########################################################################################
-/************************************************************************
-FAUST library file, GRAME section 2
-************************************************************************/
-
-//==============================Counters and Time/Tempo Tools=============================
-//========================================================================================
-
-//----------------------------`(ba.)countdown`------------------------------
-// Starts counting down from n included to 0. While trig is 1 the output is n.
-// The countdown starts with the transition of trig from 1 to 0. At the end
-// of the countdown the output value will remain at 0 until the next trig.
-// `countdown` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// countdown(n,trig) : _
-// ```
-//
-// Where:
-//
-// * `count`: the starting point of the countdown
-// * `trig`: the trigger signal (1: start at `n`; 0: decrease until 0)
-//-----------------------------------------------------------------------------
-countdown(count, trig) = \(c).(if(trig>0, count, max(0, c-1))) ~_;
-
-
-//----------------------------`(ba.)countup`--------------------------------
-// Starts counting up from 0 to n included. While trig is 1 the output is 0.
-// The countup starts with the transition of trig from 1 to 0. At the end
-// of the countup the output value will remain at n until the next trig.
-// `countup` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// countup(n,trig) : _
-// ```
-//
-// Where:
-//
-// * `count`: the maximum count value
-// * `trig`: the trigger signal (1: start at 0; 0: increase until `n`)
-//-----------------------------------------------------------------------------
-countup(count, trig) = \(c).(if(trig>0, 0, min(count, c+1))) ~_;
-
-
-//--------------------`(ba.)sweep`--------------------------
-// Counts from 0 to `period` samples repeatedly, while `run` is 1.
-// Outsputs zero while `run` is 0.
-//
-// #### Usage
-//
-// ```
-// sweep(period,run) : _
-// ```
-//-----------------------------------------------------------------
-// Author: Jonatan Liljedahl, markdown by RM
-sweep = %(int(*:max(1)))~+(1);
-
-
-//-------`(ba.)time`----------
-// A simple timer that counts every samples from the beginning of the process.
-// `time` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// time : _
-// ```
-//------------------------
-time = (+(1)~_ ) - 1;
-
-
-//-------`(ba.)tempo`----------
-// Converts a tempo in BPM into a number of samples.
-//
-// #### Usage
-//
-// ```
-// tempo(t) : _
-// ```
-//
-// Where:
-//
-// * `t`: tempo in BPM
-//------------------------
-tempo(t) = (60*ma.SR)/t;
-
-
-//-------`(ba.)period`----------
-// Basic sawtooth wave of period `p`.
-//
-// #### Usage
-//
-// ```
-// period(p) : _
-// ```
-//
-// Where:
-//
-// * `p`: period as a number of samples
-//------------------------
-// NOTE: may be this should go in oscillators.lib
-period(p) = %(int(p))~+(1');
-
-
-//-------`(ba.)pulse`----------
-// Pulses (10000) generated at period `p`.
-//
-// #### Usage
-//
-// ```
-// pulse(p) : _
-// ```
-//
-// Where:
-//
-// * `p`: period as a number of samples
-//------------------------
-// NOTE: may be this should go in oscillators.lib
-pulse(p) = period(p)==0;
-
-
-//-------`(ba.)pulsen`----------
-// Pulses (11110000) of length `n` generated at period `p`.
-//
-// #### Usage
-//
-// ```
-// pulsen(n,p) : _
-// ```
-//
-// Where:
-//
-// * `n`: the length of the pulse as a number of samples
-// * `p`: period as a number of samples
-//------------------------
-// NOTE: may be this should go in oscillators.lib
-pulsen(n,p) = period(p)= n) ;
-};
-
-
-
-//===============================Array Processing/Pattern Matching========================
-//========================================================================================
-
-//---------------------------------`(ba.)count`---------------------------------
-// Count the number of elements of list l.
-// `count` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// count(l)
-// count ((10,20,30,40)) -> 4
-// ```
-//
-// Where:
-//
-// * `l`: list of elements
-//-----------------------------------------------------------------------------
-count ((xs, xxs)) = 1 + count(xxs);
-count (xx) = 1;
-
-
-//-------------------------------`(ba.)take`-----------------------------------
-// Take an element from a list.
-// `take` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// take(e,l)
-// take(3,(10,20,30,40)) -> 30
-// ```
-//
-// Where:
-//
-// * `p`: position (starting at 1)
-// * `l`: list of elements
-//-----------------------------------------------------------------------------
-take (1, (xs, xxs)) = xs;
-take (1, xs) = xs;
-take (nn, (xs, xxs)) = take (nn-1, xxs);
-
-
-//----------------------------`(ba.)subseq`--------------------------------
-// Extract a part of a list.
-//
-// #### Usage
-//
-// ```
-// subseq(l, p, n)
-// subseq((10,20,30,40,50,60), 1, 3) -> (20,30,40)
-// subseq((10,20,30,40,50,60), 4, 1) -> 50
-// ```
-//
-// Where:
-//
-// * `l`: list
-// * `p`: start point (0: begin of list)
-// * `n`: number of elements
-//
-// #### Note:
-//
-// Faust doesn't have proper lists. Lists are simulated with parallel
-// compositions and there is no empty list
-//-----------------------------------------------------------------------------
-subseq((head, tail), 0, 1) = head;
-subseq((head, tail), 0, n) = head, subseq(tail, 0, n-1);
-subseq((head, tail), p, n) = subseq(tail, p-1, n);
-subseq(head, 0, n) = head;
-
-
-//============================Selectors (Conditions)======================================
-//========================================================================================
-
-//-----------------------------`(ba.)if`-----------------------------------
-// if-then-else implemented with a select2.
-//
-// #### Usage
-//
-// * `if(c, t, e) : _`
-//
-// Where:
-//
-// * `c`: condition
-// * `t`: signal selected while c is true
-// * `e`: signal selected while c is false
-//-----------------------------------------------------------------------------
-if(cond,thn,els) = select2(cond,els,thn);
-// TODO: perhaps it would make more sense to have an if(a,b) and an ifelse(a,b,c)?
-
-//-----------------------------`(ba.)selector`---------------------------------
-// Selects the ith input among n at compile time.
-//
-// #### Usage
-//
-// ```
-// selector(i,n)
-// _,_,_,_ : selector(2,4) : _ // selects the 3rd input among 4
-// ```
-//
-// Where:
-//
-// * `i`: input to select (`int`, numbered from 0, known at compile time)
-// * `n`: number of inputs (`int`, known at compile time, `n > i`)
-//
-// There is also cselector for selecting among complex input signals of the form (real,imag).
-//
-//-----------------------------------------------------------------------------
-selector(i,n) = par(j, n, S(i, j)) with { S(i,i) = _; S(i,j) = !; };
-cselector(i,n) = par(j, n, S(i, j)) with { S(i,i) = (_,_); S(i,j) = (!,!); }; // for complex numbers
-
-
-//-----------------------------`(ba.)selectn`---------------------------------
-// Selects the ith input among N at run time.
-//
-// #### Usage
-//
-// ```
-// selectn(N,i)
-// _,_,_,_ : selectn(4,2) : _ // selects the 3rd input among 4
-// ```
-//
-// Where:
-//
-// * `N`: number of inputs (int, known at compile time, N > 0)
-// * `i`: input to select (int, numbered from 0)
-//
-// #### Example test program
-//
-// ```
-// N=64;
-// process = par(n,N, (par(i,N,i) : selectn(N,n)));
-// ```
-//-----------------------------------------------------------------------------
-selectn(N,i) = S(N,0)
- with {
- S(1,offset) = _;
- S(n,offset) = S(left, offset), S(right, offset+left) : select2(i >= offset+left)
- with {
- right = int(n/2);
- left = n-right;
- };
- };
-
-
-//--------------------`(ba.)select2stereo`--------------------
-// Select between 2 stereo signals.
-//
-// #### Usage
-//
-// ```
-// _,_,_,_ : select2stereo(bpc) : _,_,_,_
-// ```
-//
-// Where:
-//
-// * `bpc`: the selector switch (0/1)
-//------------------------------------------------------------
- select2stereo(bpc) = ro.cross2 : select2(bpc), select2(bpc) : _,_;
-//=====================================Other==============================================
-//========================================================================================
-
-//----------------------------`(ba.)latch`--------------------------------
-// Latch input on positive-going transition of "clock" ("sample-and-hold").
-//
-// #### Usage
-//
-// ```
-// _ : latch(clocksig) : _
-// ```
-//
-// Where:
-//
-// * `clocksig`: hold trigger (0 for hold, 1 for bypass)
-//------------------------------------------------------------
- latch(c,x) = x * s : + ~ *(1-s) with { s = ((c'<=0)&(c>0)); };
-
-
-//--------------------------`(ba.)sAndH`-------------------------------
-// Sample And Hold.
-// `sAndH` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : sAndH(t) : _
-// ```
-//
-// Where:
-//
-// * `t`: hold trigger (0 for hold, 1 for bypass)
-//----------------------------------------------------------------
-// Author: RM
-sAndH(t) = select2(t,_,_)~_;
-
-
-//--------------------------`(ba.)downSample`-------------------------------
-// Down sample a signal. WARNING: this function doesn't change the
-// rate of a signal, it just holds samples...
-// `downSample` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : downSample(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: new rate in Hz
-//----------------------------------------------------------------
-// Author: RM
-downSample(freq) = sAndH(hold)
-with{
- hold = time%int(ma.SR/freq) == 0;
-};
-
-
-//------------------`(ba.)peakhold`---------------------------
-// Outputs current max value above zero.
-//
-// #### Usage
-//
-// ```
-// _ : peakhold(mode) : _;
-// ```
-//
-// Where:
-//
-// `mode` means: 0 - Pass through. A single sample 0 trigger will work as a reset.
-// 1 - Track and hold max value.
-//----------------------------------------------------------------
-// TODO: author Jonatan Liljedahl, revised by RM
-peakhold = (*,_:max) ~ _;
-
-
-//------------------`(ba.)peakholder`---------------------------
-// Tracks abs peak and holds peak for 'holdtime' samples.
-//
-// #### Usage
-//
-// ```
-// _ : peakholder(holdtime) : _;
-// ```
-//----------------------------------------------------------------
-// TODO: author Jonatan Liljedahl
-peakholder(holdtime) = peakhold2 ~ reset : (!,_) with {
- reset = ba.sweep(holdtime) > 0;
- // first out is gate that is 1 while holding last peak
- peakhold2 = _,abs <: peakhold,!,_ <: >=,_,!;
-};
-
-
-//--------------------------`(ba.)impulsify`---------------------------
-// Turns the signal from a button into an impulse (1,0,0,... when
-// button turns on).
-// `impulsify` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// button("gate") : impulsify ;
-// ```
-//----------------------------------------------------------------
-impulsify = _ <: _,mem : - : >(0);
-
-
-//-----------------------`(ba.)automat`------------------------------
-// Record and replay to the values the input signal in a loop.
-//
-// #### Usage
-//
-// ```
-// hslider(...) : automat(bps, size, init) : _
-// ```
-//-----------------------------------------------------------------------
-automat(bps, size, init, input) = rwtable(size+1, init, windex, input, rindex)
-with {
- clock = beat(bps);
- rindex = int(clock) : (+ : %(size)) ~ _; // each clock read the next entry of the table
- windex = if (timeToRenew, rindex, size); // we ignore input unless it is time to renew
- timeToRenew = int(clock) & (inputHasMoved | (input <= init));
- inputHasMoved = abs(input-input') : countfrom(int(clock)') : >(0);
- countfrom(reset) = (+ : if(reset, 0, _)) ~ _;
-};
-
-
-//-----------------`(ba.)bpf`-------------------
-// bpf is an environment (a group of related definitions) that can be used to
-// create break-point functions. It contains three functions :
-//
-// * `start(x,y)` to start a break-point function
-// * `end(x,y)` to end a break-point function
-// * `point(x,y)` to add intermediate points to a break-point function
-//
-// A minimal break-point function must contain at least a start and an end point :
-//
-// ```
-// f = bpf.start(x0,y0) : bpf.end(x1,y1);
-// ```
-//
-// A more involved break-point function can contains any number of intermediate
-// points:
-//
-// ```
-// f = bpf.start(x0,y0) : bpf.point(x1,y1) : bpf.point(x2,y2) : bpf.end(x3,y3);
-// ```
-//
-// In any case the `x_{i}` must be in increasing order (for all `i`, `x_{i} < x_{i+1}`).
-// For example the following definition :
-//
-// ```
-// f = bpf.start(x0,y0) : ... : bpf.point(xi,yi) : ... : bpf.end(xn,yn);
-// ```
-//
-// implements a break-point function f such that :
-//
-// * `f(x) = y_{0}` when `x < x_{0}`
-// * `f(x) = y_{n}` when `x > x_{n}`
-// * `f(x) = y_{i} + (y_{i+1}-y_{i})*(x-x_{i})/(x_{i+1}-x_{i})` when `x_{i} <= x`
-// and `x < x_{i+1}`
-//
-// `bpf` is a standard Faust function.
-//--------------------------------------------------------
-bpf = environment
-{
- // Start a break-point function
- start(x0,y0) = \(x).(x0,y0,x,y0);
- // Add a break-point
- point(x1,y1) = \(x0,y0,x,y).(x1, y1, x , if (x < x0, y, if (x < x1, y0 + (x-x0)*(y1-y0)/(x1-x0), y1)));
- // End a break-point function
- end (x1,y1) = \(x0,y0,x,y).(if (x < x0, y, if (x < x1, y0 + (x-x0)*(y1-y0)/(x1-x0), y1)));
-};
-
-
-//-------------------`(ba.)listInterp`-------------------------
-// Linearly interpolates between the elements of a list.
-//
-// #### Usage
-//
-// ```
-// foo = listInterp((800,400,350,450,325),index);
-// i = 1.69; // range is 0-4
-// process = foo(i);
-// ```
-//
-// Where:
-//
-// * `index`: the index (float) to interpolate between the different values.
-// The range of `index` depends on the size of the list.
-//------------------------------------------------------------
-// Author: RM
-listInterp(v) =
- bpf.start(0,take(1,v)) :
- seq(i,count(v)-2,bpf.point(i+1,take(i+2,v))) :
- bpf.end(count(v)-1,take(count(v),v));
-
-
-//-------------------`(ba.)bypass1`-------------------------
-// Takes a mono input signal, route it to `e` and bypass it if `bpc = 1`.
-// `bypass1` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : bypass1(bpc,e) : _
-// ```
-//
-// Where:
-//
-// * `bpc`: bypass switch (0/1)
-// * `e`: a mono effect
-//------------------------------------------------------------
-// Author: JOS
-// License: STK-4.3
-bypass1(bpc,e) = _ <: select2(bpc,(inswitch:e),_)
- with {
- inswitch = select2(bpc,_,0);
- };
-
-//-------------------`(ba.)bypass2`-------------------------
-// Takes a stereo input signal, route it to `e` and bypass it if `bpc = 1`.
-// `bypass2` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _,_ : bypass2(bpc,e) : _,_
-// ```
-//
-// Where:
-//
-// * `bpc`: bypass switch (0/1)
-// * `e`: a stereo effect
-//------------------------------------------------------------
-// Author: JOS
-// License: STK-4.3
-bypass2(bpc,e) = _,_ <: ((inswitch:e),_,_) : select2stereo(bpc)
- with {
- inswitch = _,_ : (select2(bpc,_,0), select2(bpc,_,0)) : _,_;
- };
-
-//-------------------`(ba.)bypass1to2`-------------------------
-// Bypass switch for effect `e` having mono input signal and stereo output.
-// Effect `e` is bypassed if `bpc = 1`.
-// `bypass1to2` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : bypass1(bpc,e) : _,_
-// ```
-//
-// Where:
-//
-// * `bpc`: bypass switch (0/1)
-// * `e`: a mono-to-stereo effect
-//------------------------------------------------------------
-// Author: JOS
-// License: STK-4.3
-bypass1to2(bpc,e) = _ <: ((inswitch:e),_,_) : ba.select2stereo(bpc)
- with {
- inswitch = select2(bpc,_,0);
- };
-
-//----------------------------`(ba.)toggle`------------------------------------------
-// Triggered by the change of 0 to 1, it toggles the output value
-// between 0 and 1.
-//
-// #### Usage
-//
-// ```
-// _ : toggle : _
-// ```
-// #### Examples
-//
-// ```
-// button("toggle") : toggle : vbargraph("output", 0, 1)
-// (an.amp_follower(0.1) > 0.01) : toggle : vbargraph("output", 0, 1) // takes audio input
-// ```
-//
-//------------------------------------------------------------------------------
-// TODO: author "Vince"
-toggle = trig : loop
- with {
- trig(x) = (x-x') == 1;
- loop = (_ != _) ~ _ ;
- };
-
-
-//----------------------------`(ba.)on_and_off`------------------------------------------
-// The first channel set the output to 1, the second channel to 0.
-//
-// #### Usage
-//
-// ```
-// _ , _ : on_and_off : _
-// ```
-//
-// #### Example
-//
-// ```
-// button("on"), button("off") : on_and_off : vbargraph("output", 0, 1)
-// ```
-//
-//------------------------------------------------------------------------------
-// TODO: author "Vince"
-on_and_off(a, b) = (a : trig) : loop(b)
-with {
- trig(x) = (x-x') == 1;
- loop(b) = + ~ (_ >= 1) * ((b : trig) == 0) ;
-};
-
-
-//-----------------------------`(ba.)selectoutn`---------------------------------
-// Route input to the output among N at run time.
-//
-// #### Usage
-//
-// ```
-// _ : selectoutn(n, s) : _,_,...n
-// ```
-//
-// Where:
-//
-// * `n`: number of outputs (int, known at compile time, N > 0)
-// * `s`: output number to route to (int, numbered from 0) (i.e. slider)
-//
-// #### Example
-//
-// ```
-// process = 1 : selectoutn(3, sel) : par(i,3,bar) ;
-// sel = hslider("volume",0,0,2,1) : int;
-// bar = vbargraph("v.bargraph", 0, 1);
-// ```
-//--------------------------------------------------------------------------
-// TODO: author "Vince"
-selectoutn(n, s) = _ <: par(i,n, _* (s==i) ) ;
-
-//////////////////////////////////Deprecated Functions////////////////////////////////////
-// This section implements functions that used to be in music.lib but that are now
-// considered as "deprecated".
-//////////////////////////////////////////////////////////////////////////////////////////
-
-millisec = ma.SR/1000.0;
-
-time1s = hslider("time", 0, 0, 1000, 0.1)*millisec;
-time2s = hslider("time", 0, 0, 2000, 0.1)*millisec;
-time5s = hslider("time", 0, 0, 5000, 0.1)*millisec;
-time10s = hslider("time", 0, 0, 10000, 0.1)*millisec;
-time21s = hslider("time", 0, 0, 21000, 0.1)*millisec;
-time43s = hslider("time", 0, 0, 43000, 0.1)*millisec;
diff --git a/Resources/Libs/compressors.lib b/Resources/Libs/compressors.lib
deleted file mode 100644
index 08cafa3..0000000
--- a/Resources/Libs/compressors.lib
+++ /dev/null
@@ -1,176 +0,0 @@
-//#################################### compressors.lib ####################################
-// A library of compressor effects. Its official prefix is `co`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file
-Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale
-----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-ba = library("basics.lib");
-si = library("signals.lib");
-an = library("analyzers.lib");
-
-
-declare name "Faust Compressor Effect Library";
-declare version "0.0";
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-//--------------------`(co.)compressor_mono`-------------------
-// Mono dynamic range compressors.
-// `compressor_mono` is a standard Faust function
-//
-// #### Usage
-//
-// ```
-// _ : compressor_mono(ratio,thresh,att,rel) : _
-// ```
-//
-// Where:
-//
-// * `ratio`: compression ratio (1 = no compression, >1 means compression)
-// * `thresh`: dB level threshold above which compression kicks in (0 dB = max level)
-// * `att`: attack time = time constant (sec) when level & compression going up
-// * `rel`: release time = time constant (sec) coming out of compression
-//
-// #### References
-//
-// *
-// *
-// * Albert Graef's "faust2pd"/examples/synth/compressor_.dsp
-// * More features:
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-compressor_mono(ratio,thresh,att,rel,x) = x * compression_gain_mono(ratio,thresh,att,rel,x);
-
-
-//--------------------`(co.)compressor_stereo`-------------------
-// Stereo dynamic range compressors.
-//
-// #### Usage
-//
-// ```
-// _,_ : compressor_stereo(ratio,thresh,att,rel) : _,_
-// ```
-//
-// Where:
-//
-// * `ratio`: compression ratio (1 = no compression, >1 means compression)
-// * `thresh`: dB level threshold above which compression kicks in (0 dB = max level)
-// * `att`: attack time = time constant (sec) when level & compression going up
-// * `rel`: release time = time constant (sec) coming out of compression
-//
-// #### References
-//
-// *
-// *
-// * Albert Graef's "faust2pd"/examples/synth/compressor_.dsp
-// * More features:
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-compressor_stereo(ratio,thresh,att,rel,x,y) = cgm*x, cgm*y with {
- cgm = compression_gain_mono(ratio,thresh,att,rel,abs(x)+abs(y));
-};
-
-compression_gain_mono(ratio,thresh,att,rel) =
- an.amp_follower_ar(att,rel) : ba.linear2db : outminusindb(ratio,thresh) :
- kneesmooth(att) : ba.db2linear
-with {
- // kneesmooth(att) installs a "knee" in the dynamic-range compression,
- // where knee smoothness is set equal to half that of the compression-attack.
- // A general 'knee' parameter could be used instead of tying it to att/2:
- kneesmooth(att) = si.smooth(ba.tau2pole(att/2.0));
- // compression gain in dB:
- outminusindb(ratio,thresh,level) = max(level-thresh,0.0) * (1.0/float(ratio)-1.0);
- // Note: "float(ratio)" REQUIRED when ratio is an integer > 1!
-};
-
-
-//----------------`(co.)limiter_1176_R4_mono`----------------------
-// A limiter guards against hard-clipping. It can be can be
-// implemented as a compressor having a high threshold (near the
-// clipping level), fast attack and release, and high ratio. Since
-// the ratio is so high, some knee smoothing is
-// desirable ("soft limiting"). This example is intended
-// to get you started using compressor_* as a limiter, so all
-// parameters are hardwired to nominal values here.
-// Ratios: 4 (moderate compression), 8 (severe compression),
-// 12 (mild limiting), or 20 to 1 (hard limiting)
-// Att: 20-800 MICROseconds (Note: scaled by ratio in the 1176)
-// Rel: 50-1100 ms (Note: scaled by ratio in the 1176)
-// Mike Shipley likes 4:1 (Grammy-winning mixer for Queen, Tom Petty, etc.)
-// Faster attack gives "more bite" (e.g. on vocals)
-// He hears a bright, clear eq effect as well (not implemented here)
-// `limiter_1176_R4_mono` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : limiter_1176_R4_mono : _;
-// ```
-//
-// #### Reference:
-//
-//
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-limiter_1176_R4_mono = compressor_mono(4,-6,0.0008,0.5);
-
-
-//-------------------`(co.)limiter_1176_R4_stereo`---------------------
-// A limiter guards against hard-clipping. It can be can be
-// implemented as a compressor having a high threshold (near the
-// clipping level), fast attack and release, and high ratio. Since
-// the ratio is so high, some knee smoothing is
-// desirable ("soft limiting"). This example is intended
-// to get you started using compressor_* as a limiter, so all
-// parameters are hardwired to nominal values here.
-// Ratios: 4 (moderate compression), 8 (severe compression),
-// 12 (mild limiting), or 20 to 1 (hard limiting)
-// Att: 20-800 MICROseconds (Note: scaled by ratio in the 1176)
-// Rel: 50-1100 ms (Note: scaled by ratio in the 1176)
-// Mike Shipley likes 4:1 (Grammy-winning mixer for Queen, Tom Petty, etc.)
-// Faster attack gives "more bite" (e.g. on vocals)
-// He hears a bright, clear eq effect as well (not implemented here)
-//
-// #### Usage
-//
-// ```
-// _,_ : limiter_1176_R4_stereo : _,_;
-// ```
-//
-// #### Reference:
-//
-//
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-limiter_1176_R4_stereo = compressor_stereo(4,-6,0.0008,0.5);
diff --git a/Resources/Libs/delays.lib b/Resources/Libs/delays.lib
deleted file mode 100644
index 90fdbb9..0000000
--- a/Resources/Libs/delays.lib
+++ /dev/null
@@ -1,386 +0,0 @@
-
-//#################################### delays.lib #########################################
-// This library contains a collection of delay functions. Its official prefix is `de`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file
-Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale
-----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-si = library("signals.lib");
-fi = library("filters.lib");
-
-
-declare name "Faust Delay Library";
-declare version "0.0";
-
-//==================================Basic Delay Functions=================================
-//========================================================================================
-
-//-------`(de.)delay`----------
-// Simple `d` samples delay where `n` is the maximum delay length as a number of
-// samples. Unlike the `@` delay operator, here the delay signal `d` is explicitely
-// bounded to the interval [0..n]. The consequence is that delay will compile even
-// if the interval of d can't be computed by the compiler.
-// `delay` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : delay(n,d) : _
-// ```
-//
-// Where:
-//
-// * `n`: the max delay length (in samples)
-// * `d`: the delay length as a number of samples (integer)
-//-----------------------------
-// TODO: add MBH np2
-delay(n,d,x) = x @ min(n, max(0,d));
-
-
-//-------`(de.)fdelay`----------
-// Simple `d` samples fractional delay based on 2 interpolated delay lines where `n` is
-// the maximum delay length as a number of samples.
-
-// `fdelay` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : fdelay(n,d) : _
-// ```
-//
-// Where:
-//
-// * `n`: the max delay length as a number of samples
-// * `d`: the delay length as a number of samples (float)
-//-----------------------------
-fdelay(n,d,x) = delay(n+1,int(d),x)*(1 - ma.frac(d)) + delay(n+1,int(d)+1,x)*ma.frac(d);
-
-
-//--------------------------`(de.)sdelay`----------------------------
-// s(mooth)delay: a mono delay that doesn't click and doesn't
-// transpose when the delay time is changed.
-//
-// #### Usage
-//
-// ```
-// _ : sdelay(N,it,dt) : _
-// ```
-//
-// Where :
-//
-// * `N`: maximal delay in samples
-// * `it`: interpolation time (in samples) for example 1024
-// * `dt`: delay time (in samples)
-//--------------------------------------------------------------------------
-sdelay(N, it, dt) = ctrl(it,dt),_ : ddi(N)
-with {
- // ddi(N,i,d0,d1)
- // DDI (Double Delay with Interpolation) : the input signal is sent to two
- // delay lines. The outputs of these delay lines are crossfaded with
- // an interpolation stage. By acting on this interpolation value one
- // can move smoothly from one delay to another. When is 0 we can
- // freely change the delay time of line 1, when it is 1 we can freely change
- // the delay time of line 0.
- //
- // = maximal delay in samples
- // = interpolation value between 0 and 1 used to crossfade the outputs of the
- // two delay lines (0.0: first delay line, 1.0: second delay line)
- // = delay time of delay line 0 in samples between 0 and -1
- // = delay time of delay line 1 in samples between 0 and -1
- // < > = the input signal we want to delay
- ddi(N, i, d0, d1) = _ <: delay(N,d0), delay(N,d1) : si.interpolate(i);
-
- // ctrl(it,dt)
- // Control logic for a Double Delay with Interpolation according to two
- //
- // USAGE : ctrl(it,dt)
- // where :
- // an interpolation time (in samples, for example 256)
- //
a delay time (in samples)
- //
- // ctrl produces 3 outputs : an interpolation value and two delay
- // times and . These signals are used to control a ddi (Double Delay with Interpolation).
- // The principle is to detect changes in the input delay time dt, then to
- // change the delay time of the delay line currently unused and then by a
- // smooth crossfade to remove the first delay line and activate the second one.
- //
- // The control logic has an internal state controlled by 4 elements
- // : the interpolation variation (0, 1/it, -1/it)
- // : the interpolation value (between 0 and 1)
- // : the delay time of line 0
- // : the delay time of line 1
- //
- // Please note that the last stage (!,_,_,_) cut because it is only
- // used internally.
- ctrl(it, dt) = \(v,ip,d0,d1).( (nv, nip, nd0, nd1)
- with {
- // interpolation variation
- nv = ba.if (v!=0.0, // if variation we are interpolating
- ba.if( (ip>0.0) & (ip<1.0), v , 0), // should we continue or not ?
- ba.if ((ip==0.0) & (dt!=d0), 1.0/it, // if true xfade from dl0 to dl1
- ba.if ((ip==1.0) & (dt!=d1), -1.0/it, // if true xfade from dl1 to dl0
- 0))); // nothing to change
- // interpolation value
- nip = ip+nv : min(1.0) : max(0.0);
-
- // update delay time of line 0 if needed
- nd0 = ba.if ((ip >= 1.0) & (d1!=dt), dt, d0);
-
- // update delay time of line 0 if needed
- nd1 = ba.if ((ip <= 0.0) & (d0!=dt), dt, d1);
- } ) ~ (_,_,_,_) : (!,_,_,_);
-};
-
-
-// ----------`(de.)prime_power_delays`-----------
-// Prime Power Delay Line Lengths.
-//
-// #### Usage
-//
-// ```
-// si.bus(N) : prime_power_delays(N,pathmin,pathmax) : si.bus(N);
-// ```
-//
-// Where:
-//
-// * `N`: positive integer up to 16 (for higher powers of 2, extend 'primes' array below.)
-// * `pathmin`: minimum acoustic ray length in the reverberator (in meters)
-// * `pathmax`: maximum acoustic ray length (meters) - think "room size"
-//
-// #### Reference
-//
-//
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-prime_power_delays(N,pathmin,pathmax) = par(i,N,delayvals(i)) with {
- Np = 16;
- primes = 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53;
- prime(n) = primes : ba.selector(n,Np); // math.lib
-
- // Prime Power Bounds [matlab: floor(log(maxdel)./log(primes(53)))]
- maxdel=8192; // more than 63 meters at 44100 samples/sec & 343 m/s
- ppbs = 13,8,5,4, 3,3,3,3, 2,2,2,2, 2,2,2,2; // 8192 is enough for all
- ppb(i) = ba.take(i+1,ppbs);
-
- // Approximate desired delay-line lengths using powers of distinct primes:
- c = 343; // soundspeed in m/s at 20 degrees C for dry air
- dmin = ma.SR*pathmin/c;
- dmax = ma.SR*pathmax/c;
- dl(i) = dmin * (dmax/dmin)^(i/float(N-1)); // desired delay in samples
- ppwr(i) = floor(0.5+log(dl(i))/log(prime(i))); // best prime power
- delayvals(i) = prime(i)^ppwr(i); // each delay a power of a distinct prime
-};
-
-
-//===============================Lagrange Interpolation===================================
-//========================================================================================
-
-//----------------------`(de.)fdelaylti` and `(de.)fdelayltv`-------------------------
-// Fractional delay line using Lagrange interpolation.
-//
-// #### Usage
-//
-// ```
-// _ : fdelaylt[i|v](order, maxdelay, delay, inputsignal) : _
-// ```
-//
-// Where `order=1,2,3,...` is the order of the Lagrange interpolation polynomial.
-//
-// `fdelaylti` is most efficient, but designed for constant/slowly-varying delay.
-// `fdelayltv` is more expensive and more robust when the delay varies rapidly.
-//
-// NOTE: The requested delay should not be less than `(N-1)/2`.
-//
-// #### References
-//
-// *
-// - (fixed-delay case)(https://ccrma.stanford.edu/~jos/Interpolation/Efficient_Time_Invariant_Lagrange_Interpolation.html)
-// - (variable-delay case)(https://ccrma.stanford.edu/~jos/Interpolation/Time_Varying_Lagrange_Interpolation.html)
-// * Timo I. Laakso et al., "Splitting the Unit Delay - Tools for Fractional
-// Delay Filter Design", IEEE Signal Processing Magazine,
-// vol. 13, no. 1, pp. 30-60, Jan 1996.
-// * Philippe Depalle and Stephan Tassart, "Fractional Delay Lines using
-// Lagrange Interpolators", ICMC Proceedings, pp. 341-343, 1996.
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-fdelaylti(N,n,d,x) = delay(n,id,x) <: seq(i,N,section(i)) : !,_
-with {
- o = (N-1.00001)/2; // offset to ~center FIR interpolator
- dmo = d - o; // assumed nonnegative [d > (N-1)/2]
- id = int(dmo);
- fd = o + ma.frac(dmo);
- section(i,x,y) = (x-x') * c(i) <: _,+(y);
- c(i) = (i - fd)/(i+1);
-};
-
-fdelayltv(N,n,d,x) = sum(i, N+1, delay(n,id+i,x) * h(N,fd,i))
-with {
- o = (N-1.00001)/2; // ~center FIR interpolator
- dmo = d - o; // assumed >=0 [d > (N-1)/2]
- id = int(dmo);
- fd = o + ma.frac(dmo);
- h(N,d,n) = facs1(N,d,n) * facs2(N,d,n);
- facs1(N,d,n) = select2(n,1,prod(k,max(1,n),select2(k
-//========================================================================================
-
-//----------------`(de.)fdelay[n]a`-------------
-// Delay lines interpolated using Thiran allpass interpolation.
-//
-// #### Usage
-//
-// ```
-// _ : fdelay[N]a(maxdelay, delay, inputsignal) : _
-// ```
-//
-// (exactly like `fdelay`)
-//
-// Where:
-//
-// * `N`=1,2,3, or 4 is the order of the Thiran interpolation filter,
-// and the delay argument is at least N - 1/2.
-//
-// #### Note
-//
-// The interpolated delay should not be less than `N - 1/2`.
-// (The allpass delay ranges from `N - 1/2` to `N + 1/2`.)
-// This constraint can be alleviated by altering the code,
-// but be aware that allpass filters approach zero delay
-// by means of pole-zero cancellations.
-// The delay range `[N-1/2`,`N+1/2]` is not optimal. What is?
-//
-// Delay arguments too small will produce an UNSTABLE allpass!
-//
-// Because allpass interpolation is recursive, it is not as robust
-// as Lagrange interpolation under time-varying conditions.
-// (You may hear clicks when changing the delay rapidly.)
-//
-// First-order allpass interpolation, delay d in [0.5,1.5]
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-fdelay1a(n,d,x) = delay(n,id,x) : fi.tf1(eta,1,eta)
-with {
- o = 0.49999; // offset to make life easy for allpass
- dmo = d - o; // assumed nonnegative
- id = int(dmo);
- fd = o + ma.frac(dmo);
- eta = (1-fd)/(1+fd); // allpass coefficient
-};
-
-// second-order allpass delay in [1.5,2.5]
-fdelay2a(n,d,x) = delay(n,id,x) : fi.tf2(a2,a1,1,a1,a2)
-with {
- o = 1.49999;
- dmo = d - o; // delay range is [order-1/2, order+1/2]
- id = int(dmo);
- fd = o + ma.frac(dmo);
- a1o2 = (2-fd)/(1+fd); // share some terms (the compiler does this anyway)
- a1 = 2*a1o2;
- a2 = a1o2*(1-fd)/(2+fd);
-};
-
-// third-order allpass delay in [2.5,3.5]
-// delay d should be at least 2.5
-fdelay3a(n,d,x) = delay(n,id,x) : fi.iir((a3,a2,a1,1),(a1,a2,a3))
-with {
- o = 2.49999;
- dmo = d - o;
- id = int(dmo);
- fd = o + ma.frac(dmo);
- a1o3 = (3-fd)/(1+fd);
- a2o3 = a1o3*(2-fd)/(2+fd);
- a1 = 3*a1o3;
- a2 = 3*a2o3;
- a3 = a2o3*(1-fd)/(3+fd);
-};
-
-// fourth-order allpass delay in [3.5,4.5]
-// delay d should be at least 3.5
-fdelay4a(n,d,x) = delay(n,id,x) : fi.iir((a4,a3,a2,a1,1),(a1,a2,a3,a4))
-with {
- o = 3.49999;
- dmo = d - o;
- id = int(dmo);
- fd = o + ma.frac(dmo);
- a1o4 = (4-fd)/(1+fd);
- a2o6 = a1o4*(3-fd)/(2+fd);
- a3o4 = a2o6*(2-fd)/(3+fd);
- a1 = 4*a1o4;
- a2 = 6*a2o6;
- a3 = 4*a3o4;
- a4 = a3o4*(1-fd)/(4+fd);
-};
-
-//////////////////////////////////Deprecated Functions////////////////////////////////////
-// This section implements functions that used to be in music.lib but that are now
-// considered as "deprecated".
-//////////////////////////////////////////////////////////////////////////////////////////
-
-delay1s(d) = delay(65536,d);
-delay2s(d) = delay(131072,d);
-delay5s(d) = delay(262144,d);
-delay10s(d) = delay(524288,d);
-delay21s(d) = delay(1048576,d);
-delay43s(d) = delay(2097152,d);
-
-fdelay1s(d) = fdelay(65536,d);
-fdelay2s(d) = fdelay(131072,d);
-fdelay5s(d) = fdelay(262144,d);
-fdelay10s(d) = fdelay(524288,d);
-fdelay21s(d) = fdelay(1048576,d);
-fdelay43s(d) = fdelay(2097152,d);
diff --git a/Resources/Libs/demos.lib b/Resources/Libs/demos.lib
deleted file mode 100644
index d508c4b..0000000
--- a/Resources/Libs/demos.lib
+++ /dev/null
@@ -1,1209 +0,0 @@
-//#################################### demos.lib ##########################################
-// This library contains a set of demo functions based on examples located in the
-// `/examples` folder. Its official prefix is `dm`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-de = library("delays.lib");
-si = library("signals.lib");
-an = library("analyzers.lib");
-fi = library("filters.lib");
-os = library("oscillators.lib");
-no = library("noises.lib");
-ef = library("misceffects.lib");
-co = library("compressors.lib");
-ve = library("vaeffects.lib");
-pf = library("phaflangers.lib");
-re = library("reverbs.lib");
-en = library("envelopes.lib");
-
-//########################################################################################
-/************************************************************************
-FAUST library file, jos section
-
-Except where noted otherwise, The Faust functions below in this
-section are Copyright (C) 2003-2017 by Julius O. Smith III
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees!)
-
-************************************************************************/
-
-//====================================Analyzers===========================================
-//========================================================================================
-
-//----------------------`(dm.)mth_octave_spectral_level_demo`----------------------
-// Demonstrate mth_octave_spectral_level in a standalone GUI.
-//
-// #### Usage
-// ```
-// _ : mth_octave_spectral_level_demo(BandsPerOctave);
-// _ : spectral_level_demo : _; // 2/3 octave
-// ```
-//------------------------------------------------------------
-// Coauthor: Yann Orlarey
-mth_octave_spectral_level_demo(BPO) = an.mth_octave_spectral_level_default(M,ftop,N,tau,dB_offset)
-with{
- M = BPO;
- ftop = 16000;
- Noct = 10; // number of octaves down from ftop
- // Lowest band-edge is at ftop*2^(-Noct+2) = 62.5 Hz when ftop=16 kHz:
- N = int(Noct*M); // without 'int()', segmentation fault observed for M=1.67
- ctl_group(x) = hgroup("[1] SPECTRUM ANALYZER CONTROLS", x);
- tau = ctl_group(hslider("[0] Level Averaging Time [unit:ms] [scale:log]
- [tooltip: band-level averaging time in milliseconds]",
- 100,1,10000,1)) * 0.001;
- dB_offset = ctl_group(hslider("[1] Level dB Offset [unit:dB]
- [tooltip: Level offset in decibels]",
- 50,-50,100,1));
-};
-
-spectral_level_demo = mth_octave_spectral_level_demo(1.5); // 2/3 octave
-
-
-//======================================Filters===========================================
-//========================================================================================
-
-//--------------------------`(dm.)parametric_eq_demo`------------------------------
-// A parametric equalizer application.
-//
-// #### Usage:
-//
-// ```
-// _ : parametric_eq_demo : _ ;
-// ```
-//------------------------------------------------------------
-parametric_eq_demo = fi.low_shelf(LL,FL) : fi.peak_eq(LP,FP,BP) : fi.high_shelf(LH,FH)
-with{
- eq_group(x) = hgroup("[0] PARAMETRIC EQ SECTIONS [tooltip: See Faust's filters.lib
- for info and pointers]",x);
- ls_group(x) = eq_group(vgroup("[1] Low Shelf",x));
-
- LL = ls_group(hslider("[0] Low Boost|Cut [unit:dB] [style:knob]
- [tooltip: Amount of low-frequency boost or cut in decibels]",0,-40,40,0.1));
- FL = ls_group(hslider("[1] Transition Frequency [unit:Hz] [style:knob] [scale:log]
- [tooltip: Transition-frequency from boost (cut) to unity gain]",200,1,5000,1));
-
- pq_group(x) = eq_group(vgroup("[2] Peaking Equalizer[tooltip: Parametric Equalizer
- sections from filters.lib]",x));
- LP = pq_group(hslider("[0] Peak Boost|Cut [unit:dB] [style:knob][tooltip: Amount of
- local boost or cut in decibels]",0,-40,40,0.1));
- FP = pq_group(hslider("[1] Peak Frequency [unit:PK] [style:knob] [tooltip: Peak
- Frequency in Piano Key (PK) units (A440 = 49PK)]",49,1,100,1)) : si.smooth(0.999)
- : ba.pianokey2hz;
- Q = pq_group(hslider("[2] Peak Q [style:knob] [scale:log] [tooltip: Quality factor
- (Q) of the peak = center-frequency/bandwidth]",40,1,1000,0.1));
-
- BP = FP/Q;
-
- hs_group(x) = eq_group(vgroup("[3] High Shelf [tooltip: A high shelf provides a boost
- or cut above some frequency]",x));
- LH = hs_group(hslider("[0] High Boost|Cut [unit:dB] [style:knob] [tooltip: Amount of
- high-frequency boost or cut in decibels]",0,-40,40,.1));
- FH = hs_group(hslider("[1] Transition Frequency [unit:Hz] [style:knob] [scale:log]
- [tooltip: Transition-frequency from boost (cut) to unity gain]",8000,20,10000,1));
-};
-
-
-//-------------------`(dm.)spectral_tilt_demo`-----------------------
-// A spectral tilt application.
-//
-// #### Usage
-//
-// ```
-// _ : spectral_tilt_demo(N) : _ ;
-// ```
-//
-// Where:
-//
-// * `N`: filter order (integer)
-//
-// All other parameters interactive
-//------------------------------------------------------------
-spectral_tilt_demo(N) = fi.spectral_tilt(O,f0,bw,alpha)
-with{
- O = N;
- alpha = hslider("[1] Slope of Spectral Tilt across Band",-1/2,-1,1,0.001);
- f0 = hslider("[2] Band Start Frequency [unit:Hz]",100,20,10000,1);
- bw = hslider("[3] Band Width [unit:Hz]",5000,100,10000,1);
-};
-
-
-//---------`(dm.)mth_octave_filterbank_demo` and `(dm.)filterbank_demo`-------------
-// Graphic Equalizer: Each filter-bank output signal routes through a fader.
-//
-// #### Usage
-//
-// ```
-// _ : mth_octave_filterbank_demo(M) : _
-// _ : filterbank_demo : _
-// ```
-//
-// Where:
-//
-// * `N`: number of bands per octave
-//--------------------------------------------------------------
-mth_octave_filterbank_demo(O) = bp1(bp,mthoctavefilterbankdemo)
-with{
- M = O;
- bp1 = ba.bypass1;
- mofb_group(x) = vgroup("CONSTANT-Q FILTER BANK (Butterworth dyadic tree)
- [tooltip: See Faust's filters.lib for documentation and references]", x);
- bypass_group(x) = mofb_group(hgroup("[0]", x));
- slider_group(x) = mofb_group(hgroup("[1]", x));
-
- N = 10*M; // total number of bands (highpass band, octave-bands, dc band)
- ftop = 10000;
- mthoctavefilterbankdemo = chan;
- chan = fi.mth_octave_filterbank_default(M,ftop,N) : sum(i,N,(*(ba.db2linear(fader(N-i)))));
- fader(i) = slider_group(vslider("[%2i] [unit:dB] [tooltip: Bandpass filter
- gain in dB]", -10, -70, 10, 0.1)) : si.smoo;
- bp = bypass_group(checkbox("[0] Bypass
- [tooltip: When this is checked, the filter-bank has no effect]"));
-};
-
-filterbank_demo = mth_octave_filterbank_demo(1); // octave-bands = default
-
-
-//======================================Effects===========================================
-//========================================================================================
-
-//---------------------------`(dm.)cubicnl_demo`--------------------------
-// Distortion demo application.
-//
-// #### Usage:
-//
-// ```
-// _ : cubicnl_demo : _;
-// ```
-//------------------------------------------------------------
-cubicnl_demo = ba.bypass1(bp, ef.cubicnl_nodc(drive:si.smoo,offset:si.smoo))
-with{
- cnl_group(x) = vgroup("CUBIC NONLINEARITY cubicnl [tooltip: Reference:
- https://ccrma.stanford.edu/~jos/pasp/Cubic_Soft_Clipper.html]", x);
- bp = cnl_group(checkbox("[0] Bypass [tooltip: When this is checked, the
- nonlinearity has no effect]"));
- drive = cnl_group(hslider("[1] Drive [tooltip: Amount of distortion]",
- 0, 0, 1, 0.01));
- offset = cnl_group(hslider("[2] Offset [tooltip: Brings in even harmonics]",
- 0, 0, 1, 0.01));
-};
-
-
-//----------------------------`(dm.)gate_demo`-------------------------
-// Gate demo application.
-//
-// #### Usage
-//
-// ```
-// _,_ : gate_demo : _,_;
-// ```
-//------------------------------------------------------------
-gate_demo = ba.bypass2(gbp,gate_stereo_demo)
-with{
- gate_group(x) = vgroup("GATE [tooltip: Reference:
- http://en.wikipedia.org/wiki/Noise_gate]", x);
- meter_group(x) = gate_group(hgroup("[0]", x));
- knob_group(x) = gate_group(hgroup("[1]", x));
-
- gbp = meter_group(checkbox("[0] Bypass [tooltip: When this is checked,
- the gate has no effect]"));
-
- gateview = ef.gate_gain_mono(gatethr,gateatt,gatehold,gaterel) : ba.linear2db :
- meter_group(hbargraph("[1] Gate Gain [unit:dB] [tooltip: Current gain of the
- gate in dB]", -50,+10)); // [style:led]
-
- gate_stereo_demo(x,y) = attach(x,gateview(abs(x)+abs(y))),y :
- ef.gate_stereo(gatethr,gateatt,gatehold,gaterel);
-
- gatethr = knob_group(hslider("[1] Threshold [unit:dB] [style:knob] [tooltip: When
- the signal level falls below the Threshold (expressed in dB), the signal is
- muted]", -30, -120, 0, 0.1));
-
- gateatt = knob_group(hslider("[2] Attack [unit:us] [style:knob] [scale:log]
- [tooltip: Time constant in MICROseconds (1/e smoothing time) for the gate
- gain to go (exponentially) from 0 (muted) to 1 (unmuted)]",
- 10, 10, 10000, 1)) : *(0.000001) : max(1.0/float(ma.SR));
-
- gatehold = knob_group(hslider("[3] Hold [unit:ms] [style:knob] [scale:log]
- [tooltip: Time in ms to keep the gate open (no muting) after the signal
- level falls below the Threshold]", 200, 1, 1000, 1)) : *(0.001) :
- max(1.0/float(ma.SR));
-
- gaterel = knob_group(hslider("[4] Release [unit:ms] [style:knob] [scale:log]
- [tooltip: Time constant in ms (1/e smoothing time) for the gain to go
- (exponentially) from 1 (unmuted) to 0 (muted)]",
- 100, 1, 1000, 1)) : *(0.001) : max(1.0/float(ma.SR));
-};
-
-
-//----------------------------`(dm.)compressor_demo`-------------------------
-// Compressor demo application.
-//
-// #### Usage
-//
-// ```
-// _,_ : compressor_demo : _,_;
-// ```
-//------------------------------------------------------------
-compressor_demo = ba.bypass2(cbp,compressor_stereo_demo)
-with{
- comp_group(x) = vgroup("COMPRESSOR [tooltip: Reference:
- http://en.wikipedia.org/wiki/Dynamic_range_compression]", x);
-
- meter_group(x) = comp_group(hgroup("[0]", x));
- knob_group(x) = comp_group(hgroup("[1]", x));
-
- cbp = meter_group(checkbox("[0] Bypass [tooltip: When this is checked, the compressor
- has no effect]"));
- gainview = co.compression_gain_mono(ratio,threshold,attack,release) : ba.linear2db :
- meter_group(hbargraph("[1] Compressor Gain [unit:dB] [tooltip: Current gain of
- the compressor in dB]",-50,+10));
-
- displaygain = _,_ <: _,_,(abs,abs:+) : _,_,gainview : _,attach;
-
- compressor_stereo_demo =
- displaygain(co.compressor_stereo(ratio,threshold,attack,release)) :
- *(makeupgain), *(makeupgain);
-
- ctl_group(x) = knob_group(hgroup("[3] Compression Control", x));
-
- ratio = ctl_group(hslider("[0] Ratio [style:knob]
- [tooltip: A compression Ratio of N means that for each N dB increase in input
- signal level above Threshold, the output level goes up 1 dB]",
- 5, 1, 20, 0.1));
-
- threshold = ctl_group(hslider("[1] Threshold [unit:dB] [style:knob]
- [tooltip: When the signal level exceeds the Threshold (in dB), its level
- is compressed according to the Ratio]",
- -30, -100, 10, 0.1));
-
- env_group(x) = knob_group(hgroup("[4] Compression Response", x));
-
- attack = env_group(hslider("[1] Attack [unit:ms] [style:knob] [scale:log]
- tooltip: Time constant in ms (1/e smoothing time) for the compression gain
- to approach (exponentially) a new lower target level (the compression
- `kicking in')]", 50, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR);
-
- release = env_group(hslider("[2] Release [unit:ms] [style: knob] [scale:log]
- [tooltip: Time constant in ms (1/e smoothing time) for the compression gain
- to approach (exponentially) a new higher target level (the compression
- 'releasing')]", 500, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR);
-
- makeupgain = comp_group(hslider("[5] Makeup Gain [unit:dB]
- [tooltip: The compressed-signal output level is increased by this amount
- (in dB) to make up for the level lost due to compression]",
- 40, -96, 96, 0.1)) : ba.db2linear;
-};
-
-
-//-------------------------`(dm.)moog_vcf_demo`---------------------------
-// Illustrate and compare all three Moog VCF implementations above.
-//
-// #### Usage
-//
-// ```
-// _ : moog_vcf_demo : _;
-// ```
-//------------------------------------------------------------
-moog_vcf_demo = ba.bypass1(bp,vcf)
-with{
- mvcf_group(x) = hgroup("MOOG VCF (Voltage Controlled Filter) [tooltip: See Faust's
- vaeffects.lib for info and references]",x);
- cb_group(x) = mvcf_group(hgroup("[0]",x));
-
- bp = cb_group(checkbox("[0] Bypass [tooltip: When this is checked, the Moog VCF
- has no effect]"));
- archsw = cb_group(checkbox("[1] Use Biquads [tooltip: Select moog_vcf_2b (two-biquad)
- implementation, instead of the default moog_vcf (analog style) implementation]"));
- bqsw = cb_group(checkbox("[2] Normalized Ladders [tooltip: If using biquads, make
- them normalized ladders (moog_vcf_2bn)]"));
-
- freq = mvcf_group(hslider("[1] Corner Frequency [unit:PK] [tooltip: The VCF resonates
- at the corner frequency (specified in PianoKey (PK) units, with A440 = 49 PK).
- The VCF response is flat below the corner frequency, and rolls off -24 dB per
- octave above.]",
- 25, 1, 88, 0.01) : ba.pianokey2hz) : si.smoo;
-
- res = mvcf_group(hslider("[2] Corner Resonance [style:knob] [tooltip: Amount of
- resonance near VCF corner frequency (specified between 0 and 1)]", 0.9, 0, 1, 0.01));
-
- outgain = mvcf_group(hslider("[3] VCF Output Level [unit:dB] [style:knob] [tooltip:
- output level in decibels]", 5, -60, 20, 0.1)) : ba.db2linear : si.smoo;
-
- vcfbq = _ <: select2(bqsw, ve.moog_vcf_2b(res,freq), ve.moog_vcf_2bn(res,freq));
- vcfarch = _ <: select2(archsw, ve.moog_vcf(res^4,freq), vcfbq);
- vcf = vcfarch : *(outgain);
-};
-
-
-//-------------------------`(dm.)wah4_demo`---------------------------
-// Wah pedal application.
-//
-// #### Usage
-//
-// ```
-// _ : wah4_demo : _;
-// ```
-//------------------------------------------------------------
-wah4_demo = ba.bypass1(bp, ve.wah4(fr))
-with{
- wah4_group(x) = hgroup("WAH4 [tooltip: Fourth-order wah effect made using moog_vcf]", x);
- bp = wah4_group(checkbox("[0] Bypass [tooltip: When this is checked, the wah pedal has
- no effect]"));
- fr = wah4_group(hslider("[1] Resonance Frequency [scale:log] [tooltip: wah resonance
- frequency in Hz]", 200,100,2000,1));
- // Avoid dc with the moog_vcf (amplitude too high when freq comes up from dc)
- // Also, avoid very high resonance frequencies (e.g., 5kHz or above).
-};
-
-
-//-------------------------`(dm.)crybaby_demo`---------------------------
-// Crybaby effect application.
-//
-// #### Usage
-//
-// ```
-// _ : crybaby_demo : _ ;
-// ```
-//------------------------------------------------------------
-crybaby_demo = ba.bypass1(bp, ve.crybaby(wah))
-with{
- crybaby_group(x) = hgroup("CRYBABY [tooltip: Reference:
- https://ccrma.stanford.edu/~jos/pasp/vegf.html]", x);
- bp = crybaby_group(checkbox("[0] Bypass [tooltip: When this is checked, the wah
- pedal has no effect]"));
- wah = crybaby_group(hslider("[1] Wah parameter [tooltip: wah pedal angle between
- 0 (rocked back) and 1 (rocked forward)]",0.8,0,1,0.01));
-};
-
-
-//-------------------------`(dm.)flanger_demo`---------------------------
-// Flanger effect application.
-//
-// #### Usage
-//
-// ```
-// _,_ : flanger_demo : _,_;
-// ```
-//------------------------------------------------------------
-flanger_demo = ba.bypass2(fbp,flanger_stereo_demo)
-with{
- flanger_group(x) = vgroup("FLANGER
- [tooltip: Reference: https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x);
- meter_group(x) = flanger_group(hgroup("[0]", x));
- ctl_group(x) = flanger_group(hgroup("[1]", x));
- del_group(x) = flanger_group(hgroup("[2] Delay Controls", x));
- lvl_group(x) = flanger_group(hgroup("[3]", x));
-
- fbp = meter_group(checkbox("[0] Bypass [tooltip: When this is checked, the flanger
- has no effect]"));
- invert = meter_group(checkbox("[1] Invert Flange Sum"));
-
- // FIXME: This should be an amplitude-response display:
- flangeview = lfor(freq) + lfol(freq) : meter_group(hbargraph("[2] Flange LFO
- [style: led] [tooltip: Display sum of flange delays]", -1.5,+1.5));
-
- flanger_stereo_demo(x,y) = attach(x,flangeview),y :
- *(level),*(level) : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert);
-
- lfol = os.oscrs;
- lfor = os.oscrc;
-
- dmax = 2048;
- dflange = 0.001 * ma.SR *
- del_group(hslider("[1] Flange Delay [unit:ms] [style:knob]", 10, 0, 20, 0.001));
- odflange = 0.001 * ma.SR *
- del_group(hslider("[2] Delay Offset [unit:ms] [style:knob]", 1, 0, 20, 0.001));
- freq = ctl_group(hslider("[1] Speed [unit:Hz] [style:knob]", 0.5, 0, 10, 0.01));
- depth = ctl_group(hslider("[2] Depth [style:knob]", 1, 0, 1, 0.001));
- fb = ctl_group(hslider("[3] Feedback [style:knob]", 0, -0.999, 0.999, 0.001));
- level = lvl_group(hslider("Flanger Output Level [unit:dB]", 0, -60, 10, 0.1)) :
- ba.db2linear;
- curdel1 = odflange+dflange*(1 + lfol(freq))/2;
- curdel2 = odflange+dflange*(1 + lfor(freq))/2;
-};
-
-
-//-------------------------`(dm.)phaser2_demo`---------------------------
-// Phaser effect demo application.
-//
-// #### Usage
-//
-// ```
-// _,_ : phaser2_demo : _,_;
-// ```
-//------------------------------------------------------------
-phaser2_demo = ba.bypass2(pbp,phaser2_stereo_demo)
-with{
- phaser2_group(x) = vgroup("PHASER2 [tooltip: Reference:
- https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x);
- meter_group(x) = phaser2_group(hgroup("[0]", x));
- ctl_group(x) = phaser2_group(hgroup("[1]", x));
- nch_group(x) = phaser2_group(hgroup("[2]", x));
- lvl_group(x) = phaser2_group(hgroup("[3]", x));
-
- pbp = meter_group(checkbox("[0] Bypass [tooltip: When this is checked, the phaser
- has no effect]"));
- invert = meter_group(checkbox("[1] Invert Internal Phaser Sum"));
- vibr = meter_group(checkbox("[2] Vibrato Mode")); // In this mode you can hear any "Doppler"
-
- // FIXME: This should be an amplitude-response display:
- // flangeview = phaser2_amp_resp : meter_group(hspectrumview("[2] Phaser Amplitude Response", 0,1));
- // phaser2_stereo_demo(x,y) = attach(x,flangeview),y : ...
-
- phaser2_stereo_demo = *(level),*(level) :
- pf.phaser2_stereo(Notches,width,frqmin,fratio,frqmax,speed,mdepth,fb,invert);
-
- Notches = 4; // Compile-time parameter: 2 is typical for analog phaser stomp-boxes
-
- // FIXME: Add tooltips
- speed = ctl_group(hslider("[1] Speed [unit:Hz] [style:knob]", 0.5, 0, 10, 0.001));
- depth = ctl_group(hslider("[2] Notch Depth (Intensity) [style:knob]", 1, 0, 1, 0.001));
- fb = ctl_group(hslider("[3] Feedback Gain [style:knob]", 0, -0.999, 0.999, 0.001));
-
- width = nch_group(hslider("[1] Notch width [unit:Hz] [style:knob] [scale:log]",
- 1000, 10, 5000, 1));
- frqmin = nch_group(hslider("[2] Min Notch1 Freq [unit:Hz] [style:knob] [scale:log]",
- 100, 20, 5000, 1));
- frqmax = nch_group(hslider("[3] Max Notch1 Freq [unit:Hz] [style:knob] [scale:log]",
- 800, 20, 10000, 1)) : max(frqmin);
- fratio = nch_group(hslider("[4] Notch Freq Ratio: NotchFreq(n+1)/NotchFreq(n) [style:knob]",
- 1.5, 1.1, 4, 0.001));
-
- level = lvl_group(hslider("Phaser Output Level [unit:dB]", 0, -60, 10, 0.1)) :
- ba.db2linear;
-
- mdepth = select2(vibr,depth,2); // Improve "ease of use"
-};
-
-
-//---------------------`(dm.)stereo_reverb_tester`--------------------
-// Handy test inputs for reverberator demos below.
-//
-// #### Usage
-//
-// ```
-// _ : stereo_reverb_tester : _
-// ```
-//------------------------------------------------------------
-stereo_reverb_tester(revin_group,x,y) = reverb_tester(_)
-with{
- reverb_tester(revin_group,x,y) = inx,iny with {
- ck_group(x) = revin_group(vgroup("[1] Input Config",x));
- mutegain = 1 - ck_group(checkbox("[1] Mute Ext Inputs
- [tooltip: When this is checked, the stereo external audio inputs are
- disabled (good for hearing the impulse response or pink-noise response alone)]"));
- pinkin = ck_group(checkbox("[2] Pink Noise
- [tooltip: Pink Noise (or 1/f noise) is Constant-Q Noise (useful for adjusting
- the EQ sections)]"));
-
- imp_group(x) = revin_group(hgroup("[2] Impulse Selection",x));
- pulseL = imp_group(button("[1] Left
- [tooltip: Send impulse into LEFT channel]")) : ba.impulsify;
- pulseC = imp_group(button("[2] Center
- [tooltip: Send impulse into LEFT and RIGHT channels]")) : ba.impulsify;
- pulseR = imp_group(button("[3] Right
- [tooltip: Send impulse into RIGHT channel]")) : ba.impulsify;
-
- inx = x*mutegain + (pulseL+pulseC) + pn;
- iny = y*mutegain + (pulseR+pulseC) + pn;
- pn = 0.1*pinkin*no.pink_noise;
- };
-};
-
-
-//-------------------------`(dm.)fdnrev0_demo`---------------------------
-// A reverb application using `fdnrev0`.
-//
-// #### Usage
-//
-// ```
-// _,_ : fdnrev0_demo(N,NB,BBSO) : _,_
-// ```
-//
-// Where:
-//
-// * `n`: Feedback Delay Network (FDN) order / number of delay lines used =
-// order of feedback matrix / 2, 4, 8, or 16 [extend primes array below for
-// 32, 64, ...]
-// * `nb`: Number of frequency bands / Number of (nearly) independent T60 controls
-// / Integer 3 or greater
-// * `bbso` = Butterworth band-split order / order of lowpass/highpass bandsplit
-// used at each crossover freq / odd positive integer
-//------------------------------------------------------------
-fdnrev0_demo(N,NB,BBSO) = stereo_reverb_tester(revin_group)
- <: re.fdnrev0(MAXDELAY,delays,BBSO,freqs,durs,loopgainmax,nonl)
- :> *(gain),*(gain)
-with{
- MAXDELAY = 8192; // sync w delays and prime_power_delays above
- defdurs = (8.4,6.5,5.0,3.8,2.7); // NB default durations (sec)
- deffreqs = (500,1000,2000,4000); // NB-1 default crossover frequencies (Hz)
- deflens = (56.3,63.0); // 2 default min and max path lengths
-
- fdn_group(x) = vgroup("FEEDBACK DELAY NETWORK (FDN) REVERBERATOR, ORDER 16
- [tooltip: See Faust's reverbs.lib for documentation and references]", x);
-
- freq_group(x) = fdn_group(vgroup("[1] Band Crossover Frequencies", x));
- t60_group(x) = fdn_group(hgroup("[2] Band Decay Times (T60)", x));
- path_group(x) = fdn_group(vgroup("[3] Room Dimensions", x));
- revin_group(x) = fdn_group(hgroup("[4] Input Controls", x));
- nonl_group(x) = revin_group(vgroup("[4] Nonlinearity",x));
- quench_group(x) = revin_group(vgroup("[3] Reverb State",x));
-
- nonl = nonl_group(hslider("[style:knob] [tooltip: nonlinear mode coupling]",
- 0, -0.999, 0.999, 0.001));
- loopgainmax = 1.0-0.5*quench_group(button("[1] Quench
- [tooltip: Hold down 'Quench' to clear the reverberator]"));
-
- pathmin = path_group(hslider("[1] min acoustic ray length [unit:m] [scale:log]
- [tooltip: This length (in meters) determines the shortest delay-line used in the FDN
- reverberator. Think of it as the shortest wall-to-wall separation in the room.]",
- 46, 0.1, 63, 0.1));
- pathmax = path_group(hslider("[2] max acoustic ray length [unit:m] [scale:log]
- [tooltip: This length (in meters) determines the longest delay-line used in the
- FDN reverberator. Think of it as the largest wall-to-wall separation in the room.]",
- 63, 0.1, 63, 0.1));
-
- durvals(i) = t60_group(vslider("[%i] %i [unit:s] [scale:log][tooltip: T60 is the 60dB
- decay-time in seconds. For concert halls, an overall reverberation time (T60) near
- 1.9 seconds is typical [Beranek 2004]. Here we may set T60 independently in each
- frequency band. In real rooms, higher frequency bands generally decay faster due
- to absorption and scattering.]",ba.take(i+1,defdurs), 0.1, 100, 0.1));
- durs = par(i,NB,durvals(NB-1-i));
-
- freqvals(i) = freq_group(hslider("[%i] Band %i upper edge in Hz [unit:Hz] [scale:log]
- [tooltip: Each delay-line signal is split into frequency-bands for separate
- decay-time control in each band]",ba.take(i+1,deffreqs), 100, 10000, 1));
- freqs = par(i,NB-1,freqvals(i));
-
- delays = de.prime_power_delays(N,pathmin,pathmax);
-
- gain = hslider("[3] Output Level (dB) [unit:dB][tooltip: Output scale factor]",
- -40, -70, 20, 0.1) : ba.db2linear;
- // (can cause infinite loop:) with { db2linear(x) = pow(10, x/20.0); };
-};
-
-
-
-//---------------------------`(dm.)zita_rev_fdn_demo`------------------------------
-// Reverb demo application based on `zita_rev_fdn`.
-//
-// #### Usage
-//
-// ```
-// si.bus(8) : zita_rev_fdn_demo : si.bus(8)
-// ```
-//------------------------------------------------------------
-zita_rev_fdn_demo = re.zita_rev_fdn(f1,f2,t60dc,t60m,fsmax)
-with{
- fsmax = 48000.0;
- fdn_group(x) = hgroup("Zita_Rev Internal FDN Reverb [tooltip: ~ Zita_Rev's internal
- 8x8 Feedback Delay Network (FDN) & Schroeder allpass-comb reverberator. See
- Faust's reverbs.lib for documentation and references]",x);
- t60dc = fdn_group(vslider("[1] Low RT60 [unit:s] [style:knob][style:knob]
- [tooltip: T60 = time (in seconds) to decay 60dB in low-frequency band]",
- 3, 1, 8, 0.1));
- f1 = fdn_group(vslider("[2] LF X [unit:Hz] [style:knob] [scale:log]
- [tooltip: Crossover frequency (Hz) separating low and middle frequencies]",
- 200, 50, 1000, 1));
- t60m = fdn_group(vslider("[3] Mid RT60 [unit:s] [style:knob] [scale:log]
- [tooltip: T60 = time (in seconds) to decay 60dB in middle band]",
- 2, 1, 8, 0.1));
- f2 = fdn_group(vslider("[4] HF Damping [unit:Hz] [style:knob] [scale:log]
- [tooltip: Frequency (Hz) at which the high-frequency T60 is half the middle-band's T60]",
- 6000, 1500, 0.49*fsmax, 1));
-};
-
-//----------------------------------`(dm.)zita_rev1`------------------------------
-// Example GUI for `zita_rev1_stereo` (mostly following the Linux `zita-rev1` GUI).
-//
-// Only the dry/wet and output level parameters are "dezippered" here. If
-// parameters are to be varied in real time, use `smooth(0.999)` or the like
-// in the same way.
-//
-// #### Usage
-//
-// ```
-// _,_ : zita_rev1 : _,_
-// ```
-//
-// #### Reference
-//
-//
-//------------------------------------------------------------
-zita_rev1 = _,_ <: re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ : out_eq,_,_ :
- dry_wet : out_level
-with{
- fsmax = 48000.0; // highest sampling rate that will be used
-
- fdn_group(x) = hgroup(
- "[0] Zita_Rev1 [tooltip: ~ ZITA REV1 FEEDBACK DELAY NETWORK (FDN) & SCHROEDER
- ALLPASS-COMB REVERBERATOR (8x8). See Faust's reverbs.lib for documentation and
- references]", x);
-
- in_group(x) = fdn_group(hgroup("[1] Input", x));
-
- rdel = in_group(vslider("[1] In Delay [unit:ms] [style:knob] [tooltip: Delay in ms
- before reverberation begins]",60,20,100,1));
-
- freq_group(x) = fdn_group(hgroup("[2] Decay Times in Bands (see tooltips)", x));
-
- f1 = freq_group(vslider("[1] LF X [unit:Hz] [style:knob] [scale:log] [tooltip:
- Crossover frequency (Hz) separating low and middle frequencies]", 200, 50, 1000, 1));
-
- t60dc = freq_group(vslider("[2] Low RT60 [unit:s] [style:knob] [scale:log]
- [style:knob] [tooltip: T60 = time (in seconds) to decay 60dB in low-frequency band]",
- 3, 1, 8, 0.1));
-
- t60m = freq_group(vslider("[3] Mid RT60 [unit:s] [style:knob] [scale:log] [tooltip:
- T60 = time (in seconds) to decay 60dB in middle band]",2, 1, 8, 0.1));
-
- f2 = freq_group(vslider("[4] HF Damping [unit:Hz] [style:knob] [scale:log]
- [tooltip: Frequency (Hz) at which the high-frequency T60 is half the middle-band's T60]",
- 6000, 1500, 0.49*fsmax, 1));
-
- out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q);
- // Zolzer style peaking eq (not used in zita-rev1) (filters.lib):
- // pareq_stereo(eqf,eql,Q) = peak_eq(eql,eqf,eqf/Q), peak_eq(eql,eqf,eqf/Q);
- // Regalia-Mitra peaking eq with "Q" hard-wired near sqrt(g)/2 (filters.lib):
- pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt)
- with {
- tpbt = wcT/sqrt(max(0,g)); // tan(PI*B/SR), B bw in Hz (Q^2 ~ g/4)
- wcT = 2*ma.PI*eqf/ma.SR; // peak frequency in rad/sample
- g = ba.db2linear(eql); // peak gain
- };
-
- eq1_group(x) = fdn_group(hgroup("[3] RM Peaking Equalizer 1", x));
-
- eq1f = eq1_group(vslider("[1] Eq1 Freq [unit:Hz] [style:knob] [scale:log] [tooltip:
- Center-frequency of second-order Regalia-Mitra peaking equalizer section 1]",
- 315, 40, 2500, 1));
-
- eq1l = eq1_group(vslider("[2] Eq1 Level [unit:dB] [style:knob] [tooltip: Peak level
- in dB of second-order Regalia-Mitra peaking equalizer section 1]", 0, -15, 15, 0.1));
-
- eq1q = eq1_group(vslider("[3] Eq1 Q [style:knob] [tooltip: Q = centerFrequency/bandwidth
- of second-order peaking equalizer section 1]", 3, 0.1, 10, 0.1));
-
- eq2_group(x) = fdn_group(hgroup("[4] RM Peaking Equalizer 2", x));
-
- eq2f = eq2_group(vslider("[1] Eq2 Freq [unit:Hz] [style:knob] [scale:log] [tooltip:
- Center-frequency of second-order Regalia-Mitra peaking equalizer section 2]",
- 1500, 160, 10000, 1));
-
- eq2l = eq2_group(vslider("[2] Eq2 Level [unit:dB] [style:knob] [tooltip: Peak level
- in dB of second-order Regalia-Mitra peaking equalizer section 2]", 0, -15, 15, 0.1));
-
- eq2q = eq2_group(vslider("[3] Eq2 Q [style:knob] [tooltip: Q = centerFrequency/bandwidth
- of second-order peaking equalizer section 2]", 3, 0.1, 10, 0.1));
-
- out_group(x) = fdn_group(hgroup("[5] Output", x));
-
- dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y with {
- wet = 0.5*(drywet+1.0);
- dry = 1.0-wet;
- };
-
- drywet = out_group(vslider("[1] Dry/Wet Mix [style:knob] [tooltip: -1 = dry, 1 = wet]",
- 0, -1.0, 1.0, 0.01)) : si.smoo;
-
- out_level = *(gain),*(gain);
-
- gain = out_group(vslider("[2] Level [unit:dB] [style:knob] [tooltip: Output scale
- factor]", -20, -70, 40, 0.1)) : ba.db2linear : si.smoo;
-};
-
-
-//====================================Generators==========================================
-//========================================================================================
-
-//--------------------------`(dm.)sawtooth_demo`---------------------------
-// An application demonstrating the different sawtooth oscillators of Faust.
-//
-// #### Usage
-//
-// ```
-// sawtooth_demo : _
-// ```
-//------------------------------------------------------------
-sawtooth_demo = signal
-with{
- osc_group(x) = vgroup("[0] SAWTOOTH OSCILLATOR [tooltip: See Faust's oscillators.lib
- for documentation and references]",x);
- knob_group(x) = osc_group(hgroup("[1]", x));
- ampdb = knob_group(vslider("[1] Amplitude [unit:dB] [style:knob] [tooltip: Sawtooth
- waveform amplitude]",-20,-120,10,0.1));
- amp = ampdb : ba.db2linear : si.smoo;
- freq = knob_group(vslider("[2] Frequency [unit:PK] [style:knob] [tooltip: Sawtooth
- frequency as a Piano Key (PK) number (A440 = key 49)]",49,1,88,0.01) : ba.pianokey2hz);
- detune1 = 1 + 0.01 * knob_group(
- vslider("[3] Detuning 1 [unit:%%] [style:knob] [tooltip: Percentange frequency-shift
- up or down for second oscillator]",-0.1,-10,10,0.01));
- detune2 = 1 + 0.01 * knob_group(vslider("[4] Detuning 2 [unit:%%] [style:knob] [tooltip:
- Percentange frequency-shift up or down for third detuned oscillator]",+0.1,-10,10,0.01));
- portamento = knob_group(vslider("[5] Portamento [unit:sec] [style:knob] [scale:log]
- [tooltip: Portamento (frequency-glide) time-constant in seconds]",0.1,0.001,10,0.001));
- sfreq = freq : si.smooth(ba.tau2pole(portamento));
- saworder = knob_group(nentry("[6] Saw Order [tooltip: Order of sawtootn aliasing
- suppression]",2,1,os.MAX_SAW_ORDER,1));
- sawchoice = _ <: par(i,os.MAX_SAW_ORDER,os.sawN(i+1)) :
- ba.selectn(int(os.MAX_SAW_ORDER), int(saworder-1)); // when max is pwr of 2
- tone = (amp/3) * (sawchoice(sfreq) + sawchoice(sfreq*detune1) + sawchoice(sfreq*detune2));
- signal = amp * select2(ei, select2(ss, tone, white_or_pink_noise), _);
- white_or_pink_noise = select2(wp,no.noise,no.pink_noise);
- checkbox_group(x) = knob_group(vgroup("[7] Alternate Signals",x));
- ss = checkbox_group(checkbox("[0] Noise (White or Pink - uses only Amplitude control on
- the left)"));
- wp = checkbox_group(checkbox("[1] Pink instead of White Noise (also called 1/f Noise)
- [tooltip: Pink Noise (or 1/f noise) is Constant-Q Noise, meaning that it has the
- same total power in every octave]"));
- ei = checkbox_group(checkbox("[2] External Signal Input (overrides Sawtooth/Noise
- selection above)"));
-};
-
-
-//----------------------`(dm.)virtual_analog_oscillator_demo`----------------------
-// Virtual analog oscillator demo application.
-//
-// #### Usage
-//
-// ```
-// virtual_analog_oscillator_demo : _
-// ```
-//------------------------------------------------------------
-virtual_analog_oscillator_demo = signal
-with{
- osc_group(x) = vgroup("[0] VIRTUAL ANALOG OSCILLATORS
- [tooltip: See Faust's oscillators.lib for documentation and references]",x);
-
- // Signals
- sawchoice = _ <:
- // When MAX_SAW_ORDER is a power of 2:
- par(i,os.MAX_SAW_ORDER,os.sawN(i+1)) : ba.selectn(int(os.MAX_SAW_ORDER), int(saworder-1));
- // When MAX_SAW_ORDER is NOT a power of 2:
- // (par(i,MAX_SAW_ORDER,sawN(i+1)), par(j,MAX_SAW_ORDER_NEXTPOW2-MAX_SAW_ORDER,_))
- // : selectn(MAX_SAW_ORDER_NEXTPOW2, saworder-1);
- saw = (amp/3) *
- (sawchoice(sfreq) + sawchoice(sfreq*detune1) + sawchoice(sfreq*detune2));
- sq = (amp/3) *
- (os.square(sfreq) + os.square(sfreq*detune1) + os.square(sfreq*detune2));
- tri = (amp/3) *
- (os.triangle(sfreq) + os.triangle(sfreq*detune1) + os.triangle(sfreq*detune2));
- pt = (amp/3) * (os.pulsetrain(sfreq,ptd)
- + os.pulsetrain(sfreq*detune1,ptd)
- + os.pulsetrain(sfreq*detune2,ptd));
- ptN = (amp/3) * (os.pulsetrainN(N,sfreq,ptd)
- + os.pulsetrainN(N,sfreq*detune1,ptd)
- + os.pulsetrainN(N,sfreq*detune2,ptd)) with {N=3;};
- pn = amp * no.pink_noise;
-
- signal = ssaw*saw + ssq*sq + stri*tri
- + spt*((ssptN*ptN)+(1-ssptN)*pt)
- + spn*pn + sei*_;
-
- // Signal controls:
- signal_group(x) = osc_group(hgroup("[0] Signal Levels",x));
- ssaw = signal_group(vslider("[0] Sawtooth [style:vslider]",1,0,1,0.01));
-
- pt_group(x) = signal_group(vgroup("[1] Pulse Train",x));
- ssptN = pt_group(checkbox("[0] Order 3
- [tooltip: When checked, use 3rd-order aliasing suppression (up from 2)
- See if you can hear a difference with the freq high and swept]"));
- spt = pt_group(vslider("[1] [style:vslider]",0,0,1,0.01));
- ptd = pt_group(vslider("[2] Duty Cycle [style:knob]",0.5,0,1,0.01))
- : si.smooth(0.99);
-
- ssq = signal_group(vslider("[2] Square [style:vslider]",0,0,1,0.01));
- stri = signal_group(vslider("[3] Triangle [style:vslider]",0,0,1,0.01));
- spn = signal_group(vslider(
- "[4] Pink Noise [style:vslider][tooltip: Pink Noise (or 1/f noise) is
- Constant-Q Noise, meaning that it has the same total power in every octave
- (uses only amplitude controls)]",0,0,1,0.01));
- sei = signal_group(vslider("[5] Ext Input [style:vslider]",0,0,1,0.01));
-
- // Signal Parameters
- knob_group(x) = osc_group(hgroup("[1] Signal Parameters", x));
- af_group(x) = knob_group(vgroup("[0]", x));
- ampdb = af_group(hslider("[1] Mix Amplitude [unit:dB] [style:hslider]
- [tooltip: Sawtooth waveform amplitude]",-20,-120,10,0.1));
- amp = ampdb : ba.db2linear : si.smoo;
- freq = af_group(hslider("[2] Frequency [unit:PK] [style:hslider] [tooltip: Sawtooth
- frequency as a Piano Key (PK) number (A440 = key 49)]",49,1,88,0.01) : ba.pianokey2hz);
-
- detune1 = 1 - 0.01 * knob_group(
- vslider("[3] Detuning 1 [unit:%%] [style:knob]
- [tooltip: Percentange frequency-shift up or down for second oscillator]",
- -0.1,-10,10,0.01));
- detune2 = 1 + 0.01 * knob_group(
- vslider("[4] Detuning 2 [unit:%%] [style:knob]
- [tooltip: Percentange frequency-shift up or down for third detuned oscillator]",
- +0.1,-10,10,0.01));
- portamento = knob_group(
- vslider("[5] Portamento [unit:sec] [style:knob] [scale:log]
- [tooltip: Portamento (frequency-glide) time-constant in seconds]",
- 0.1,0.001,10,0.001));
- saworder = knob_group(nentry("[6] Saw Order [tooltip: Order of sawtooth aliasing
- suppression]",2,1,os.MAX_SAW_ORDER,1));
- sfreq = freq : si.smooth(ba.tau2pole(portamento));
-};
-
-
-//--------------------------`(dm.)oscrs_demo` ---------------------------
-// Simple application demoing filter based oscillators.
-//
-// #### Usage
-//
-// ```
-// oscrs_demo : _
-// ```
-//-------------------------------------------------------------------
-oscrs_demo = signal
-with{
- osc_group(x) = vgroup("[0] SINE WAVE OSCILLATOR oscrs [tooltip: Sine oscillator based
- on 2D vector rotation]",x);
- ampdb = osc_group(hslider("[1] Amplitude [unit:dB] [tooltip: Sawtooth waveform
- amplitude]",-20,-120,10,0.1));
- amp = ampdb : ba.db2linear : si.smoo;
- freq = osc_group(
- hslider("[2] Frequency [unit:PK]
- [tooltip: Sine wave frequency as a Piano Key (PK) number (A440 = 49 PK)]",
- 49,1,88,0.01) : ba.pianokey2hz);
- portamento = osc_group(
- hslider("[3] Portamento [unit:sec] [scale:log]
- [tooltip: Portamento (frequency-glide) time-constant in seconds]",
- 0.1,0.001,10,0.001));
- sfreq = freq : si.smooth(ba.tau2pole(portamento));
- signal = amp * os.oscrs(sfreq);
-};
-
-oscr_demo = oscrs_demo; // synonym
-
-
-//--------------------------`(dm.)velvet_noise_demo`---------------------------
-// Listen to velvet_noise!
-//
-// #### Usage
-//
-// ```
-// velvet_noise_demo : _
-// ```
-//-------------------------------------------------------------------
-
-velvet_noise_demo = vn
-with{
- amp = hslider("Amp [unit:dB]",-10,-70,10,0.1) : ba.db2linear;
- f0 = 10.0, hslider("Freq [unit:log10(Hz)]",3,0,4,0.001) : pow;
- vn = no.velvet_noise(amp,f0);
-};
-
-
-//--------------------------`(dm.)latch_demo`---------------------------
-// Illustrate latch operation
-//
-// #### Usage
-//
-// ```
-// echo 'import("stdfaust.lib");' > latch_demo.dsp
-// echo 'process = dm.latch_demo;' >> latch_demo.dsp
-// faust2octave latch_demo.dsp
-// Octave:1> plot(faustout);
-// ```
-//-------------------------------------------------------------------
-latch_demo = x, c, ba.latch(c,x) // plot(faustout) after faust2octave
-with{
- f = float(ma.SR)/1000.0;
- x = os.oscr(f);
- c = 0.5 * os.oscrs(5*f); // sample 5 times per period
-};
-
-
-//--------------------------`(dm.)envelopes_demo`---------------------------
-// Illustrate various envelopes overlaid, including their gate * 1.1
-//
-// #### Usage
-//
-// ```
-// echo 'import("stdfaust.lib");' > envelopes_demo.dsp
-// echo 'process = dm.envelopes_demo;' >> envelopes_demo.dsp
-// faust2octave envelopes_demo.dsp
-// Octave:1> plot(faustout);
-// ```
-//-------------------------------------------------------------------
-envelopes_demo = gate <: _*1.1,envSE,envAR,envARFE,envARE,envASR,envADSR,envADSRE
-with{
- gate = (1-(1@500)) + 0.5*(1@750-(1@1700)); // retrigger at 1/2 amp
- envSE = en.smoothEnvelope(attSec/6.91); // uses time-constant not t60
- envAR = en.ar(attSec,relT60);
- envARFE = en.arfe(attSec,relT60,0.25);
- envARE = en.are(attSec,relT60);
- envASR = en.asr(attSec,susLvl,relT60);
- envADSR = en.adsr(attSec,decT60,susLvl,relT60);
- envADSRE = en.adsre(attSec,decT60,susLvl,relT60);
- attSec=0.002; // 2 ms attack time
- decT60=0.010; // 10 ms decay-to-sustain time
- susLvl=80.0; // Sustain level = 0.8
- relT60=0.010; // 10 ms release (decay-to-zero) time
-};
-
-fft_spectral_level_demo(N) = an.rfft_spectral_level(N,tau,dB_offset)
-with{
- ctl_group(x) = hgroup("[1] FFT SPECTRUM ANALYZER CONTROLS", x);
- tau = ctl_group(hslider("[0] Level Averaging Time [unit:ms] [scale:log]
- [tooltip: band-level averaging time in milliseconds]",
- 100,1,10000,1)) * 0.001;
- dB_offset = ctl_group(hslider("[1] Level dB Offset [unit:dB]
- [tooltip: Level offset in decibels]",
- 50,-50,100,1));
-};
-
-// end jos section
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-// TODO: Add GRAME functions here
-
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
-
-//-------------------------------`(dm.)exciter`-------------------------------
-// Psychoacoustic harmonic exciter, with GUI.
-//
-// #### Usage
-//
-// ```
-// _ : exciter : _
-// ```
-//
-// #### References
-//
-// *
-// *
-//-------------------------------------------------------------------------------------
-// Authors: PPriyanka Shekar and Julius O. Smith III
-// License: STK-4.3
-// Markdown: Romain Michon
-//-------------------------------------------------------------------------------------
-exciter = _ <: (fi.highpass(2, fc) : compressor : pregain : harmonicCreator :
- postgain), _ : balance
-with{
- // TODO: rewrite to use the standard compressor from compressors.lib
- compressor = ba.bypass1(cbp,compressorMono)
- with{
- comp_group(x) = vgroup("COMPRESSOR [tooltip: Reference:
- http://en.wikipedia.org/wiki/Dynamic_range_compression]", x);
-
- meter_group(x) = comp_group(hgroup("[0]", x));
- knob_group(x) = comp_group(hgroup("[1]", x));
-
- cbp = meter_group(checkbox("[0] Bypass [tooltip: When this is checked,
- the compressor has no effect]"));
-
- gainview = co.compression_gain_mono(ratio,threshold,attack,release) : ba.linear2db
- : meter_group(hbargraph("[1] Compressor Gain [unit:dB] [tooltip: Current gain
- of the compressor in dB]",-50,+10));
-
- displaygain = _ <: _,abs : _,gainview : attach;
-
- compressorMono = displaygain(co.compressor_mono(ratio,threshold,attack,release));
-
- ctl_group(x) = knob_group(hgroup("[3] Compression Control", x));
-
- ratio = ctl_group(hslider("[0] Ratio [style:knob] [tooltip: A compression Ratio
- of N means that for each N dB increase in input signal level above Threshold, the
- output level goes up 1 dB]", 5, 1, 20, 0.1));
-
- threshold = ctl_group(hslider("[1] Threshold [unit:dB] [style:knob] [tooltip:
- When the signal level exceeds the Threshold (in dB), its level is compressed
- according to the Ratio]", -30, -100, 10, 0.1));
-
- env_group(x) = knob_group(hgroup("[4] Compression Response", x));
-
- attack = env_group(hslider("[1] Attack [unit:ms] [style:knob] [tooltip:
- Time constant in ms (1/e smoothing time) for the compression gain to approach
- (exponentially) a new lower target level (the compression `kicking in')]",
- 50, 0, 500, 0.1)) : *(0.001) : max(1/ma.SR);
-
- release = env_group(hslider("[2] Release [unit:ms] [style: knob] [tooltip:
- Time constant in ms (1/e smoothing time) for the compression gain to approach
- (exponentially) a new higher target level (the compression 'releasing')]",
- 500, 0, 1000, 0.1)) : *(0.001) : max(1/ma.SR);
- };
-
- //Exciter GUI controls
- ex_group(x) = hgroup("EXCITER [tooltip: Reference: Patent US4150253 A]", x);
-
- //Highpass - selectable cutoff frequency
- fc = ex_group(hslider("[0] Cutoff Frequency [unit:Hz] [style:knob] [scale:log]
- [tooltip: Cutoff frequency for highpassed components to be excited]",
- 5000, 1000, 10000, 100));
-
- //Pre-distortion gain - selectable percentage of harmonics
- ph = ex_group(hslider("[1] Harmonics [unit:percent] [style:knob] [tooltip:
- Percentage of harmonics generated]", 20, 0, 200, 1)) / 100;
- pregain = * (ph);
-
- // TODO: same thing: why doesn't this use cubicnl?
- //Asymmetric cubic soft clipper
- harmonicCreator(x) = x <: cubDist1, cubDist2, cubDist3 :> _;
- cubDist1(x) = (x < 0) * x;
- cubDist2(x) = (x >= 0) * (x <= 1) * (x - x ^ 3 / 3);
- cubDist3(x) = (x > 1) * 2/3;
-
- //Post-distortion gain - undoes effect of pre-gain
- postgain = * (1/ph);
-
- //Balance - selectable dry/wet mix
- ml = ex_group(hslider("[2] Mix [style:knob] [tooltip: Dry/Wet mix of original signal
- to excited signal]", 0.50, 0.00, 1.00, 0.01));
- balance = (_ * ml), (_ * (1.0 - ml)) :> _;
-};
-
-
-//----------------------------`(dm.)vocoder_demo`-------------------------
-// Use example of the vocoder function where an impulse train is used
-// as excitation.
-//
-// #### Usage
-//
-// ```
-// _ : vocoder_demo : _;
-// ```
-//------------------------------------------------------------
-// Author: Romain Michon
-// License: LGPL
-vocoder_demo = hgroup("My Vocoder",_,os.lf_imptrain(freq)*gain :
- ve.vocoder(bands,att,rel,BWRatio) <: _,_)
-with{
- bands = 32;
- vocoderGroup(x) = vgroup("Vocoder",x);
- att = vocoderGroup(hslider("[0] Attack [style:knob] [tooltip: Attack time in seconds]",
- 5,0.1,100,0.1)*0.001);
- rel = vocoderGroup(hslider("[1] Release [style:knob] [tooltip: Release time in seconds]",
- 5,0.1,100,0.1)*0.001);
- BWRatio = vocoderGroup(hslider("[2] BW [style:knob] [tooltip: Coefficient to adjust the
- bandwidth of each band]",0.5,0.1,2,0.001));
- excitGroup(x) = vgroup("Excitation",x);
- freq = excitGroup(hslider("[0] Freq [style:knob]",330,50,2000,0.1));
- gain = excitGroup(vslider("[1] Gain",0.5,0,1,0.01) : si.smoo);
-};
-
-//----------------------------`(dm.)freeverb_demo`-------------------------
-// Freeverb demo application.
-//
-// #### Usage
-//
-// ```
-// _,_ : freeverb_demo : _,_;
-// ```
-//------------------------------------------------------------
-// Author: Romain Michon
-// License: LGPL
-freeverb_demo = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
- re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
- *(1-g), *(1-g) :> _,_
-with{
- scaleroom = 0.28;
- offsetroom = 0.7;
- allpassfeed = 0.5;
- scaledamp = 0.4;
- fixedgain = 0.1;
- origSR = 44100;
-
- parameters(x) = hgroup("Freeverb",x);
- knobGroup(x) = parameters(vgroup("[0]",x));
- damping = knobGroup(vslider("[0] Damp [style: knob] [tooltip: Somehow control the
- density of the reverb.]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR);
- combfeed = knobGroup(vslider("[1] RoomSize [style: knob] [tooltip: The room size
- between 0 and 1 with 1 for the largest room.]", 0.5, 0, 1, 0.025)*scaleroom*
- origSR/ma.SR + offsetroom);
- spatSpread = knobGroup(vslider("[2] Stereo Spread [style: knob] [tooltip: Spatial
- spread between 0 and 1 with 1 for maximum spread.]",0.5,0,1,0.01)*46*ma.SR/origSR
- : int);
- g = parameters(vslider("[1] Wet [tooltip: The amount of reverb applied to the signal
- between 0 and 1 with 1 for the maximum amount of reverb.]", 0.3333, 0, 1, 0.025));
-};
-
-// end further contributions section
diff --git a/Resources/Libs/dx7.lib b/Resources/Libs/dx7.lib
deleted file mode 100644
index 8da11dd..0000000
--- a/Resources/Libs/dx7.lib
+++ /dev/null
@@ -1,1031 +0,0 @@
-//#################################### dx7.lib #########################################
-// Yamaha DX7 emulation library. Its official prefix is `dx`.
-//########################################################################################
-// Yamaha DX7 emulation library. The various functions available in this library
-// are used by the libraries generated from `.syx` DX7 preset files. This
-// toolkit was greatly inspired by the CSOUND DX7 emulation package:
-// .
-//
-// This library and its related tools are under development. Use it at your
-// own risk!
-//##############################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-/*
-TODO:
- * LFO not implemented yet
- * The whole system needs some tuning
-*/
-
-ba = library("basics.lib");
-en = library("envelopes.lib");
-ma = library("maths.lib");
-os = library("oscillators.lib");
-
-//----------------------`(dx.)dx7_ampf`--------------------------
-// DX7 amplitude conversion function. 3 versions of this function
-// are available:
-//
-// * `dx7_amp_bpf`: BPF version (same as in the CSOUND toolkit)
-// * `dx7_amp_func`: estimated mathematical equivalent of `dx7_amp_bpf`
-// * `dx7_ampf`: default (sugar for `dx7_amp_func`)
-//
-// #### Usage:
-//
-// ```
-// dx7AmpPreset : dx7_ampf_bpf : _
-// ```
-//
-// Where:
-//
-// * `dx7AmpPreset`: DX7 amplitude value (0-99)
-//----------------------------------------------------------
-// CSOUND function implemented as a BPF
-// Corresponds to F2 in the CSOUND implementation.
-dx7_amp_bpf = ba.bpf.start(0,0) : seq(i,14,ba.bpf.point(xPoints(i)+1,yPoints(i))) : ba.bpf.end(127,1)
-with{
- xPoints(n) = ba.take(n+1,(9,19,29,39,49,59,64,69,74,79,84,89,94,98));
- yPoints(n) = ba.take(n+1,(0.000227445,0.000985595,0.002350265,0.005989386,0.014253222,0.033813495,0.052312358,0.080970432,0.124260804,0.190447309,0.295223654,0.457088704,0.70227445,1));
-};
-// Function estimated from the CSOUND function (default)
-dx7_amp_func = min(98)/98 : pow(_,8);
-dx7_ampf = dx7_amp_func;
-
-//----------------------`(dx.)dx7_egraterisef`--------------------------
-// DX7 envelope generator rise conversion function. 3 versions of this function
-// are available:
-//
-// * `dx7_egraterise_bpf`: BPF version (same as in the CSOUND toolkit)
-// * `dx7_egraterise_func`: estimated mathematical equivalent of `dx7_egraterise_bpf`
-// * `dx7_egraterisef`: default (sugar for `dx7_egraterise_func`)
-//
-// #### Usage:
-//
-// ```
-// dx7envelopeRise : dx7_egraterisef : _
-// ```
-//
-// Where:
-//
-// * `dx7envelopeRise`: DX7 envelope rise value (0-99)
-//----------------------------------------------------------
-// CSOUND function implemented as a BPF
-// Corresponds to F4 in the CSOUND implementation.
-dx7_egraterise_bpf = ba.bpf.start(0,38) : seq(i,24,ba.bpf.point(xPoints(i)+1,yPoints(i))) : ba.bpf.end(127,0.003)
-with{
- xPoints(n) = ba.take(n+1,(4,9,14,19,24,29,34,42,45,48,51,54,60,66,68,71,74,77,
- 80,83,86,89,92,95));
- yPoints(n) = ba.take(n+1,(22.8,12,7.5,4.8,2.7,1.8,1.3,.737,.615,
- .505,.409,.321,.080,.055,.032,.024,.018,.014,.011,.008,.008,
- .007,.005,.003));
-};
-// Function estimated from the CSOUND function (default)
-dx7_egraterise_func = 38*pow((127-_)/127,12) : max(0.003);
-dx7_egraterisef = dx7_egraterise_func;
-
-//----------------------`(dx.)dx7_egraterisepercf`--------------------------
-// DX7 envelope generator percussive rise conversion function. 3 versions of
-// this function are available:
-//
-// * `dx7_egrateriseperc_bpf`: BPF version (same as in the CSOUND toolkit)
-// * `dx7_egrateriseperc_func`: estimated mathematical equivalent of `dx7_egrateriseperc_bpf`
-// * `dx7_egraterisepercf`: default (sugar for `dx7_egrateriseperc_func`)
-//
-// #### Usage:
-//
-// ```
-// dx7envelopePercRise : dx7_egraterisepercf : _
-// ```
-//
-// Where:
-//
-// * `dx7envelopePercRise`: DX7 envelope percussive rise value (0-99)
-//----------------------------------------------------------
-// CSOUND function implemented as a BPF
-// Corresponds to F5 in the CSOUND implementation.
-dx7_egrateriseperc_bpf = ba.bpf.start(0,0.00001) : seq(i,10,ba.bpf.point(xPoints(i)+1,yPoints(i))) : ba.bpf.end(127,1)
-with{
- xPoints(n) = ba.take(n+1,(30,34,39,49,59,69,79,89,94,98));
- yPoints(n) = ba.take(n+1,(0.00001,0.02,0.06,0.14,0.24,0.35,0.5,0.7,0.86,1));
-};
-// Function estimated from the CSOUND function (default)
-dx7_egrateriseperc_func = >=(30)*min(_-30,68)/68 : pow(_,1.8);
-dx7_egraterisepercf = dx7_egrateriseperc_func;
-
-//----------------------`(dx.)dx7_egratedecayf`--------------------------
-// DX7 envelope generator decay conversion function. 3 versions of
-// this function are available:
-//
-// * `dx7_egratedecay_bpf`: BPF version (same as in the CSOUND toolkit)
-// * `dx7_egratedecay_func`: estimated mathematical equivalent of `dx7_egratedecay_bpf`
-// * `dx7_egratedecayf`: default (sugar for `dx7_egratedecay_func`)
-//
-// #### Usage:
-//
-// ```
-// dx7envelopeDecay : dx7_egratedecayf : _
-// ```
-//
-// Where:
-//
-// * `dx7envelopeDecay`: DX7 envelope decay value (0-99)
-//----------------------------------------------------------
-// CSOUND function implemented as a BPF
-// Corresponds to F6 in the CSOUND implementation.
-dx7_egratedecay_bpf = ba.bpf.start(0,318) : seq(i,23,ba.bpf.point(xPoints(i)+1,yPoints(i))) : ba.bpf.end(127,.008)
-with{
- xPoints(n) = ba.take(n+1,(3,7,12,17,22,27,32,40,43,49,52,55,58,63,66,69,72,75,
- 78,81,84,87,90));
- yPoints(n) = ba.take(n+1,(181,115,63,39.7,20,11.2,7,5.66,3.98,1.99,
- 1.34,.99,.71,.41,.15,.081,.068,.047,.037,.025,.02,.013,.008));
-};
-// Function estimated from the CSOUND function (default)
-dx7_egratedecay_func = 318*pow((127-_)/127,12.6) : max(0.008);
-dx7_egratedecayf = dx7_egratedecay_func;
-
-//----------------------`(dx.)dx7_egratedecaypercf`--------------------------
-// DX7 envelope generator percussive decay conversion function. 3 versions of
-// this function are available:
-//
-// * `dx7_egratedecayperc_bpf`: BPF version (same as in the CSOUND toolkit)
-// * `dx7_egratedecayperc_func`: estimated mathematical equivalent of `dx7_egratedecayperc_bpf`
-// * `dx7_egratedecaypercf`: default (sugar for `dx7_egratedecayperc_func`)
-//
-// #### Usage:
-//
-// ```
-// dx7envelopePercDecay : dx7_egratedecaypercf : _
-// ```
-//
-// Where:
-//
-// * `dx7envelopePercDecay`: DX7 envelope decay value (0-99)
-//----------------------------------------------------------
-// CSOUND function implemented as a BPF
-// Corresponds to F7 in the CSOUND implementation.
-dx7_egratedecayperc_bpf = ba.bpf.start(0,0.00001) : seq(i,10,ba.bpf.point(xPoints(i),yPoints(i))) : ba.bpf.end(127,1)
-with{
- xPoints(n) = ba.take(n+1,(10,20,30,40,50,60,70,80,90,99));
- yPoints(n) = ba.take(n+1,(0.25,0.35,0.43,0.52,0.59,0.7,0.77,0.84,0.92,1));
-};
-// Function estimated from the CSOUND function (default)
-dx7_egratedecayperc_func = min(99)/99 : pow(_,0.7);
-dx7_egratedecaypercf = dx7_egratedecayperc_func;
-
-//----------------------`(dx.)dx7_eglv2peakf`--------------------------
-// DX7 envelope level to peak conversion function. 3 versions of
-// this function are available:
-//
-// * `dx7_eglv2peak_bpf`: BPF version (same as in the CSOUND toolkit)
-// * `dx7_eglv2peak_func`: estimated mathematical equivalent of `dx7_eglv2peak_bpf`
-// * `dx7_eglv2peakf`: default (sugar for `dx7_eglv2peak_func`)
-//
-// #### Usage:
-//
-// ```
-// dx7Level : dx7_eglv2peakf : _
-// ```
-//
-// Where:
-//
-// * `dx7Level`: DX7 level value (0-99)
-//-----------------------------------------------------------
-// CSOUND function implemented as a BPF
-// Corresponds to F8 in the CSOUND implementation.
-dx7_eglv2peak_bpf = ba.bpf.start(0,0) : seq(i,14,ba.bpf.point(xPoints(i)+1,yPoints(i))) : ba.bpf.end(127,2.08795)
-with{
- xPoints(n) = ba.take(n+1,(9,19,29,39,49,59,64,59,74,79,84,89,94,98));
- yPoints(n) = ba.take(n+1,(0.000477,0.002,0.00493,0.01257,0.02992,0.07098,0.10981,0.16997,0.260855,0.39979,0.61974,0.95954,1.47425,2.08795));
-};
-// Function estimated from the CSOUND function (default)
-dx7_eglv2peak_func = min(98)/98 : pow(_,8) : *(2.08795);
-dx7_eglv2peakf = dx7_eglv2peak_func;
-
-//----------------------`(dx.)dx7_velsensf`--------------------------
-// DX7 velocity sensitivity conversion function.
-//
-// #### Usage:
-//
-// ```
-// dx7Velocity : dx7_velsensf : _
-// ```
-//
-// Where:
-//
-// * `dx7Velocity`: DX7 level value (0-8)
-//-----------------------------------------------------------
-// Corresponds to F10 in the CSOUND implementation
-dx7_velsensf = /(8);
-
-//----------------------`(dx.)dx7_fdbkscalef`--------------------------
-// DX7 feedback scaling conversion function.
-//
-// #### Usage:
-//
-// ```
-// dx7Feedback : dx7_fdbkscalef : _
-// ```
-//
-// Where:
-//
-// * `dx7Feedback`: DX7 feedback value
-//-----------------------------------------------------------
-// Corresponds to F11 in the CSOUND implementation
-dx7_fdbkscalef = *(0.875);
-
-//------------------------------`(dx.)dx7_op`---------------------------
-// DX7 Operator. Implements a phase-modulable sine wave oscillator connected
-// to a DX7 envelope generator.
-//
-// #### Usage:
-//
-// ```
-// dx7_op(freq,phaseMod,outLev,R1,R2,R3,R4,L1,L2,L3,L4,keyVel,rateScale,type,gain,gate) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency of the oscillator
-// * `phaseMod`: phase deviation (-1 - 1)
-// * `outLev`: preset output level (0-99)
-// * `R1`: preset envelope rate 1 (0-99)
-// * `R2`: preset envelope rate 2 (0-99)
-// * `R3`: preset envelope rate 3 (0-99)
-// * `R4`: preset envelope rate 4 (0-99)
-// * `L1`: preset envelope level 1 (0-99)
-// * `L2`: preset envelope level 2 (0-99)
-// * `L3`: preset envelope level 3 (0-99)
-// * `L4`: preset envelope level 4 (0-99)
-// * `keyVel`: preset key velocity sensitivity (0-99)
-// * `rateScale`: preset envelope rate scale
-// * `type`: preset operator type
-// * `gain`: general gain
-// * `gate`: trigger signal
-//-----------------------------------------------------------------
-dx7_op(freq,phaseMod,outLev,R1,R2,R3,R4,L1,L2,L3,L4,keyVel,rateScale,type,gain,gate) =
-(en.dx7envelope(egr1,egr2,egr3,egr4,egl1,egl2,egl3,egl4,gate) : envTable)*sineWave
-with{
- tablesize = 1 << 16;
- // phase modulation, not freq modulation
- sineWave = rdtable(tablesize, os.sinwaveform(tablesize), ma.modulo(int(os.phasor(tablesize,freq) + phaseMod*tablesize),tablesize));
- amp = outLev/99; // the corresponding "CSOUND table" has just been hardcoded here
- // computing levels
- vFac = keyVel : dx7_velsensf;
- egl1 = L1*amp <: *(1-vFac) + *(vFac*gain);
- egl2 = L2*amp <: *(1-vFac) + *(vFac*gain);
- egl3 = L3*amp <: *(1-vFac) + *(vFac*gain);
- egl4 = L4*amp <: *(1-vFac) + *(vFac*gain);
- // computing rates
- rs = (freq : ba.hz2midikey)-21 : /(105)*6*rateScale;
- egr1 = R1+rs : min(99) <:
- select2(egl1>egl4,dx7_egratedecayf,dx7_egraterisef) <:
- *(egl4 <: select2(egl1>egl4,dx7_egratedecaypercf,dx7_egraterisepercf)),
- *(egl1 <: select2(egl1>egl4,dx7_egratedecaypercf,dx7_egraterisepercf)) :
- - : abs : max(0.001);
- egr2 = R2+rs : min(99) <:
- select2(egl2>egl1,dx7_egratedecayf,dx7_egraterisef) <:
- *(egl2 <: select2(egl2>egl1,dx7_egratedecaypercf,dx7_egraterisepercf)),
- *(egl1 <: select2(egl2>egl1,dx7_egratedecaypercf,dx7_egraterisepercf)) :
- - : abs : max(0.001);
- egr3 = R3+rs : min(99) <:
- select2(egl3>egl2,dx7_egratedecayf,dx7_egraterisef) <:
- *(egl2 <: select2(egl3>egl2,dx7_egratedecaypercf,dx7_egraterisepercf)),
- *(egl3 <: select2(egl3>egl2,dx7_egratedecaypercf,dx7_egraterisepercf)) :
- - : abs : max(0.001);
- egr4 = R4+rs : min(99) <:
- select2(egl3<=egl4,dx7_egratedecayf,dx7_egraterisef) <:
- *(egl3 <: select2(egl3<=egl4,dx7_egratedecaypercf,dx7_egraterisepercf)),
- *(egl4 <: select2(egl3<=egl4,dx7_egratedecaypercf,dx7_egraterisepercf)) :
- - : abs : max(0.001);
- envTable = _ <: select2(type,dx7_eglv2peakf,dx7_ampf);
-};
-
-//------------------------------`(dx.)dx7_algo`---------------------------
-// DX7 algorithms. Implements the 32 DX7 algorithms (a quick Google search
-// should give your more details on this). Each algorithm uses 6 operators
-//
-// #### Usage:
-//
-// ```
-// dx7_algo(algN,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) : _
-// ```
-//
-// Where:
-//
-// * `algN`: algorithm number (0-31, should be an int...)
-// * `egR1`: preset envelope rates 1 (a list of 6 values between 0-99)
-// * `egR2`: preset envelope rates 2 (a list of 6 values between 0-99)
-// * `egR3`: preset envelope rates 3 (a list of 6 values between 0-99)
-// * `egR4`: preset envelope rates 4 (a list of 6 values between 0-99)
-// * `egL1`: preset envelope levels 1 (a list of 6 values between 0-99)
-// * `egL2`: preset envelope levels 2 (a list of 6 values between 0-99)
-// * `egL3`: preset envelope levels 3 (a list of 6 values between 0-99)
-// * `egL4`: preset envelope levels 4 (a list of 6 values between 0-99)
-// * `outLev`: preset output levels (a list of 6 values between 0-99)
-// * `keyVel`: preset key velocity sensitivities (a list of 6 values between 0-99)
-// * `ampModSens`: preset amplitude sensitivities (a list of 6 values between 0-99)
-// * `opMode`: preset operator mode (a list of 6 values between 0-1)
-// * `opFreq`: preset operator frequencies (a list of 6 values between 0-99)
-// * `opDetune`: preset operator detuning (a list of 6 values between 0-99)
-// * `opRateScale`: preset operator rate scale (a list of 6 values between 0-99)
-// * `feedback`: preset operator feedback (a list of 6 values between 0-99)
-// * `lfoDelay`: preset LFO delay (a list of 6 values between 0-99)
-// * `lfoDepth`: preset LFO depth (a list of 6 values between 0-99)
-// * `lfoSpeed`: preset LFO speed (a list of 6 values between 0-99)
-// * `freq`: fundamental frequency
-// * `gain`: general gain
-// * `gate`: trigger signal
-//-----------------------------------------------------------------
-
-// Alg 1
-// NOTE: the .2 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(0,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op6~*(feedback*.2) : op5 : op4 : op3) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 2
-// NOTE: the .2 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(1,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2~*(feedback*.2) : op1),(op6 : op5 : op4 : op3) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 3
-// Note: weird rand and delay implemented in the csound orchestra and not
-// really sure why...
-dx7_algo(2,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op3 : op2 : op1),(op6~*(feedback) : op5 : op4) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 4
-dx7_algo(3,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op3 : op2 : op1),(op6 : op5 : op4)~*(feedback) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 5
-// NOTE: the .1 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(4,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op4 : op3),(op6~*(feedback*.1) : op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 6
-dx7_algo(5,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op4 : op3),(op6 : op5)~*(feedback) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 7
-dx7_algo(6,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op4,(op6~*(feedback) : op5) :> op3) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 8
-// NOTE: the .1 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(7,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op4~*(feedback*.1),(op6 : op5) :> op3) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 9
-// NOTE: the .4 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(8,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2~*(feedback*.4) : op1),(op4,(op6 : op5) :> op3) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 10
-// NOTE: the .2 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(9,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op5,op6 :> op4),(op3~*(feedback*.2) : op2 : op1) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 11
-// NOTE: the .2 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(10,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op5,op6~*(feedback*.2) :> op4),(op3 : op2 : op1) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 12
-// NOTE: the .2 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(11,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op4,op5,op6 :> op3),(op2~*(feedback*.2) : op1) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 13
-dx7_algo(12,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op4,op5,op6~*(feedback) :> op3),(op2 : op1) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 14
-dx7_algo(13,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op5,op6~*(feedback) :> op4 : op3) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 15
-// NOTE: the .4 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(14,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2~*(feedback*.4) : op1),(op5,op6 :> op4 : op3) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 16
-dx7_algo(15,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op2,(op4 : op3),(op6~*(feedback) : op5) :> op1
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 17
-// NOTE: the .5 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(16,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op2~*(feedback*.5),(op4 : op3),(op6 : op5) :> op1
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 18
-dx7_algo(17,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op2,op3~*(feedback),(op6 : op5 : op4) :> op1
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 19
-// NOTE: the .4 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(18,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op3 : op2 : op1),(op6~*(feedback*.4) <: op4,op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 20
-dx7_algo(19,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op3~*(feedback) <: op1,op2),(op5,op6 :> op4) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 21
-dx7_algo(20,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op3~*(feedback) <: op1,op2),(op6 <: op4,op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 22
-// NOTE: the .1 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(21,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op6~*(feedback*.1) <: op3,op4,op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 23
-dx7_algo(22,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,(op3 : op2),(op6~*(feedback) <: op4,op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 24
-// NOTE: the .6 for feedback was hardcoded in the csound orchestra, not sure why
-// we need it
-dx7_algo(23,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,op2,(op6~*(feedback*.6) <: op3,op4,op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 25
-dx7_algo(24,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,op2,op3,(op6~*(feedback) <: op4,op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 26
-dx7_algo(25,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,(op3 : op2),(op5,op6~*(feedback) :> op4) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 27
-dx7_algo(26,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,(op3~*(feedback) : op2),(op5,op6 :> op4) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),1,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,_,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 28
-dx7_algo(27,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-(op2 : op1),(op5~*(feedback) : op4 : op3),op6 :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),0,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),1,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,_,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 29
-dx7_algo(28,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,op2,(op4 : op3),(op6~*(feedback) : op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 30
-dx7_algo(29,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,op2,(op5~*(feedback) : op4 : op3),op6 :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),0,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),1,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,_,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),1,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,_,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 31
-dx7_algo(30,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,op2,op3,op4,(op6~*(feedback) : op5) :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,_,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),1,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,_,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-// Alg 32
-dx7_algo(31,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) =
-op1,op2,op3,op4,op5,op6 :> _
-with{
- op6Freq = select2(opMode(5),opFreq(5)*freq,opFreq(5)) + opDetune(5)/4;
- op6 = dx7_op(op6Freq,0,outLevel(5),egR1(5),egR2(5),egR3(5),egR4(5),egL1(5),egL2(5),egL3(5),egL4(5),keyVelSens(5),opRateScale(5),0,gain,gate);
- op5Freq = select2(opMode(4),opFreq(4)*freq,opFreq(4)) + opDetune(4)/4;
- op5 = dx7_op(op5Freq,0,outLevel(4),egR1(4),egR2(4),egR3(4),egR4(4),egL1(4),egL2(4),egL3(4),egL4(4),keyVelSens(4),opRateScale(4),0,gain,gate);
- op4Freq = select2(opMode(3),opFreq(3)*freq,opFreq(3)) + opDetune(3)/4;
- op4 = dx7_op(op4Freq,0,outLevel(3),egR1(3),egR2(3),egR3(3),egR4(3),egL1(3),egL2(3),egL3(3),egL4(3),keyVelSens(3),opRateScale(3),0,gain,gate);
- op3Freq = select2(opMode(2),opFreq(2)*freq,opFreq(2)) + opDetune(2)/4;
- op3 = dx7_op(op3Freq,0,outLevel(2),egR1(2),egR2(2),egR3(2),egR4(2),egL1(2),egL2(2),egL3(2),egL4(2),keyVelSens(2),opRateScale(2),0,gain,gate);
- op2Freq = select2(opMode(1),opFreq(1)*freq,opFreq(1)) + opDetune(1)/4;
- op2 = dx7_op(op2Freq,0,outLevel(1),egR1(1),egR2(1),egR3(1),egR4(1),egL1(1),egL2(1),egL3(1),egL4(1),keyVelSens(1),opRateScale(1),0,gain,gate);
- op1Freq = select2(opMode(0),opFreq(0)*freq,opFreq(0)) + opDetune(0)/4;
- op1 = dx7_op(op1Freq,0,outLevel(0),egR1(0),egR2(0),egR3(0),egR4(0),egL1(0),egL2(0),egL3(0),egL4(0),keyVelSens(0),opRateScale(0),0,gain,gate);
-};
-
-//------------------------------`(dx.)dx7_ui`---------------------------
-// Generic DX7 function where all parameters are controllable using UI elements.
-// The `master-with-mute` branch must be used for this function to work...
-// This function is MIDI-compatible.
-//
-// #### Usage
-//
-// ```
-// dx7_ui : _
-// ```
-//-----------------------------------------------------------------
-dx7_ui =
-par(i,32,dx7_algo(i,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) : control(algorithm == i)) :> _
-with{
- algorithm = nentry("h:dx7/v:global/[0]algorithm",0,0,31,1) : int;
- feedback = nentry("h:dx7/v:global/[1]feedback",0,0,99,1) : dx7_fdbkscalef/(2*ma.PI);
- lfoDelay = nentry("h:dx7/v:global/[2]lfoDelay",0,0,99,1);
- lfoDepth = nentry("h:dx7/v:global/[3]lfoDepth",0,0,99,1);
- lfoSpeed = nentry("h:dx7/v:global/[4]lfoSpeed",0,0,99,1);
- freq = hslider("h:dx7/v:global/[5]freq",400,50,1000,0.01);
- gain = hslider("h:dx7/v:global/[6]gain",0.8,0,1,0.01);
- gate = button("h:dx7/v:global/[7]gate");
- egR1UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[0]egR1",90,0,99,1));
- egR1(n) = ba.take(n+1,egR1UI);
- egR2UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[1]egR2",90,0,99,1));
- egR2(n) = ba.take(n+1,egR2UI);
- egR3UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[2]egR3",90,0,99,1));
- egR3(n) = ba.take(n+1,egR3UI);
- egR4UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[3]egR4",90,0,99,1));
- egR4(n) = ba.take(n+1,egR4UI);
- egL1UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[4]egL1",0,0,99,1));
- egL1(n) = ba.take(n+1,egL1UI);
- egL2UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[5]egL2",90,0,99,1));
- egL2(n) = ba.take(n+1,egL2UI);
- egL3UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[6]egL3",90,0,99,1));
- egL3(n) = ba.take(n+1,egL3UI);
- egL4UI = par(i,6,nentry("h:dx7/v:[%i]op%i/[7]egL4",0,0,99,1));
- egL4(n) = ba.take(n+1,egL4UI);
- outLevelUI = par(i,6,nentry("h:dx7/v:[%i]op%i/[8]level",95,0,99,1));
- outLevel(n) = ba.take(n+1,outLevelUI);
- keyVelSensUI = par(i,6,nentry("h:dx7/v:[%i]op%i/[9]keyVelSens",1,0,8,1));
- keyVelSens(n) = ba.take(n+1,keyVelSensUI);
- ampModSensUI = par(i,6,nentry("h:dx7/v:[%i]op%i/[10]ampModSens",0,0,99,1));
- ampModSens(n) = ba.take(n+1,ampModSensUI);
- opModeUI = par(i,6,nentry("h:dx7/v:[%i]op%i/[11]opMode",0,0,1,1));
- opMode(n) = ba.take(n+1,opModeUI);
- opFreqUI = par(i,6,nentry("h:dx7/v:[%i]op%i/[12]opFreq",1.0,0.0,2.0,0.01));
- opFreq(n) = ba.take(n+1,opFreqUI);
- opDetuneUI = par(i,6,nentry("h:dx7/v:[%i]op%i/[13]opDetune",1,-10,10,1));
- opDetune(n) = ba.take(n+1,opDetuneUI);
- opRateScaleUI = par(i,6,nentry("h:dx7/v:[%i]op%i/[14]opRateScale",0,0,10,1));
- opRateScale(n) = ba.take(n+1,opRateScaleUI);
-};
diff --git a/Resources/Libs/envelopes.lib b/Resources/Libs/envelopes.lib
deleted file mode 100644
index a15d1f8..0000000
--- a/Resources/Libs/envelopes.lib
+++ /dev/null
@@ -1,299 +0,0 @@
-//################################ envelopes.lib ##########################################
-// This library contains a collection of envelope generators. Its official prefix is `en`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-declare name "Faust Envelope Library";
-declare version "0.0";
-declare author "GRAME";
-declare copyright "GRAME";
-declare license "LGPL with exception";
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-si = library("signals.lib");
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-//------------------------`(en.)smoothEnvelope`------------------------
-// An envelope with an exponential attack and release.
-// `smoothEnvelope` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// smoothEnvelope(ar,t) : _
-// ```
-//
-// * `ar`: attack and release duration (s)
-// * `t`: trigger signal (0-1)
-//----------------------------------------------------------------
-smoothEnvelope(ar,t) = t : si.smooth(ba.tau2pole(ar));
-
-//-----------------------`(en.)ar`--------------------------
-// AR (Attack, Release) envelope generator (useful to create percussion envelopes).
-// `ar` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// ar(a,r,t) : _
-// ```
-//
-// Where:
-//
-// * `a`: attack (sec)
-// * `r`: release (sec)
-// * `t`: trigger signal (0 or 1)
-//-----------------------------------------------------
-ar(a,r,t) = cnt(totalTime,totalTime,on) : ba.bpf.start(0,0) :
- ba.bpf.point(attTime,1) : ba.bpf.end(attTime+relTime,0)
-with{
- cnt(count,init,trig) = \(c).(ba.if(trig>0,0,min(count, c+1)))~+(init-init');
- on = (t-t')>0;
- attTime = ma.SR*a;
- relTime = ma.SR*r;
- totalTime = attTime+relTime;
-};
-
-//------------------------`(en.)arfe`----------------------
-// ARFE (Attack and Release-to-Final-value Exponentially) envelope generator.
-// Approximately equal to smoothEnvelope(Attack/6.91) when Attack == Release.
-// `arfe` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// arfe(a,r,f,g) : _
-// ```
-//
-// Where:
-//
-// * `a`, `r`: attack (sec), release (sec)
-// * `f`: final value to approach upon release (such as 0)
-// * `g`: gate signal ( >0 for attack, release begins when g returns to 0)
-//-----------------------------------------------------
-// Author: JOS
-// License: STK-4.3
-arfe(attT60,relT60,fv,gate) = envelope with {
- ugate = gate>0;
- samps = ugate : +~(*(ugate)); // ramp time in samples
- attSamps = int(attT60 * ma.SR);
- target = select2(ugate, fv, float(gate));
- t60 = select2(ugate, relT60, attT60);
- pole = ba.tau2pole(t60/6.91);
- envelope = target : si.smooth(pole);
-};
-
-//------------------------`(en.)are`----------------------
-// ARE (Attack, Release) envelope generator with Exponential segments.
-// Approximately equal to smoothEnvelope(Attack/6.91) when Attack == Release.
-// `are` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// are(a,r,g) : _
-// ```
-//
-// Where:
-//
-// * `a`, `r`: attack (sec), release (sec)
-// * `g`: gate signal ( >0 for attack, release begins when g returns to 0)
-//-----------------------------------------------------
-// Author: JOS
-// License: STK-4.3
-are(attT60,relT60,gate) = arfe(attT60,relT60,0,gate);
-
-//------------------------`(en.)asr`----------------------
-// ASR (Attack, Sustain, Release) envelope generator.
-// `asr` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// asr(a,s,r,g) : _
-// ```
-//
-// Where:
-//
-// * `a`, `s`, `r`: attack (sec), sustain (percentage of g), release (sec)
-// * `g`: trigger signal ( >0 for attack, then release is when g back to 0)
-//-----------------------------------------------------
-// TODO: author RM
-asr(a,s,r,t) = on*(as) : ba.sAndH(on) : rel
-with{
- on = t>0;
- off = t==0;
- attTime = ma.SR*a;
- relTime = ma.SR*r;
- sustainGain = t*s*0.01;
- as = ba.countup(attTime,off) : ba.bpf.start(0,0) :
- ba.bpf.end(attTime,sustainGain);
- rel = _,ba.countup(relTime,on) : ba.bpf.start(0) : ba.bpf.end(relTime,0);
-};
-
-//------------------------`(en.)adsr`----------------------
-// ADSR (Attack, Decay, Sustain, Release) envelope generator.
-// `adsr` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// adsr(a,d,s,r,g) : _
-// ```
-//
-// Where:
-//
-// * `a`, `d`, `s`, `r`: attack (sec), decay (sec), sustain level (percentage of max), release (sec)
-// * `g`: gate signal ( >0 for attack, then release is when g back to 0)
-//-----------------------------------------------------
-// TODO: author RM
-adsr(a,d,s,r,t) = on*(ads) : ba.sAndH(on) : rel
-with{
- on = t>0;
- off = t==0;
- attTime = ma.SR*a;
- decTime = ma.SR*d;
- relTime = ma.SR*r;
- sustainGain = t*s*0.01;
- ads = ba.countup(attTime+decTime,off) : ba.bpf.start(0,0) :
- ba.bpf.point(attTime,1) : ba.bpf.end(attTime+decTime,sustainGain);
- rel = _,ba.countup(relTime,on) : ba.bpf.start(0) : ba.bpf.end(relTime,0);
-};
-
-//-----------------------------------------------------
-// Old version of ADSR (originally from music.lib)...
-/*
-adsr(a,d,s,r,t) = env ~ (_,_) : (!,_) // the 2 'state' signals are fed back
-with {
- env (p2,y) =
- (t>0) & (p2|(y>=1)), // p2 = decay-sustain phase
- (y + p1*u - (p2&(y>s))*v*y - p3*w*y) // y = envelop signal
- *((p3==0)|(y>=eps)) // cut off tails to prevent denormals
- with {
- p1 = (p2==0) & (t>0) & (y<1); // p1 = attack phase
- p3 = (t<=0) & (y>0); // p3 = release phase
- // #samples in attack, decay, release, must be >0
- na = ma.SR*a+(a==0.0); nd = ma.SR*d+(d==0.0); nr = ma.SR*r+(r==0.0);
- // correct zero sustain level
- z = s+(s==0.0)*ba.db2linear(-60);
- // attack, decay and (-60dB) release rates
- u = 1/na; v = 1-pow(z, 1/nd); w = 1-1/pow(z*ba.db2linear(60), 1/nr);
- // values below this threshold are considered zero in the release phase
- eps = ba.db2linear(-120);
- };
-};
-*/
-
-//----------------------`(en.)dx7envelope`----------------------
-// DX7 operator envelope generator with 4 independent rates and levels. It is
-// essentially a 4 points BPF.
-//
-// #### Usage
-//
-// ```
-// dx7_envelope(R1,R2,R3,R4,L1,L2,L3,L4,t) : _
-// ```
-//
-// Where:
-//
-// * `RN`: rates in seconds
-// * `LN`: levels (0-1)
-// * `t`: trigger signal
-//-----------------------------------------------------
-dx7envelope(R1,R2,R3,R4,L1,L2,L3,L4,t) = up*on : ba.sAndH(on) : down
-with{
- on = t>0;
- off = t==0;
- rs1 = R1*ma.SR;
- rs2 = R2*ma.SR;
- rs3 = R3*ma.SR;
- rs4 = R4*ma.SR;
- up = ba.countup(rs1+rs2+rs3,off) : ba.bpf.start(0,L4) : ba.bpf.point(rs1,L1) :
- ba.bpf.point(rs1+rs2,L2) : ba.bpf.end(rs1+rs2+rs3,L3);
- down = _,ba.countup(rs4,on) : ba.bpf.start(0) : ba.bpf.end(rs4,L4);
-};
-
-////////////////////////////////////////////////////////
-// UNDOCUMENTED/DISMISSED ELEMENTS
-////////////////////////////////////////////////////////
-
-// end GRAME section
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
-
-//------------------------`(en.)adsre`----------------------
-// ADSRE (Attack, Decay, Sustain, Release) envelope generator with Exponential segments.
-// `adsre` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// adsre(a,d,s,r,g) : _
-// ```
-//
-// Where:
-//
-// * `a`, `d`, `s`, `r`: attack (sec), decay (sec), sustain level (percentage of max), release (sec)
-// * `g`: gate signal ( >0 for attack, then release is when g back to 0)
-//-----------------------------------------------------
-// Author: JOS
-// License: STK-4.3
-adsre(attT60,decT60,susLvl,relT60,gate) = envelope with {
- ugate = gate>0;
- samps = ugate : +~(*(ugate)); // ramp time in samples
- attSamps = int(attT60 * ma.SR);
- target = select2(ugate, 0.0,
- select2(samps
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees!)
-
-************************************************************************/
-
-//===============================Basic Filters============================================
-//========================================================================================
-
-//----------------------`(fi.)zero`--------------------------
-// One zero filter. Difference equation: $y(n) = x(x) - zx(n-1)$.
-//
-// #### Usage
-//
-// ```
-// _ : zero(z) : _
-// ```
-//
-// Where:
-//
-// * `z`: location of zero along real axis in z-plane
-//
-// #### Reference
-//
-//----------------------------------------------------------
-zero(z) = _ <: _,mem : _,*(z) : -;
-
-//------------------------`(fi.)pole`---------------------------
-// One pole filter. Could also be called a "leaky integrator".
-// Difference equation: $y(n) = x(n) + py(n-1)$.
-//
-// #### Usage
-//
-// ```
-// _ : pole(p) : _
-// ```
-//
-// Where:
-//
-// * `p`: pole location = feedback coefficient
-//
-// #### Reference
-//
-//------------------------------------------------------------
-pole(p) = + ~ *(p);
-
-//----------------------`(fi.)integrator`--------------------------
-// Same as `pole(1)` [implemented separately for block-diagram clarity].
-//------------------------------------------------------------
-integrator = + ~ _ ;
-
-//-------------------`(fi.)dcblockerat`-----------------------
-// DC blocker with configurable break frequency.
-// The amplitude response is substantially flat above $fb$,
-// and sloped at about +6 dB/octave below $fb$.
-// Derived from the analog transfer function
-// $H(s) = \frac{s}{(s + 2 \pi fb)}$
-// by the low-frequency-matching bilinear transform method
-// (i.e., the standard frequency-scaling constant 2SR).
-//
-// #### Usage
-//
-// ```
-// _ : dcblockerat(fb) : _
-// ```
-//
-// Where:
-//
-// * `fb`: "break frequency" in Hz, i.e., -3 dB gain frequency.
-//
-// #### Reference
-//
-//------------------------------------------------------------
-dcblockerat(fb) = *(b0) : zero(1) : pole(p)
-with {
- wn = ma.PI*fb/ma.SR;
- b0 = 1.0 / (1 + wn);
- p = (1 - wn) * b0;
-};
-
-//----------------------`(fi.)dcblocker`--------------------------
-// DC blocker. Default dc blocker has -3dB point near 35 Hz (at 44.1 kHz)
-// and high-frequency gain near 1.0025 (due to no scaling).
-// `dcblocker` is as standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : dcblocker : _
-// ```
-//------------------------------------------------------------
-dcblocker = zero(1) : pole(0.995);
-
-//=======================================Comb Filters=====================================
-//========================================================================================
-
-//------`(fi.)ff_comb`--------
-// Feed-Forward Comb Filter. Note that `ff_comb` requires integer delays
-// (uses `delay` internally).
-// `ff_comb` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : ff_comb(maxdel,intdel,b0,bM) : _
-// ```
-//
-// Where:
-//
-// * `maxdel`: maximum delay (a power of 2)
-// * `intdel`: current (integer) comb-filter delay between 0 and maxdel
-// * `del`: current (float) comb-filter delay between 0 and maxdel
-// * `b0`: gain applied to delay-line input
-// * `bM`: gain applied to delay-line output and then summed with input
-//
-// #### Reference
-//
-//------------------------------------------------------------
-ff_comb (maxdel,M,b0,bM) = _ <: *(b0), bM * de.delay(maxdel,M) : + ;
-
-//------`(fi.)ff_fcomb`--------
-// Feed-Forward Comb Filter. Note that `ff_fcomb` takes floating-point delays
-// (uses `fdelay` internally).
-// `ff_fcomb` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : ff_fcomb(maxdel,del,b0,bM) : _
-// ```
-//
-// Where:
-//
-// * `maxdel`: maximum delay (a power of 2)
-// * `intdel`: current (integer) comb-filter delay between 0 and maxdel
-// * `del`: current (float) comb-filter delay between 0 and maxdel
-// * `b0`: gain applied to delay-line input
-// * `bM`: gain applied to delay-line output and then summed with input
-//
-// #### Reference
-//
-//------------------------------------------------------------
-ff_fcomb(maxdel,M,b0,bM) = _ <: *(b0), bM * de.fdelay(maxdel,M) : + ;
-
-//-----------`(fi.)ffcombfilter`-------------------
-// Typical special case of `ff_comb()` where: `b0 = 1`.
-//------------------------------------------------------------
-ffcombfilter(maxdel,del,g) = ff_comb(maxdel,del,1,g);
-
-
-//-----------------------`(fi.)fb_comb`-----------------------
-// Feed-Back Comb Filter (integer delay).
-//
-// #### Usage
-//
-// ```
-// _ : fb_comb(maxdel,intdel,b0,aN) : _
-// ```
-//
-// Where:
-//
-// * `maxdel`: maximum delay (a power of 2)
-// * `intdel`: current (integer) comb-filter delay between 0 and maxdel
-// * `del`: current (float) comb-filter delay between 0 and maxdel
-// * `b0`: gain applied to delay-line input and forwarded to output
-// * `aN`: minus the gain applied to delay-line output before summing with the input
-// and feeding to the delay line
-//
-// #### Reference
-//
-//------------------------------------------------------------
-fb_comb (maxdel,N,b0,aN) = (+ <: de.delay(maxdel,N-1),_) ~ *(-aN) : !,*(b0):mem;
-
-
-//-----------------------`(fi.)fb_fcomb`-----------------------
-// Feed-Back Comb Filter (floating point delay).
-//
-// #### Usage
-//
-// ```
-// _ : fb_fcomb(maxdel,del,b0,aN) : _
-// ```
-//
-// Where:
-//
-// * `maxdel`: maximum delay (a power of 2)
-// * `intdel`: current (integer) comb-filter delay between 0 and maxdel
-// * `del`: current (float) comb-filter delay between 0 and maxdel
-// * `b0`: gain applied to delay-line input and forwarded to output
-// * `aN`: minus the gain applied to delay-line output before summing with the input
-// and feeding to the delay line
-//
-// #### Reference
-//
-//------------------------------------------------------------
-fb_fcomb(maxdel,N,b0,aN) = (+ <: de.fdelay(maxdel,float(N)-1.0),_) ~ *(-aN) : !,*(b0):mem;
-
-//-----------------------`(fi.)rev1`-----------------------
-// Special case of `fb_comb` (`rev1(maxdel,N,g)`).
-// The "rev1 section" dates back to the 1960s in computer-music reverberation.
-// See the `jcrev` and `brassrev` in `reverbs.lib` for usage examples.
-//------------------------------------------------------------
-rev1(maxdel,N,g) = fb_comb (maxdel,N,1,-g);
-
-//-----`(fi.)fbcombfilter` and `(fi.)ffbcombfilter`------------
-// Other special cases of Feed-Back Comb Filter.
-//
-// #### Usage
-//
-// ```
-// _ : fbcombfilter(maxdel,intdel,g) : _
-// _ : ffbcombfilter(maxdel,del,g) : _
-// ```
-//
-// Where:
-//
-// * `maxdel`: maximum delay (a power of 2)
-// * `intdel`: current (integer) comb-filter delay between 0 and maxdel
-// * `del`: current (float) comb-filter delay between 0 and maxdel
-// * `g`: feedback gain
-//
-// #### Reference
-//
-//------------------------------------------------------------
-fbcombfilter(maxdel,intdel,g) = (+ : de.delay(maxdel,intdel)) ~ *(g);
-ffbcombfilter(maxdel,del,g) = (+ : de.fdelay(maxdel,del)) ~ *(g);
-
-
-//-------------------`(fi.)allpass_comb`-----------------
-// Schroeder Allpass Comb Filter. Note that
-//
-// ```
-// allpass_comb(maxlen,len,aN) = ff_comb(maxlen,len,aN,1) : fb_comb(maxlen,len-1,1,aN);
-// ```
-//
-// which is a direct-form-1 implementation, requiring two delay lines.
-// The implementation here is direct-form-2 requiring only one delay line.
-//
-// #### Usage
-//
-// ```
-// _ : allpass_comb (maxdel,intdel,aN) : _
-// ```
-//
-// Where:
-//
-// * `maxdel`: maximum delay (a power of 2)
-// * `intdel`: current (integer) comb-filter delay between 0 and maxdel
-// * `del`: current (float) comb-filter delay between 0 and maxdel
-// * `aN`: minus the feedback gain
-//
-// #### References
-// *
-// *
-// *
-//------------------------------------------------------------
-allpass_comb(maxdel,N,aN) = (+ <: de.delay(maxdel,N-1),*(aN)) ~ *(-aN) : mem,_ : + ;
-
-
-//-------------------`(fi.)allpass_fcomb`-----------------
-// Schroeder Allpass Comb Filter. Note that
-//
-// ```
-// allpass_comb(maxlen,len,aN) = ff_comb(maxlen,len,aN,1) : fb_comb(maxlen,len-1,1,aN);
-// ```
-//
-// which is a direct-form-1 implementation, requiring two delay lines.
-// The implementation here is direct-form-2 requiring only one delay line.
-//
-// `allpass_fcomb` is a standard Faust library.
-//
-// #### Usage
-//
-// ```
-// _ : allpass_comb (maxdel,intdel,aN) : _
-// _ : allpass_fcomb(maxdel,del,aN) : _
-// ```
-//
-// Where:
-//
-// * `maxdel`: maximum delay (a power of 2)
-// * `intdel`: current (float) comb-filter delay between 0 and maxdel
-// * `del`: current (float) comb-filter delay between 0 and maxdel
-// * `aN`: minus the feedback gain
-//
-// #### References
-// *
-// *
-// *
-//------------------------------------------------------------
-allpass_fcomb(maxdel,N,aN) = (+ <: de.fdelay(maxdel,N-1),*(aN)) ~ *(-aN) : mem,_ : + ;
-
-
-//-----------------------`(fi.)rev2`-----------------------
-// Special case of `allpass_comb` (`rev2(maxlen,len,g)`).
-// The "rev2 section" dates back to the 1960s in computer-music reverberation.
-// See the `jcrev` and `brassrev` in `reverbs.lib` for usage examples.
-//------------------------------------------------------------
-rev2(maxlen,len,g) = allpass_comb(maxlen,len,-g);
-
-//-------------------`(fi.)allpass_fcomb5` and `(fi.)allpass_fcomb1a`-----------------
-// Same as `allpass_fcomb` but use `fdelay5` and `fdelay1a` internally
-// (Interpolation helps - look at an fft of faust2octave on
-//
-// ```
-// `1-1' <: allpass_fcomb(1024,10.5,0.95), allpass_fcomb5(1024,10.5,0.95);`).
-// ```
-//------------------------------------------------------------
-allpass_fcomb5(maxdel,N,aN) = (+ <: de.fdelay5(maxdel,N-1),*(aN)) ~ *(-aN) : mem,_ : + ;
-allpass_fcomb1a(maxdel,N,aN) = (+ <: de.fdelay1a(maxdel,N-1),*(aN)) ~ *(-aN) : mem,_ : + ;
-
-//========================Direct-Form Digital Filter Sections=============================
-//========================================================================================
-
-// Specified by transfer-function polynomials B(z)/A(z) as in matlab
-
-//----------------------------`(fi.)iir`-------------------------------
-// Nth-order Infinite-Impulse-Response (IIR) digital filter,
-// implemented in terms of the Transfer-Function (TF) coefficients.
-// Such filter structures are termed "direct form".
-//
-// `iir` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : iir(bcoeffs,acoeffs) : _
-// ```
-//
-// Where:
-//
-// * `order`: filter order (int) = max(#poles,#zeros)
-// * `bcoeffs`: (b0,b1,...,b_order) = TF numerator coefficients
-// * `acoeffs`: (a1,...,a_order) = TF denominator coeffs (a0=1)
-//
-// #### Reference
-//
-//------------------------------------------------------------
-iir(bv,av) = ma.sub ~ fir(av) : fir(bv);
-
-//-----------------------------`(fi.)fir`---------------------------------
-// FIR filter (convolution of FIR filter coefficients with a signal)
-//
-// #### Usage
-//
-// ```
-// _ : fir(bv) : _
-// ```
-//
-// `fir` is standard Faust function.
-//
-// Where:
-//
-// * `bv` = b0,b1,...,bn is a parallel bank of coefficient signals.
-//
-// #### Note
-//
-// `bv` is processed using pattern-matching at compile time,
-// so it must have this normal form (parallel signals).
-//
-// #### Example
-//
-// Smoothing white noise with a five-point moving average:
-//
-// ```
-// bv = .2,.2,.2,.2,.2;
-// process = noise : fir(bv);
-// ```
-//
-// Equivalent (note double parens):
-//
-// ```
-// process = noise : fir((.2,.2,.2,.2,.2));
-// ```
-//------------------------------------------------------------
-//fir(bv) = conv(bv);
-fir((b0,bv)) = _ <: *(b0), R(1,bv) :> _ with {
- R(n,(bn,bv)) = (@(n):*(bn)), R(n+1,bv);
- R(n, bn) = (@(n):*(bn)); };
-fir(b0) = *(b0);
-
-//---------------`(fi.)conv` and `(fi.)convN`-------------------------------
-// Convolution of input signal with given coefficients.
-//
-// #### Usage
-//
-// ```
-// _ : conv((k1,k2,k3,...,kN)) : _; // Argument = one signal bank
-// _ : convN(N,(k1,k2,k3,...)) : _; // Useful when N < count((k1,...))
-// ```
-//------------------------------------------------------------
-//convN(N,kv,x) = sum(i,N,take(i+1,kv) * x@i); // take() defined in math.lib
-convN(N,kv) = sum(i,N, @(i)*take(i+1,kv)); // take() defined in math.lib
-//conv(kv,x) = sum(i,count(kv),take(i+1,kv) * x@i); // count() from math.lib
-conv(kv) = fir(kv);
-
-//----------------`(fi.)tf1`, `(fi.)tf2` and `(fi.)tf3`----------------------
-// tfN = N'th-order direct-form digital filter.
-//
-// #### Usage
-//
-// ```
-// _ : tf1(b0,b1,a1) : _
-// _ : tf2(b0,b1,b2,a1,a2) : _
-// _ : tf3(b0,b1,b2,b3,a1,a2,a3) : _
-// ```
-//
-// Where:
-//
-// * `a`: the poles
-// * `b`: the zeros
-//
-// #### Reference
-//
-//------------------------------------------------------------
-tf1(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
-tf2(b0,b1,b2,a1,a2) = iir((b0,b1,b2),(a1,a2)); // cf. TF2 in music.lib)
-// tf2 is a variant of tf22 below with duplicated mems
-tf3(b0,b1,b2,b3,a1,a2,a3) = iir((b0,b1,b2,b3),(a1,a2,a3));
-
-// "Original" version for music.lib. This is here for comparison but people should
-// use tf2 instead
-TF2(b0,b1,b2,a1,a2) = sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
-with {
- conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
- conv2(k0,k1,x) = k0*x + k1*x';
- sub(x,y) = y-x;
-};
-
-//------------`(fi.)notchw`--------------
-// Simple notch filter based on a biquad (`tf2`).
-// `notchw` is a standard Faust function.
-//
-// #### Usage:
-//
-// ```
-// _ : notchw(width,freq) : _
-// ```
-//
-// Where:
-//
-// * `width`: "notch width" in Hz (approximate)
-// * `freq`: "notch frequency" in Hz
-//
-// #### Reference
-//
-//------------------------------------------------------------
-notchw(width,freq) = tf2(b0,b1,b2,a1,a2)
-with {
- fb = 0.5*width; // First design a dcblockerat(width/2)
- wn = PI*fb/SR;
- b0db = 1.0 / (1 + wn);
- p = (1 - wn) * b0db; // This is our pole radius.
- // Now place unit-circle zeros at desired angles:
- tn = 2*PI*freq/SR;
- a2 = p * p;
- a2p1 = 1+a2;
- a1 = -a2p1*cos(tn);
- b1 = a1;
- b0 = 0.5*a2p1;
- b2 = b0;
-};
-
-//======================Direct-Form Second-Order Biquad Sections==========================
-// Direct-Form Second-Order Biquad Sections
-//
-// #### Reference
-//
-//========================================================================================
-
-//----------------`(fi.)tf21`, `(fi.)tf22`, `(fi.)tf22t` and `(fi.)tf21t`----------------------
-// tfN = N'th-order direct-form digital filter where:
-//
-// * `tf21` is tf2, direct-form 1
-// * `tf22` is tf2, direct-form 2
-// * `tf22t` is tf2, direct-form 2 transposed
-// * `tf21t` is tf2, direct-form 1 transposed
-//
-// #### Usage
-//
-// ```
-// _ : tf21(b0,b1,b2,a1,a2) : _
-// _ : tf22(b0,b1,b2,a1,a2) : _
-// _ : tf22t(b0,b1,b2,a1,a2) : _
-// _ : tf21t(b0,b1,b2,a1,a2) : _
-// ```
-//
-// Where:
-//
-// * `a`: the poles
-// * `b`: the zeros
-//
-// #### Reference
-//
-//------------------------------------------------------------
-tf21(b0,b1,b2,a1,a2) = // tf2, direct-form 1:
- _ <:(mem<:((mem:*(b2)),*(b1))),*(b0) :>_
- : ((_,_,_:>_) ~(_<:*(-a1),(mem:*(-a2))));
-tf22(b0,b1,b2,a1,a2) = // tf2, direct-form 2:
- _ : (((_,_,_:>_)~*(-a1)<:mem,*(b0))~*(-a2))
- : (_<:mem,*(b1)),_ : *(b2),_,_ :> _;
-tf22t(b0,b1,b2,a1,a2) = // tf2, direct-form 2 transposed:
- _ : (_,_,(_ <: *(b2)',*(b1)',*(b0))
- : _,+',_,_ :> _)~*(-a1)~*(-a2) : _;
-tf21t(b0,b1,b2,a1,a2) = // tf2, direct-form 1 transposed:
- tf22t(1,0,0,a1,a2) : tf22t(b0,b1,b2,0,0); // or write it out if you want
-
-//=========================== Ladder/Lattice Digital Filters =============================
-// Ladder and lattice digital filters generally have superior numerical
-// properties relative to direct-form digital filters. They can be derived
-// from digital waveguide filters, which gives them a physical interpretation.
-
-// #### Reference
-// * F. Itakura and S. Saito: "Digital Filtering Techniques for Speech Analysis and Synthesis",
-// 7th Int. Cong. Acoustics, Budapest, 25 C 1, 1971.
-// * J. D. Markel and A. H. Gray: Linear Prediction of Speech, New York: Springer Verlag, 1976.
-// *
-//========================================================================================
-
-//-------------------------------`(fi.)av2sv`-----------------------------------
-// Compute reflection coefficients sv from transfer-function denominator av.
-//
-// #### Usage
-//
-// ```
-// sv = av2sv(av)
-// ```
-//
-// Where:
-//
-// * `av`: parallel signal bank `a1,...,aN`
-// * `sv`: parallel signal bank `s1,...,sN`
-//
-// where `ro = ith` reflection coefficient, and
-// `ai` = coefficient of `z^(-i)` in the filter
-// transfer-function denominator `A(z)`.
-//
-// #### Reference
-//
-// (where reflection coefficients are denoted by k rather than s).
-//------------------------------------------------------------
-av2sv(av) = par(i,M,s(i+1)) with {
- M = ba.count(av);
- s(m) = sr(M-m+1); // m=1..M
- sr(m) = Ari(m,M-m+1); // s_{M-1-m}
- Ari(m,i) = ba.take(i+1,Ar(m-1));
- //step-down recursion for lattice/ladder digital filters:
- Ar(0) = (1,av); // Ar(m) is order M-m (i.e. "reverse-indexed")
- Ar(m) = 1,par(i,M-m, (Ari(m,i+1) - sr(m)*Ari(m,M-m-i))/(1-sr(m)*sr(m)));
-};
-
-//----------------------------`(fi.)bvav2nuv`--------------------------------
-// Compute lattice tap coefficients from transfer-function coefficients.
-//
-// #### Usage
-//
-// ```
-// nuv = bvav2nuv(bv,av)
-// ```
-//
-// Where:
-//
-// * `av`: parallel signal bank `a1,...,aN`
-// * `bv`: parallel signal bank `b0,b1,...,aN`
-// * `nuv`: parallel signal bank `nu1,...,nuN`
-//
-// where `nui` is the i'th tap coefficient,
-// `bi` is the coefficient of `z^(-i)` in the filter numerator,
-// `ai` is the coefficient of `z^(-i)` in the filter denominator
-//------------------------------------------------------------
-bvav2nuv(bv,av) = par(m,M+1,nu(m)) with {
- M = ba.count(av);
- nu(m) = ba.take(m+1,Pr(M-m)); // m=0..M
- // lattice/ladder tap parameters:
- Pr(0) = bv; // Pr(m) is order M-m, 'r' means "reversed"
- Pr(m) = par(i,M-m+1, (Pri(m,i) - nu(M-m+1)*Ari(m,M-m-i+1)));
- Pri(m,i) = ba.take(i+1,Pr(m-1));
- Ari(m,i) = ba.take(i+1,Ar(m-1));
- //step-down recursion for lattice/ladder digital filters:
- Ar(0) = (1,av); // Ar(m) is order M-m (recursion index must start at constant)
- Ar(m) = 1,par(i,M-m, (Ari(m,i+1) - sr(m)*Ari(m,M-m-i))/(1-sr(m)*sr(m)));
- sr(m) = Ari(m,M-m+1); // s_{M-1-m}
-};
-
-//--------------------`(fi.)iir_lat2`-----------------------
-// Two-multiply latice IIR filter of arbitrary order.
-//
-// #### Usage
-//
-// ```
-// _ : iir_lat2(bv,av) : _
-// ```
-//
-// Where:
-//
-// * bv: zeros as a bank of parallel signals
-// * av: poles as a bank of parallel signals
-//------------------------------------------------------------
-iir_lat2(bv,av) = allpassnt(M,sv) : sum(i,M+1,*(ba.take(M-i+1,tg)))
-with {
- M = ba.count(av);
- sv = av2sv(av); // sv = vector of sin(theta) reflection coefficients
- tg = bvav2nuv(bv,av); // tg = vector of tap gains
-};
-
-//-----------------------`(fi.)allpassnt`--------------------------
-// Two-multiply lattice allpass (nested order-1 direct-form-ii allpasses).
-//
-// #### Usage
-//
-// ```
-// _ : allpassnt(n,sv) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the filter
-// * `sv`: the reflection coefficients (-1 1)
-//------------------------------------------------------------
-allpassnt(0,sv) = _;
-allpassnt(n,sv) =
-//0: x <: ((+ <: (allpassnt(n-1,sv)),*(s))~(*(-s))) : _',_ :+
- _ : ((+ <: (allpassnt(n-1,sv),*(s)))~*(-s)) : fsec(n)
-with {
- fsec(1) = ro.crossnn(1) : _, (_<:mem,_) : +,_;
- fsec(n) = ro.crossn1(n) : _, (_<:mem,_),par(i,n-1,_) : +, par(i,n,_);
- innertaps(n) = par(i,n,_);
- s = ba.take(n,sv); // reflection coefficient s = sin(theta)
-};
-
-//--------------------`(fi.)iir_kl`-----------------------
-// Kelly-Lochbaum ladder IIR filter of arbitrary order.
-//
-// #### Usage
-//
-// ```
-// _ : iir_kl(bv,av) : _
-// ```
-//
-// Where:
-//
-// * bv: zeros as a bank of parallel signals
-// * av: poles as a bank of parallel signals
-//------------------------------------------------------------
-iir_kl(bv,av) = allpassnklt(M,sv) : sum(i,M+1,*(tghr(i)))
-with {
- M = ba.count(av);
- sv = av2sv(av); // sv = vector of sin(theta) reflection coefficients
- tg = bvav2nuv(bv,av); // tg = vector of tap gains for 2mul case
- tgr(i) = ba.take(M+1-i,tg);
- tghr(n) = tgr(n)/pi(n);
- pi(0) = 1;
- pi(n) = pi(n-1)*(1+ba.take(M-n+1,sv)); // all sign parameters '+'
-};
-
-//-----------------------`(fi.)allpassnklt`--------------------------
-// Kelly-Lochbaum ladder allpass.
-//
-// #### Usage:
-//
-// ```
-// _ : allpassklt(n,sv) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the filter
-// * `sv`: the reflection coefficients (-1 1)
-//------------------------------------------------------------
-allpassnklt(0,sv) = _;
-allpassnklt(n,sv) = _ <: *(s),(*(1+s) : (+
- : allpassnklt(n-1,sv))~(*(-s))) : fsec(n)
-with {
- fsec(1) = _, (_<:mem*(1-s),_) : sumandtaps(n);
- fsec(n) = _, (_<:mem*(1-s),_), par(i,n-1,_) : sumandtaps(n);
- s = ba.take(n,sv);
- sumandtaps(n) = +,par(i,n,_);
-};
-
-//--------------------`(fi.)iir_lat1`-----------------------
-// One-multiply latice IIR filter of arbitrary order.
-//
-// #### Usage
-//
-// ```
-// _ : iir_lat1(bv,av) : _
-// ```
-//
-// Where:
-//
-// * bv: zeros as a bank of parallel signals
-// * av: poles as a bank of parallel signals
-//------------------------------------------------------------
-iir_lat1(bv,av) = allpassn1mt(M,sv) : sum(i,M+1,*(tghr(i+1)))
-with {
- M = ba.count(av);
- sv = av2sv(av); // sv = vector of sin(theta) reflection coefficients
- tg = bvav2nuv(bv,av); // tg = vector of tap gains
- tgr(i) = ba.take(M+2-i,tg); // i=1..M+1 (for "takability")
- tghr(n) = tgr(n)/pi(n);
- pi(1) = 1;
- pi(n) = pi(n-1)*(1+ba.take(M-n+2,sv)); // all sign parameters '+'
-};
-
-//-----------------------`(fi.)allpassn1mt`--------------------------
-// One-multiply lattice allpass with tap lines.
-//
-// #### Usage
-//
-// ```
-// _ : allpassn1mt(n,sv) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the filter
-// * `sv`: the reflection coefficients (-1 1)
-//------------------------------------------------------------
-allpassn1mt(0,sv) = _;
-allpassn1mt(n,sv)= _ <: _,_ : ((+:*(s) <: _,_),_ : _,+ : ro.crossnn(1)
- : allpassn1mt(n-1,sv),_)~(*(-1)) : fsec(n)
-with {
-//0: fsec(n) = _',_ : +
- fsec(1) = ro.crossnn(1) : _, (_<:mem,_) : +,_;
- fsec(n) = ro.crossn1(n) : _, (_<:mem,_),par(i,n-1,_) : +, par(i,n,_);
- innertaps(n) = par(i,n,_);
- s = ba.take(n,sv); // reflection coefficient s = sin(theta)
-};
-
-//-------------------------------`(fi.)iir_nl`-------------------------
-// Normalized ladder filter of arbitrary order.
-//
-// #### Usage
-//
-// ```
-// _ : iir_nl(bv,av) : _
-// ```
-//
-// Where:
-//
-// * bv: zeros as a bank of parallel signals
-// * av: poles as a bank of parallel signals
-//
-// #### References
-// * J. D. Markel and A. H. Gray, Linear Prediction of Speech, New York: Springer Verlag, 1976.
-// *
-//------------------------------------------------------------
-iir_nl(bv,av) = allpassnnlt(M,sv) : sum(i,M+1,*(tghr(i)))
-with {
- M = ba.count(av);
- sv = av2sv(av); // sv = vector of sin(theta) reflection coefficients
- tg = bvav2nuv(bv,av); // tg = vector of tap gains for 2mul case
- tgr(i) = ba.take(M+1-i,tg);
- tghr(n) = tgr(n)/pi(n);
- pi(0) = 1;
- s(n) = ba.take(M-n+1,sv); // reflection coefficient = sin(theta)
- c(n) = sqrt(max(0,1-s(n)*s(n))); // compiler crashes on sqrt(-)
- pi(n) = pi(n-1)*c(n);
-};
-
-//-------------------------------`(fi.)allpassnnlt`-------------------------
-// Normalized ladder allpass filter of arbitrary order.
-//
-// #### Usage:
-//
-// ```
-// _ : allpassnnlt(n,sv) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the filter
-// * `sv`: the reflection coefficients (-1,1)
-//
-// #### References
-// * J. D. Markel and A. H. Gray, Linear Prediction of Speech, New York: Springer Verlag, 1976.
-// *
-//------------------------------------------------------------
-allpassnnlt(0,sv) = _;
-allpassnnlt(n,scl*(sv)) = allpassnnlt(n,par(i,count(sv),scl*(sv(i))));
-allpassnnlt(n,sv) = _ <: *(s),(*(c) : (+
- : allpassnnlt(n-1,sv))~(*(-s))) : fsec(n)
-with {
- fsec(1) = _, (_<:mem*(c),_) : sumandtaps(n);
- fsec(n) = _, (_<:mem*(c),_), par(i,n-1,_) : sumandtaps(n);
- s = ba.take(n,sv);
- c = sqrt(max(0,1-s*s));
- sumandtaps(n) = +,par(i,n,_);
-};
-
-//=============================Useful Special Cases=======================================
-//========================================================================================
-
-//--------------------------------`(fi.)tf2np`------------------------------------
-// Biquad based on a stable second-order Normalized Ladder Filter
-// (more robust to modulation than `tf2` and protected against instability).
-//
-// #### Usage
-//
-// ```
-// _ : tf2np(b0,b1,b2,a1,a2) : _
-// ```
-//
-// Where:
-//
-// * `a`: the poles
-// * `b`: the zeros
-//------------------------------------------------------------
-tf2np(b0,b1,b2,a1,a2) = allpassnnlt(M,sv) : sum(i,M+1,*(tghr(i)))
-with {
- smax = 0.9999; // maximum reflection-coefficient magnitude allowed
- s2 = max(-smax, min(smax,a2)); // Project both reflection-coefficients
- s1 = max(-smax, min(smax,a1/(1+a2))); // into the defined stability-region.
- sv = (s1,s2); // vector of sin(theta) reflection coefficients
- M = 2;
- nu(2) = b2;
- nu(1) = b1 - b2*a1;
- nu(0) = (b0-b2*a2) - nu(1)*s1;
- tg = (nu(0),nu(1),nu(2));
- tgr(i) = ba.take(M+1-i,tg); // vector of tap gains for 2mul case
- tghr(n) = tgr(n)/pi(n); // apply pi parameters for NLF case
- pi(0) = 1;
- s(n) = ba.take(M-n+1,sv);
- c(n) = sqrt(1-s(n)*s(n));
- pi(n) = pi(n-1)*c(n);
-};
-
-//-----------------------------`(fi.)wgr`---------------------------------
-// Second-order transformer-normalized digital waveguide resonator.
-//
-// #### Usage
-//
-// ```
-// _ : wgr(f,r) : _
-// ```
-//
-// Where:
-//
-// * `f`: resonance frequency (Hz)
-// * `r`: loss factor for exponential decay (set to 1 to make a numerically stable oscillator)
-//
-// #### References
-// *
-// *
-//------------------------------------------------------------
-wgr(f,r,x) = (*(G),_<:_,((+:*(C))<:_,_),_:+,_,_:+(x),-) ~ cross : _,*(0-gi)
-with {
- C = cos(2*ma.PI*f/ma.SR);
- gi = sqrt(max(0,(1+C)/(1-C))); // compensate amplitude (only needed when
- G = r*(1-1' + gi')/gi; // frequency changes substantially)
- cross = _,_ <: !,_,_,!;
-};
-
-//-----------------------------`(fi.)nlf2`--------------------------------
-// Second order normalized digital waveguide resonator.
-//
-// #### Usage
-//
-// ```
-// _ : nlf2(f,r) : _
-// ```
-//
-// Where:
-//
-// * `f`: resonance frequency (Hz)
-// * `r`: loss factor for exponential decay (set to 1 to make a sinusoidal oscillator)
-//
-// #### Reference
-//
-//------------------------------------------------------------
-nlf2(f,r,x) = ((_<:_,_),(_<:_,_) : (*(s),*(c),*(c),*(0-s)) :>
- (*(r),+(x))) ~ cross
-with {
- th = 2*ma.PI*f/ma.SR;
- c = cos(th);
- s = sin(th);
- cross = _,_ <: !,_,_,!;
-};
-
-
-//------------`(fi.)apnl`---------------
-// Passive Nonlinear Allpass based on Pierce switching springs idea.
-// Switch between allpass coefficient `a1` and `a2` at signal zero crossings.
-//
-// #### Usage
-//
-// ```
-// _ : apnl(a1,a2) : _
-// ```
-//
-// Where:
-//
-// * `a1` and `a2`: allpass coefficients
-//
-// #### Reference
-// * "A Passive Nonlinear Digital Filter Design ..." by John R. Pierce and Scott
-// A. Van Duyne, JASA, vol. 101, no. 2, pp. 1120-1126, 1997
-//------------------------------------------------------------
-apnl(a1,a2,x) = nonLinFilter
-with{
- condition = _>0;
- nonLinFilter = (x - _ <: _*(condition*a1 + (1-condition)*a2),_')~_ :> +;
-};
-
-
-//============================Ladder/Lattice Allpass Filters==============================
-// An allpass filter has gain 1 at every frequency, but variable phase.
-// Ladder/lattice allpass filters are specified by reflection coefficients.
-// They are defined here as nested allpass filters, hence the names allpassn*.
-//
-// #### References
-// *
-// *
-// * Linear Prediction of Speech, Markel and Gray, Springer Verlag, 1976
-//========================================================================================
-
-//---------------`(fi.)allpassn`-----------------
-// Two-multiply lattice - each section is two multiply-adds.
-//
-// #### Usage:
-//
-// ```
-// _ : allpassn(n,sv) : _
-// ```
-// #### Where:
-//
-// * `n`: the order of the filter
-// * `sv`: the reflection coefficients (-1 1)
-//
-// #### References
-// * J. O. Smith and R. Michon, "Nonlinear Allpass Ladder Filters in FAUST", in
-// Proceedings of the 14th International Conference on Digital Audio Effects
-// (DAFx-11), Paris, France, September 19-23, 2011.
-//----------------------------------------------
-allpassn(0,sv) = _;
-allpassn(n,sv) = _ <: ((+ <: (allpassn(n-1,sv)),*(s))~(*(-s))) : _',_ :+
-with { s = ba.take(n,sv); };
-
-//---------------`(fi.)allpassnn`-----------------
-// Normalized form - four multiplies and two adds per section,
-// but coefficients can be time varying and nonlinear without
-// "parametric amplification" (modulation of signal energy).
-//
-// #### Usage:
-//
-// ```
-// _ : allpassnn(n,tv) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the filter
-// * `tv`: the reflection coefficients (-PI PI)
-//----------------------------------------------
-// power-normalized (reflection coefficients s = sin(t)):
-allpassnn(0,tv) = _;
-allpassnn(n,tv) = _ <: *(s), (*(c) : (+
- : allpassnn(n-1,tv))~(*(-s))) : _, mem*c : +
-with { c=cos(ba.take(n,tv)); s=sin(ba.take(n,tv)); };
-
-//---------------`(fi.)allpasskl`-----------------
-// Kelly-Lochbaum form - four multiplies and two adds per
-// section, but all signals have an immediate physical
-// interpretation as traveling pressure waves, etc.
-//
-// #### Usage:
-//
-// ```
-// _ : allpassnkl(n,sv) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the filter
-// * `sv`: the reflection coefficients (-1 1)
-//----------------------------------------------
-// Kelly-Lochbaum:
-allpassnkl(0,sv) = _;
-allpassnkl(n,sv) = _ <: *(s),(*(1+s) : (+
- : allpassnkl(n-1,sv))~(*(-s))) : _, mem*(1-s) : +
-with { s = ba.take(n,sv); };
-
-//---------------`(fi.)allpass1m`-----------------
-// One-multiply form - one multiply and three adds per section.
-// Normally the most efficient in special-purpose hardware.
-//
-// #### Usage:
-//
-// ```
-// _ : allpassn1m(n,sv) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the filter
-// * `sv`: the reflection coefficients (-1 1)
-//----------------------------------------------
-// one-multiply:
-allpassn1m(0,sv) = _;
-allpassn1m(n,sv)= _ <: _,_ : ((+:*(s) <: _,_),_ : _,+ : cross
- : allpassn1m(n-1,sv),_)~(*(-1)) : _',_ : +
-with {s = ba.take(n,sv); cross = _,_ <: !,_,_,!; };
-
-//===========Digital Filter Sections Specified as Analog Filter Sections==================
-//========================================================================================
-
-//-------------------------`(fi.)tf2s` and `(fi.)tf2snp`--------------------------------
-// Second-order direct-form digital filter,
-// specified by ANALOG transfer-function polynomials B(s)/A(s),
-// and a frequency-scaling parameter. Digitization via the
-// bilinear transform is built in.
-//
-// #### Usage
-//
-// ```
-// _ : tf2s(b2,b1,b0,a1,a0,w1) : _
-// ```
-// Where:
-//
-// ```
-// b2 s^2 + b1 s + b0
-// H(s) = --------------------
-// s^2 + a1 s + a0
-// ```
-//
-// and `w1` is the desired digital frequency (in radians/second)
-// corresponding to analog frequency 1 rad/sec (i.e., `s = j`).
-//
-// #### Example
-//
-// A second-order ANALOG Butterworth lowpass filter,
-// normalized to have cutoff frequency at 1 rad/sec,
-// has transfer function
-//
-// ```
-// 1
-// H(s) = -----------------
-// s^2 + a1 s + 1
-// ```
-//
-// where `a1 = sqrt(2)`. Therefore, a DIGITAL Butterworth lowpass
-// cutting off at `SR/4` is specified as `tf2s(0,0,1,sqrt(2),1,PI*SR/2);`
-//
-// #### Method
-//
-// Bilinear transform scaled for exact mapping of w1.
-//
-// #### Reference
-//
-//----------------------------------------------
-tf2s(b2,b1,b0,a1,a0,w1) = tf2(b0d,b1d,b2d,a1d,a2d)
-with {
- c = 1/tan(w1*0.5/ma.SR); // bilinear-transform scale-factor
- csq = c*c;
- d = a0 + a1 * c + csq;
- b0d = (b0 + b1 * c + b2 * csq)/d;
- b1d = 2 * (b0 - b2 * csq)/d;
- b2d = (b0 - b1 * c + b2 * csq)/d;
- a1d = 2 * (a0 - csq)/d;
- a2d = (a0 - a1*c + csq)/d;
-};
-
-// tf2snp = tf2s but using a protected normalized ladder filter for tf2:
-tf2snp(b2,b1,b0,a1,a0,w1) = tf2np(b0d,b1d,b2d,a1d,a2d)
-with {
- c = 1/tan(w1*0.5/ma.SR); // bilinear-transform scale-factor
- csq = c*c;
- d = a0 + a1 * c + csq;
- b0d = (b0 + b1 * c + b2 * csq)/d;
- b1d = 2 * (b0 - b2 * csq)/d;
- b2d = (b0 - b1 * c + b2 * csq)/d;
- a1d = 2 * (a0 - csq)/d;
- a2d = (a0 - a1*c + csq)/d;
-};
-
-//-----------------------------`(fi.)tf3slf`-------------------------------
-// Analogous to tf2s above, but third order, and using the typical
-// low-frequency-matching bilinear-transform constant 2/T ("lf" series)
-// instead of the specific-frequency-matching value used in tf2s and tf1s.
-// Note the lack of a "w1" argument.
-//
-// #### Usage
-//
-// ```
-// _ : tf3slf(b3,b2,b1,b0,a3,a2,a1,a0) : _
-// ```
-//----------------------------------------------
-tf3slf(b3,b2,b1,b0,a3,a2,a1,a0) = tf3(b0d,b1d,b2d,b3d,a1d,a2d,a3d) with {
- c = 2.0 * ma.SR; // bilinear-transform scale-factor ("lf" case)
- csq = c*c;
- cc = csq*c;
- // Thank you maxima:
- b3d = (b3*c^3-b2*c^2+b1*c-b0)/d;
- b2d = (-3*b3*c^3+b2*c^2+b1*c-3*b0)/d;
- b1d = (3*b3*c^3+b2*c^2-b1*c-3*b0)/d;
- b0d = (-b3*c^3-b2*c^2-b1*c-b0)/d;
- a3d = (a3*c^3-a2*c^2+a1*c-a0)/d;
- a2d = (-3*a3*c^3+a2*c^2+a1*c-3*a0)/d;
- a1d = (3*a3*c^3+a2*c^2-a1*c-3*a0)/d;
- d = (-a3*c^3-a2*c^2-a1*c-a0);
-};
-
-//-----------------------------`(fi.)tf1s`--------------------------------
-// First-order direct-form digital filter,
-// specified by ANALOG transfer-function polynomials B(s)/A(s),
-// and a frequency-scaling parameter.
-//
-// #### Usage
-//
-// ```
-// tf1s(b1,b0,a0,w1)
-// ```
-// Where:
-//
-// b1 s + b0
-// H(s) = ----------
-// s + a0
-//
-// and `w1` is the desired digital frequency (in radians/second)
-// corresponding to analog frequency 1 rad/sec (i.e., `s = j`).
-//
-// #### Example
-// A first-order ANALOG Butterworth lowpass filter,
-// normalized to have cutoff frequency at 1 rad/sec,
-// has transfer function
-//
-// 1
-// H(s) = -------
-// s + 1
-//
-// so `b0 = a0 = 1` and `b1 = 0`. Therefore, a DIGITAL first-order
-// Butterworth lowpass with gain -3dB at `SR/4` is specified as
-//
-// ```
-// tf1s(0,1,1,PI*SR/2); // digital half-band order 1 Butterworth
-// ```
-//
-// #### Method
-//
-// Bilinear transform scaled for exact mapping of w1.
-//
-// #### Reference
-//
-//----------------------------------------------
-tf1s(b1,b0,a0,w1) = tf1(b0d,b1d,a1d)
-with {
- c = 1/tan(w1*0.5/ma.SR); // bilinear-transform scale-factor
- d = a0 + c;
- b1d = (b0 - b1*c) / d;
- b0d = (b0 + b1*c) / d;
- a1d = (a0 - c) / d;
-};
-
-//-----------------------------`(fi.)tf2sb`--------------------------------
-// Bandpass mapping of `tf2s`: In addition to a frequency-scaling parameter
-// `w1` (set to HALF the desired passband width in rad/sec),
-// there is a desired center-frequency parameter wc (also in rad/s).
-// Thus, `tf2sb` implements a fourth-order digital bandpass filter section
-// specified by the coefficients of a second-order analog lowpass prototpe
-// section. Such sections can be combined in series for higher orders.
-// The order of mappings is (1) frequency scaling (to set lowpass cutoff w1),
-// (2) bandpass mapping to wc, then (3) the bilinear transform, with the
-// usual scale parameter `2*SR`. Algebra carried out in maxima and pasted here.
-//
-// #### Usage
-//
-// ```
-// _ : tf2sb(b2,b1,b0,a1,a0,w1,wc) : _
-// ```
-//----------------------------------------------
-tf2sb(b2,b1,b0,a1,a0,w1,wc) =
- iir((b0d/a0d,b1d/a0d,b2d/a0d,b3d/a0d,b4d/a0d),(a1d/a0d,a2d/a0d,a3d/a0d,a4d/a0d)) with {
- T = 1.0/float(ma.SR);
- b0d = (4*b0*w1^2+8*b2*wc^2)*T^2+8*b1*w1*T+16*b2;
- b1d = 4*b2*wc^4*T^4+4*b1*wc^2*w1*T^3-16*b1*w1*T-64*b2;
- b2d = 6*b2*wc^4*T^4+(-8*b0*w1^2-16*b2*wc^2)*T^2+96*b2;
- b3d = 4*b2*wc^4*T^4-4*b1*wc^2*w1*T^3+16*b1*w1*T-64*b2;
- b4d = (b2*wc^4*T^4-2*b1*wc^2*w1*T^3+(4*b0*w1^2+8*b2*wc^2)*T^2-8*b1*w1*T +16*b2)
- + b2*wc^4*T^4+2*b1*wc^2*w1*T^3;
- a0d = wc^4*T^4+2*a1*wc^2*w1*T^3+(4*a0*w1^2+8*wc^2)*T^2+8*a1*w1*T+16;
- a1d = 4*wc^4*T^4+4*a1*wc^2*w1*T^3-16*a1*w1*T-64;
- a2d = 6*wc^4*T^4+(-8*a0*w1^2-16*wc^2)*T^2+96;
- a3d = 4*wc^4*T^4-4*a1*wc^2*w1*T^3+16*a1*w1*T-64;
- a4d = wc^4*T^4-2*a1*wc^2*w1*T^3+(4*a0*w1^2+8*wc^2)*T^2-8*a1*w1*T+16;
-};
-
-//-----------------------------`(fi.)tf1sb`--------------------------------
-// First-to-second-order lowpass-to-bandpass section mapping,
-// analogous to tf2sb above.
-//
-// #### Usage
-//
-// ```
-// _ : tf1sb(b1,b0,a0,w1,wc) : _
-// ```
-//----------------------------------------------
-tf1sb(b1,b0,a0,w1,wc) = tf2(b0d/a0d,b1d/a0d,b2d/a0d,a1d/a0d,a2d/a0d) with {
- T = 1.0/float(ma.SR);
- a0d = wc^2*T^2+2*a0*w1*T+4;
- b0d = b1*wc^2*T^2 +2*b0*w1*T+4*b1;
- b1d = 2*b1*wc^2*T^2-8*b1;
- b2d = b1*wc^2*T^2-2*b0*w1*T+4*b1;
- a1d = 2*wc^2*T^2-8;
- a2d = wc^2*T^2-2*a0*w1*T+4;
-};
-
-//==============================Simple Resonator Filters==================================
-//========================================================================================
-
-//------------------`(fi.)resonlp`-----------------
-// Simple resonant lowpass filter based on `tf2s` (virtual analog).
-// `resonlp` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : resonlp(fc,Q,gain) : _
-// _ : resonhp(fc,Q,gain) : _
-// _ : resonbp(fc,Q,gain) : _
-//
-// ```
-//
-// Where:
-//
-// * `fc`: center frequency (Hz)
-// * `Q`: q
-// * `gain`: gain (0-1)
-//---------------------------------------------------------------------
-// resonlp = 2nd-order lowpass with corner resonance:
-resonlp(fc,Q,gain) = tf2s(b2,b1,b0,a1,a0,wc)
-with {
- wc = 2*ma.PI*fc;
- a1 = 1/Q;
- a0 = 1;
- b2 = 0;
- b1 = 0;
- b0 = gain;
-};
-
-
-//------------------`(fi.)resonhp`-----------------
-// Simple resonant highpass filters based on `tf2s` (virtual analog).
-// `resonhp` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : resonlp(fc,Q,gain) : _
-// _ : resonhp(fc,Q,gain) : _
-// _ : resonbp(fc,Q,gain) : _
-//
-// ```
-//
-// Where:
-//
-// * `fc`: center frequency (Hz)
-// * `Q`: q
-// * `gain`: gain (0-1)
-//---------------------------------------------------------------------
-// resonhp = 2nd-order highpass with corner resonance:
-resonhp(fc,Q,gain,x) = gain*x-resonlp(fc,Q,gain,x);
-
-
-//------------------`(fi.)resonbp`-----------------
-// Simple resonant bandpass filters based on `tf2s` (virtual analog).
-// `resonbp` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : resonlp(fc,Q,gain) : _
-// _ : resonhp(fc,Q,gain) : _
-// _ : resonbp(fc,Q,gain) : _
-//
-// ```
-//
-// Where:
-//
-// * `fc`: center frequency (Hz)
-// * `Q`: q
-// * `gain`: gain (0-1)
-//---------------------------------------------------------------------
-// resonbp = 2nd-order bandpass
-resonbp(fc,Q,gain) = tf2s(b2,b1,b0,a1,a0,wc)
-with {
- wc = 2*ma.PI*fc;
- a1 = 1/Q;
- a0 = 1;
- b2 = 0;
- b1 = gain;
- b0 = 0;
-};
-
-//======================Butterworth Lowpass/Highpass Filters==============================
-//========================================================================================
-
-//----------------`(fi.)lowpass`--------------------
-// Nth-order Butterworth lowpass filter.
-// `lowpass` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : lowpass(N,fc) : _
-// ```
-//
-// Where:
-//
-// * `N`: filter order (number of poles) [nonnegative constant integer]
-// * `fc`: desired cut-off frequency (-3dB frequency) in Hz
-//
-// #### References
-// *
-// * `butter` function in Octave `("[z,p,g] = butter(N,1,'s');")`
-//------------------------------
-lowpass(N,fc) = lowpass0_highpass1(0,N,fc);
-
-
-//----------------`(fi.)highpass`--------------------
-// Nth-order Butterworth highpass filters.
-// `highpass` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : highpass(N,fc) : _
-// ```
-//
-// Where:
-//
-// * `N`: filter order (number of poles) [nonnegative constant integer]
-// * `fc`: desired cut-off frequency (-3dB frequency) in Hz
-//
-// #### References
-// *
-// * `butter` function in Octave `("[z,p,g] = butter(N,1,'s');")`
-//------------------------------
-highpass(N,fc) = lowpass0_highpass1(1,N,fc);
-
-
-//-------------`(fi.)lowpass0_highpass1`--------------
-lowpass0_highpass1(s,N,fc) = lphpr(s,N,N,fc)
-with {
- lphpr(s,0,N,fc) = _;
- lphpr(s,1,N,fc) = tf1s(s,1-s,1,2*ma.PI*fc);
- lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2s(s,0,1-s,a1s,1,w1) with {
- parity = N % 2;
- S = (O-parity)/2; // current section number
- a1s = -2*cos((ma.PI)*-1 + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
- w1 = 2*ma.PI*fc;
- };
-};
-
-//================Special Filter-Bank Delay-Equalizing Allpass Filters====================
-// These special allpass filters are needed by filterbank et al. below.
-// They are equivalent to (`lowpass(N,fc)` +|- `highpass(N,fc))/2`, but with
-// canceling pole-zero pairs removed (which occurs for odd N).
-//========================================================================================
-
-//--------------------`(fi.)lowpass_plus`|`minus_highpass`----------------
-highpass_plus_lowpass(1,fc) = _;
-highpass_plus_lowpass(3,fc) = tf2s(1,-1,1,1,1,w1) with { w1 = 2*ma.PI*fc; };
-highpass_minus_lowpass(3,fc) = tf1s(-1,1,1,w1) with { w1 = 2*ma.PI*fc; };
-highpass_plus_lowpass(5,fc) = tf2s(1,-a11,1,a11,1,w1)
-with {
- a11 = 1.618033988749895;
- w1 = 2*ma.PI*fc;
-};
-highpass_minus_lowpass(5,fc) = tf1s(1,-1,1,w1) : tf2s(1,-a12,1,a12,1,w1)
-with {
- a12 = 0.618033988749895;
- w1 = 2*ma.PI*fc;
-};
-
-// Catch-all definitions for generality - even order is done:
-
-highpass_plus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with {
- switch_odd_even(0,N,fc) = highpass_plus_lowpass_even(N,fc);
- switch_odd_even(1,N,fc) = highpass_plus_lowpass_odd(N,fc);
-};
-
-highpass_minus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with {
- switch_odd_even(0,N,fc) = highpass_minus_lowpass_even(N,fc);
- switch_odd_even(1,N,fc) = highpass_minus_lowpass_odd(N,fc);
-};
-
-highpass_plus_lowpass_even(N,fc) = highpass(N,fc) + lowpass(N,fc);
-highpass_minus_lowpass_even(N,fc) = highpass(N,fc) - lowpass(N,fc);
-
-// FIXME: Rewrite the following, as for orders 3 and 5 above,
-// to eliminate pole-zero cancellations:
-highpass_plus_lowpass_odd(N,fc) = highpass(N,fc) + lowpass(N,fc);
-highpass_minus_lowpass_odd(N,fc) = highpass(N,fc) - lowpass(N,fc);
-
-//==========================Elliptic (Cauer) Lowpass Filters==============================
-// Elliptic (Cauer) Lowpass Filters
-//
-// #### References
-// *
-//-------------------------------------------------------------------------
-bandpass(Nh,fl,fu) = bandpass0_bandstop1(0,Nh,fl,fu);
-
-
-//--------------------`(fi.)bandstop`----------------
-// Order 2*Nh Butterworth bandstop filter made using the transformation
-// `s <- s + wc^2/s` on `highpass(Nh)`, where `wc` is the desired bandpass center
-// frequency. The `highpass(Nh)` cutoff `w1` is half the desired bandpass width.
-// `bandstop` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : bandstop(Nh,fl,fu) : _
-// ```
-// Where:
-//
-// * `Nh`: HALF the desired bandstop order (which is therefore even)
-// * `fl`: lower -3dB frequency in Hz
-// * `fu`: upper -3dB frequency in Hz
-// Thus, the passband (stopband) width is `fu-fl`,
-// and its center frequency is `(fl+fu)/2`.
-//
-// #### Reference
-//
-//-------------------------------------------------------------------------
-bandstop(Nh,fl,fu) = bandpass0_bandstop1(1,Nh,fl,fu);
-bandpass0_bandstop1(s,Nh,fl,fu) = bpbsr(s,Nh,Nh,fl,fu)
-with {
- wl = 2*ma.PI*fl; // digital (z-plane) lower passband edge
- wu = 2*ma.PI*fu; // digital (z-plane) upper passband edge
-
- c = 2.0*ma.SR; // bilinear transform scaling used in tf2sb, tf1sb
- wla = c*tan(wl/c); // analog (s-splane) lower cutoff
- wua = c*tan(wu/c); // analog (s-splane) upper cutoff
-
- wc = sqrt(wla*wua); // s-plane center frequency
- w1 = wua - wc^2/wua; // s-plane lowpass prototype cutoff
-
- bpbsr(s,0,Nh,fl,fu) = _;
- bpbsr(s,1,Nh,fl,fu) = tf1sb(s,1-s,1,w1,wc);
- bpbsr(s,O,Nh,fl,fu) = bpbsr(s,O-2,Nh,fl,fu) : tf2sb(s,0,(1-s),a1s,1,w1,wc)
- with {
- parity = Nh % 2;
- S = (O-parity)/2; // current section number
- a1s = -2*cos(-1*ma.PI + (1-parity)*ma.PI/(2*Nh) + (S-1+parity)*ma.PI/Nh);
- };
-};
-
-//===========================Elliptic Bandpass Filters====================================
-//========================================================================================
-
-//---------------------`(fi.)bandpass6e`-----------------------------
-// Order 12 elliptic bandpass filter analogous to `bandpass(6)`.
-//--------------------------------------------------------------
-bandpass6e(fl,fu) = tf2sb(b21,b11,b01,a11,a01,w1,wc) : tf1sb(0,1,a02,w1,wc)
-with {
- a11 = 0.802636764161030; // In octave: format long; poly(p(1:2))
- a01 = 1.412270893774204;
- a02 = 0.822445908998816; // poly(p(3))
- b21 = 0.019809144837789; // poly(z)
- b11 = 0;
- b01 = 1.161516418982696;
-
- wl = 2*ma.PI*fl; // digital (z-plane) lower passband edge
- wu = 2*ma.PI*fu; // digital (z-plane) upper passband edge
-
- c = 2.0*ma.SR; // bilinear transform scaling used in tf2sb, tf1sb
- wla = c*tan(wl/c); // analog (s-splane) lower cutoff
- wua = c*tan(wu/c); // analog (s-splane) upper cutoff
-
- wc = sqrt(wla*wua); // s-plane center frequency
- w1 = wua - wc^2/wua; // s-plane lowpass cutoff
-};
-
-//----------------------`(fi.)bandpass12e`---------------------------
-// Order 24 elliptic bandpass filter analogous to `bandpass(6)`.
-//--------------------------------------------------------------
-bandpass12e(fl,fu) =
- tf2sb(b21,b11,b01,a11,a01,w1,wc) :
- tf2sb(b22,b12,b02,a12,a02,w1,wc) :
- tf2sb(b23,b13,b03,a13,a03,w1,wc)
-with { // octave script output:
- b21 = 0.000099999997055;
- a21 = 1;
- b11 = 0;
- a11 = 0.782413046821645;
- b01 = 0.000433227200555;
- a01 = 0.245291508706160;
- b22 = 1;
- a22 = 1;
- b12 = 0;
- a12 = 0.512478641889141;
- b02 = 7.621731298870603;
- a02 = 0.689621364484675;
- b23 = 1;
- a23 = 1;
- b13 = 0;
- a13 = 0.168404871113589;
- b03 = 53.536152954556727;
- a03 = 1.069358407707312;
-
- wl = 2*ma.PI*fl; // digital (z-plane) lower passband edge
- wu = 2*ma.PI*fu; // digital (z-plane) upper passband edge
-
- c = 2.0*ma.SR; // bilinear transform scaling used in tf2sb, tf1sb
- wla = c*tan(wl/c); // analog (s-splane) lower cutoff
- wua = c*tan(wu/c); // analog (s-splane) upper cutoff
-
- wc = sqrt(wla*wua); // s-plane center frequency
- w1 = wua - wc^2/wua; // s-plane lowpass cutoff
-};
-
-//=================Parametric Equalizers (Shelf, Peaking)=================================
-// Parametric Equalizers (Shelf, Peaking)
-//
-// #### References
-// *
-// *
-// * Digital Audio Signal Processing, Udo Zolzer, Wiley, 1999, p. 124
-// * https://ccrma.stanford.edu/~jos/filters/Low_High_Shelving_Filters.html>
-// * https://ccrma.stanford.edu/~jos/filters/Peaking_Equalizers.html>
-// * maxmsp.lib in the Faust distribution
-// * bandfilter.dsp in the faust2pd distribution
-//========================================================================================
-
-//----------------------`(fi.)low_shelf`----------------------
-// First-order "low shelf" filter (gain boost|cut between dc and some frequency)
-// `low_shelf` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : lowshelf(N,L0,fx) : _
-// _ : low_shelf(L0,fx) : _ // default case (order 3)
-// _ : lowshelf_other_freq(N,L0,fx) : _
-// ```
-//
-// Where:
-// * `N`: filter order 1, 3, 5, ... (odd only). (default should be 3)
-// * `L0`: desired level (dB) between dc and fx (boost `L0>0` or cut `L0<0`)
-// * `fx`: -3dB frequency of lowpass band (`L0>0`) or upper band (`L0<0`)
-// (see "SHELF SHAPE" below).
-//
-// The gain at SR/2 is constrained to be 1.
-// The generalization to arbitrary odd orders is based on the well known
-// fact that odd-order Butterworth band-splits are allpass-complementary
-// (see filterbank documentation below for references).
-//
-// #### Shelf Shape
-// The magnitude frequency response is approximately piecewise-linear
-// on a log-log plot ("BODE PLOT"). The Bode "stick diagram" approximation
-// L(lf) is easy to state in dB versus dB-frequency lf = dB(f):
-//
-// * L0 > 0:
-// * L(lf) = L0, f between 0 and fx = 1st corner frequency;
-// * L(lf) = L0 - N * (lf - lfx), f between fx and f2 = 2nd corner frequency;
-// * L(lf) = 0, lf > lf2.
-// * lf2 = lfx + L0/N = dB-frequency at which level gets back to 0 dB.
-// * L0 < 0:
-// * L(lf) = L0, f between 0 and f1 = 1st corner frequency;
-// * L(lf) = - N * (lfx - lf), f between f1 and lfx = 2nd corner frequency;
-// * L(lf) = 0, lf > lfx.
-// * lf1 = lfx + L0/N = dB-frequency at which level goes up from L0.
-//
-// See `lowshelf_other_freq`.
-//--------------------------------------------------------------
-lowshelf(N,L0,fx) = filterbank(N,(fx)) : _, *(ba.db2linear(L0)) :> _;
-// Special cases and optimization:
-low_shelf = lowshelf(3); // default = 3rd order Butterworth
-low_shelf1(L0,fx,x) = x + (ba.db2linear(L0)-1)*lowpass(1,fx,x); // optimized
-low_shelf1_l(G0,fx,x) = x + (G0-1)*lowpass(1,fx,x); // optimized
-lowshelf_other_freq(N, L0, fx) = ba.db2linear(ba.linear2db(fx) + L0/N); // convenience
-
-//-------------`(fi.)high_shelf`--------------
-// First-order "high shelf" filter (gain boost|cut above some frequency).
-// `high_shelf` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : highshelf(N,Lpi,fx) : _
-// _ : high_shelf(L0,fx) : _ // default case (order 3)
-// _ : highshelf_other_freq(N,Lpi,fx) : _
-// ```
-//
-// Where:
-//
-// * `N`: filter order 1, 3, 5, ... (odd only).
-// * `Lpi`: desired level (dB) between fx and SR/2 (boost Lpi>0 or cut Lpi<0)
-// * `fx`: -3dB frequency of highpass band (L0>0) or lower band (L0<0)
-// (Use highshelf_other_freq() below to find the other one.)
-//
-// The gain at dc is constrained to be 1.
-// See `lowshelf` documentation above for more details on shelf shape.
-//--------------------------------------------------------------
-highshelf(N,Lpi,fx) = filterbank(N,(fx)) : *(ba.db2linear(Lpi)), _ :> _;
-// Special cases and optimization:
-high_shelf = highshelf(3); // default = 3rd order Butterworth
-high_shelf1(Lpi,fx,x) = x + (ba.db2linear(Lpi)-1)*highpass(1,fx,x); // optimized
-high_shelf1_l(Gpi,fx,x) = x + (Gpi-1)*highpass(1,fx,x); //optimized
-
-// shelf transitions between frequency fx and this one:
-highshelf_other_freq(N, Lpi, fx) = ba.db2linear(ba.linear2db(fx) - Lpi/N);
-
-
-//-------------------`(fi.)peak_eq`------------------------------
-// Second order "peaking equalizer" section (gain boost or cut near some frequency)
-// Also called a "parametric equalizer" section.
-// `peak_eq` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : peak_eq(Lfx,fx,B) : _;
-// ```
-//
-// Where:
-//
-// * `Lfx`: level (dB) at fx (boost Lfx>0 or cut Lfx<0)
-// * `fx`: peak frequency (Hz)
-// * `B`: bandwidth (B) of peak in Hz
-//--------------------------------------------------------------
-peak_eq(Lfx,fx,B) = tf2s(1,b1s,1,a1s,1,wx) with {
- T = float(1.0/ma.SR);
- Bw = B*T/sin(wx*T); // prewarp s-bandwidth for more accuracy in z-plane
- a1 = ma.PI*Bw;
- b1 = g*a1;
- g = ba.db2linear(abs(Lfx));
- b1s = select2(Lfx>0,a1,b1); // When Lfx>0, pole dominates bandwidth
- a1s = select2(Lfx>0,b1,a1); // When Lfx<0, zero dominates
- wx = 2*ma.PI*fx;
-};
-
-//--------------------`(fi.)peak_eq_cq`----------------------------
-// Constant-Q second order peaking equalizer section.
-//
-// #### Usage
-//
-// ```
-// _ : peak_eq_cq(Lfx,fx,Q) : _;
-// ```
-//
-// Where:
-//
-// * `Lfx`: level (dB) at fx
-// * `fx`: boost or cut frequency (Hz)
-// * `Q`: "Quality factor" = fx/B where B = bandwidth of peak in Hz
-//------------------------------------------------------------
-peak_eq_cq(Lfx,fx,Q) = peak_eq(Lfx,fx,fx/Q);
-
-//-------------------`(fi.)peak_eq_rm`--------------------------
-// Regalia-Mitra second order peaking equalizer section
-//
-// #### Usage
-//
-// ```
-// _ : peak_eq_rm(Lfx,fx,tanPiBT) : _;
-// ```
-//
-// Where:
-//
-// * `Lfx`: level (dB) at fx
-// * `fx`: boost or cut frequency (Hz)
-// * `tanPiBT`: `tan(PI*B/SR)`, where B = -3dB bandwidth (Hz) when 10^(Lfx/20) = 0
-// ~ PI*B/SR for narrow bandwidths B
-//
-// #### Reference
-// P.A. Regalia, S.K. Mitra, and P.P. Vaidyanathan,
-// "The Digital All-Pass Filter: A Versatile Signal Processing Building Block"
-// Proceedings of the IEEE, 76(1):19-37, Jan. 1988. (See pp. 29-30.)
-//------------------------------------------------------------
-peak_eq_rm(Lfx,fx,tanPiBT) = _ <: _,A,_ : +,- : *(0.5),*(K/2.0) : + with {
- A = tf2(k2, k1*(1+k2), 1, k1*(1+k2), k2) <: _,_; // allpass
- k1 = 0.0 - cos(2.0*ma.PI*fx/ma.SR);
- k2 = (1.0 - tanPiBT)/(1.0 + tanPiBT);
- K = ba.db2linear(Lfx);
-};
-
-
-//---------------------`(fi.)spectral_tilt`-------------------------
-// Spectral tilt filter, providing an arbitrary spectral rolloff factor
-// alpha in (-1,1), where
-// -1 corresponds to one pole (-6 dB per octave), and
-// +1 corresponds to one zero (+6 dB per octave).
-// In other words, alpha is the slope of the ln magnitude versus ln frequency.
-// For a "pinking filter" (e.g., to generate 1/f noise from white noise),
-// set alpha to -1/2.
-//
-// #### Usage
-//
-// ```
-// _ : spectral_tilt(N,f0,bw,alpha) : _
-// ```
-// Where:
-//
-// * `N`: desired integer filter order (fixed at compile time)
-// * `f0`: lower frequency limit for desired roll-off band
-// * `bw`: bandwidth of desired roll-off band
-// * `alpha`: slope of roll-off desired in nepers per neper
-// (ln mag / ln radian freq)
-//
-// #### Examples
-// See `spectral_tilt_demo`.
-//
-// #### Reference
-// J.O. Smith and H.F. Smith,
-// "Closed Form Fractional Integration and Differentiation via Real Exponentially Spaced Pole-Zero Pairs",
-// arXiv.org publication arXiv:1606.06154 [cs.CE], June 7, 2016,
-// http://arxiv.org/abs/1606.06154
-//------------------------------------------------------------
-spectral_tilt(N,f0,bw,alpha) = seq(i,N,sec(i)) with {
- sec(i) = g * tf1s(b1,b0,a0,1) with {
- g = a0/b0; // unity dc-gain scaling
- b1 = 1.0;
- b0 = mzh(i);
- a0 = mph(i);
- mzh(i) = prewarp(mz(i),ma.SR,w0); // prewarping for bilinear transform
- mph(i) = prewarp(mp(i),ma.SR,w0);
- prewarp(w,SR,wp) = wp * tan(w*T/2) / tan(wp*T/2) with { T = 1/ma.SR; };
- mz(i) = w0 * r ^ (-alpha+i); // minus zero i in s plane
- mp(i) = w0 * r ^ i; // minus pole i in s plane
- w0 = 2 * ma.PI * f0; // radian frequency of first pole
- f1 = f0 + bw; // upper band limit
- r = (f1/f0)^(1.0/float(N-1)); // pole ratio (2 => octave spacing)
- };
-};
-
-
-//----------------------`(fi.)levelfilter`----------------------
-// Dynamic level lowpass filter.
-// `levelfilter` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : levelfilter(L,freq) : _
-// ```
-//
-// Where:
-//
-// * `L`: desired level (in dB) at Nyquist limit (SR/2), e.g., -60
-// * `freq`: corner frequency (-3dB point) usually set to fundamental freq
-// * `N`: Number of filters in series where L = L/N
-//
-// #### Reference
-//
-//------------------------------------------------------------
-levelfilter(L,freq,x) = (L * L0 * x) + ((1.0-L) * lp2out(x))
-with {
- L0 = pow(L,1/3);
- Lw = ma.PI*freq/ma.SR; // = w1 T / 2
- Lgain = Lw / (1.0 + Lw);
- Lpole2 = (1.0 - Lw) / (1.0 + Lw);
- lp2out = *(Lgain) : + ~ *(Lpole2);
-};
-
-
-//----------------------`(fi.)levelfilterN`----------------------
-// Dynamic level lowpass filter.
-//
-// #### Usage
-//
-// ```
-// _ : levelfilterN(N,freq,L) : _
-// ```
-//
-// Where:
-//
-// * `L`: desired level (in dB) at Nyquist limit (SR/2), e.g., -60
-// * `freq`: corner frequency (-3dB point) usually set to fundamental freq
-// * `N`: Number of filters in series where L = L/N
-//
-// #### Reference
-//
-//------------------------------------------------------------
-levelfilterN(N,freq,L) = seq(i,N,levelfilter((L/N),freq));
-
-
-//=================================Mth-Octave Filter-Banks================================
-// Mth-octave filter-banks split the input signal into a bank of parallel signals, one
-// for each spectral band. They are related to the Mth-Octave Spectrum-Analyzers in
-// `analysis.lib`.
-// The documentation of this library contains more details about the implementation.
-// The parameters are:
-//
-// * `M`: number of band-slices per octave (>1)
-// * `N`: total number of bands (>2)
-// * `ftop`: upper bandlimit of the Mth-octave bands ( _),
- (par(i, 2*n+2, gainRight(360 * i / p)) :> _)
-with
-{
- p = 2*n+2;
-
- gainLeft(a) = _ * sin(ratio_minus + ratio_cortex)
- with
- {
- ratio_minus = ma.PI*.5 * abs( (30 + a) / 60 * ((a <= 30)) + (a - 330) / 60 * (a >= 330) );
- ratio_cortex= ma.PI*.5 * abs( (120 + a) / 150 * (a > 30) * (a <= 180));
- };
-
- gainRight(a) = _ * sin(ratio_minus + ratio_cortex)
- with
- {
- ratio_minus = ma.PI*.5 * abs( (390 - a) / 60 * (a >= 330) + (30 - a) / 60 * (a <= 30) );
- ratio_cortex= ma.PI*.5 * abs( (180 - a) / 150 * (a < 330) * (a >= 180));
- };
-};
-
-
-//============================Optimization Functions======================================
-// Functions to weight the circular harmonics signals depending to the
-// ambisonics optimization.
-// It can be `basic` for no optimization, `maxRe` or `inPhase`.
-//========================================================================================
-
-
-//----------------`(ho.)optimBasic`-------------------------
-// The basic optimization has no effect and should be used for a perfect
-// circle of loudspeakers with one listener at the perfect center loudspeakers
-// array.
-//
-// #### Usage
-//
-// ```
-// _ : optimBasic(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order
-//-----------------------------------------------------
-optimBasic(n) = par(i, 2*n+1, _);
-
-
-//----------------`(ho.)optimMaxRe`-------------------------
-// The maxRe optimization optimize energy vector. It should be used for an
-// auditory confined in the center of the loudspeakers array.
-//
-// #### Usage
-//
-// ```
-// _ : optimMaxRe(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order
-//-----------------------------------------------------
-optimMaxRe(n) = par(i, 2*n+1, optim(i, n, _))
- with {
- optim(i, n, _)= _ * cos(indexabs / (2*n+1) * ma.PI)
- with {
- numberOfharmonics = 2 *n + 1;
- indexabs = (int)((i - 1) / 2 + 1);
- };
- };
-
-
-//----------------`(ho.)optimInPhase`-------------------------
-// The inPhase Optimization optimize energy vector and put all loudspeakers signals
-// in phase. It should be used for an auditory.
-//
-// #### Usage
-//
-// ```
-// _ : optimInPhase(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order
-//-----------------------------------------------------
-optimInPhase(n) = par(i, 2*n+1, optim(i, n, _))
-with
-{
- optim(i, n, _)= _ * (fact(n)^2.) / (fact(n+indexabs) * fact(n-indexabs))
- with
- {
- indexabs = (int)((i - 1) / 2 + 1);
- fact(0) = 1;
- fact(n) = n * fact(n-1);
- };
- };
-
-
-//----------------`(ho.)wider`-------------------------
-// Can be used to wide the diffusion of a localized sound. The order
-// depending signals are weighted and appear in a logarithmic way to
-// have linear changes.
-//
-// #### Usage
-//
-// ```
-// _ : wider(n,w) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order
-// * `w`: the width value between 0 - 1
-//-----------------------------------------------------
-wider(n, w) = par(i, 2*n+1, perform(n, w, i, _))
-with
-{
- perform(n, w, i, _) = _ * (log(n+1) * (1 - w) + 1) * clipweight
- with
- {
- clipweight = weighter(n, w, i) * (weighter(n, w, i) > 0) * (weighter(n, w, i) <= 1) + (weighter(n, w, i) > 1)
- with
- {
- weighter(n, w, 0) = 1.;
- weighter(n, w, i) = (((w * log(n+1)) - log(indexabs)) / (log(indexabs+1) - log(indexabs)))
- with
- {
- indexabs = (int)((i - 1) / 2 + 1);
- };
- };
- };
-};
-
-
-
-//----------------`(ho.)map`-------------------------
-// It simulate the distance of the source by applying a gain
-// on the signal and a wider processing on the soundfield.
-//
-// #### Usage
-//
-// ```
-// map(n, x, r, a)
-// ```
-//
-// Where:
-//
-// * `n`: the order
-// * `x`: the signal
-// * `r`: the radius
-// * `a`: the angle in radian
-//-----------------------------------------------------
-map(n, x, r, a) = encoder(n, x * volume(r), a) : wider(n, ouverture(r))
-with
-{
- volume(r) = 1. / (r * r * (r > 1) + (r < 1));
- ouverture(r) = r * (r < 1) + (r > 1);
-};
-
-
-
-
-//----------------`(ho.)rotate`-------------------------
-// Rotates the sound field.
-//
-// #### Usage
-//
-// ```
-// _ : rotate(n, a) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order
-// * `a`: the angle in radian
-//-----------------------------------------------------
-rotate(n, a) = par(i, 2*n+1, _) <: par(i, 2*n+1, rotation(i, a))
-with
-{
- rotation(i, a) = (par(j, 2*n+1, gain1(i, j, a)), par(j, 2*n+1, gain2(i, j, a)), par(j, 2*n+1, gain3(i, j, a)) :> _)
- with
- {
- indexabs = (int)((i - 1) / 2 + 1);
- gain1(i, j, a) = _ * cos(a * indexabs) * (j == i);
- gain2(i, j, a) = _ * sin(a * indexabs) * (j-1 == i) * (j != 0) * (i%2 == 1);
- gain3(i, j, a) = (_ * sin(a * indexabs)) * (j+1 == i) * (j != 0) * (i%2 == 0);
- };
-};
diff --git a/Resources/Libs/instruments.lib b/Resources/Libs/instruments.lib
deleted file mode 100644
index c9518f9..0000000
--- a/Resources/Libs/instruments.lib
+++ /dev/null
@@ -1,262 +0,0 @@
-//instruments.lib - Faust function of various types useful for building physical model instruments
-
-declare name "Faust-STK Tools Library";
-declare author "Romain Michon (rmichon@ccrma.stanford.edu)";
-declare copyright "Romain Michon";
-declare version "1.0";
-declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license);
-
-no = library("noises.lib");
-en = library("envelopes.lib");
-ma = library("maths.lib");
-ba = library("basics.lib");
-de = library("delays.lib");
-si = library("signals.lib");
-fi = library("filters.lib");
-os = library("oscillators.lib");
-re = library("reverbs.lib");
-
-//========================= ENVELOPE GENERATORS ===============================
-
-//----------------------- VIBRATO ENVELOPE ----------------------------
-// 4 phases envelope to control vibrato gain
-//
-// USAGE:
-// _ : *(envVibrato(b,a,s,r,t)) : _
-// where
-// b = beginning duration (silence) in seconds
-// a = attack duration in seconds
-// s = sustain as a percentage of the amplitude to be modified
-// r = release duration in seconds
-// t = trigger signal
-
-envVibrato(b,a,s,r,t) = env ~ (_,_,_) : (!,!,_) // the 3 'state' signals are fed back
- with {
- env (p2,cnt,y) =
- (t>0) & (p2|(y>=1)),
- (cnt + 1)*(t>0), // counter for the first step "b"
- (y + p1*p3*u*(s/100) - p4*w*y)*((p4==0)|(y>=eps)) // y = envelop signal
- //*(y>=eps) // cut off tails to prevent denormals
- with {
- p1 = (p2==0) & (t>0) & (y<1) & (cnt>(b*ma.SR)); // p1 = attack phase
- p3 = 1-(cnt<(nb)); // p3 = beginning phase
- p4 = (t<=0) & (y>0); // p4 = release phase
- // #samples in attack, release, must be >0
- nb = ma.SR*b+(b==0.0) ; na = ma.SR*a+(a==0.0); nr = ma.SR*r+(r==0.0);
- // attack and (-60dB) release rates
- z = s+(s==0.0)*ba.db2linear(-60);
- u = 1/na; w = 1-1/pow(z*ba.db2linear(60), 1/nr);
- // values below this threshold are considered zero in the release phase
- eps = ba.db2linear(-120);
- };
- };
-
-//----------------------- ASYMPT60 ----------------------------
-// Envelope generator which asymptotically approaches a target value.
-//
-// USAGE:
-// asympT60(value,trgt,T60,trig) : _
-// where
-// value = starting value
-// trgt = target value
-// T60 = ramping time
-// trig = trigger signal
-
-asympT60(value,trgt,T60,trig) = (_*factor + constant)~_
- with {
- cntSample = *(trig) + 1~_ : -(1);
- attDur = float(2);
- cndFirst = ((cntSample < attDur) & (trig > 0));
- target = value*cndFirst + trgt*(cndFirst < 1);
- factorAtt = exp(-7/attDur);
- factorT60 = exp(-7/(T60*float(ma.SR)));
- factor = factorAtt*((cntSample < attDur) & (trig > 0)) +
- ((cntSample >= attDur) | (trig < 1))*factorT60;
- constant = (1 - factor)*target;
- };
-
-//========================= TABLES ===============================
-
-//----------------------- CLIPPING FUNCTION ----------------------------
-// Positive and negative clipping functions.
-//
-// USAGE:
-// _ : saturationPos : _
-// _ : saturationNeg : _
-// _ : saturationPos : saturationNeg : _
-
-saturationPos(x) = x <: (_>1),(_<=1 : *(x)) :> +;
-saturationNeg(x) = x <: (_<-1),(_>=-1 : *(x)) :> *(-1) + _;
-
-//----------------------- BOW TABLE ----------------------------
-// Simple bow table.
-//
-// USAGE:
-// index : bow(offset,slope) : _
-// where
-// 0 <= index <= 1
-
-bow(offset,slope) = pow(abs(sample) + 0.75, -4) : saturationPos
- with {
- sample(y) = (y + offset)*slope;
- };
-
-//----------------------- REED TABLE ----------------------------
-// Simple reed table to be used with waveguide models of clanrinet, saxophone, etc.
-//
-// USAGE:
-// _ : reed(offset,slope) : _
-// where
-// offset = offset between 0 and 1
-// slope = slope between 0 and 1
-// REFERENCE:
-// https://ccrma.stanford.edu/~jos/pasp/View_Single_Reed_Oscillation.html
-
-reed(offset,slope) = reedTable : saturationPos : saturationNeg
- with {
- reedTable = offset + (slope*_);
- };
-
-//========================= FILTERS ===============================
-
-//----------------------- ONE POLE ----------------------------
-
-onePole(b0,a1,x) = (b0*x - a1*_)~_;
-
-//----------------------- ONE POLE SWEPT ----------------------------
-
-onePoleSwep(a1,x) = (1 + a1)*x - a1*x';
-
-//----------------------- POLE ZERO ----------------------------
-
-poleZero(b0,b1,a1,x) = (b0*x + b1*x' - a1*_)~_;
-
-//----------------------- ONE ZEROS ----------------------------
-// Simple One zero and One zero recursive filters
-//
-// USAGE:
-// _ : oneZero0(b0,b1) : _
-// _ : oneZero1(b0,b1) : _
-// REFERENCE:
-// https://ccrma.stanford.edu/~jos/fp2/One_Zero.html
-
-oneZero0(b0,b1,x) = (*(b1) + x*b0)~_;
-oneZero1(b0,b1,x) = (x'*b1 + x*b0);
-
-//----------------------- BANDPASS FILTER WITH CONSTANT UNITY PEAK GAIN BASED ON A BIQUAD ----------------------------
-
-bandPass(resonance,radius) = fi.TF2(b0,b1,b2,a1,a2)
- with {
- a2 = radius*radius;
- a1 = -2*radius*cos(ma.PI*2*resonance/ma.SR);
- b0 = 0.5-0.5*a2;
- b1 = 0;
- b2 = -b0;
- };
-
-//----------------------- BANDPASS FILTER BASED ON A BIQUAD ----------------------------
-// Band pass filter using a biquad (TF2 is declared in filter.lib)
-//
-// USAGE:
-// _ : bandPassH(resonance,radius) : _
-// where
-// resonance = center frequency
-// radius = radius
-
-bandPassH(resonance,radius) = fi.TF2(b0,b1,b2,a1,a2)
- with {
- a2 = radius*radius;
- a1 = -2*radius*cos(ma.PI*2*resonance/ma.SR);
- b0 = 1;
- b1 = 0;
- b2 = 0;
- };
-
-//----------------------- FLUE JET NON-LINEAR FUNCTION ----------------------------
-// Jet Table: flue jet non-linear function, computed by a polynomial calculation
-
-jetTable(x) = x <: _*(_*_-1) : saturationPos : saturationNeg;
-
-//----------------------- NON LINEAR MODULATOR ----------------------------
-// nonLinearModulator adapts the function allpassnn from filter.lib for using it with waveguide instruments
-//
-// USAGE:
-// _ : nonLinearModulator(nonlinearity,env,freq,typeMod,freqMod,order) : _
-// where
-// nonlinearity = nonlinearity coefficient between 0 and 1
-// env = input to connect any kind of envelope
-// freq = current tone frequency
-// typeMod = if 0: theta is modulated by the incoming signal;
-// if 1: theta is modulated by the averaged incoming signal;
-// if 2: theta is modulated by the squared incoming signal;
-// if 3: theta is modulated by a sine wave of frequency freqMod;
-// if 4: theta is modulated by a sine wave of frequency freq;
-// freqMod = frequency of the sine wave modulation
-// order = order of the filter
-
-nonLinearModulator(nonlinearity,env,freq,typeMod,freqMod,order) =
- //theta is modulated by a sine wave
- _ <: nonLinearFilterOsc*(typeMod >= 3),
- //theta is modulated by the incoming signal
- (_ <: nonLinearFilterSig*nonlinearity,_*(1 - nonlinearity) :> +)*(typeMod < 3)
- :> +
- with {
- //which frequency to use for the sine wave oscillator?
- freqOscMod = (typeMod == 4)*freq + (typeMod != 4)*freqMod;
-
- //the incoming signal is scaled and the envelope is applied
- tsignorm(x) = nonlinearity*ma.PI*x*env;
- tsigsquared(x) = nonlinearity*ma.PI*x*x*env; //incoming signal is squared
- tsigav(x) = nonlinearity*ma.PI*((x + x')/2)*env; //incoming signal is averaged with its previous sample
-
- //select which version of the incoming signal of theta to use
- tsig(x) = tsignorm(x)*(typeMod == 0) + tsigav(x)*(typeMod == 1)
- + tsigsquared(x)*(typeMod == 2);
-
- //theta is modulated by a sine wave generator
- tosc = nonlinearity*ma.PI*os.osc(freqOscMod)*env;
-
- //incoming signal is sent to the nonlinear passive allpass ladder filter
- nonLinearFilterSig(x) = x <: fi.allpassnn(order,(par(i,order,tsig(x))));
- nonLinearFilterOsc = _ <: fi.allpassnn(order,(par(i,order,tosc)));
- };
-
-//========================= TOOLS ===============================
-
-//----------------------- STEREOIZER ----------------------------
-// This function takes a mono input signal and spacialize it in stereo
-// in function of the period duration of the tone being played.
-//
-// USAGE:
-// _ : stereo(periodDuration) : _,_
-// where
-// periodDuration = period duration of the tone being played in number of samples
-// REFERENCE:
-// https://ccrma.stanford.edu/realsimple/faust_strings/
-
-stereoizer(periodDuration) = _ <: _,widthdelay : stereopanner
- with {
- W = hslider("v:Spat/spatial width", 0.5, 0, 1, 0.01);
- A = hslider("v:Spat/pan angle", 0.6, 0, 1, 0.01);
- widthdelay = de.delay(4096,W*periodDuration/2);
- stereopanner = _,_ : *(1.0-A), *(A);
- };
-
-//----------------------- INSTRREVERB ----------------------------
-// GUI for zita_rev1_stereo from reverbs.lib
-//
-// USAGE:
-// _,_ : instrRerveb
-
-instrReverb = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) :
-re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+
- with {
- reverbGain = hslider("v:Reverb/reverbGain",0.137,0,1,0.01) : si.smoo;
- roomSize = hslider("v:Reverb/roomSize",0.72,0.01,2,0.01);
- rdel = 20;
- f1 = 200;
- f2 = 6000;
- t60dc = roomSize*3;
- t60m = roomSize*2;
- fsmax = 48000;
- };
diff --git a/Resources/Libs/maths.lib b/Resources/Libs/maths.lib
deleted file mode 100644
index 90d0d36..0000000
--- a/Resources/Libs/maths.lib
+++ /dev/null
@@ -1,613 +0,0 @@
-//################################### maths.lib ##########################################
-// Mathematic library for Faust. Its official prefix is `ma`.
-//########################################################################################
-// Some functions are implemented as Faust foreign functions of `math.h` functions
-// that are not part of Faust's primitives. Defines also various constants and several
-// utilities.
-//########################################################################################
-
-// ## History
-// * 06/13/2016 [RM] normalizing and integrating to new libraries
-// * 07/08/2015 [YO] documentation comments
-// * 20/06/2014 [SL] added FTZ function
-// * 20/06/2014 [SL] added FTZ function
-// * 22/06/2013 [YO] added float|double|quad variants of some foreign functions
-// * 28/06/2005 [YO] postfixed functions with 'f' to force float version instead of double
-// * 28/06/2005 [YO] removed 'modf' because it requires a pointer as argument
-
-/************************************************************************
-************************************************************************
-FAUST library file
-Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale
-----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-declare name "Faust Math Library";
-declare version "2.1";
-declare author "GRAME";
-declare copyright "GRAME";
-declare license "LGPL with exception";
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-
-//---------------------------------`(ma.)SR`---------------------------------------
-// Current sampling rate (between 1000Hz and 192000Hz). Constant during
-// program execution.
-//
-// #### Usage
-//
-// ```
-// SR : _
-// ```
-//-----------------------------------------------------------------------------
-SR = min(192000.0, max(1.0, fconstant(int fSamplingFreq, )));
-
-
-//---------------------------------`(ma.)BS`---------------------------------------
-// Current block-size. Can change during the execution.
-//
-// #### Usage
-//
-// ```
-// BS : _
-// ```
-//-----------------------------------------------------------------------------
-BS = fvariable(int count, );
-
-
-//---------------------------------`(ma.)PI`---------------------------------------
-// Constant PI in double precisio.n
-//
-// #### Usage
-//
-// ```
-// PI : _
-// ```
-//-----------------------------------------------------------------------------
-PI = 3.1415926535897932385;
-
-
-//---------------------------------`(ma.)FTZ`---------------------------------------
-// Flush to zero: force samples under the "maximum subnormal number"
-// to be zero. Usually not needed in C++ because the architecture
-// file take care of this, but can be useful in javascript for instance.
-//
-// #### Usage
-//
-// ```
-// _ : ftz : _
-// ```
-//
-// See :
-//-----------------------------------------------------------------------------
-FTZ(x) = x * (abs(x) > 1.17549435e-38);
-
-
-//---------------------------------`(ma.)neg`---------------------------------------
-// Invert the sign (-x) of a signal.
-//
-// #### Usage
-//
-// ```
-// _ : neg : _
-// ```
-//-----------------------------------------------------------------------------
-neg(x) = -x;
-
-
-//-------`(ma.)sub(x,y)`------------------
-// Subtract `x` and `y`.
-//------------------------------
-sub(x,y) = y-x;
-
-
-//---------------------------------`(ma.)inv`---------------------------------------
-// Compute the inverse (1/x) of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : inv : _
-// ```
-//-----------------------------------------------------------------------------
-inv(x) = 1/x;
-
-
-//---------------------------------`(ma.)cbrt`--------------------------------------
-// Computes the cube root of of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : cbrt : _
-// ```
-//-----------------------------------------------------------------------------
-cbrt = ffunction(float cbrtf|cbrt|cbrtl (float), ,"");
-
-
-//---------------------------------`(ma.)hypot`-------------------------------------
-// Computes the euclidian distance of the two input signals
-// sqrt(x*x+y*y) without undue overflow or underflow.
-//
-// #### Usage
-//
-// ```
-// _,_ : hypot : _
-// ```
-//-----------------------------------------------------------------------------
-hypot = ffunction(float hypotf|hypot|hypotl (float, float), ,"");
-
-
-//---------------------------------`(ma.)ldexp`-------------------------------------
-// Takes two input signals: x and n, and multiplies x by 2 to the power n.
-//
-// #### Usage
-//
-// ```
-// _,_ : ldexp : _
-// ```
-//-----------------------------------------------------------------------------
-ldexp = ffunction(float ldexpf|ldexp|ldexpl (float, int), ,"");
-
-
-//---------------------------------`(ma.)scalb`-------------------------------------
-// Takes two input signals: x and n, and multiplies x by 2 to the power n.
-//
-// #### Usage
-//
-// ```
-// _,_ : scalb : _
-// ```
-//-----------------------------------------------------------------------------
-scalb = ffunction(float scalbnf|scalbn|scalbnl (float, int), ,"");
-
-
-//---------------------------------`(ma.)log1p`----------------------------------
-// Computes log(1 + x) without undue loss of accuracy when x is nearly zero.
-//
-// #### Usage
-//
-// ```
-// _ : log1p : _
-// ```
-//-----------------------------------------------------------------------------
-log1p = ffunction(float log1pf|log1p|log1pl (float), ,"");
-
-
-//---------------------------------`(ma.)logb`---------------------------------------
-// Return exponent of the input signal as a floating-point number.
-//
-// #### Usage
-//
-// ```
-// _ : logb : _
-// ```
-//-----------------------------------------------------------------------------
-logb = ffunction(float logbf|logb|logbl (float), ,"");
-
-
-//---------------------------------`(ma.)ilogb`-------------------------------------
-// Return exponent of the input signal as an integer number.
-//
-// #### Usage
-//
-// ```
-// _ : ilogb : _
-// ```
-//-----------------------------------------------------------------------------
-ilogb = ffunction(int ilogbf|ilogb|ilogbl (float), ,"");
-
-
-//---------------------------------`(ma.)log2`-------------------------------------
-// Returns the base 2 logarithm of x.
-//
-// #### Usage
-//
-// ```
-// _ : log2 : _
-// ```
-//-----------------------------------------------------------------------------
-log2(x) = log(x)/log(2.0);
-
-
-//---------------------------------`(ma.)expm1`-------------------------------------
-// Return exponent of the input signal minus 1 with better precision.
-//
-// #### Usage
-//
-// ```
-// _ : expm1 : _
-// ```
-//-----------------------------------------------------------------------------
-expm1 = ffunction(float expm1f|expm1|expm1l (float), ,"");
-
-
-//---------------------------------`(ma.)acosh`-------------------------------------
-// Computes the principle value of the inverse hyperbolic cosine
-// of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : acosh : _
-// ```
-//-----------------------------------------------------------------------------
-acosh = ffunction(float acoshf|acosh|acoshl (float), , "");
-
-
-//--------------------------------`(ma.)asinh`-----------------------------------
-// Computes the inverse hyperbolic sine of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : asinh : _
-// ```
-//-----------------------------------------------------------------------------
-asinh = ffunction(float asinhf|asinh|asinhl (float), , "");
-
-
-//--------------------------------`(ma.)atanh`-----------------------------------
-// Computes the inverse hyperbolic tangent of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : atanh : _
-// ```
-//-----------------------------------------------------------------------------
-atanh = ffunction(float atanhf|atanh|atanhl (float), , "");
-
-
-//---------------------------------`(ma.)sinh`---------------------------------------
-// Computes the hyperbolic sine of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : sinh : _
-// ```
-//-----------------------------------------------------------------------------
-sinh = ffunction(float sinhf|sinh|sinhl (float), , "");
-
-
-//---------------------------------`(ma.)cosh`--------------------------------------
-// Computes the hyperbolic cosine of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : cosh : _
-// ```
-//-----------------------------------------------------------------------------
-cosh = ffunction(float coshf|cosh|coshl (float), , "");
-
-
-//---------------------------------`(ma.)tanh`--------------------------------------
-// Computes the hyperbolic tangent of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : tanh : _
-// ```
-//-----------------------------------------------------------------------------
-tanh = ffunction(float tanhf|tanh|tanhl (float), ,"");
-
-
-//---------------------------------`(ma.)erf`---------------------------------------
-// Computes the error function of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : erf : _
-// ```
-//-----------------------------------------------------------------------------
-erf = ffunction(float erff|erf|erfl(float), ,"");
-
-
-//---------------------------------`(ma.)erfc`---------------------------------------
-// Computes the complementary error function of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : erfc : _
-// ```
-//-----------------------------------------------------------------------------
-erfc = ffunction(float erfcf|erfc|erfcl(float), ,"");
-
-
-//---------------------------------`(ma.)gamma`-------------------------------------
-// Computes the gamma function of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : gamma : _
-// ```
-//-----------------------------------------------------------------------------
-gamma = ffunction(float tgammaf|tgamma|tgammal(float), ,"");
-
-
-//---------------------------------`(ma.)lgamma`------------------------------------
-// Calculates the natural logorithm of the absolute value of
-// the gamma function of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : lgamma : _
-// ```
-//-----------------------------------------------------------------------------
-lgamma = ffunction(float lgammaf|lgamma|lgammal(float), ,"");
-
-
-//----------------------------------`(ma.)J0`---------------------------------------
-// Computes the Bessel function of the first kind of order 0
-// of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : J0 : _
-// ```
-//-----------------------------------------------------------------------------
-J0 = ffunction(float j0(float), ,"");
-
-
-//----------------------------------`(ma.)J1`---------------------------------------
-// Computes the Bessel function of the first kind of order 1
-// of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : J1 : _
-// ```
-//-----------------------------------------------------------------------------
-J1 = ffunction(float j1(float), ,"");
-
-
-//----------------------------------`(ma.)Jn`---------------------------------------
-// Computes the Bessel function of the first kind of order n
-// (first input signal) of the second input signal.
-//
-// #### Usage
-//
-// ```
-// _,_ : Jn : _
-// ```
-//-----------------------------------------------------------------------------
-Jn = ffunction(float jn(int, float), ,"");
-
-
-//----------------------------------`(ma.)Y0`---------------------------------------
-// Computes the linearly independent Bessel function of the second kind
-// of order 0 of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : Y0 : _
-// ```
-//-----------------------------------------------------------------------------
-Y0 = ffunction(float y0(float), ,"");
-
-
-//----------------------------------`(ma.)Y1`---------------------------------------
-// Computes the linearly independent Bessel function of the second kind
-// of order 1 of the input signal.
-//
-// #### Usage
-//
-// ```
-// _ : Y0 : _
-// ```
-//-----------------------------------------------------------------------------
-Y1 = ffunction(float y1(float), ,"");
-
-
-//----------------------------------`(ma.)Yn`---------------------------------------
-// Computes the linearly independent Bessel function of the second kind
-// of order n (first input signal) of the second input signal.
-//
-// #### Usage
-//
-// ```
-// _,_ : Yn : _
-// ```
-//-----------------------------------------------------------------------------
-Yn = ffunction(float yn(int, float), ,"");
-
-
-//----------------------------`(ma.)fabs`, `(ma.)fmax`, `(ma.)fmin`---------------------------
-// Just for compatibility...
-//
-// ```
-// fabs = abs
-// fmax = max
-// fmin = min
-// ```
-//-----------------------------------------------------------------------------
-fabs = abs;
-fmax = max;
-fmin = min;
-
-//-------------------------------`(ma.)np2`--------------------------------------
-// Gives the next power of 2 of x.
-//
-// #### Usage
-//
-// ```
-// np2(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: an integer
-//-----------------------------------------------------------------------------
-np2 = -(1) <: >>(1)|_ <: >>(2)|_ <: >>(4)|_ <: >>(8)|_ <: >>(16)|_ : +(1);
-
-
-//-----------------------------`(ma.)frac`---------------------------------------
-// Gives the fractional part of n.
-//
-// #### Usage
-//
-// ```
-// frac(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: a decimal number
-//------------------------------------------------------------------------------
-frac(n) = n - floor(n);
-decimal = frac;
-// NOTE: decimal does the same thing as frac but using floor instead. JOS uses frac a lot
-// in filters.lib so we decided to keep that one... decimal is declared though for
-// backward compatibility.
-// decimal(n) = n - floor(n);
-
-//-------------------------------`(ma.)modulo`---------------------------------------
-// Modulus operation.
-//
-// #### Usage
-//
-// ```
-// modulo(x,N) : _
-// ```
-//
-// Where:
-//
-// * `x`: the numerator
-// * `N`: the denominator
-//------------------------------------------------------------------------------
-modulo(x,N) = (x % N + N) % N;
-
-
-//---------------`(ma.)isnan`----------------
-// Return non-zero if and only if x is a NaN.
-//
-// #### Usage
-//
-// ```
-// isnan(x)
-// _ : isnan : _
-// ```
-//
-// Where:
-//
-// * `x`: signal to analyse
-//------------------------------------------
-isnan = ffunction(int isnan (float),,"");
-nextafter = ffunction(float nextafter(float, float),,"");
-
-
-//---------------------------`(ma.)chebychev`-------------------------------
-// Chebychev transformation of order n.
-//
-// #### Usage
-//
-// ```
-// _ : chebychev(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: the order of the polynomial
-//
-// #### Semantics
-//
-// ```
-// T[0](x) = 1,
-// T[1](x) = x,
-// T[n](x) = 2x*T[n-1](x) - T[n-2](x)
-// ```
-//
-// #### Reference
-//
-//
-//-------------------------------------------------------------------------
-chebychev(0) = !:1;
-chebychev(1) = _;
-chebychev(n) = _ <: *(2)*chebychev(n-1)-chebychev(n-2);
-
-
-
-//------------------------`(ma.)chebychevpoly`-------------------------------
-// Linear combination of the first Chebyshev polynomials.
-//
-// #### Usage
-//
-// ```
-// _ : chebychevpoly((c0,c1,...,cn)) : _
-// ```
-//
-// Where:
-//
-// * `cn`: the different Chebychevs polynomials such that:
-// chebychevpoly((c0,c1,...,cn)) = Sum of chebychev(i)*ci
-//
-// #### Reference
-//
-//
-//-------------------------------------------------------------------------
-chebychevpoly(lcoef) = _ <: L(0,lcoef) :> _
- with {
- L(n,(c,cs)) = chebychev(n)*c, L(n+1,cs);
- L(n,c) = chebychev(n)*c;
- };
-
-
-//------------------`(ma.)diffn`----------------------------
-// Negated first-order difference.
-//
-// #### Usage
-//
-// ```
-// _ : diffn : _
-// ```
-//--------------------------------------------------------
-diffn(x) = x' - x; // negated first-order difference
-
-//------------------`(ma.)signum`----------------------------
-// The signum function signum(x) is defined as
-// -1 for x<0, 0 for x==0, and 1 for x>0;
-//
-// #### Usage
-//
-// ```
-// _ : signum : _
-// ```
-//--------------------------------------------------------
-signum(x) = (x>0)-(x<0);
diff --git a/Resources/Libs/maxmsp.lib b/Resources/Libs/maxmsp.lib
deleted file mode 100644
index 8e8b88e..0000000
--- a/Resources/Libs/maxmsp.lib
+++ /dev/null
@@ -1,220 +0,0 @@
-/************************************************************************
- ************************************************************************
- FAUST library file
- Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale
- ---------------------------------------------------------------------
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA.
- ************************************************************************
- ************************************************************************/
-
-declare name "MaxMSP compatibility Library";
-declare author "GRAME";
-declare copyright "GRAME";
-declare version "1.1";
-declare license "LGPL";
-
-ba = library("basics.lib");
-ma = library("maths.lib");
-
-atodb = db2lin;
-
-//-------------------------------------------------------------------------
-//
-// Implementation of MaxMSP filtercoeff
-//
-// from : Cookbook formulae for audio EQ biquad filter coefficients
-// by : Robert Bristow-Johnson
-// URL : http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
-//
-//-------------------------------------------------------------------------
-
-filtercoeff(f0, dBgain, Q) = environment
-{
- //----------------------------------------
- // biquad coeffs for various filters
- // usage : filtercoeff(f0, dBgain, Q).LPF
- //----------------------------------------
-
- LPF = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = (1 - cos(w0))/2;
- b1 = 1 - cos(w0);
- b2 = (1 - cos(w0))/2;
- a0 = 1 + alpha;
- a1 = -2*cos(w0);
- a2 = 1 - alpha;
- };
-
- HPF = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = (1 + cos(w0))/2;
- b1 = -1 - cos(w0);
- b2 = (1 + cos(w0))/2;
- a0 = 1 + alpha;
- a1 = -2*cos(w0);
- a2 = 1 - alpha;
- };
-
- BPF = rbjcoef( a0, a1, a2, b0, b1, b2 ) // constant 0 dB peak gain
- with {
- b0 = alpha;
- b1 = 0;
- b2 = -alpha;
- a0 = 1 + alpha;
- a1 = -2*cos(w0);
- a2 = 1 - alpha;
- };
-
- notch = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = 1;
- b1 = -2*cos(w0);
- b2 = 1;
- a0 = 1 + alpha;
- a1 = -2*cos(w0);
- a2 = 1 - alpha;
- };
-
- APF = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = 1 - alpha;
- b1 = -2*cos(w0);
- b2 = 1 + alpha;
- a0 = 1 + alpha;
- a1 = -2*cos(w0);
- a2 = 1 - alpha;
- };
-
- peakingEQ = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = 1 + alpha*A;
- b1 = -2*cos(w0);
- b2 = 1 - alpha*A;
- a0 = 1 + alpha/A;
- a1 = -2*cos(w0);
- a2 = 1 - alpha/A;
- };
-
- peakNotch = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = 1 + alpha*G;
- b1 = -2*cos(w0);
- b2 = 1 - alpha*G;
- a0 = 1 + alpha/G;
- a1 = -2*cos(w0);
- a2 = 1 - alpha/G;
- };
-
- lowShelf = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = A*( (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha );
- b1 = 2*A*( (A-1) - (A+1)*cos(w0) );
- b2 = A*( (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha );
- a0 = (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha;
- a1 = -2*( (A-1) + (A+1)*cos(w0) );
- a2 = (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha;
- };
-
- highShelf = rbjcoef( a0, a1, a2, b0, b1, b2 )
- with {
- b0 = A*( (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha );
- b1 = -2*A*( (A-1) + (A+1)*cos(w0) );
- b2 = A*( (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha );
- a0 = (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha;
- a1 = 2*( (A-1) - (A+1)*cos(w0) );
- a2 = (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha;
- };
-
- // --------------------- implementation ------------------------------
-
- // convert rbj coeffs to biquad coeffs
- rbjcoef(a0,a1,a2,b0,b1,b2) = (b0/a0, b1/a0, b2/a0, a1/a0, a2/a0);
-
- // common values
-// alpha = sin(w0)/(2*Q);
-// w0 = 2*ma.PI*f0/Fs;
- alpha = sin(w0)/(2*max(0.001,Q));
- w0 = 2*ma.PI*max(0,f0)/Fs;
- Fs = ma.SR;
- A = 10^(dBgain/40); // (for peaking and shelving EQ filters only)
- G = sqrt(max(0.00001, dBgain)); // When gain is a linear values (i.e. not in dB)
-};
-
-
-//-------------------------------------------------------------------------
-// Implementation of MaxMSP biquad~
-// y[n] = a0 * x[n] + a1 * x[n-1] + a2 * x[n-2] - b1 * y[n-1] - b2 * y[n-2]
-//-------------------------------------------------------------------------
-
-biquad(x,a0,a1,a2,b1,b2) = x : + ~ ((-1)*conv2(b1, b2)) : conv3(a0, a1, a2)
- with {
- conv2(c0,c1,x) = c0*x+c1*x';
- conv3(c0,c1,c2,x) = c0*x+c1*x'+c2*x'';
- };
-
-//-------------------------------------------------------------------------
-//
-// Filters using filtercoeff and biquad
-//
-//-------------------------------------------------------------------------
-
-// Low Pass Filter
-LPF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).LPF : biquad;
-
-// High Pass Filter
-HPF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).HPF : biquad;
-
-// Band Pass Filter
-BPF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).BPF : biquad;
-
-// notch Filter
-notch(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).notch : biquad;
-
-// All Pass Filter
-APF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).APF : biquad;
-
-// ????
-peakingEQ(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).peakingEQ : biquad;
-
-// Max peakNotch is like peakingEQ but with a linear gain
-peakNotch(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).peakNotch : biquad;
-
-// ????
-lowShelf(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).lowShelf : biquad;
-
-// ????
-highShelf(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).highShelf : biquad;
-
-
-//-------------------------------------------------------------------------
-// Implementation of Max/MSP line~. Generate signal ramp or envelope
-//
-// USAGE : line(value, time)
-// value : the desired output value
-// time : the interpolation time to reach this value (in milliseconds)
-//
-// NOTE : the interpolation process is restarted every time the desired
-// output value changes. The interpolation time is sampled only then.
-//-------------------------------------------------------------------------
-
-line (value, time) = state~(_,_):!,_
- with {
- state (t, c) = nt, ba.if (nt <= 0, value, c+(value - c) / nt)
- with {
- nt = ba.if( value != value', samples, t-1);
- samples = time*ma.SR/1000.0;
- };
- };
diff --git a/Resources/Libs/misceffects.lib b/Resources/Libs/misceffects.lib
deleted file mode 100644
index a28e4b8..0000000
--- a/Resources/Libs/misceffects.lib
+++ /dev/null
@@ -1,461 +0,0 @@
-//################################## misceffects.lib ##########################################
-// This library contains a collection of audio effects. Its official prefix is `ef`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file
-Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale
-----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-de = library("delays.lib");
-si = library("signals.lib");
-an = library("analyzers.lib");
-fi = library("filters.lib");
-
-
-declare name "Faust Math Library";
-declare version "2.0"; // TODO to check
-
-//======================================Dynamic===========================================
-//========================================================================================
-
-//---------------------`(ef.)cubicnl`-----------------------
-// Cubic nonlinearity distortion.
-// `cubicnl` is a standard Faust library.
-//
-// #### Usage:
-//
-// ```
-// _ : cubicnl(drive,offset) : _
-// _ : cubicnl_nodc(drive,offset) : _
-// ```
-//
-// Where:
-//
-// * `drive`: distortion amount, between 0 and 1
-// * `offset`: constant added before nonlinearity to give even harmonics. Note: offset
-// can introduce a nonzero mean - feed cubicnl output to dcblocker to remove this.
-//
-// #### References:
-//
-// *
-// *
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-cubicnl(drive,offset) = *(pregain) : +(offset) : clip(-1,1) : cubic
-with {
- pregain = pow(10.0,2*drive);
- clip(lo,hi) = min(hi) : max(lo);
- cubic(x) = x - x*x*x/3;
- postgain = max(1.0,1.0/pregain);
-};
-
-cubicnl_nodc(drive,offset) = cubicnl(drive,offset) : fi.dcblocker;
-
-
-//-----------------`(ef.)gate_mono`-------------------
-// Mono signal gate.
-// `gate_mono` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : gate_mono(thresh,att,hold,rel) : _
-// ```
-//
-// Where:
-//
-// * `thresh`: dB level threshold above which gate opens (e.g., -60 dB)
-// * `att`: attack time = time constant (sec) for gate to open (e.g., 0.0001 s = 0.1 ms)
-// * `hold`: hold time = time (sec) gate stays open after signal level < thresh (e.g., 0.1 s)
-// * `rel`: release time = time constant (sec) for gate to close (e.g., 0.020 s = 20 ms)
-//
-// #### References
-//
-// *
-// *
-// *
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-gate_mono(thresh,att,hold,rel,x) = x * gate_gain_mono(thresh,att,hold,rel,x);
-
-
-//-----------------`(ef.)gate_stereo`-------------------
-// Stereo signal gates.
-// `gate_stereo` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _,_ : gate_stereo(thresh,att,hold,rel) : _,_
-// ```
-//
-// Where:
-//
-// * `thresh`: dB level threshold above which gate opens (e.g., -60 dB)
-// * `att`: attack time = time constant (sec) for gate to open (e.g., 0.0001 s = 0.1 ms)
-// * `hold`: hold time = time (sec) gate stays open after signal level < thresh (e.g., 0.1 s)
-// * `rel`: release time = time constant (sec) for gate to close (e.g., 0.020 s = 20 ms)
-//
-// #### References
-//
-// *
-// *
-// *
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-gate_stereo(thresh,att,hold,rel,x,y) = ggm*x, ggm*y with {
- ggm = gate_gain_mono(thresh,att,hold,rel,abs(x)+abs(y));
-};
-
-gate_gain_mono(thresh,att,hold,rel,x) = x : extendedrawgate : an.amp_follower_ar(att,rel) with {
- extendedrawgate(x) = max(float(rawgatesig(x)),holdsig(x));
- rawgatesig(x) = inlevel(x) > ba.db2linear(thresh);
- minrate = min(att,rel);
- inlevel = an.amp_follower_ar(minrate,minrate);
- holdcounter(x) = (max(holdreset(x) * holdsamps,_) ~-(1));
- holdsig(x) = holdcounter(x) > 0;
- holdreset(x) = rawgatesig(x) < rawgatesig(x)'; // reset hold when raw gate falls
- holdsamps = int(hold*ma.SR);
-};
-
-
-//=====================================Filtering==========================================
-//========================================================================================
-
-//-------------------------`(ef.)speakerbp`-------------------------------
-// Dirt-simple speaker simulator (overall bandpass eq with observed
-// roll-offs above and below the passband).
-//
-// Low-frequency speaker model = +12 dB/octave slope breaking to
-// flat near f1. Implemented using two dc blockers in series.
-//
-// High-frequency model = -24 dB/octave slope implemented using a
-// fourth-order Butterworth lowpass.
-//
-// Example based on measured Celestion G12 (12" speaker):
-//
-// `speakerbp` is a standard Faust function
-//
-// #### Usage
-//
-// ```
-// speakerbp(f1,f2)
-// _ : speakerbp(130,5000) : _
-// ```
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-// TODO: perhaps this should be moved to physmodels.lib
-speakerbp(f1,f2) = fi.dcblockerat(f1) : fi.dcblockerat(f1) : fi.lowpass(4,f2);
-
-
-//------------`(ef.)piano_dispersion_filter`---------------
-// Piano dispersion allpass filter in closed form.
-//
-// #### Usage
-//
-// ```
-// piano_dispersion_filter(M,B,f0)
-// _ : piano_dispersion_filter(1,B,f0) : +(totalDelay),_ : fdelay(maxDelay) : _
-// ```
-//
-// Where:
-//
-// * `M`: number of first-order allpass sections (compile-time only)
-// Keep below 20. 8 is typical for medium-sized piano strings.
-// * `B`: string inharmonicity coefficient (0.0001 is typical)
-// * `f0`: fundamental frequency in Hz
-//
-// #### Outputs
-//
-// * MINUS the estimated delay at `f0` of allpass chain in samples,
-// provided in negative form to facilitate subtraction
-// from delay-line length.
-// * Output signal from allpass chain
-
-// #### Reference
-//
-// * "Dispersion Modeling in Waveguide Piano Synthesis Using Tunable
-// Allpass Filters", by Jukka Rauhala and Vesa Valimaki, DAFX-2006, pp. 71-76
-// * (An erratum in Eq. (7)
-// is corrected in Dr. Rauhala's encompassing dissertation (and below).)
-// *
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-// TODO: perhaps this should be moved to physmodels.lib?
-piano_dispersion_filter(M,B,f0) = -Df0*M,seq(i,M,fi.tf1(a1,1,a1))
-with {
- a1 = (1-D)/(1+D); // By Eq. 3, have D >= 0, hence a1 >= 0 also
- D = exp(Cd - Ikey(f0)*kd);
- trt = pow(2.0,1.0/12.0); // 12th root of 2
- logb(b,x) = log(x) / log(b); // log-base-b of x
- Ikey(f0) = logb(trt,f0*trt/27.5);
- Bc = max(B,0.000001);
- kd = exp(k1*log(Bc)*log(Bc) + k2*log(Bc)+k3);
- Cd = exp((m1*log(M)+m2)*log(Bc)+m3*log(M)+m4);
- k1 = -0.00179;
- k2 = -0.0233;
- k3 = -2.93;
- m1 = 0.0126;
- m2 = 0.0606;
- m3 = -0.00825;
- m4 = 1.97;
- wT = 2*ma.PI*f0/ma.SR;
- polydel(a) = atan(sin(wT)/(a+cos(wT)))/wT;
- Df0 = polydel(a1) - polydel(1.0/a1);
-};
-
-
-//-------------------------`(ef.)stereo_width`---------------------------
-// Stereo Width effect using the Blumlein Shuffler technique.
-// `stereo_width` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _,_ : stereo_width(w) : _,_
-// ```
-//
-// Where:
-//
-// * `w`: stereo width between 0 and 1
-//
-// At `w=0`, the output signal is mono ((left+right)/2 in both channels).
-// At `w=1`, there is no effect (original stereo image).
-// Thus, w between 0 and 1 varies stereo width from 0 to "original".
-//
-// #### Reference
-//
-// * "Applications of Blumlein Shuffling to Stereo Microphone Techniques"
-// Michael A. Gerzon, JAES vol. 42, no. 6, June 1994
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-stereo_width(w) = shuffle : *(mgain),*(sgain) : shuffle
-with {
- shuffle = _,_ <: +,-; // normally scaled by 1/sqrt(2) for orthonormality,
- mgain = 1-w/2; // but we pick up the needed normalization here.
- sgain = w/2;
-};
-
-
-//========================================Time Based======================================
-//========================================================================================
-
-//----------`(ef.)echo`----------
-// A simple echo effect.
-//
-// `echo` is a standard Faust function
-//
-// #### Usage
-//
-// ```
-// _ : echo(maxDuration,duration,feedback) : _
-// ```
-//
-// Where:
-//
-// * `maxDuration`: the max echo duration in seconds
-// * `duration`: the echo duration in seconds
-// * `feedback`: the feedback coefficient
-//----------------------------------------------------
-// TODO: author RM
-echo(maxDuration,duration,feedback) = +~(de.fdelay1(N,n)*feedback)
-with{
- // compute the next power of 2 of maxDuration
- N = maxDuration : ba.sec2samp : int : ma.np2 : max(1);
- n = duration : ba.sec2samp;
-};
-
-// TODO demo function for echo
-
-//=======================================Pitch Shifting===================================
-//========================================================================================
-
-//--------------`(ef.)transpose`----------------
-// A simple pitch shifter based on 2 delay lines.
-// `transpose` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : transpose(w, x, s) : _
-// ```
-//
-// Where:
-//
-// * `w`: the window length (samples)
-// * `x`: crossfade duration duration (samples)
-// * `s`: shift (semitones)
-//-----------------------------------------
-transpose(w, x, s, sig) = de.fdelay(maxDelay,d,sig)*ma.fmin(d/x,1) +
- de.fdelay(maxDelay,d+w,sig)*(1-ma.fmin(d/x,1))
-with {
- maxDelay = 65536;
- i = 1 - pow(2, s/12);
- d = i : (+ : +(w) : fmod(_,w)) ~ _;
-};
-
-
-//===========================================Meshes=======================================
-//========================================================================================
-
-
-// TODO: the following should be in physmodels.lib when it will be operational
-//----------------------------------`(ef.)mesh_square`------------------------------
-// Square Rectangular Digital Waveguide Mesh.
-//
-// #### Usage
-//
-// ```
-// bus(4*N) : mesh_square(N) : bus(4*N);
-// ```
-//
-// Where:
-//
-// * `N`: number of nodes along each edge - a power of two (1,2,4,8,...)
-//
-// #### Reference
-//
-//
-//
-// #### Signal Order In and Out
-//
-// The mesh is constructed recursively using 2x2 embeddings. Thus,
-// the top level of `mesh_square(M)` is a block 2x2 mesh, where each
-// block is a `mesh(M/2)`. Let these blocks be numbered 1,2,3,4 in the
-// geometry NW,NE,SW,SE, i.e., as
-// 1 2
-// 3 4
-// Each block has four vector inputs and four vector outputs, where the
-// length of each vector is `M/2`. Label the input vectors as Ni,Ei,Wi,Si,
-// i.e., as the inputs from the North, East South, and West,
-// and similarly for the outputs. Then, for example, the upper
-// left input block of M/2 signals is labeled 1Ni. Most of the
-// connections are internal, such as 1Eo -> 2Wi. The `8*(M/2)` input
-// signals are grouped in the order
-// 1Ni 2Ni
-// 3Si 4Si
-// 1Wi 3Wi
-// 2Ei 4Ei
-// and the output signals are
-// 1No 1Wo
-// 2No 2Eo
-// 3So 3Wo
-// 4So 4Eo
-// or
-//
-// In: 1No 1Wo 2No 2Eo 3So 3Wo 4So 4Eo
-//
-// Out: 1Ni 2Ni 3Si 4Si 1Wi 3Wi 2Ei 4Ei
-//
-// Thus, the inputs are grouped by direction N,S,W,E, while the
-// outputs are grouped by block number 1,2,3,4, which can also be
-// interpreted as directions NW, NE, SW, SE. A simple program
-// illustrating these orderings is `process = mesh_square(2);`.
-//
-// #### Example
-//
-// Reflectively terminated mesh impulsed at one corner:
-//
-// ```
-// mesh_square_test(N,x) = mesh_square(N)~(busi(4*N,x)) // input to corner
-// with { busi(N,x) = bus(N) : par(i,N,*(-1)) : par(i,N-1,_), +(x); };
-// process = 1-1' : mesh_square_test(4); // all modes excited forever
-// ```
-//
-// In this simple example, the mesh edges are connected as follows:
-//
-// 1No -> 1Ni, 1Wo -> 2Ni, 2No -> 3Si, 2Eo -> 4Si,
-//
-// 3So -> 1Wi, 3Wo -> 3Wi, 4So -> 2Ei, 4Eo -> 4Ei
-//
-// A routing matrix can be used to obtain other connection geometries.
-//------------------------------------------------------------
-// TODO: author JOS, revised by RM
-// four-port scattering junction:
-mesh_square(1) =
- si.bus(4) <: par(i,4,*(-1)), (si.bus(4) :> (*(.5)) <: si.bus(4)) :> si.bus(4);
-
-// rectangular NxN square waveguide mesh:
-mesh_square(N) = si.bus(4*N) : (route_inputs(N/2) : par(i,4,mesh_square(N/2)))
- ~(prune_feedback(N/2))
- : prune_outputs(N/2) : route_outputs(N/2) : si.bus(4*N)
-with {
- // select block i of N, block size = M:
- s(i,N,M) = par(j, M*N, Sv(i, j))
- with { Sv(i,i) = si.bus(N); Sv(i,j) = si.block(N); };
-
- // prune mesh outputs down to the signals which make it out:
- prune_outputs(N)
- = si.bus(16*N) :
- si.block(N), si.bus(N), si.block(N), si.bus(N),
- si.block(N), si.bus(N), si.bus(N), si.block(N),
- si.bus(N), si.block(N), si.block(N), si.bus(N),
- si.bus(N), si.block(N), si.bus(N), si.block(N)
- : si.bus(8*N);
-
- // collect mesh outputs into standard order (N,W,E,S):
- route_outputs(N)
- = si.bus(8*N)
- <: s(4,N,8),s(5,N,8), s(0,N,8),s(2,N,8),
- s(3,N,8),s(7,N,8), s(1,N,8),s(6,N,8)
- : si.bus(8*N);
-
- // collect signals used as feedback:
- prune_feedback(N) = si.bus(16*N) :
- si.bus(N), si.block(N), si.bus(N), si.block(N),
- si.bus(N), si.block(N), si.block(N), si.bus(N),
- si.block(N), si.bus(N), si.bus(N), si.block(N),
- si.block(N), si.bus(N), si.block(N), si.bus(N) :
- si.bus(8*N);
-
- // route mesh inputs (feedback, external inputs):
- route_inputs(N) = si.bus(8*N), si.bus(8*N)
- <:s(8,N,16),s(4,N,16), s(12,N,16),s(3,N,16),
- s(9,N,16),s(6,N,16), s(1,N,16),s(14,N,16),
- s(0,N,16),s(10,N,16), s(13,N,16),s(7,N,16),
- s(2,N,16),s(11,N,16), s(5,N,16),s(15,N,16)
- : si.bus(16*N);
-};
-
-
-//////////////////////////////////Deprecated Functions////////////////////////////////////
-// This section implements functions that used to be in music.lib but that are now
-// considered as "deprecated".
-//////////////////////////////////////////////////////////////////////////////////////////
-
-echo1s = vgroup("echo 1000", +~(de.delay(65536, int(hslider("millisecond", 0, 0, 1000, 0.10)*ba.millisec)-1) * (hslider("feedback", 0, 0, 100, 0.1)/100.0)));
-echo2s = vgroup("echo 2000", +~(de.delay(131072, int(hslider("millisecond", 0, 0, 2000, 0.25)*ba.millisec)-1) * (hslider("feedback", 0, 0, 100, 0.1)/100.0)));
-echo5s = vgroup("echo 5000", +~(de.delay(262144, int(hslider("millisecond", 0, 0, 5000, 0.50)*ba.millisec)-1) * (hslider("feedback", 0, 0, 100, 0.1)/100.0)));
-echo10s = vgroup("echo 10000", +~(de.delay(524288, int(hslider("millisecond", 0, 0, 10000, 1.00)*ba.millisec)-1) * (hslider("feedback", 0, 0, 100, 0.1)/100.0)));
-echo21s = vgroup("echo 21000", +~(de.delay(1048576, int(hslider("millisecond", 0, 0, 21000, 1.00)*ba.millisec)-1) * (hslider("feedback", 0, 0, 100, 0.1)/100.0)));
-echo43s = vgroup("echo 43000", +~(de.delay(2097152, int(hslider("millisecond", 0, 0, 43000, 1.00)*ba.millisec)-1) * (hslider("feedback", 0, 0, 100, 0.1)/100.0)));
diff --git a/Resources/Libs/noises.lib b/Resources/Libs/noises.lib
deleted file mode 100644
index 680807d..0000000
--- a/Resources/Libs/noises.lib
+++ /dev/null
@@ -1,294 +0,0 @@
-//##################################### noises.lib ########################################
-// Faust Noise Generator Library. Its official prefix is `no`.
-//########################################################################################
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-fi = library("filters.lib");
-os = library("oscillators.lib");
-no = library("noises.lib"); // for compatible copy/paste out of this file
-
-declare name "Faust Noise Generator Library";
-declare version "0.0";
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-//-------`(no.)noise`----------
-// White noise generator (outputs random number between -1 and 1).
-// `Noise` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// noise : _
-// ```
-//------------------------
-noise = random / RANDMAX
-with{
- mask = 4294967295; // 2^32-1
- random = +(12345) ~ *(1103515245) & mask; // "linear congruential"
- RANDMAX = 2147483647.0; // = 2^31-1 = MAX_SIGNED_INT in 32 bits
-};
-
-//---------------------`(no.)multirandom`--------------------------
-// Generates multiple decorrelated random numbers
-// in parallel.
-//
-// #### Usage
-// ```
-// multirandom(n) : si.bus(n)
-// ```
-//
-// Where:
-//
-// * `n`: the number of decorrelated random numbers in parallel
-//-------------------------------------------------------------
-multirandom(n) = randomize(n) ~_
-with {
- randomize (1) = +(12345) : *(1103515245);
- randomize (n) = randomize(1) <: randomize(n-1),_;
-};
-
-//-----------------------`(no.)multinoise`------------------------
-// Generates multiple decorrelated noises
-// in parallel.
-//
-// #### Usage
-//
-// ```
-// multinoise(n) : si.bus(n)
-// ```
-//
-// Where:
-//
-// * `n`: the number of decorrelated random numbers in parallel
-//------------------------------------------------------------
-multinoise(n) = multirandom(n) : par(i,n,/(RANDMAX)) : par(i,n,float)
-with {
- RANDMAX = 2147483647.0;
-};
-
-//-----------------------`(no.)noises`------------------------
-// TODO.
-//----------------------------------------------------------
-noises(N,i) = multinoise(N) : ba.selector(i,N);
-
-//########################################################################################
-/************************************************************************
-FAUST library file, jos section
-
-Except where noted otherwise, The Faust functions below in this
-section are Copyright (C) 2003-2017 by Julius O. Smith III
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and/or Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees)
-
-************************************************************************/
-
-//---------------------------`(no.)pink_noise`--------------------------
-// Pink noise (1/f noise) generator (third-order approximation)
-// `pink_noise` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// pink_noise : _;
-// ```
-//
-// #### Reference:
-//
-//
-//------------------------------------------------------------
-pink_filter = fi.iir((0.049922035, -0.095993537, 0.050612699, -0.004408786),
- (-2.494956002, 2.017265875, -0.522189400));
-
-pink_noise = noise : pink_filter;
-
-//-------------------------`(no.)pink_noise_vm`-------------------
-// Multi pink noise generator.
-//
-// #### Usage
-//
-// ```
-// pink_noise_vm(N) : _;
-// ```
-//
-// Where:
-//
-// * `N`: number of latched white-noise processes to sum,
-// not to exceed sizeof(int) in C++ (typically 32).
-//
-// #### References
-//
-// *
-// *
-//------------------------------------------------------------
-pink_noise_vm(N) = noise <: _,par(i,N,ba.latch(clock(i))) :> _
-with {
- clock(i) = (ba.time>>i)&1; // i'th latch clock signal
-};
-
-//--------------------`(no.)lfnoise`, `(no.)lfnoise0` and `(no.)lfnoiseN`-----------------
-// Low-frequency noise generators (Butterworth-filtered downsampled white noise)
-//
-// #### Usage
-//
-// ```
-// lfnoise0(rate) : _; // new random number every int(SR/rate) samples or so
-// lfnoiseN(N,rate) : _; // same as "lfnoise0(rate) : lowpass(N,rate)" [see filters.lib]
-// lfnoise(rate) : _; // same as "lfnoise0(rate) : seq(i,5,lowpass(N,rate))" (no overshoot)
-// ```
-//
-// #### Example
-//
-// (view waveforms in faust2octave):
-//
-// ```
-// rate = SR/100.0; // new random value every 100 samples (SR from music.lib)
-// process = lfnoise0(rate), // sampled/held noise (piecewise constant)
-// lfnoiseN(3,rate), // lfnoise0 smoothed by 3rd order Butterworth LPF
-// lfnoise(rate); // lfnoise0 smoothed with no overshoot
-// ```
-//------------------------------------------------------------
-lfnoise0(freq) = noise : ba.latch(os.oscrs(freq));
-lfnoiseN(N,freq) = lfnoise0(freq) : fi.lowpass(N,freq); // Nth-order Butterworth lowpass
-lfnoise(freq) = lfnoise0(freq) : seq(i,5,fi.lowpass(1,freq)); // non-overshooting lowpass
-
-//-------------------------`(no.)sparse_noise_vm`-------------------
-// sparse noise generator.
-//
-// #### Usage
-//
-// ```
-// sparse_noise(f0) : _;
-// ```
-//
-// Where:
-//
-// * ` f0`: average frequency of noise impulses per second
-//
-// Random impulses in the amplitude range -1 to 1 are generated
-// at an average rate of f0 impulses per second.
-//
-// #### Reference
-//
-// * See velvet_noise
-//------------------------------------------------------------
-sparse_noise(f0) = sn
-with {
- saw = os.lf_sawpos(f0);
- sawdiff = saw - saw';
- e = float(no.noise); // float() keeps 4.656613e-10f scaling here instead of later
- eHeld = e : ba.latch(sawdiff);
- eHeldPos = 0.5 + 0.5 * eHeld;
- crossed = (saw >= eHeldPos) * (saw' < eHeldPos);
- sn = e' * float(crossed);
-};
-
-//-------------------------`(no.)velvet_noise_vm`-------------------
-// velvet noise generator.
-//
-// #### Usage
-//
-// ```
-// velvet_noise(amp,f0) : _;
-// ```
-//
-// Where:
-//
-// * `amp`: amplitude of noise impulses (positive and negative)
-// * ` f0`: average frequency of noise impulses per second
-//
-// #### Reference
-//
-// * Matti Karjalainen and Hanna Jarvelainen,
-// "Reverberation Modeling Using Velvet Noise",
-// in Proc. 30th Int. Conf. Intelligent Audio Environments (AES07),
-// March 2007.
-//
-//------------------------------------------------------------
-velvet_noise(amp,f0) = vn
-with {
- sn = no.sparse_noise(f0);
- vn = amp * ma.signum(sn);
-};
-
-//----------------------------`(no.)gnoise`------------------------
-// approximate zero-mean, unit-variance Gaussian white noise generator
-//
-// #### Usage
-//
-// ```
-// gnoise(N) : _;
-// ```
-//
-// Where:
-//
-// * `N`: number of uniform random numbers added to approximate Gaussian white noise
-//
-// #### Reference
-//
-// * See Central Limit Theorem
-//
-//------------------------------------------------------------
-gnoise(N) = uvgwn
-with {
- uwn = no.multinoise(N); // uniform white noise in [-1,1] on N channels
- gwn = uwn :> _; // sum of uniform approaches Gaussian by centeral limit thm
- sigma = sqrt(N/3.0); // rms of each uwn channel
- uvgwn = gwn / sigma; // approaches zero-mean, unit-variance Gaussian white noise, for large N
-};
-
-/*** END jos section ***/
-
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
diff --git a/Resources/Libs/oscillators.lib b/Resources/Libs/oscillators.lib
deleted file mode 100644
index b4e5f19..0000000
--- a/Resources/Libs/oscillators.lib
+++ /dev/null
@@ -1,986 +0,0 @@
-//############################## oscillators.lib ######################################
-// This library contains a collection of sound generators. Its official prefix is `os`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-declare name "Faust Oscillator Library";
-declare version "0.0";
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-fi = library("filters.lib");
-
-
-//=========================Wave-Table-Based Oscillators===================================
-//========================================================================================
-
-
-//-----------------------`(os.)sinwaveform`------------------------
-// Sine waveform ready to use with a `rdtable`.
-//
-// #### Usage
-//
-// ```
-// sinwaveform(tablesize) : _
-// ```
-//
-// Where:
-//
-// * `tablesize`: the table size
-//------------------------------------------------------------
-sinwaveform(tablesize) = float(ba.time)*(2.0*ma.PI)/float(tablesize) : sin;
-
-//-----------------------`(os.)coswaveform`------------------------
-// Cosine waveform ready to use with a `rdtable`.
-//
-// #### Usage
-//
-// ```
-// coswaveform(tablesize) : _
-// ```
-//
-// Where:
-//
-// * `tablesize`: the table size
-//------------------------------------------------------------
-coswaveform(tablesize) = float(ba.time)*(2.0*ma.PI)/float(tablesize) : cos;
-
-//-----------------------`(os.)phasor`------------------------
-// A simple phasor to be used with a `rdtable`.
-// `phasor` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// phasor(tablesize,freq) : _
-// ```
-//
-// Where:
-//
-// * `tablesize`: the table size
-// * `freq`: the frequency of the wave (Hz)
-//------------------------------------------------------------
-phasor(tablesize,freq) = freq/float(ma.SR) : (+ : ma.decimal) ~ _ : *(float(tablesize));
-
-//-----------------------`(os.)hs_phasor`------------------------
-// Hardsyncing phasor to be used with an `rdtable`.
-//
-// #### Usage
-//
-// ```
-// hs_phasor(ts,freq,c) : _
-// ```
-//
-// Where:
-//
-// * `ts`: the tablesize for the related sine wavetable
-// * `freq`: the fundamental frequency of the phasor
-// * `c`: a clock signal, `c>0` resets phase to 0
-//---------------------------------------------------------
-// Author: Mike Olsen
-hs_phasor(ts,freq,c) = inc : (+ : d)~ (-(_<:(_,*(_,clk)))) : *(ts)
-with {
- clk = c>0;
- d = ma.decimal;
- inc = freq/float(ma.SR);
-};
-
-//-----------------------`(os.)oscsin`------------------------
-// Sine wave oscillator.
-// `oscsin` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// oscsin(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency of the wave (Hz)
-//------------------------------------------------------------
-oscsin(freq) = rdtable(tablesize, sinwaveform(tablesize), int(phasor(tablesize,freq)))
-with{
- tablesize = 1 << 16;
-};
-
-//-----------------------`(os.)hs_oscsin`------------------------
-// Sin lookup table with hardsyncing phase.
-//
-// #### Usage
-//
-// ```
-// hs_oscsin(freq,c) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the fundamental frequency of the phasor
-// * `c`: a clock signal, `c>0` resets phase to 0
-//---------------------------------------------------------
-// Author: Mike Olsen
-hs_oscsin(freq,c) = rdtable(ts, sinwaveform(ts), int(hs_phasor(ts,freq,c)))
-with {
- ts = 1 << 16;
-};
-
-//-----------------------`(os.)osccos`------------------------
-// Cosine wave oscillator.
-//
-// #### Usage
-//
-// ```
-// osccos(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency of the wave (Hz)
-//------------------------------------------------------------
-osccos(freq) = rdtable(tablesize, coswaveform(tablesize), int(phasor(tablesize,freq)) )
-with{
- tablesize = 1 << 16;
-};
-
-//-----------------------`(os.)oscp`------------------------
-// A sine wave generator with controllable phase.
-//
-// #### Usage
-//
-// ```
-// oscp(freq,p) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency of the wave (Hz)
-// * `p`: the phase in radian
-//------------------------------------------------------------
-oscp(freq,p) = oscsin(freq) * cos(p) + osccos(freq) * sin(p);
-
-//-----------------------`(os.)osci`------------------------
-// Interpolated phase sine wave oscillator.
-//
-// #### Usage
-//
-// ```
-// osci(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency of the wave (Hz)
-//------------------------------------------------------------
-osci(freq) = s1 + d * (s2 - s1)
-with {
- tablesize = 1 << 16;
- i = int(phasor(tablesize,freq));
- d = ma.decimal(phasor(tablesize,freq));
- s1 = rdtable(tablesize+1,sinwaveform(tablesize),i);
- s2 = rdtable(tablesize+1,sinwaveform(tablesize),i+1);
-};
-
-// end GRAME section
-//########################################################################################
-/************************************************************************
-FAUST library file, jos section
-
-Except where noted otherwise, The Faust functions below in this
-section are Copyright (C) 2003-2017 by Julius O. Smith III
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-The MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees)
-
-************************************************************************/
-
-//===============================LFOs===============================
-// Low-Frequency Oscillators (LFOs) have prefix `lf_`
-// (no aliasing suppression, which is not audible at LF).
-//==================================================================
-
-//--------`(os.)lf_imptrain`----------
-// Unit-amplitude low-frequency impulse train.
-// `lf_imptrain` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// lf_imptrain(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency in Hz
-//------------------------------------------------------------
-lf_imptrain(freq) = lf_sawpos(freq)<:-(mem)<0; // definition below
-
-//--------`(os.)lf_pulsetrainpos`----------
-// Unit-amplitude nonnegative LF pulse train, duty cycle between 0 and 1
-//
-//
-// #### Usage
-//
-// ```
-// lf_pulsetrainpos(freq,duty) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency in Hz
-// * `duty`: duty cycle between 0 and 1
-//------------------------------------------------------------
-lf_pulsetrainpos(freq,duty) = float(lf_sawpos(freq) <= duty);
-
-//pulsetrainpos = lf_pulsetrainpos; // for backward compatibility
-
-//--------`(os.)lf_pulsetrain`----------
-// Unit-amplitude zero-mean LF pulse train, duty cycle between 0 and 1
-//
-// #### Usage
-//
-// ```
-// lf_pulsetrain(freq,duty) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency in Hz
-// * `duty`: duty cycle between 0 and 1
-//------------------------------------------------------------
-lf_pulsetrain(freq,duty) = 2.0*lf_pulsetrainpos(freq,duty) - 1.0;
-
-//--------`(os.)lf_squarewavepos`----------
-// Positive LF square wave in [0,1]
-//
-// #### Usage
-//
-// ```
-// lf_squarewavepos(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency in Hz
-//------------------------------------------------------------
-lf_squarewavepos(freq) = lf_pulsetrainpos(freq,0.5);
-// squarewavepos = lf_squarewavepos; // for backward compatibility
-
-
-//--------`(os.)lf_squarewave`----------
-// Zero-mean unit-amplitude LF square wave.
-// `lf_squarewave` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// lf_squarewave(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency in Hz
-//------------------------------------------------------------
-lf_squarewave(freq) = 2*lf_squarewavepos(freq) - 1;
-// squarewave = lf_squarewave; // for backward compatibility
-
-
-//--------`(os.)lf_trianglepos`----------
-// Positive unit-amplitude LF positive triangle wave
-//
-// #### Usage
-//
-// ```
-// lf_trianglepos(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency in Hz
-//------------------------------------------------------------
-lf_trianglepos(freq) = 1-abs(saw1(freq)); // saw1 defined below
-
-//================== Low Frequency Sawtooths ====================
-// Sawtooth waveform oscillators for virtual analog synthesis et al.
-// The 'simple' versions (`lf_rawsaw`, `lf_sawpos` and `saw1`), are mere samplings of
-// the ideal continuous-time ("analog") waveforms. While simple, the
-// aliasing due to sampling is quite audible. The differentiated
-// polynomial waveform family (`saw2`, `sawN`, and derived functions)
-// do some extra processing to suppress aliasing (not audible for
-// very low fundamental frequencies). According to Lehtonen et al.
-// (JASA 2012), the aliasing of `saw2` should be inaudible at fundamental
-// frequencies below 2 kHz or so, for a 44.1 kHz sampling rate and 60 dB SPL
-// presentation level; fundamentals 415 and below required no aliasing
-// suppression (i.e., `saw1` is ok).
-//=====================================================================
-
-//-----------------`(os.)lf_rawsaw`--------------------
-// Simple sawtooth waveform oscillator between 0 and period in samples.
-//
-// #### Usage
-//
-// ```
-// lf_rawsaw(periodsamps)
-// ```
-//
-// Where:
-//
-// * `periodsamps`: number of periods per samples
-//---------------------------------------------------------
-lf_rawsaw(periodsamps) = (_,periodsamps : fmod) ~ +(1.0);
-
-//-----------------`(os.)lf_sawpos_phase`--------------------
-// Simple sawtooth waveform oscillator between 0 and 1
-// with phase control.
-//
-// #### Usage
-//
-// ```
-// lf_sawpos_phase(freq,phase)
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-// * `phase`: phase
-//---------------------------------------------------------
-lf_sawpos_phase(phase,freq) = (+(phase-phase') : ma.frac ) ~ +(freq/ma.SR);
-
-//================== Bandlimited Sawtooth ====================
-//------------------`(os.)sawN`--------------------------------
-// Bandlimited Sawtooth
-//
-// `sawN(N,freq)`, `sawNp`, `saw2dpw(freq)`, `saw2(freq)`, `saw3(freq)`,
-// `saw4(freq)`, `saw5(freq)`, `saw6(freq)`, `sawtooth(freq)`, `saw2f2(freq)`
-// `saw2f4(freq)`
-//
-// #### Method 1 (`saw2`)
-//
-// Polynomial Transition Regions (PTR) (for aliasing suppression)
-//
-// ##### Reference
-//
-// * Kleimola, J.; Valimaki, V., "Reducing Aliasing from Synthetic Audio
-// Signals Using Polynomial Transition Regions," in Signal Processing
-// Letters, IEEE , vol.19, no.2, pp.67-70, Feb. 2012
-// *
-// *
-//
-// #### Method 2 (`sawN`)
-//
-// Differentiated Polynomial Waves (DPW) (for aliasing suppression)
-//
-// ##### Reference
-//
-// "Alias-Suppressed Oscillators based on Differentiated Polynomial Waveforms",
-// Vesa Valimaki, Juhan Nam, Julius Smith, and Jonathan Abel,
-// IEEE Tr. Acoustics, Speech, and Language Processing (IEEE-ASLP),
-// Vol. 18, no. 5, May 2010.
-//
-// #### Other Cases
-//
-// Correction-filtered versions of `saw2`: `saw2f2`, `saw2f4`
-// The correction filter compensates "droop" near half the sampling rate.
-// See reference for sawN.
-//
-// #### Usage
-//
-// ```
-// sawN(N,freq) : _
-// sawNp(N,freq,phase) : _
-// saw2dpw(freq) : _
-// saw2(freq) : _
-// saw3(freq) : _ // based on sawN
-// saw4(freq) : _ // based on sawN
-// saw5(freq) : _ // based on sawN
-// saw6(freq) : _ // based on sawN
-// sawtooth(freq) : _ // = saw2
-// saw2f2(freq) : _
-// saw2f4(freq) : _
-// ```
-//
-// Where:
-//
-// * `N`: polynomial order
-// * `freq`: frequency in Hz
-// * `phase`: phase
-//===================================================================
-// --- sawN for N = 1 to 6 ---
-//We can do 6, but 5 and 6 have noise at low fundamentals: MAX_SAW_ORDER = 6; MAX_SAW_ORDER_NEXTPOW2 = 8;
-MAX_SAW_ORDER = 4; MAX_SAW_ORDER_NEXTPOW2 = 8; // par cannot handle the case of 0 elements
-sawN(N,freq) = saw1l : poly(Nc) : D(Nc-1) : gate(Nc-1)
-with {
- Nc = max(1,min(N,MAX_SAW_ORDER));
- clippedFreq = max(20.0,abs(freq)); // use lf_sawpos(freq) for LFOs (freq < 20 Hz)
- saw1l = 2*lf_sawpos(clippedFreq) - 1; // zero-mean, amplitude +/- 1
- // Also note the availability of lf_sawpos_phase above.
- poly(1,x) = x;
- poly(2,x) = x*x;
- poly(3,x) = x*x*x - x;
- poly(4,x) = x*x*(x*x - 2.0);
- poly(5,x) = x*(7.0/3 + x*x*(-10.0/3.0 + x*x));
- poly(6,x) = x*x*(7.0 + x*x*(-5.0 + x*x));
- p0n = float(ma.SR)/clippedFreq; // period in samples
- diff1(x) = (x - x')/(2.0/p0n);
- diff(N) = seq(n,N,diff1); // N diff1s in series
- factorial(0) = 1;
- factorial(i) = i * factorial(i-1);
- D(0) = _;
- D(i) = diff(i)/factorial(i+1);
- gate(N) = *(1@(N)); // delayed step for blanking startup glitch
-};
-
-//------------------`(os.)sawNp`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-// --- sawNp for N = 1 to 6 ---
-// Phase offset = delay (max 8191 samples is more than one period of audio):
-sawNp(N,freq,phase) = sawN(N,freq) : @(max(0,min(8191,int(phase*ma.SR/freq))));
-
-// Special named cases:
-
-//------------------`(os.)saw2dpw`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-// --- sawN ---
-saw2dpw(freq) = saw1(freq) <: * <: -(mem) : *(0.25'*ma.SR/freq); // inferior to saw2 below
-
-//------------------`(os.)saw3`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-saw3 = sawN(3); saw4 = sawN(4); saw5 = sawN(5); saw6 = sawN(6);
-
-
-//------------------`(os.)sawtooth`--------------------------------
-// Alias-free sawtooth wave. 2nd order interpolation (based
-// on `saw2`).
-// `sawtooth` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// sawtooth(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//--------------------------------------------------------
-saw2(freq) = y with { // newer PTR version (stateless - freq can vary at any speed)
- p0 = float(ma.SR)/float(max(1.0e-7,abs(freq))); // period in samples
- t0 = 1.0/p0; // phase increment
- p = ((_<:(-(1)<:_,_),_) <: selector1,selector2) ~(+(t0)):!,_;
- selector1 = select2(<(0)); // for feedback
- selector2 = select2(<(0), (_<:_,(*(1-p0):+(1)):+), _); // for output
- y = 2*p-1;
-};
-// --- sawtooth ---
-sawtooth = saw2; // default choice for sawtooth signal - see also sawN
-
-//------------------`(os.)saw2f2`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-// --- Correction-filtered versions of saw2: saw2f2, saw2f4 ----
-// The correction filter compensates "droop" near half the sampling rate.
-// See reference for sawN.
-saw2f2 = saw2 : cf2 with {
- cf2 = fi.tf2(1.155704605878911, 0.745184288225518,0.040305967265900,
- 0.823765146386639, 0.117420665547108);
-};
-
-
-//------------------`(os.)saw2f4`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-saw2f4 = saw2 : cf4 with {
- cf4 = fi.iir((1.155727435125014, 2.285861038554662,
- 1.430915027294021, 0.290713280893317, 0.008306401748854),
- (2.156834679164532, 1.559532244409321, 0.423036498118354,
- 0.032080681130972));
-};
-
-
-//=========Bandlimited Pulse, Square, and Impulse Trains============
-// Bandlimited Pulse, Square, and Impulse Trains
-//
-// `pulsetrainN`, `pulsetrain`, `squareN`, `square`, `imptrain`, `imptrainN`,
-// `triangle`, `triangleN`
-//
-// All are zero-mean and meant to oscillate in the audio frequency range.
-// Use simpler sample-rounded lf_* versions above for LFOs.
-//
-// #### Usage
-//
-// ```
-// pulsetrainN(N,freq,duty) : _
-// pulsetrain(freq, duty) : _ // = pulsetrainN(2)
-// squareN(N, freq) : _
-// square : _ // = squareN(2)
-// imptrainN(N,freq) : _
-// imptrain : _ // = imptrainN(2)
-// triangleN(N,freq) : _
-// triangle : _ // = triangleN(2)
-// ```
-//
-// Where:
-//
-// * `N`: polynomial order
-// * `freq`: frequency in Hz
-//====================================================================
-
-//------------------`(os.)pulsetrainN`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-pulsetrainN(N,freq,duty) = diffdel(sawN(N,freqC),del) with {
- // non-interpolated-delay version: diffdel(x,del) = x - x@int(del+0.5);
- // linearly interpolated delay version (sounds good to me):
- diffdel(x,del) = x-x@int(del)*(1-ma.frac(del))-x@(int(del)+1)*ma.frac(del);
- // Third-order Lagrange interpolated-delay version (see filters.lib):
- // diffdel(x,del) = x - fdelay3(DELPWR2,max(1,min(DELPWR2-2,ddel)));
- DELPWR2 = 2048; // Needs to be a power of 2 when fdelay*() used above.
- delmax = DELPWR2-1; // arbitrary upper limit on diff delay (duty=0.5)
- SRmax = 96000.0; // assumed upper limit on sampling rate
- fmin = SRmax / float(2.0*delmax); // 23.4 Hz (audio freqs only)
- freqC = max(freq,fmin); // clip frequency at lower limit
- period = (float(ma.SR) / freqC); // actual period
- ddel = duty * period; // desired delay
- del = max(0,min(delmax,ddel));
-};
-
-
-//------------------`(os.)pulsetrain`--------------------------------
-// Bandlimited pulse train oscillator. Based on `pulsetrainN(2)`.
-// `pulsetrain` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// pulsetrain(freq, duty) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-// * `duty`: duty cycle between 0 and 1
-//--------------------------------------------------------
-pulsetrain = pulsetrainN(2);
-
-
-//------------------`(os.)squareN`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-squareN(N,freq) = pulsetrainN(N,freq,0.5);
-
-
-//------------------`(os.)square`--------------------------------
-// Bandlimited square wave oscillator. Based on `squareN(2)`.
-// `square` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// square(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//--------------------------------------------------------
-square = squareN(2);
-
-
-//------------------`(os.)impulse`--------------------------------
-// One-time impulse generated when the Faust process is started.
-// `impulse` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// impulse : _
-// ```
-//--------------------------------------------------------
-impulse = 1-1';
-
-
-//------------------`(os.)imptrainN`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-imptrainN(N,freq) = impulse + 0.5*ma.diffn(sawN(N,freq));
-
-
-//------------------`(os.)imptrain`--------------------------------
-// Bandlimited impulse train generator. Based on `imptrainN(2)`.
-// `imptrain` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// imptrain(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//--------------------------------------------------------
-imptrain = imptrainN(2); // default based on saw2
-
-
-//------------------`(os.)triangleN`--------------------------------
-// TODO: MarkDown doc in comments
-//--------------------------------------------------------
-triangleN(N,freq) = squareN(N,freq) : fi.pole(p) : *(gain) with {
- gain = 4.0*freq/ma.SR; // for aproximate unit peak amplitude
- p = 0.999;
-};
-
-
-//------------------`(os.)triangle`--------------------------------
-// Bandlimited triangle wave oscillator. Based on `triangleN(2)`.
-// `triangle` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// triangle(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//--------------------------------------------------------
-triangle = triangleN(2); // default based on saw2
-
-
-//===============================Filter-Based Oscillators=================================
-// Filter-Based Oscillators
-//
-// #### Usage
-//
-// ```
-// osc[b|r|rs|rc|s|w](f), where f = frequency in Hz.
-// ```
-//
-// #### References
-//
-// *
-// *
-//========================================================================================
-
-//--------------------------`(os.)oscb`--------------------------------
-// Sinusoidal oscillator based on the biquad.
-//
-// #### Usage
-//
-// ```
-// oscb(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//------------------------------------------------------------
-oscb(f) = impulse : fi.tf2(1,0,0,a1,1)
-with {
- a1 = -2*cos(2*ma.PI*f/ma.SR);
-};
-
-
-//--------------------------`(os.)oscrq`---------------------------
-// Sinusoidal (sine and cosine) oscillator based on 2D vector rotation,
-// = undamped "coupled-form" resonator
-// = lossless 2nd-order normalized ladder filter.
-//
-// #### Usage
-//
-// ```
-// oscrq(freq) : _,_
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-// #### Reference
-//
-// *
-//------------------------------------------------------------
-oscrq(f) = impulse : fi.nlf2(f,1); // sine and cosine outputs
-
-
-//--------------------------`(os.)oscrs`---------------------------
-// Sinusoidal (sine) oscillator based on 2D vector rotation,
-// = undamped "coupled-form" resonator
-// = lossless 2nd-order normalized ladder filter.
-//
-// #### Usage
-//
-// ```
-// oscrs(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-// #### Reference
-//
-// *
-//------------------------------------------------------------
-oscrs(f) = impulse : fi.nlf2(f,1) : _,!; // sine
-
-
-//--------------------------`(os.)oscrc`---------------------------
-// Sinusoidal (cosine) oscillator based on 2D vector rotation,
-// = undamped "coupled-form" resonator
-// = lossless 2nd-order normalized ladder filter.
-//
-// #### Usage
-//
-// ```
-// oscrc(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-// #### Reference
-//
-// *
-//------------------------------------------------------------
-oscrc(f) = impulse : fi.nlf2(f,1) : !,_; // cosine
-
-oscrp(f,p) = oscrq(f) : *(cos(p)), *(sin(p)) : + ; // p=0 for sine, p=PI/2 for cosine, etc.
-oscr = oscrs; // default = sine (starts without a pop)
-
-
-//-----------------------`(os.)osc`------------------------
-// Default sine wave oscillator (same as oscrs).
-// `osc` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// osc(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency of the wave (Hz)
-//------------------------------------------------------------
-//osc = oscsin;
-osc = oscrs;
-
-
-//--------------------------`(os.)oscs`--------------------------------
-// Sinusoidal oscillator based on the state variable filter
-// = undamped "modified-coupled-form" resonator
-// = "magic circle" algorithm used in graphics
-//------------------------------------------------------------
-oscs(f) = (*(-1) : sint(wn) : sintp(wn,impulse)) ~ _
-with {
- wn = 2*ma.PI*f/ma.SR; // approximate
- // wn = 2*sin(PI*f/SR); // exact
- sub(x,y) = y-x;
- sint(x) = *(x) : + ~ _ ; // frequency-scaled integrator
- sintp(x,y) = *(x) : +(y): + ~ _ ; // same + state input
-};
-
-
-//================ Waveguide-Resonator-Based Oscillators ================
-// Sinusoidal oscillator based on the waveguide resonator `wgr`.
-//=======================================================================
-
-//-----------------`(os.)oscw`--------------------
-// Sinusoidal oscillator based on the waveguide resonator `wgr`. Unit-amplitude
-// cosine oscillator.
-//
-// #### Usage
-//
-// ```
-// oscwc(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-// #### Reference
-//
-// *
-//------------------------------------------------------------
-oscwc(fr) = impulse : fi.wgr(fr,1) : _,!; // cosine (cheapest at 1 mpy/sample)
-
-
-//-----------------`(os.)oscws`--------------------
-// Sinusoidal oscillator based on the waveguide resonator `wgr`. Unit-amplitude
-// sine oscillator
-//
-// #### Usage
-//
-// ```
-// oscws(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-// #### Reference
-//
-// *
-//------------------------------------------------------------
-oscws(fr) = impulse : fi.wgr(fr,1) : !,_; // sine (needs a 2nd scaling mpy)
-
-
-//-----------------`(os.)oscwq`--------------------
-// Sinusoidal oscillator based on the waveguide resonator `wgr`.
-// Unit-amplitude cosine and sine (quadrature) oscillator.
-//
-// #### Usage
-//
-// ```
-// oscwq(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-// #### Reference
-//
-// *
-//------------------------------------------------------------
-oscq(fr) = impulse : fi.wgr(fr,1); // phase quadrature outputs
-
-
-//-----------------`(os.)oscw`--------------------
-// Sinusoidal oscillator based on the waveguide resonator `wgr`.
-// Unit-amplitude cosine oscillator (default)
-//
-// #### Usage
-//
-// ```
-// oscw(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-// #### Reference
-//
-// *
-//------------------------------------------------------------
-oscw = oscwc;
-
-// end jos section
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
-
-//-----------------`(os.)lf_sawpos`--------------------
-// Simple sawtooth waveform oscillator between 0 and 1.
-//
-// #### Usage
-//
-// ```
-// lf_sawpos(freq)
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//
-//---------------------------------------------------------
-// Author: Bart Brouns
-// License: STK-4.3
-// MarkDown: Romain Michon
-lf_sawpos(freq) = ma.frac ~ +(freq'/ma.SR);
-
-//-----------------`(os.)lf_saw`--------------------
-// Simple sawtooth waveform.
-// `lf_saw` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// lf_saw(freq)
-// ```
-//
-// Where:
-//
-// * `freq`: frequency
-//---------------------------------------------------------
-// Author: Bart Brouns
-// License: STK-4.3
-// MarkDown: Romain Michon
-saw1(freq) = 2.0 * lf_sawpos(freq) - 1.0;
-lf_saw(freq) = saw1(freq);
-
-//----------`(os.)lf_triangle`----------
-// Positive unit-amplitude LF triangle wave
-// `lf_triangle` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// lf_triangle(freq) : _
-// ```
-//
-// Where:
-//
-// * `freq`: frequency in Hz
-//------------------------------------------------------------
-// Author: Bart Brouns
-// License: STK-4.3
-// MarkDown: Romain Michon
-lf_triangle(freq) = 2*lf_trianglepos(freq) - 1;
-
-// end further contributions section
-//########################################################################################
diff --git a/Resources/Libs/phaflangers.lib b/Resources/Libs/phaflangers.lib
deleted file mode 100644
index 3bbb0fa..0000000
--- a/Resources/Libs/phaflangers.lib
+++ /dev/null
@@ -1,232 +0,0 @@
-//#################################### phaflangers.lib ########################################
-// A library of phasor and flanger effects. Its official prefix is `pf`.
-//########################################################################################
-
-ma = library("maths.lib");
-de = library("delays.lib");
-fi = library("filters.lib");
-os = library("oscillators.lib");
-pf = library("phaflangers.lib");
-
-declare name "Faust Phaser and Flanger Library";
-declare version "0.0";
-
-//########################################################################################
-/************************************************************************
-FAUST library file, jos section
-
-Except where noted otherwise, The Faust functions below in this
-section are Copyright (C) 2003-2017 by Julius O. Smith III
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees!)
-
-************************************************************************/
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-//---------------`(pf.)flanger_mono`-------------
-// Mono flanging effect.
-//
-// #### Usage:
-//
-// ```
-// _ : flanger_mono(dmax,curdel,depth,fb,invert) : _;
-// ```
-//
-// Where:
-//
-// * `dmax`: maximum delay-line length (power of 2) - 10 ms typical
-// * `curdel`: current dynamic delay (not to exceed dmax)
-// * `depth`: effect strength between 0 and 1 (1 typical)
-// * `fb`: feedback gain between 0 and 1 (0 typical)
-// * `invert`: 0 for normal, 1 to invert sign of flanging sum
-//
-// #### Reference
-//
-//
-//------------------------------------------------------------
-flanger_mono(dmax,curdel,depth,fb,invert)
- = _ <: _, (- : de.fdelay(dmax,curdel)) ~ *(fb) : _,
- *(select2(invert,depth,0-depth))
- : + : *(0.5);
-
-//---------------`(pf.)flanger_stereo`-------------
-// Stereo flanging effect.
-// `flanger_stereo` is a standard Faust function.
-//
-// #### Usage:
-//
-// ```
-// _,_ : flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert) : _,_;
-// ```
-//
-// Where:
-//
-// * `dmax`: maximum delay-line length (power of 2) - 10 ms typical
-// * `curdel`: current dynamic delay (not to exceed dmax)
-// * `depth`: effect strength between 0 and 1 (1 typical)
-// * `fb`: feedback gain between 0 and 1 (0 typical)
-// * `invert`: 0 for normal, 1 to invert sign of flanging sum
-//
-// #### Reference
-//
-//
-//------------------------------------------------------------
-flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert)
- = flanger_mono(dmax,curdel1,depth,fb,invert),
- flanger_mono(dmax,curdel2,depth,fb,invert);
-
-
-vibrato2_mono(sections,phase01,fb,width,frqmin,fratio,frqmax,speed) =
- (+ : seq(i,sections,ap2p(R,th(i)))) ~ *(fb)
-with {
- //tf2 = component("filters.lib").tf2;
- // second-order resonant digital allpass given pole radius and angle:
- ap2p(R,th) = fi.tf2(a2,a1,1,a1,a2) with {
- a2 = R^2;
- a1 = -2*R*cos(th);
- };
- R = exp(-pi*width/ma.SR);
- cososc = os.oscrc; // oscillators.lib
- sinosc = os.oscrs; // oscillators.lib
- osc = cososc(speed) * phase01 + sinosc(speed) * (1-phase01);
- lfo = (1-osc)/2; // in [0,1]
- pi = 4*atan(1);
- thmin = 2*pi*frqmin/ma.SR;
- thmax = 2*pi*frqmax/ma.SR;
- th1 = thmin + (thmax-thmin)*lfo;
- th(i) = (fratio^(i+1))*th1;
-};
-
-
-//-------`(pf.)phaser2_mono`-----------------
-// Mono phasing effect.
-//
-// #### Phaser
-//
-// ```
-// _ : phaser2_mono(Notches,phase,width,frqmin,fratio,frqmax,speed,depth,fb,invert) : _;
-// ```
-//
-// Where:
-//
-// * `Notches`: number of spectral notches (MACRO ARGUMENT - not a signal)
-// * `phase`: phase of the oscillator (0-1)
-// * `width`: approximate width of spectral notches in Hz
-// * `frqmin`: approximate minimum frequency of first spectral notch in Hz
-// * `fratio`: ratio of adjacent notch frequencies
-// * `frqmax`: approximate maximum frequency of first spectral notch in Hz
-// * `speed`: LFO frequency in Hz (rate of periodic notch sweep cycles)
-// * `depth`: effect strength between 0 and 1 (1 typical) (aka "intensity")
-// when depth=2, "vibrato mode" is obtained (pure allpass chain)
-// * `fb`: feedback gain between -1 and 1 (0 typical)
-// * `invert`: 0 for normal, 1 to invert sign of flanging sum
-//
-// Reference:
-//
-// *
-// *
-// * 'An Allpass Approach to Digital Phasing and Flanging', Julius O. Smith III,
-// Proc. Int. Computer Music Conf. (ICMC-84), pp. 103-109, Paris, 1984.
-// * CCRMA Tech. Report STAN-M-21:
-//------------------------------------------------------------
-phaser2_mono(Notches,phase01,width,frqmin,fratio,frqmax,speed,depth,fb,invert) =
- _ <: *(g1) + g2mi*vibrato2_mono(Notches,phase01,fb,width,frqmin,fratio,frqmax,speed)
-with { // depth=0 => direct-signal only
- g1 = 1-depth/2; // depth=1 => phaser mode (equal sum of direct and allpass-chain)
- g2 = depth/2; // depth=2 => vibrato mode (allpass-chain signal only)
- g2mi = select2(invert,g2,-g2); // inversion negates the allpass-chain signal
-};
-
-
-//-------`(pf.)phaser2_stereo`-------
-// Stereo phasing effect.
-// `phaser2_stereo` is a standard Faust function.
-//
-// #### Phaser
-//
-// ```
-// _ : phaser2_stereo(Notches,phase,width,frqmin,fratio,frqmax,speed,depth,fb,invert) : _;
-// ```
-//
-// Where:
-//
-// * `Notches`: number of spectral notches (MACRO ARGUMENT - not a signal)
-// * `phase`: phase of the oscillator (0-1)
-// * `width`: approximate width of spectral notches in Hz
-// * `frqmin`: approximate minimum frequency of first spectral notch in Hz
-// * `fratio`: ratio of adjacent notch frequencies
-// * `frqmax`: approximate maximum frequency of first spectral notch in Hz
-// * `speed`: LFO frequency in Hz (rate of periodic notch sweep cycles)
-// * `depth`: effect strength between 0 and 1 (1 typical) (aka "intensity")
-// when depth=2, "vibrato mode" is obtained (pure allpass chain)
-// * `fb`: feedback gain between -1 and 1 (0 typical)
-// * `invert`: 0 for normal, 1 to invert sign of flanging sum
-//
-// Reference:
-//
-// *
-// *
-// * 'An Allpass Approach to Digital Phasing and Flanging', Julius O. Smith III,
-// Proc. Int. Computer Music Conf. (ICMC-84), pp. 103-109, Paris, 1984.
-// * CCRMA Tech. Report STAN-M-21:
-//------------------------------------------------------------
-phaser2_stereo(Notches,width,frqmin,fratio,frqmax,speed,depth,fb,invert)
- = phaser2_mono(Notches,0,width,frqmin,fratio,frqmax,speed,depth,fb,invert),
- phaser2_mono(Notches,1,width,frqmin,fratio,frqmax,speed,depth,fb,invert);
-
-// end jos section
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-// TODO: Add GRAME functions here
-
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
diff --git a/Resources/Libs/physmodels.lib b/Resources/Libs/physmodels.lib
deleted file mode 100644
index 5017a37..0000000
--- a/Resources/Libs/physmodels.lib
+++ /dev/null
@@ -1,3653 +0,0 @@
-//##################################### physmodels.lib ###################################
-// Faust physical modeling library; Its official prefix is `pm`.
-//
-// This library provides an environment to facilitate physical modeling of musical
-// instruments. It contains dozens of functions implementing low and high level
-// elements going from a simple waveguide to fully operational models with
-// built-in UI, etc.
-//
-// It is organized as follows:
-//
-// * [Global Variables](#global-variables): Useful pre-defined variables for
-// physical modeling (e.g., speed of sound, etc.).
-// * [Conversion Tools](#conversion-tools-1): Conversion functions specific
-// to physical modeling (e.g., length to frequency, etc.).
-// * [Bidirectional Utilities](#bidirectional-utilities): Functions to create
-// bidirectional block diagrams for physical modeling.
-// * [Basic Elements](#basic-elements-1): waveguides, specific types of filters, etc.
-// * [String Instruments](#string-instruments): various types of strings
-// (e.g., steel, nylon, etc.), bridges, guitars, etc.
-// * [Bowed String Instruments](#bowed-string-instruments): parts and models
-// specific to bowed string instruments (e.g., bows, bridges, violins, etc.).
-// * [Wind Instrument](#wind-instruments): parts and models specific to wind
-// string instruments (e.g., reeds, mouthpieces, flutes, clarinets, etc.).
-// * [Exciters](#exciters): pluck generators, "blowers", etc.
-// * [Modal Percussions](#modal-percussions): percussion instruments based on
-// modal models.
-// * [Vocal Synthesis](#vocal-synthesis): functions for various vocal synthesis
-// techniques (e.g., fof, source/filter, etc.) and vocal synthesizers.
-// * [Misc Functions](#misc-functions): any other functions that don't fit in
-// the previous category (e.g., nonlinear filters, etc.)
-//
-// This library is part of the Faust Physical Modeling ToolKit.
-// More information on how to use this library can be found on this page:
-// . Tutorials on how to make
-// physical models of musical instruments using Faust can be found
-// [here](https://ccrma.stanford.edu/~rmichon/faustTutorials/#making-physical-models-of-musical-instruments-with-faust) as well.
-//########################################################################################
-// Authors: Romain Michon , Pierre-Amaury Grumiaux, and Yann Orlarey
-
-import("stdfaust.lib");
-
-/*
-TODO:
- - It'd be cool to have a version of the block diagram generator that automatically flips
- things based on the use of chains, etc.
- - When setting pole of filters by hand (e.g. smooth, should adjust pole in function of SR)
- - Probably need a single resonator function / see how to integrate that with "mode"
- - Need a non-linear function and see how this can be integrated with modal synthesis
- - See how bowed modal models could be integarted to this
- - Currently still missing keyboard instruments
- - Currently still missing vocal synth: easy to fix (create a formant filter function)
- - Real polyphonic instruments should be designated with some kind of prefix (e.g.,
- full)
-*/
-
-//=============================Global Variables===========================================
-// Useful pre-defined variables for physical modeling.
-//========================================================================================
-
-//--------------`(pm.)speedOfSound`----------
-// Speed of sound in meters per second (340m/s).
-//--------------------------------------
-speedOfSound = 340;
-
-//--------------`(pm.)maxLength`----------
-// The default maximum length (3) in meters of strings and tubes used in this
-// library. This variable should be overriden to allow longer strings or tubes.
-//--------------------------------------
-maxLength = 3;
-
-//================================Conversion Tools=======================================
-// Useful conversion tools for physical modeling.
-//========================================================================================
-
-//--------------`(pm.)f2l`----------
-// Frequency to length in meters.
-//
-// #### Usage
-//
-// ```
-// f2l(freq) : distanceInMeters
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency
-//-------------------------------
-f2l(freq) = speedOfSound/freq;
-
-//--------------`(pm.)l2f`----------
-// Length in meters to frequency.
-//
-// #### Usage
-//
-// ```
-// l2f(length) : freq
-// ```
-//
-// Where:
-//
-// * `length`: length/distance in meters
-//-------------------------------
-l2f(length) = speedOfSound/length;
-
-//--------------`(pm.)l2s`----------
-// Length in meters to number of samples.
-//
-// #### Usage
-//
-// ```
-// l2s(l) : numberOfSamples
-// ```
-//
-// Where:
-//
-// * `l`: length in meters
-//-------------------------------
-l2s(l) = l*ma.SR/speedOfSound;
-
-//=============================Bidirectional Utilities====================================
-// Set of fundamental functions to create bi-directional block diagrams in Faust.
-// These elements are used as the basis of this library to connect high level
-// elements (e.g., mouthpieces, strings, bridge, instrument body, etc.). Each
-// block has 3 inputs and 3 outputs. The first input/output carry left going
-// waves, the second input/output carry right going waves, and the third
-// input/output is used to carry any potential output signal to the end of the
-// algorithm.
-//========================================================================================
-
-//--------------`(pm.)basicBlock`----------
-// Empty bidirectional block to be used with [`chain`](#chain): 3 signals ins
-// and 3 signals out.
-//
-// #### Usage
-//
-// ```
-// chain(basicBlock : basicBlock : etc.)
-// ```
-//-------------------------------
-basicBlock = _,_,_;
-
-//-------`(pm.)chain`----------
-// Creates a chain of bidirectional blocks.
-// Blocks must have 3 inputs and outputs. The first input/output carry left
-// going waves, the second input/output carry right going waves, and the third
-// input/output is used to carry any potential output signal to the end of the
-// algorithm. The implied one sample delay created by the `~` operator is
-// generalized to the left and right going waves. Thus, `n` blocks in `chain()`
-// will add an `n` samples delay to both left and right going waves.
-//
-// #### Usage
-//
-// ```
-// leftGoingWaves,rightGoingWaves,mixedOutput : chain( A : B ) : leftGoingWaves,rightGoingWaves,mixedOutput
-// with{
-// A = _,_,_;
-// B = _,_,_;
-// };
-// ```
-//-----------------------------
-chain(A:As) = ((ro.crossnn(1),_',_ : _,A : ro.crossnn(1),_,_ : _,chain(As) : ro.crossnn(1),_,_)) ~ _ : !,_,_,_;
-chain(A) = A;
-
-//-------`(pm.)inLeftWave`--------------
-// Adds a signal to left going waves anywhere in a [`chain`](#chain) of blocks.
-//
-// #### Usage
-//
-// ```
-// model(x) = chain(A : inLeftWave(x) : B)
-// ```
-//
-// Where `A` and `B` are bidirectional blocks and `x` is the signal added to left
-// going waves in that chain.
-//--------------------------------
-inLeftWave(x) = +(x),_,_;
-
-//-------`(pm.)inRightWave`--------------
-// Adds a signal to right going waves anywhere in a [`chain`](#chain) of blocks.
-//
-// #### Usage
-//
-// ```
-// model(x) = chain(A : inRightWave(x) : B)
-// ```
-//
-// Where `A` and `B` are bidirectional blocks and `x` is the signal added to right
-// going waves in that chain.
-//--------------------------------
-inRightWave(x) = _,+(x),_;
-
-//-------`(pm.)in`--------------
-// Adds a signal to left and right going waves anywhere in a [`chain`](#chain)
-// of blocks.
-//
-// #### Usage
-//
-// ```
-// model(x) = chain(A : in(x) : B)
-// ```
-//
-// Where `A` and `B` are bidirectional blocks and `x` is the signal added to
-// left and right going waves in that chain.
-//--------------------------------
-in(x) = +(x),+(x),_;
-
-//-------`(pm.)outLeftWave`--------------
-// Sends the signal of left going waves to the output channel of the [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// chain(A : outLeftWave : B)
-// ```
-//
-// Where `A` and `B` are bidirectional blocks.
-//--------------------------------
-outLeftWave(x,y,s) = x,y,x+s;
-
-//-------`(pm.)outRightWave`--------------
-// Sends the signal of right going waves to the output channel of the [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// chain(A : outRightWave : B)
-// ```
-//
-// Where `A` and `B` are bidirectional blocks.
-//--------------------------------
-outRightWave(x,y,s) = x,y,y+s;
-
-//-------`(pm.)out`--------------
-// Sends the signal of right and left going waves to the output channel of the
-// [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// chain(A : out : B)
-// ```
-//
-// Where `A` and `B` are bidirectional blocks.
-//--------------------------------
-out(x,y,s) = x,y,x+y+s;
-
-//-------`(pm.)terminations`--------------
-// Creates terminations on both sides of a [`chain`](#chain) without closing
-// the inputs and outputs of the bidirectional signals chain. As for
-// [`chain`](#chain), this function adds a 1 sample delay to the bidirectional
-// signal, both ways. Of courses, this function can be nested within a
-// [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// terminations(a,b,c)
-// with{
-// a = *(-1); // left termination
-// b = chain(D : E : F); // bidirectional chain of blocks (D, E, F, etc.)
-// c = *(-1); // right termination
-// };
-// ```
-//----------------------------------------
-terminations(a,b,c) = (_,ro.crossnn(1),_,_ : +,+,_ : b) ~ (a,c : ro.crossnn(1));
-
-//-------`(pm.)lTermination`----------
-// Creates a termination on the left side of a [`chain`](#chain) without
-// closing the inputs and outputs of the bidirectional signals chain. This
-// function adds a 1 sample delay near the termination and can be nested
-// within another [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// lTerminations(a,b)
-// with{
-// a = *(-1); // left termination
-// b = chain(D : E : F); // bidirectional chain of blocks (D, E, F, etc.)
-// };
-// ```
-//----------------------------------------
-lTermination(a,b) = (ro.crossnn(1),_,_ : _,+,_ : b) ~ a;
-
-//-------`(pm.)rTermination`----------
-// Creates a termination on the right side of a [`chain`](#chain) without
-// closing the inputs and outputs of the bidirectional signals chain. This
-// function adds a 1 sample delay near the termination and can be nested
-// within another [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// rTerminations(b,c)
-// with{
-// b = chain(D : E : F); // bidirectional chain of blocks (D, E, F, etc.)
-// c = *(-1); // right termination
-// };
-// ```
-//----------------------------------------
-rTermination(b,c) = (_,_,_,_ : +,_,_ : b) ~ (!,c);
-
-//-------`(pm.)closeIns`----------
-// Closes the inputs of a bidirectional chain in all directions.
-//
-// #### Usage
-//
-// ```
-// closeIns : chain(...) : _,_,_
-// ```
-//----------------------------------------
-closeIns = 0,0,0;
-
-//-------`(pm.)closeOuts`----------
-// Closes the outputs of a bidirectional chain in all directions except for the
-// main signal output (3d output).
-//
-// #### Usage
-//
-// ```
-// _,_,_ : chain(...) : _
-// ```
-//----------------------------------------
-closeOuts = !,!,_;
-
-//-------`(pm.)endChain`----------
-// Closes the inputs and outputs of a bidirectional chain in all directions
-// except for the main signal output (3d output).
-//
-// #### Usage
-//
-// ```
-// endChain(chain(...)) : _
-// ```
-//----------------------------------------
-endChain(b) = closeIns : b : closeOuts;
-
-
-//==================================Basic Elements========================================
-// Basic elements for physical modeling (e.g., waveguides, specific filters,
-// etc.).
-//========================================================================================
-
-//-------`(pm.)waveguideN`----------
-// A series of waveguide functions based on various types of delays (see
-// [`fdelay[n]`](#fdelayn)).
-//
-// #### List of functions
-//
-// * `waveguideUd`: unit delay waveguide
-// * `waveguideFd`: fractional delay waveguide
-// * `waveguideFd2`: second order fractional delay waveguide
-// * `waveguideFd4`: fourth order fractional delay waveguide
-//
-// #### Usage
-//
-// ```
-// chain(A : waveguideUd(nMax,n) : B)
-// ```
-//
-// Where:
-//
-// * `nMax`: the maximum length of the delays in the waveguide
-// * `n`: the length of the delay lines in samples.
-//----------------------------------
-waveguideUd(nMax,n) = par(i,2,de.delay(nMax,n)),_;
-waveguideFd(nMax,n) = par(i,2,de.fdelay(nMax,n)),_;
-waveguideFd2(nMax,n) = par(i,2,de.fdelay2(nMax,n)),_;
-waveguideFd4(nMax,n) = par(i,2,de.fdelay4(nMax,n)),_;
-
-//-------`(pm.)waveguide`----------
-// Standard `pm.lib` waveguide (based on [`waveguideFd4`](#waveguiden)).
-//
-// #### Usage
-//
-// ```
-// chain(A : waveguide(nMax,n) : B)
-// ```
-//
-// Where:
-//
-// * `nMax`: the maximum length of the delays in the waveguide
-// * `n`: the length of the delay lines in samples.
-//----------------------------------
-waveguide(nMax,n) = waveguideFd4(nMax,n);
-
-//-------`(pm.)bridgeFilter`----------
-// Generic two zeros bridge FIR filter (as implemented in the
-// [STK](https://ccrma.stanford.edu/software/stk/)) that can be used to
-// implement the reflectance violin, guitar, etc. bridges.
-//
-// #### Usage
-//
-// ```
-// _ : bridge(brightness,absorption) : _
-// ```
-//
-// Where:
-//
-// * `brightness`: controls the damping of high frequencies (0-1)
-// * `absorption`: controls the absorption of the brige and thus the t60 of
-// the string plugged to it (0-1) (1 = 20 seconds)
-//----------------------------------
-// TODO: perhaps, the coefs of this filter should be adapted in function of SR
-bridgeFilter(brightness,absorption,x) = rho * (h0 * x' + h1*(x+x''))
-with{
- freq = 320;
- t60 = (1-absorption)*20;
- h0 = (1.0 + brightness)/2;
- h1 = (1.0 - brightness)/4;
- rho = pow(0.001,1.0/(freq*t60));
-};
-
-//-------`(pm.)modeFilter`----------
-// Resonant bandpass filter that can be used to implement a single resonance
-// (mode).
-//
-// #### Usage
-//
-// ```
-// _ : modeFilter(freq,t60,gain) : _
-// ```
-//
-// Where:
-//
-// * `freq`: mode frequency
-// * `t60`: mode resonance duration (in seconds)
-// * `gain`: mode gain (0-1)
-//----------------------------------
-modeFilter(freq,t60,gain) = fi.tf2(b0,b1,b2,a1,a2)*gain
-with{
- b0 = 1;
- b1 = 0;
- b2 = -1;
- w = 2*ma.PI*freq/ma.SR;
- r = pow(0.001,1/float(t60*ma.SR));
- a1 = -2*r*cos(w);
- a2 = r^2;
-};
-
-//================================String Instruments======================================
-// Low and high level string instruments parts. Most of the elements in
-// this section can be used in a bidirectional chain.
-//========================================================================================
-
-//-------`(pm.)stringSegment`----------
-// A string segment without terminations (just a simple waveguide).
-//
-// #### Usage
-//
-// ```
-// chain(A : stringSegment(maxLength,length) : B)
-// ```
-//
-// Where:
-//
-// * `maxLength`: the maximum length of the string in meters (should be static)
-// * `length`: the length of the string in meters
-//----------------------------------
-stringSegment(maxLength,length) = waveguide(nMax,n)
-with{
- nMax = maxLength : l2s;
- n = length : l2s/2;
-};
-
-//-------`(pm.)openString`----------
-// A bidirectional block implementing a basic "generic" string with a
-// selectable excitation position. Lowpass filters are built-in and
-// allow to simulate the effect of dispersion on the sound and thus
-// to change the "stiffness" of the string.
-//
-// #### Usage
-//
-// ```
-// chain(... : openString(length,stiffness,pluckPosition,excitation) : ...)
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `stiffness`: the stiffness of the string (0-1) (1 for max stiffness)
-// * `pluckPosition`: excitation position (0-1) (1 is bottom)
-// * `excitation`: the excitation signal
-//----------------------------------
-openString(length,stiffness,pluckPosition,excitation) = chain(stringSegment(maxStringLength,ntbd) : in(excitation) : dispersionFilters : stringSegment(maxStringLength,btbd))
-with{
- dispersionFilters = par(i,2,si.smooth(stiffness)),_; // one pole filters
- maxStringLength = maxLength;
- ntbd = length*pluckPosition; // length of the upper portion of the string
- btbd = length*(1-pluckPosition); // length of the lower portion of the string
-};
-
-//-------`(pm.)nylonString`----------
-// A bidirectional block implementing a basic nylon string with selectable
-// excitation position. This element is based on [`openString`](#openstring)
-// and has a fix stiffness corresponding to that of a nylon string.
-//
-// #### Usage
-//
-// ```
-// chain(... : nylonString(length,pluckPosition,excitation) : ...)
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: excitation position (0-1) (1 is bottom)
-// * `excitation`: the excitation signal
-//----------------------------------
-nylonString(length,pluckPosition,excitation) =
-openString(length,stiffness,pluckPosition,excitation)
-with{
- stiffness = 0.4; // empirically set but it sounds good ;)
-};
-
-//-------`(pm.)steelString`----------
-// A bidirectional block implementing a basic steel string with selectable
-// excitation position. This element is based on [`openString`](#openstring)
-// and has a fix stiffness corresponding to that of a steel string.
-//
-// #### Usage
-//
-// ```
-// chain(... : steelString(length,pluckPosition,excitation) : ...)
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: excitation position (0-1) (1 is bottom)
-// * `excitation`: the excitation signal
-//----------------------------------
-steelString(length,pluckPosition,excitation) =
-openString(length,stiffness,pluckPosition,excitation)
-with{
- stiffness = 0.05; // empirically set but it sounds good ;)
- // in fact, we could almost get rid of the filters in that case,
- // but I think it's good to keep them for consistency
-};
-
-//-------`(pm.)openStringPick`----------
-// A bidirectional block implementing a "generic" string with selectable
-// excitation position. It also has a built-in pickup whose position is the
-// same as the excitation position. Thus, moving the excitation position
-// will also move the pickup.
-//
-// #### Usage
-//
-// ```
-// chain(... : openStringPick(length,stiffness,pluckPosition,excitation) : ...)
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `stiffness`: the stiffness of the string (0-1) (1 for max stiffness)
-// * `pluckPosition`: excitation position (0-1) (1 is bottom)
-// * `excitation`: the excitation signal
-//----------------------------------
-openStringPick(length,stiffness,pluckPosition,excitation) = strChain
-with{
- dispersionFilters = par(i,2,si.smooth(stiffness)),_;
- maxStringLength = maxLength;
- nti = length*pluckPosition; // length of the upper portion of the string
- itb = length*(1-pluckPosition); // length of the lower portion of the string
- strChain = chain(stringSegment(maxStringLength,nti) : in(excitation) : out :
- dispersionFilters : stringSegment(maxStringLength,itb));
-};
-
-//-------`(pm.)openStringPickUp`----------
-// A bidirectional block implementing a "generic" string with selectable
-// excitation position and stiffness. It also has a built-in pickup whose
-// position can be independenly selected. The only constraint is that the
-// pickup has to be placed after the excitation position.
-//
-// #### Usage
-//
-// ```
-// chain(... : openStringPickUp(length,stiffness,pluckPosition,excitation) : ...)
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `stiffness`: the stiffness of the string (0-1) (1 for max stiffness)
-// * `pluckPosition`: pluck position between the top of the string and the
-// pickup (0-1) (1 for same as pickup position)
-// * `pickupPosition`: position of the pickup on the string (0-1) (1 is bottom)
-// * `excitation`: the excitation signal
-//----------------------------------
-openStringPickUp(length,stiffness,pluckPosition,pickupPosition,excitation) = strChain
-with{
- dispersionFilters = par(i,2,si.smooth(stiffness)),_;
- maxStringLength = maxLength;
- nti = length*pluckPosition; // top to excitation length
- nto = nti*pickupPosition; // nuts to pickup length
- oti = nti*(1-pickupPosition); // pickup to excitation length
- itb = length*(1-pluckPosition); // pickup to bottom length
- strChain = chain(stringSegment(maxStringLength,nto) : out :
- stringSegment(maxStringLength,oti) : in(excitation) : dispersion :
- stringSegment(maxStringLength,itb));
-};
-
-//-------`(pm.)openStringPickDown`----------
-// A bidirectional block implementing a "generic" string with selectable
-// excitation position and stiffness. It also has a built-in pickup whose
-// position can be independenly selected. The only constraint is that the
-// pickup has to be placed before the excitation position.
-//
-// #### Usage
-//
-// ```
-// chain(... : openStringPickDown(length,stiffness,pluckPosition,excitation) : ...)
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `stiffness`: the stiffness of the string (0-1) (1 for max stiffness)
-// * `pluckPosition`: pluck position on the string (0-1) (1 is bottom)
-// * `pickupPosition`: position of the pickup between the top of the string
-// and the excitation position (0-1) (1 is excitation position)
-// * `excitation`: the excitation signal
-//----------------------------------
-openStringPickDown(length,stiffness,pluckPosition,pickupPosition,excitation) =
-strChain
-with{
- dispersionFilters = par(i,2,si.smooth(stiffness)),_;
- maxStringLength = maxLength;
- nto = length*pickupPosition; // top to pickup length
- nti = nto*pluckPosition; // top to excitation length
- ito = nto*(1-pluckPosition); // excitation to pickup length
- otb = length*(1-pickupPosition); // pickup to bottom length
- strChain = chain(stringSegment(maxStringLength,nti) : in(excitation) :
- stringSegment(maxStringLength,ito) : out : dispersionFilters :
- stringSegment(maxStringLength,otb));
-};
-
-// TODO: eventually, we'd want to implement a generic function here that
-// automatically switches the position of elements in the algorithm
-// depending on the position of the pick. Even though this is currently
-// possible, it will pose optimization issues (we'd want the new mute
-// feature of Faust to be generalized in order to do that)
-
-//-------`(pm.)ksReflexionFilter`----------
-// The "typical" one-zero Karplus-strong feedforward reflexion filter. This
-// filter will be typically used in a termination (see below).
-//
-// #### Usage
-//
-// ```
-// terminations(_,chain(...),ksReflexionFilter)
-// ```
-//----------------------------------
-ksReflexionFilter = _ <: (_+_')/2;
-
-//-------`(pm.)rStringRigidTermination`----------
-// Bidirectional block implementing a right rigid string termination (no damping,
-// just phase inversion).
-//
-// #### Usage
-//
-// ```
-// chain(rStringRigidTermination : stringSegment : ...)
-// ```
-//----------------------------------
-rStringRigidTermination = rTermination(basicBlock,*(-1));
-
-//-------`(pm.)lStringRigidTermination`----------
-// Bidirectional block implementing a left rigid string termination (no damping,
-// just phase inversion).
-//
-// #### Usage
-//
-// ```
-// chain(... : stringSegment : lStringRigidTermination)
-// ```
-//----------------------------------
-lStringRigidTermination = lTermination(*(-1),basicBlock);
-
-//-------`(pm.)elecGuitarBridge`----------
-// Bidirectional block implementing a simple electric guitar bridge. This
-// block is based on [`bridgeFilter`](#bridgeFilter). The bridge doesn't
-// implement transmittance since it is not meant to be connected to a
-// body (unlike acoustic guitar). It also partially sets the resonance
-// duration of the string with the nuts used on the other side.
-//
-// #### Usage
-//
-// ```
-// chain(... : stringSegment : elecGuitarBridge)
-// ```
-//----------------------------------
-elecGuitarBridge = rTermination(basicBlock,-bridgeFilter(0.8,0.6));
-
-//-------`(pm.)elecGuitarNuts`----------
-// Bidirectional block implementing a simple electric guitar nuts. This
-// block is based on [`bridgeFilter`](#bridgeFilter) and does essentially
-// the same thing as [`elecGuitarBridge`](#elecguitarbridge), but on the
-// other side of the chain. It also partially sets the resonance duration of
-// the string with the bridge used on the other side.
-//
-// #### Usage
-//
-// ```
-// chain(elecGuitarNuts : stringSegment : ...)
-// ```
-//----------------------------------
-elecGuitarNuts = lTermination(-bridgeFilter(0.8,0.6),basicBlock);
-
-//-------`(pm.)guitarBridge`----------
-// Bidirectional block implementing a simple acoustic guitar bridge. This
-// bridge damps more hight frequencies than
-// [`elecGuitarBridge`](#elecguitarbridge) and implements a transmittance
-// filter. It also partially sets the resonance duration of the string with
-// the nuts used on the other side.
-//
-// #### Usage
-//
-// ```
-// chain(... : stringSegment : guitarBridge)
-// ```
-//----------------------------------
-guitarBridge = rTermination(basicBlock,reflectance) : _,transmittance,_
-with{
- reflectance = -bridgeFilter(0.4,0.5);
- transmittance = _; // TODO
-};
-
-//-------`(pm.)guitarNuts`----------
-// Bidirectional block implementing a simple acoustic guitar nuts. This
-// nuts damps more hight frequencies than
-// [`elecGuitarNuts`](#elecguitarnuts) and implements a transmittance
-// filter. It also partially sets the resonance duration of the string with
-// the bridge used on the other side.
-//
-// #### Usage
-//
-// ```
-// chain(guitarNuts : stringSegment : ...)
-// ```
-//----------------------------------
-guitarNuts = lTermination(-bridgeFilter(0.4,0.5),basicBlock);
-
-//-------`(pm.)idealString`----------
-// An "ideal" string with rigid terminations and where the plucking position
-// and the pick-up position are the same. Since terminations are rigid, this
-// string will ring forever.
-//
-// #### Usage
-//
-// ```
-// 1-1' : idealString(length,reflexion,xPosition,excitation)
-// ```
-//
-// With:
-// * `length`: the length of the string in meters
-// * `pluckPosition`: the plucking position (0.001-0.999)
-// * `excitation`: the input signal for the excitation
-//----------------------------------------------------------
-idealString(length,pluckPosition,excitation) = wg
-with{
- maxStringLength = maxLength;
- lengthTuning = 0.08; // tuned "by hand"
- tunedLength = length-lengthTuning;
- nUp = tunedLength*pluckPosition; // upper string segment length
- nDown = tunedLength*(1-pluckPosition); // lower string segment length
- wg = chain(lStringRigidTermination : stringSegment(maxStringLength,nUp) :
- in(excitation) : out : stringSegment(maxStringLength,nDown) :
- rStringRigidTermination); // waveguide chain
-};
-
-//-------`(pm.)ks`----------
-// A Karplus-Strong string (in that case, the string is implemented as a
-// one dimension waveguide).
-//
-// #### Usage
-//
-// ```
-// ks(length,damping,excitation) : _
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `damping`: string damping (0-1)
-// * `excitation`: excitation signal
-//----------------------------------
-ks(length,damping,excitation) = endChain(ksChain)
-with{
- maxStringLength = maxLength;
- lengthTuning = 0.05; // tuned "by hand"
- tunedLength = length-lengthTuning;
- refCoef = (1-damping)*0.2+0.8;
- refFilter = ksReflexionFilter*refCoef;
- ksChain = terminations(_,chain(in(excitation) :
- stringSegment(maxStringLength,tunedLength) : out),refFilter);
-};
-
-//-------`(pm.)ks_ui_MIDI`----------
-// Ready-to-use, MIDI-enabled Karplus-Strong string with buil-in UI.
-//
-// #### Usage
-//
-// ```
-// ks_ui_MIDI : _
-// ```
-//----------------------------------
-ks_ui_MIDI = gate : impulseExcitation*gain : ks( (freq : f2l), damping )
-with{
- f = hslider("v:karplus/h:[0]params/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:karplus/h:[0]params/[1]bend[style:knob][hidden:1][midi:pitchwheel]"
- ,1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:karplus/h:[0]params/[2]gain[style:knob]",0.8,0,1,0.01);
- s = hslider("v:karplus/h:[0]params/[3]sustain[hidden:1][midi:ctrl 64][style:knob]"
- ,0,0,1,1);
- damping = hslider("v:karplus/h:[0]params/[1]damping[midi:ctrl 1][style:knob]"
- ,0.01,0,1,0.01) : si.smoo;
- t = button("v:karplus/[1]gate");
-
- gate = t+s : min(1);
- freq = f*bend;
-};
-
-//-------`(pm.)elecGuitarModel`----------
-// A simple electric guitar model (without audio effects, of course) with
-// selectable pluck position.
-// This model implements a single string. Additional strings should be created
-// by making a polyphonic applications out of this function. Pitch is changed by
-// changing the length of the string and not through a finger model.
-//
-// #### Usage
-//
-// ```
-// elecGuitarModel(length,pluckPosition,mute,excitation) : _
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: pluck position (0-1) (1 is on the bridge)
-// * `mute`: mute coefficient (1 for no mute and 0 for instant mute)
-// * `excitation`: excitation signal
-//----------------------------------
-elecGuitarModel(length,pluckPosition,mute,excitation) = endChain(egChain)
-with{
- maxStringLength = maxLength;
- lengthTuning = 0.11; // tuned "by hand"
- stringL = length-lengthTuning;
- muteBlock = *(mute),*(mute),_;
- egChain = chain(
- elecGuitarNuts :
- openStringPick(stringL,0.05,pluckPosition,excitation) :
- muteBlock :
- elecGuitarBridge);
-};
-
-//-------`(pm.)elecGuitar`----------
-// A simple electric guitar model with steel strings (based on
-// [`elecGuitarModel`](#elecguitarmodel)) implementing an excitation
-// model.
-// This model implements a single string. Additional strings should be created
-// by making a polyphonic applications out of this function.
-//
-// #### Usage
-//
-// ```
-// elecGuitar(length,pluckPosition,trigger) : _
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: pluck position (0-1) (1 is on the bridge)
-// * `mute`: mute coefficient (1 for no mute and 0 for instant mute)
-// * `gain`: gain of the pluck (0-1)
-// * `trigger`: trigger signal (1 for on, 0 for off)
-//----------------------------------
-elecGuitar(stringLength,pluckPosition,mute,gain,trigger) =
-pluckString(stringLength,1,1,1,gain,trigger) :
-elecGuitarModel(stringLength,pluckPosition,mute);
-
-//-------`(pm.)elecGuitar_ui_MIDI`----------
-// Ready-to-use MIDI-enabled electric guitar physical model with built-in UI.
-//
-// #### Usage
-//
-// ```
-// elecGuitar_ui_MIDI : _
-// ```
-//----------------------------------
-elecGuitar_ui_MIDI = elecGuitar(stringLength,pluckPosition,1,gain,gate)*outGain
-with{
- f = hslider("v:elecGuitar/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:elecGuitar/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel][style:knob]"
- ,1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:elecGuitar/h:[0]midi/[2]gain[style:knob]",0.8,0,1,0.01);
- s = hslider("v:elecGuitar/h:[0]midi/[3]sustain[hidden:1]
- [midi:ctrl 64][style:knob]",0,0,1,1);
- pluckPosition = hslider("v:elecGuitar/[1]pluckPosition[midi:ctrl 1]",0.8,0,1,0.01) : si.smoo;
- outGain = hslider("v:elecGuitar/[2]outGain",0.5,0,1,0.01);
- t = button("v:elecGuitar/[3]gate");
- gate = t+s : min(1);
- freq = f*bend;
- stringLength = freq : f2l;
-};
-
-//-------`(pm.)guitarBody`----------
-// WARNING: not implemented yet!
-// Bidirectional block implementing a simple acoustic guitar body.
-//
-// #### Usage
-//
-// ```
-// chain(... : guitarBody)
-// ```
-//----------------------------------
-// TODO: not implemented yet
-guitarBody = reflectance,transmittance,_
-with{
- transmittance = _;
- reflectance = _;
-};
-
-//-------`(pm.)guitarModel`----------
-// A simple acoustic guitar model with steel strings and selectable excitation
-// position. This model implements a single string. Additional strings should be created
-// by making a polyphonic applications out of this function. Pitch is changed by
-// changing the length of the string and not through a finger model.
-// WARNING: this function doesn't currently implement a body (just strings and
-// bridge)
-//
-// #### Usage
-//
-// ```
-// guitarModel(length,pluckPosition,excitation) : _
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: pluck position (0-1) (1 is on the bridge)
-// * `excitation`: excitation signal
-//----------------------------------
-guitarModel(length,pluckPosition,excitation) = endChain(egChain)
-with{
- maxStringLength = maxLength;
- lengthTuning = 0.1; // tuned "by hand"
- stringL = length-lengthTuning;
- egChain = chain(guitarNuts : steelString(stringL,pluckPosition,excitation) :
- guitarBridge : guitarBody : out);
-};
-
-//-------`(pm.)guitar`----------
-// A simple acoustic guitar model with steel strings (based on
-// [`guitarModel`](#guitarmodel)) implementing an excitation model.
-// This model implements a single string. Additional strings should be created
-// by making a polyphonic applications out of this function.
-//
-// #### Usage
-//
-// ```
-// guitar(length,pluckPosition,trigger) : _
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: pluck position (0-1) (1 is on the bridge)
-// * `gain`: gain of the excitation
-// * `trigger`: trigger signal (1 for on, 0 for off)
-//----------------------------------
-guitar(stringLength,pluckPosition,gain,trigger) =
-pluckString(stringLength,1,1.5,1,gain,trigger) : guitarModel(stringLength, pluckPosition);
-
-//-------`(pm.)guitar_ui_MIDI`----------
-// Ready-to-use MIDI-enabled steel strings acoustic guitar physical model with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// guitar_ui_MIDI : _
-// ```
-//----------------------------------
-guitar_ui_MIDI = guitar(stringLength,pluckPosition,gain,gate)*outGain
-with{
- f = hslider("v:guitar/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:guitar/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:guitar/h:[0]midi/[2]gain[style:knob]",0.8,0,1,0.01);
- s = hslider("v:guitar/h:[0]midi/[3]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- pluckPosition = hslider("v:guitar/pluckPosition[midi:ctrl 1]"
- ,0.8,0,1,0.01) : si.smoo;
- outGain = hslider("v:guitar/outGain",0.5,0,1,0.01);
- t = button("v:guitar/[4]gate");
- gate = t+s : min(1);
- freq = f*bend;
- stringLength = freq : f2l;
-};
-
-//-------`(pm.)nylonGuitarModel`----------
-// A simple acoustic guitar model with nylon strings and selectable excitation
-// position. This model implements a single string. Additional strings should be created
-// by making a polyphonic applications out of this function. Pitch is changed by
-// changing the length of the string and not through a finger model.
-// WARNING: this function doesn't currently implement a body (just strings and
-// bridge)
-//
-// #### Usage
-//
-// ```
-// nylonGuitarModel(length,pluckPosition,excitation) : _
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: pluck position (0-1) (1 is on the bridge)
-// * `excitation`: excitation signal
-//----------------------------------
-nylonGuitarModel(length,pluckPosition,excitation) = endChain(egChain)
-with{
- maxStringLength = maxLength; // meters
- lengthTuning = 0.11;
- stringL = length-lengthTuning;
- egChain = chain(guitarNuts : nylonString(stringL,pluckPosition,excitation) :
- guitarBridge : guitarBody : out);
-};
-
-//-------`(pm.)nylonGuitar`----------
-// A simple acoustic guitar model with steel strings (based on
-// [`nylonGuitarModel`](#nylonguitarmodel)) implementing an excitation model.
-// This model implements a single string. Additional strings should be created
-// by making a polyphonic applications out of this function.
-//
-// #### Usage
-//
-// ```
-// nylonGuitar(length,pluckPosition,trigger) : _
-// ```
-//
-// Where:
-//
-// * `length`: the length of the string in meters
-// * `pluckPosition`: pluck position (0-1) (1 is on the bridge)
-// * `gain`: gain of the excitation (0-1)
-// * `trigger`: trigger signal (1 for on, 0 for off)
-//----------------------------------
-nylonGuitar(stringLength,pluckPosition,gain,trigger) =
-pluckString(stringLength,1,1.5,1,gain,trigger) : nylonGuitarModel(stringLength, pluckPosition);
-
-//-------`(pm.)nylonGuitar_ui_MIDI`----------
-// Ready-to-use MIDI-enabled nylon strings acoustic guitar physical model with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// nylonGuitar_ui_MIDI : _
-// ```
-//----------------------------------
-nylonGuitar_ui_MIDI = nylonGuitar(stringLength,pluckPosition,gain,gate)*outGain
-with{
- f = hslider("v:nylonGuitar/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:nylonGuitar/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:nylonGuitar/h:[0]midi/[2]gain[style:knob]",0.8,0,1,0.01);
- s = hslider("v:nylonGuitar/h:[0]midi/[3]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- pluckPosition = hslider("v:nylonGuitar/pluckPosition[midi:ctrl 1]"
- ,0.8,0,1,0.01) : si.smoo;
- outGain = hslider("v:nylonGuitar/outGain",0.5,0,1,0.01);
- t = button("v:nylonGuitar/[4]gate");
- gate = t+s : min(1);
- freq = f*bend;
- stringLength = freq : f2l;
-};
-
-//=============================Bowed String Instruments===================================
-// Low and high level basic string instruments parts. Most of the elements in
-// this section can be used in a bidirectional chain.
-//========================================================================================
-
-//-------`(pm.)bowTable`----------
-// Extremely basic bow table that can be used to implement a wide range of
-// bow types for many different bowed string instruments (violin, cello, etc.)
-//
-// #### Usage
-//
-// ```
-// excitation : bowTable(offeset,slope) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: an excitation signal
-// * `offset`: table offset
-// * `slope`: table slope
-//----------------------------------
-bowTable(offset,slope) = pow(abs(sample) + 0.75, -4) : min(1)
-with{
- sample = +(offset)*slope;
-};
-
-
-//-------`(pm.)violinBowTable`----------
-// Violin bow table based on [`bowTable`](#bowtable).
-//
-// #### Usage
-//
-// ```
-// bowVelocity : violinBowTable(bowPressure) : _
-// ```
-//
-// Where:
-//
-// * `bowVelocity`: velocity of the bow/excitation signal (0-1)
-// * `bowPressure`: bow pressure on the string (0-1)
-//----------------------------------
-violinBowTable(bowPressure) = bowTable(0,tableSlope)
-with{
- tableSlope = 5 - (4*bowPressure);
-};
-
-//-------`(pm.)bowInteraction`----------
-// Bidirectional block implementing the interaction of a bow in a
-// [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// chain(... : stringSegment : bowInteraction(bowTable) : stringSegment : ...)
-// ```
-//
-// Where:
-//
-// * `bowTable`: the bow table
-//----------------------------------
-bowInteraction(b) = (_,_ <: b,_,_ :> _,_),_;
-
-//-------`(pm.)violinBow`----------
-// Bidirectional block implementing a violin bow and its interaction with
-// a string.
-//
-// #### Usage
-//
-// ```
-// chain(... : stringSegment : violinBow(bowPressure,bowVelocity) : stringSegment : ...)
-// ```
-//
-// Where:
-//
-// * `bowVelocity`: velocity of the bow / excitation signal (0-1)
-// * `bowPressure`: bow pressure on the string (0-1)
-//----------------------------------
-violinBow(bowPressure,bowVelocity) = bowInteraction(bowSystem)
-with{
- bowSystem = + : bowVelocity-_ <: *(violinBowTable(bowPressure)) <: _,_;
-};
-
-//-------`(pm.)violinBowedString`----------
-// Violin bowed string bidirectional block with controllable bow position.
-// Terminations are not implemented in this model.
-//
-// #### Usage
-//
-// ```
-// chain(nuts : violinBowedString(stringLength,bowPressure,bowVelocity,bowPosition) : bridge)
-// ```
-//
-// Where:
-//
-// * `stringLength`: the length of the string in meters
-// * `bowVelocity`: velocity of the bow / excitation signal (0-1)
-// * `bowPressure`: bow pressure on the string (0-1)
-// * `bowPosition`: the position of the bow on the string (0-1)
-//----------------------------------
-violinBowedString(stringLength,bowPressure,bowVelocity,bowPosition) =
- chain(
- stringSegment(maxStringLength,ntbd) :
- violinBow(bowPressure,bowVelocity) :
- stringSegment(maxStringLength,btbd)
- )
-with{
- maxStringLength = maxLength;
- ntbd = stringLength*bowPosition; // upper portion of the string length
- btbd = stringLength*(1-bowPosition); // lower portion of the string length
-};
-
-//-------`(pm.)violinNuts`----------
-// Bidirectional block implementing simple violin nuts. This function is
-// based on [`bridgeFilter`](#bridgefilter).
-//
-// #### Usage
-//
-// ```
-// chain(violinNuts : stringSegment : ...)
-// ```
-//----------------------------------
-violinNuts = lTermination(-bridgeFilter(0.6,0.1),basicBlock);
-
-//-------`(pm.)violinBridge`----------
-// Bidirectional block implementing a simple violin bridge. This function is
-// based on [`bridgeFilter`](#bridgefilter).
-//
-// #### Usage
-//
-// ```
-// chain(... : stringSegment : violinBridge
-// ```
-//----------------------------------
-// TODO:
-// * reflectance is not implemented yet
-violinBridge = rTermination(basicBlock,reflectance) : _,transmittance,_
-with{
- reflectance = -bridgeFilter(0.2,0.9);
- transmittance = _;
-};
-
-//-------`(pm.)violinBody`----------
-// Bidirectional block implementing a simple violin body (just a simple
-// resonant lowpass filter).
-//
-// #### Usage
-//
-// ```
-// chain(... : stringSegment : violinBridge : violinBody)
-// ```
-//----------------------------------
-// TODO:
-// * reflectance is not implemented yet
-violinBody = reflectance,transmittance,_
-with{
- transmittance = fi.resonbp(500,2,1);
- reflectance = _;
-};
-
-//-------`(pm.)violinModel`----------
-// Ready-to-use simple violin physical model. This model implements a single
-// string. Additional strings should be created
-// by making a polyphonic applications out of this function. Pitch is changed
-// by changing the length of the string (and not through a finger model).
-//
-// #### Usage
-//
-// ```
-// violinModel(stringLength,bowPressure,bowVelocity,bridgeReflexion,
-// bridgeAbsorption,bowPosition) : _
-// ```
-//
-// Where:
-//
-// * `stringLength`: the length of the string in meters
-// * `bowVelocity`: velocity of the bow / excitation signal (0-1)
-// * `bowPressure`: bow pressure on the string (0-1))
-// * `bowPosition`: the position of the bow on the string (0-1)
-//----------------------------------
-violinModel(stringLength,bowPressure,bowVelocity,bowPosition) =
- endChain(modelChain)
-with{
- stringTuning = 0.08;
- stringL = stringLength-stringTuning;
- modelChain = chain(
- violinNuts :
- violinBowedString(stringL,bowPressure,bowVelocity,bowPosition) :
- violinBridge :
- violinBody :
- out
- );
-};
-
-//-------`(pm.)violin_ui`----------
-// Ready-to-use violin physical model with built-in UI.
-//
-// #### Usage
-//
-// ```
-// violinModel_ui : _
-// ```
-//----------------------------------
-violin_ui = violinModel(stringLength,bowPress,bowVel,bowPos)*outGain
-with{
- stringLength = hslider("v:violin/v:[0]string/[0]length",0.75,0,2,0.01) : si.smoo;
- bowVel = hslider("v:violin/v:[1]bow/[0]velocity",0,0,1,0.01) : si.smoo;
- bowPress = hslider("v:violin/v:[1]bow/[1]pressure",0.5,0,1,0.01) : si.smoo;
- bowPos = hslider("v:violin/v:[1]bow/[2]position",0.7,0,1,0.01) : si.smoo;
- outGain = hslider("v:violin/outGain",0.5,0,1,0.01);
-};
-
-//-------`(pm.)violin_ui_MIDI`----------
-// Ready-to-use MIDI-enabled violin physical model with built-in UI.
-//
-// #### Usage
-//
-// ```
-// violin_ui_MIDI : _
-// ```
-//----------------------------------
-violin_ui_MIDI = violinModel(stringLength,bowPress,bowVel,bowPos)*outGain
-with{
- f = hslider("v:violin/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:violin/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:violin/h:[0]midi/[2]gain[style:knob]
- ",0.6,0,1,0.01);
- envAttack = hslider("v:violin/h:[0]midi/[3]envAttack[style:knob]
- ",1,0,30,0.01)*0.001;
- s = hslider("v:violin/h:[0]midi/[4]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- bowPress = hslider("v:violin/h:[1]bow/[0]pressure[style:knob]
- [midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
- bowPos = hslider("v:violin/h:[1]bow/[1]position[style:knob]
- ",0.7,0,1,0.01) : si.smoo;
- vibratoFreq = hslider("v:violin/h:[2]otherParams/[0]vibratoFrequency
- [style:knob]",6,1,10,0.01);
- vibratoGain = hslider("v:violin/h:[2]otherParams/[1]vibratoGain
- [style:knob]",0.5,0,1,0.01)*0.01;
- outGain = hslider("v:violin/h:[2]otherParams/[2]outGain[style:knob]
- ",0.5,0,1,0.01);
- t = button("v:violin/[3]gate");
-
- gate = t+s : min(1);
- vibrato = 1+os.osc(vibratoFreq)*vibratoGain*envelope;
- freq = f*bend*vibrato;
- envelope = gate*gain : si.smooth(ba.tau2pole(envAttack));
-
- stringLength = freq : f2l;
- bowVel = envelope;
-};
-
-//=================================Wind Instruments=======================================
-// Low and high level basic wind instruments parts. Most of the elements in
-// this section can be used in a bidirectional chain.
-//========================================================================================
-
-//-------`(pm.)openTube`----------
-// A tube segment without terminations (same as [`stringSegment`](#stringsegment)).
-//
-// #### Usage
-//
-// ```
-// chain(A : openTube(maxLength,length) : B)
-// ```
-//
-// Where:
-//
-// * `maxLength`: the maximum length of the tube in meters (should be static)
-// * `length`: the length of the tube in meters
-//----------------------------------
-openTube = stringSegment;
-
-//-------`(pm.)reedTable`----------
-// Extremely basic reed table that can be used to implement a wide range of
-// single reed types for many different instruments (saxophone, clarinet, etc.).
-//
-// #### Usage
-//
-// ```
-// excitation : reedTable(offeset,slope) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: an excitation signal
-// * `offset`: table offset
-// * `slope`: table slope
-//----------------------------------
-reedTable(offset,slope) = reedTable : min(1) : max(-1)
-with {
- reedTable = *(slope) + offset;
-};
-
-//-------`(pm.)fluteJetTable`----------
-// Extremely basic flute jet table.
-//
-// #### Usage
-//
-// ```
-// excitation : fluteJetTable : _
-// ```
-//
-// Where:
-//
-// * `excitation`: an excitation signal
-//----------------------------------
-fluteJetTable = _ <: *(* : -(1)) : clipping
-with{
- clipping = min(1) : max(-1);
-};
-
-//-------`(pm.)brassLipsTable`----------
-// Simple brass lips/mouthpiece table. Since this implementation is very basic
-// and that the lips and tube of the instrument are coupled to each other, the
-// length of that tube must be provided here.
-//
-// #### Usage
-//
-// ```
-// excitation : brassLipsTable(tubeLength,lipsTension) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: an excitation signal (can be DC)
-// * `tubeLength`: length in meters of the tube connected to the mouthpiece
-// * `lipsTension`: tension of the lips (0-1) (default: 0.5)
-//----------------------------------
-brassLipsTable(tubeLength,lipsTension) = *(0.03) : lipFilter <: * : clipping
-with{
- clipping = min(1) : max(-1);
- freq = (tubeLength : l2f)*pow(4,(2*lipsTension)-1);
- filterR = 0.997;
- a1 = -2*filterR*cos(ma.PI*2*freq/ma.SR);
- lipFilter = fi.tf2(1,0,0,a1,pow(filterR,2)); // resonance with same freq as tube
-};
-
-//-------`(pm.)clarinetReed`----------
-// Clarinet reed based on [`reedTable`](#reedtable) with controllable
-// stiffness.
-//
-// #### Usage
-//
-// ```
-// excitation : clarinetReed(stiffness) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: an excitation signal
-// * `stiffness`: reed stiffness (0-1)
-//----------------------------------
-clarinetReed(stiffness) = reedTable(0.7,tableSlope)
-with{
- tableSlope = -0.44 + 0.26*stiffness;
-};
-
-//-------`(pm.)clarinetMouthPiece`----------
-// Bidirectional block implementing a clarinet mouthpiece as well as the various
-// interactions happening with traveling waves. This element is ready to be
-// plugged to a tube...
-//
-// #### Usage
-//
-// ```
-// chain(clarinetMouthPiece(reedStiffness,pressure) : tube : etc.)
-// ```
-//
-// Where:
-//
-// * `pressure`: the pressure of the air flow (DC) created by the virtual performer (0-1).
-// This can also be any kind of signal that will directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-// * `reedStiffness`: reed stiffness (0-1)
-//----------------------------------
-clarinetMouthPiece(reedStiffness,pressure) = lTermination(reedInteraction,in(pressure))
-with{
- reedInteraction = *(-1) <: *(clarinetReed(reedStiffness));
-};
-
-//-------`(pm.)brassLips`----------
-// Bidirectional block implementing a brass mouthpiece as well as the various
-// interactions happening with traveling waves. This element is ready to be
-// plugged to a tube...
-//
-// #### Usage
-//
-// ```
-// chain(brassLips(tubeLength,lipsTension,pressure) : tube : etc.)
-// ```
-//
-// Where:
-//
-// * `tubeLength`: length in meters of the tube connected to the mouthpiece
-// * `lipsTension`: tension of the lips (0-1) (default: 0.5)
-// * `pressure`: the pressure of the air flow (DC) created by the virtual performer (0-1).
-// This can also be any kind of signal that will directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-//----------------------------------
-brassLips(tubeLength,lipsTension,pressure) = lTermination(mpInteraction,basicBlock)
-with{
- absorption = *(0.85); // absorption coefficient
- p = pressure*0.3; // scaling pressure
- mpInteraction = absorption <:
- (p-_ : brassLipsTable(tubeLength,lipsTension) <: *(p),1-_),_ : _,* : + : fi.dcblocker;
-};
-
-//-------`(pm.)fluteEmbouchure`----------
-// Bidirectional block implementing a flute embouchure as well as the various
-// interactions happening with traveling waves. This element is ready to be
-// plugged between tubes segments...
-//
-// #### Usage
-//
-// ```
-// chain(... : tube : fluteEmbouchure(pressure) : tube : etc.)
-// ```
-//
-// Where:
-//
-// * `pressure`: the pressure of the air flow (DC) created by the virtual
-// performer (0-1).
-// This can also be any kind of signal that will directly injected in the
-// mouthpiece (e.g., breath noise, etc.)
-//----------------------------------
-fluteEmbouchure(pressure) =
-(_ <: _,_),_,_ : _,*(0.5)+(pressure-_*0.5 : fluteJetTable),_;
-
-//-------`(pm.)wBell`----------
-// Generic wind instrument bell bidirectional block that should be placed at
-// the end of a [`chain`](#chain).
-//
-// #### Usage
-//
-// ```
-// chain(... : wBell(opening))
-// ```
-//
-// Where:
-//
-// * `opening`: the "opening" of bell (0-1)
-//----------------------------------
-wBell(opening) = rTermination(basicBlock,si.smooth(opening));
-
-//-------`(pm.)fluteHead`----------
-// Simple flute head implementing waves reflexion.
-//
-// #### Usage
-//
-// ```
-// chain(fluteHead : tube : ...)
-// ```
-//----------------------------------
-fluteHead = lTermination(*(absorption),basicBlock)
-with{
- absorption = 0.95; // same as for foot
-};
-
-//-------`(pm.)fluteFoot`----------
-// Simple flute foot implementing waves reflexion and dispersion.
-//
-// #### Usage
-//
-// ```
-// chain(... : tube : fluteFoot)
-// ```
-//----------------------------------
-fluteFoot = rTermination(basicBlock,*(absorption) : dispersion)
-with{
- dispersion = si.smooth(0.7); // just a simple lowpass
- absorption = 0.95; // same as for head
-};
-
-//-------`(pm.)clarinetModel`----------
-// A simple clarinet physical model without tone holes (pitch is changed by
-// changing the length of the tube of the instrument).
-//
-// #### Usage
-//
-// ```
-// clarinetModel(length,pressure,reedStiffness,bellOpening) : _
-// ```
-//
-// Where:
-//
-// * `tubeLength`: the length of the tube in meters
-// * `pressure`: the pressure of the air flow created by the virtual performer (0-1).
-// This can also be any kind of signal that will directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-// * `reedStiffness`: reed stiffness (0-1)
-// * `bellOpening`: the opening of bell (0-1)
-//----------------------------------
-clarinetModel(tubeLength,pressure,reedStiffness,bellOpening) = endChain(modelChain)
-with{
- lengthTuning = 0.05; // empirical adjustment of the tuning of the tube
- maxTubeLength = maxLength;
- tunedLength = tubeLength/2-lengthTuning; // not really sure why we had to shift octave here
- modelChain =
- chain(
- clarinetMouthPiece(reedStiffness,pressure) :
- openTube(maxTubeLength,tunedLength) :
- wBell(bellOpening) : out
- );
-};
-
-//-------`(pm.)clarinetModel_ui`----------
-// Same as [`clarinetModel`](#clarinetModel) but with a built-in UI. This function
-// doesn't implement a virtual "blower", thus `pressure` remains an argument here.
-//
-// #### Usage
-//
-// ```
-// clarinetModel_ui(pressure) : _
-// ```
-//
-// Where:
-//
-// * `pressure`: the pressure of the air flow created by the virtual performer (0-1).
-// This can also be any kind of signal that will be directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-//----------------------------------
-clarinetModel_ui(pressure) = clarinetModel(tubeLength,pressure,reedStiffness,bellOpening)*outGain
-with{
- tubeLength = hslider("v:clarinetModel/[0]tubeLength",0.8,0.01,3,0.01) : si.smoo;
- reedStiffness = hslider("v:clarinetModel/[1]reedStiffness",0.5,0,1,0.01);
- bellOpening = hslider("v:clarinetModel/[2]bellOpening",0.5,0,1,0.01);
- outGain = hslider("v:clarinetModel/[3]outGain",0.5,0,1,0.01);
-};
-
-//-------`(pm.)clarinet_ui`----------
-// Ready-to-use clarinet physical model with built-in UI based on
-// [`clarinetModel`](#clarinetmodel).
-//
-// #### Usage
-//
-// ```
-// clarinet_ui : _
-// ```
-//----------------------------------
-clarinet_ui = hgroup("clarinet",blower_ui : clarinetModel_ui);
-
-//-------`(pm.)clarinet_ui_MIDI`----------
-// Ready-to-use MIDI compliant clarinet physical model with built-in UI.
-//
-// #### Usage
-//
-// ```
-// clarinet_ui_MIDI : _
-// ```
-//----------------------------------
-clarinet_ui_MIDI =
-clarinetModel(tubeLength,blow,reedStiffness,bellOpening)*outGain
-with{
- f = hslider("v:clarinet/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:clarinet/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:clarinet/h:[0]midi/[2]gain[style:knob]
- ",0.6,0,1,0.01);
- envAttack = hslider("v:clarinet/h:[0]midi/[3]envAttack[style:knob]
- ",1,0,30,0.01)*0.001;
- s = hslider("v:clarinet/h:[0]midi/[4]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- reedStiffness = hslider("v:clarinet/h:[1]otherParams/[0]reedStiffness
- [midi:ctrl 1][style:knob]",0.5,0,1,0.01);
- bellOpening = hslider("v:clarinet/h:[1]otherParams/[1]bellOpening
- [midi:ctrl 3][style:knob]",0.5,0,1,0.01);
- vibratoFreq = hslider("v:clarinet/h:[1]otherParams/[2]vibratoFreq
- [style:knob]",5,1,10,0.01);
- vibratoGain = hslider("v:clarinet/h:[1]otherParams/[3]vibratoGain
- [style:knob]",0.25,0,1,0.01)*0.01;
- outGain = hslider("v:clarinet/h:[1]otherParams/[4]outGain[style:knob]
- ",0.5,0,1,0.01);
- t = button("v:clarinet/[2]gate");
-
- gate = t+s : min(1);
- vibrato = 1+os.osc(vibratoFreq)*vibratoGain*envelope;
- freq = f*bend*vibrato;
- envelope = gate*gain : si.smooth(ba.tau2pole(envAttack));
-
- tubeLength = freq : f2l;
- pressure = envelope; // TODO: double vibrato here!!
- blow = blower(pressure,0.05,2000,vibratoFreq,vibratoGain);
-};
-
-//-------`(pm.)brassModel`----------
-// A simple generic brass instrument physical model without pistons
-// (pitch is changed by changing the length of the tube of the instrument).
-// This model is kind of hard to control and might not sound very good if
-// bad parameters are given to it...
-//
-// #### Usage
-//
-// ```
-// brassModel(tubeLength,lipsTension,mute,pressure) : _
-// ```
-//
-// Where:
-//
-// * `tubeLength`: the length of the tube in meters
-// * `lipsTension`: tension of the lips (0-1) (default: 0.5)
-// * `mute`: mute opening at the end of the instrument (0-1) (default: 0.5)
-// * `pressure`: the pressure of the air flow created by the virtual performer (0-1).
-// This can also be any kind of signal that will directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-//----------------------------------
-brassModel(tubeLength,lipsTension,mute,pressure) = endChain(brassChain)
-with{
- maxTubeLength = maxLength;
- lengthTuning = 0; // Not that important for that one because of lips tension
- tunedLength = tubeLength + lengthTuning;
- brassChain = chain(brassLips(tunedLength,lipsTension,pressure) : openTube(maxTubeLength,tunedLength) : wBell(mute) : out);
-};
-
-//-------`(pm.)brassModel_ui`----------
-// Same as [`brassModel`](#brassModel) but with a built-in UI. This function
-// doesn't implement a virtual "blower", thus `pressure` remains an argument here.
-//
-// #### Usage
-//
-// ```
-// brassModel_ui(pressure) : _
-// ```
-//
-// Where:
-//
-// * `pressure`: the pressure of the air flow created by the virtual performer (0-1).
-// This can also be any kind of signal that will be directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-//----------------------------------
-brassModel_ui(pressure) = brassModel(tubeLength,lipsTension,mute,pressure)
-with{
- tubeLength = hslider("v:brassModel/[1]tubeLength",0.5,0.01,2.5,0.01) : si.smoo;
- lipsTension = hslider("v:brassModel/[2]lipsTension",0.5,0,1,0.01) : si.smoo;
- mute = hslider("v:brassModel/[3]mute",0.5,0,1,0.01) : si.smoo;
-};
-
-//-------`(pm.)brass_ui`----------
-// Ready-to-use brass instrument physical model with built-in UI based on
-// [`brassModel`](#brassmodel).
-//
-// #### Usage
-//
-// ```
-// brass_ui : _
-// ```
-//----------------------------------
-brass_ui = hgroup("brass",blower_ui : brassModel_ui);
-
-//-------`(pm.)brass_ui_MIDI`----------
-// Ready-to-use MIDI-controllable brass instrument physical model with built-in UI.
-//
-// #### Usage
-//
-// ```
-// brass_ui_MIDI : _
-// ```
-//----------------------------------
-brass_ui_MIDI = brassModel(tubeLength,lipsTension,mute,pressure)*outGain
-with{
- f = hslider("v:brass/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:brass/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:brass/h:[0]midi/[2]gain[style:knob]
- ",0.5,0,1,0.01);
- envAttack = hslider("v:brass/h:[0]midi/[3]envAttack[style:knob]
- ",1,0,30,0.01)*0.001;
- s = hslider("v:brass/h:[0]midi/[4]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- lipsTension = hslider("v:brass/h:[1]otherParams/[0]lipsTension[style:knob]
- [midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
- mute = hslider("v:brass/h:[1]otherParams/[1]mute[style:knob]
- ",0.5,0,1,0.01) : si.smoo;
- vibratoFreq = hslider("v:brass/h:[1]otherParams/[2]vibratoFreq[style:knob]
- ",5,1,10,0.01);
- vibratoGain = hslider("v:brass/h:[1]otherParams/[3]vibratoGain[style:knob]
- ",0.5,0,1,0.01)*0.04;
- outGain = hslider("v:brass/h:[1]otherParams/[4]outGain[style:knob]
- ",0.5,0,1,0.01);
- t = button("v:brass/[2]gate");
-
- gate = t+s : min(1);
- vibrato = 1+os.osc(vibratoFreq)*vibratoGain*envelope;
- freq = f*bend;
- envelope = gate*gain : si.smooth(ba.tau2pole(envAttack));
-
- tubeLength = freq : f2l;
- pressure = envelope*vibrato;
-};
-
-//-------`(pm.)fluteModel`----------
-// A simple generic brass instrument physical model without tone holes
-// (pitch is changed by changing the length of the tube of the instrument).
-//
-// #### Usage
-//
-// ```
-// fluteModel(tubeLength,lipsTension,mute,pressure) : _
-// ```
-//
-// Where:
-//
-// * `tubeLength`: the length of the tube in meters
-// * `mouthPosition`: position of the mouth on the embouchure (0-1) (default: 0.5)
-// * `pressure`: the pressure of the air flow created by the virtual performer (0-1).
-// This can also be any kind of signal that will directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-//----------------------------------
-// TODO: this model is out of tune and we're not really sure why
-fluteModel(tubeLength,mouthPosition,pressure) = endChain(fluteChain) : fi.dcblocker
-with{
- maxTubeLength = maxLength;
- tubeTuning = 0.27; // set "by hand"
- tLength = tubeLength+tubeTuning; // global tube length
- embouchurePos = 0.27 + (mouthPosition-0.5)*0.4; // position of the embouchure on the tube
- tted = tLength*embouchurePos; // head to embouchure distance
- eted = tLength*(1-embouchurePos); // embouchure to foot distance
- fluteChain = chain(fluteHead : openTube(maxTubeLength,tted) : fluteEmbouchure(pressure) : openTube(maxTubeLength,eted) : fluteFoot : out);
-};
-
-//-------`(pm.)fluteModel_ui`----------
-// Same as [`fluteModel`](#fluteModel) but with a built-in UI. This function
-// doesn't implement a virtual "blower", thus `pressure` remains an argument here.
-//
-// #### Usage
-//
-// ```
-// fluteModel_ui(pressure) : _
-// ```
-//
-// Where:
-//
-// * `pressure`: the pressure of the air flow created by the virtual performer (0-1).
-// This can also be any kind of signal that will be directly injected in the mouthpiece
-// (e.g., breath noise, etc.)
-//----------------------------------
-fluteModel_ui(pressure) =
-fluteModel(tubeLength,mouthPosition,pressure)*outGain
-with{
- tubeLength = hslider("v:fluteModel/[0]tubeLength",0.8,0.01,3,0.01) : si.smoo;
- mouthPosition = hslider("v:fluteModel/[1]mouthPosition",0.5,0,1,0.01) : si.smoo;
- outGain = hslider("v:fluteModel/[2]outGain",0.5,0,1,0.01);
-};
-
-//-------`(pm.)flute_ui`----------
-// Ready-to-use flute physical model with built-in UI based on
-// [`fluteModel`](#flutemodel).
-//
-// #### Usage
-//
-// ```
-// flute_ui : _
-// ```
-//----------------------------------
-flute_ui = hgroup("flute",blower_ui : fluteModel_ui);
-
-//-------`(pm.)flute_ui_MIDI`----------
-// Ready-to-use MIDI-controllable flute physical model with built-in UI.
-//
-// #### Usage
-//
-// ```
-// brass_ui_MIDI : _
-// ```
-//----------------------------------
-flute_ui_MIDI = fluteModel(tubeLength,mouthPosition,blow)*outGain
-with{
- f = hslider("v:flute/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:flute/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:flute/h:[0]midi/[2]gain[style:knob]
- ",0.9,0,1,0.01);
- envAttack = hslider("v:flute/h:[0]midi/[3]envAttack[style:knob]
- ",1,0,30,0.01)*0.001;
- s = hslider("v:flute/h:[0]midi/[4]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- mouthPosition = hslider("v:flute/h:[1]otherParams/[0]mouthPosition
- [style:knob][midi:ctrl 1]",0.5,0,1,0.01)
- : si.smoo;
- vibratoFreq = hslider("v:flute/h:[1]otherParams/[1]vibratoFreq[style:knob]
- ",5,1,10,0.01);
- vibratoGain = hslider("v:flute/h:[1]otherParams/[2]vibratoGain[style:knob]
- ",0.5,0,1,0.01)*0.04;
- outGain = hslider("v:flute/h:[1]otherParams/[3]outGain[style:knob]
- ",0.5,0,1,0.01);
- t = button("v:flute/[2]gate");
-
- gate = t+s : min(1);
- freq = f*bend;
- envelope = gate*gain : si.smooth(ba.tau2pole(envAttack));
-
- tubeLength = freq : f2l;
- pressure = envelope;
- blow = blower(pressure,0.05,2000,vibratoFreq,vibratoGain);
-};
-
-
-//=====================================Exciters===========================================
-// Various kind of excitation signal generators.
-//========================================================================================
-
-//-------`(pm.)impulseExcitation`--------------
-// Creates an impulse excitation of one sample.
-//
-// #### Usage
-//
-// ```
-// gate = button('gate');
-// impulseExcitation(gate) : chain;
-// ```
-//
-// Where:
-//
-// * `gate`: a gate button
-//--------------------------------------
-impulseExcitation(trigger) = trigger : ba.impulsify;
-
-//-------`(pm.)strikeModel`--------------
-// Creates a filtered noise excitation.
-//
-// #### Usage
-//
-// ```
-// gate = button('gate');
-// strikeModel(LPcutoff,HPcutoff,sharpness,gain,gate) : chain;
-// ```
-//
-// Where:
-//
-// * `HPcutoff`: highpass cutoff frequency
-// * `LPcutoff`: lowpass cutoff frequency
-// * `sharpness`: sharpness of the attack and release (0-1)
-// * `gain`: gain of the excitation
-// * `gate`: a gate button/trigger signal (0/1)
-//--------------------------------------
-strikeModel(HPcutoff,LPcutoff,sharpness,gain,trigger) =
-no.noise : fi.highpass(2,HPcutoff) : fi.lowpass(2,LPcutoff) :
-*(en.ar(att,rel,trigger))*gain
-with{
- att = 0.002*sharpness;
- rel = att;
-};
-
-//-------`(pm.)strike`--------------
-// Strikes generator with controllable excitation position.
-//
-// #### Usage
-//
-// ```
-// gate = button('gate');
-// strike(exPos,sharpness,gain,gate) : chain;
-// ```
-//
-// Where:
-//
-// * `exPos`: excitation position wiht 0: for max low freqs and 1: for max high
-// freqs. So, on membrane for example, 0 would be the middle and 1 the edge
-// * `sharpness`: sharpness of the attack and release (0-1)
-// * `gain`: gain of the excitation
-// * `gate`: a gate button/trigger signal (0/1)
-//--------------------------------------
-strike(exPos,sharpness,gain,trigger) = strikeModel(HPcutoff,LPcutoff,sharpness,gain,trigger)
-with{
- HPcutoff = 40+exPos*500;
- LPcutoff = 500+exPos*15000;
-};
-
-//-------`(pm.)pluckString`--------------
-// Creates a plucking excitation signal.
-//
-// #### Usage
-//
-// ```
-// trigger = button('gate');
-// pluckString(stringLength,cutoff,maxFreq,sharpness,trigger)
-// ```
-//
-// Where:
-//
-// * `stringLength`: length of the string to pluck
-// * `cutoff`: cutoff ratio (1 for default)
-// * `maxFreq`: max frequency ratio (1 for default)
-// * `sharpness`: sharpness of the attack and release (1 for default)
-// * `gain`: gain of the excitation (0-1)
-// * `trigger`: trigger signal (1 for on, 0 for off)
-//--------------------------------------
-pluckString(stringLength,cutoff,maxFreq,sharpness,gain,trigger) =
-no.noise : fi.lowpass(2,cutoffreq) : *(en.ar(att,rel,trigger))*gain
-with{
- freq = stringLength : l2f;
- maxF = 2000*maxFreq;
- att = 0.002*sharpness*pow((1 - freq/maxF),2);
- rel = att;
- cutoffreq = freq*5*cutoff;
-};
-
-//-------`(pm.)blower`--------------
-// A virtual blower creating a DC signal with some breath noise in it.
-//
-// #### Usage
-//
-// ```
-// blower(pressure,breathGain,breathCutoff) : _
-// ```
-//
-// Where:
-//
-// * `pressure`: pressure (0-1)
-// * `breathGain`: breath noise gain (0-1) (recommended: 0.005)
-// * `breathCutoff`: breath cuttoff frequency (Hz) (recommended: 2000)
-//--------------------------------------
-blower(pressure,breathGain,breathCutoff,vibratoFreq,vibratoGain) = pressure + vibrato + breathNoise
-with{
- vibrato = os.osc(vibratoFreq)*vibratoGain;
- breathNoise = no.noise : fi.lowpass(2,breathCutoff) : *(pressure*breathGain);
-};
-
-//-------`(pm.)blower_ui`--------------
-// Same as [`blower`](#blower) but with a built-in UI.
-//
-// #### Usage
-//
-// ```
-// blower : somethingToBeBlown
-// ```
-//--------------------------------------
-blower_ui = blower(pressure,breathGain,breathCutoff,vibratoFreq,vibratoGain)
-with{
- pressure = hslider("v:blower/[0]pressure",0,0,1,0.01) : si.smoo;
- breathGain = hslider("v:blower/[1]breathGain",0.1,0,1,0.01)*0.05;
- breathCutoff = hslider("v:blower/[2]breathCutoff",2000,20,20000,0.1);
- vibratoFreq = hslider("v:blower/[3]vibratoFreq",5,0.1,10,0.1);
- vibratoGain = hslider("v:blower/[4]vibratoGain",0.25,0,1,0.01)*0.03;
-};
-
-
-//============================Modal Percussions===========================================
-// High and low level functions for modal synthesis of percussion instruments.
-//========================================================================================
-
-//-------`(pm.)djembeModel`----------
-// Dirt-simple djembe modal physical model. Mode parameters are empirically
-// calculated and don't correspond to any measurements or 3D model. They
-// kind of sound good though :).
-//
-// #### Usage
-//
-// ```
-// excitation : djembeModel(freq)
-// ```
-//
-// Where:
-//
-// * `excitation`: excitation signal
-// * `freq`: fundamental frequency of the bar
-//----------------------------------
-djembeModel(freq) = _ <: par(i,nModes,modeFilter(modeFreqs(i),modeT60s(i),modeGains(i))) :> /(nModes)
-with{
- nModes = 20;
- theta = 0; // angle
- modeFreqs(i) = freq + 200*i;
- modeT60s(i) = (nModes-i)*0.03;
- modeGains(i) = cos((i+1)*theta)/float(i+1)*(1/(i+1));
-};
-
-//-------`(pm.)djembe`----------
-// Dirt-simple djembe modal physical model. Mode parameters are empirically
-// calculated and don't correspond to any measurements or 3D model. They
-// kind of sound good though :).
-//
-// This model also implements a virtual "exciter".
-//
-// #### Usage
-//
-// ```
-// djembe(freq,strikePosition,strikeSharpness,gain,trigger
-// ```
-//
-// Where:
-//
-// * `freq`: fundamental frequency of the model
-// * `strikePosition`: strike position (0 for the middle of the membrane and
-// 1 for the edge)
-// * `strikeSharpness`: sharpness of the strike (0-5, default: 0.5)
-// * `gain`: gain of the strike
-// * `trigger`: trigger signal (0: off, 1: on)
-//----------------------------------
-djembe(freq,strikePosition,strikeSharpness,gain,trigger) =
-strike(strikePosition,strikeSharpness,gain,trigger) : djembeModel(freq);
-
-//-------`(pm.)djembe_ui_MIDI`----------
-// Simple MIDI controllable djembe physical model with built-in UI.
-//
-// #### Usage
-//
-// ```
-// djembe_ui_MIDI : _
-// ```
-//----------------------------------
-djembe_ui_MIDI =
-djembe(freq,strikePosition,strikeSharpness,gain,gate)*outGain
-with{
- freq = hslider("v:djembe/h:[0]midi/[0]freq[style:knob]",60,50,100,0.01);
- gain = hslider("v:djembe/h:[0]midi/[2]gain[style:knob]",1,0,1,0.01);
- strikePosition = hslider("v:djembe/h:[1]otherParams/[0]strikePosition
- [midi:ctrl 1][style:knob]",0.5,0,1,0.01);
- strikeSharpness = hslider("v:djembe/h:[1]otherParams/[1]strikeSharpness[style:knob]",0.5,0.01,5,0.01);
- outGain = hslider("v:djembe/h:[1]otherParams/[2]outGain
- [style:knob]",1,0,1,0.01);
- gate = button("v:djembe/[3]gate");
-};
-
-//-------`(pm.)marimbaBarModel`----------
-// Generic marimba tone bar modal model.
-//
-// This model was generated using
-// `mesh2faust` from a 3D CAD model of a marimba tone bar
-// (`libraries/modalmodels/marimbaBar`). The corresponding CAD model is that
-// of a C2 tone bar (original fundamental frequency: ~65Hz). While
-// `marimbaBarModel` allows to translate the harmonic content of the generated
-// sound by providing a frequency (`freq`), mode transposition has limits and
-// the model will sound less and less like a marimba tone bar as it
-// diverges from C2. To make an accurate model of a marimba, we'd want to have
-// an independent model for each bar...
-//
-// This model contains 5 excitation positions going linearly from the center
-// bottom to the center top of the bar. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// #### Usage
-//
-// ```
-// excitation : marimbaBarModel(freq,exPos,t60,t60DecayRatio,t60DecaySlope)
-// ```
-//
-// Where:
-//
-// * `excitation`: excitation signal
-// * `freq`: fundamental frequency of the bar
-// * `exPos`: excitation position (0-4)
-// * `t60`: T60 in seconds (recommended value: 0.1)
-// * `t60DecayRatio`: T60 decay ratio (recommended value: 1)
-// * `t60DecaySlope`: T60 decay slope (recommended value: 5)
-//----------------------------------
-marimbaBarModel(freq,exPos,t60,t60DecayRatio,t60DecaySlope) = _ <: par(i,nModes,modeFilter(modesFreqs(i),modesT60s(i),modesGains(int(exPos),i))) :> /(nModes)
-with{
-nModes = 50;
-nExPos = 5;
-modesFreqRatios(n) = ba.take(n+1,(1,3.31356,3.83469,8.06313,9.44778,14.1169,18.384,21.0102,26.1775,28.9944,37.0728,37.8703,40.0634,47.6439,51.019,52.43,58.286,63.5486,65.3628,66.9587,74.5301,78.692,80.8375,89.978,92.9661,95.1914,97.4807,110.62,112.069,113.826,119.356,127.045,129.982,132.259,133.477,144.549,149.438,152.033,153.166,155.597,158.183,168.105,171.863,174.464,178.937,181.482,185.398,190.369,192.19,195.505));
-modesFreqs(i) = freq*modesFreqRatios(i);
-modesGains(p,n) = waveform{1,0.776725,0.625723,0.855223,0.760159,0.698373,0.768011,0.641127,0.244034,0.707754,0.634013,0.247527,0.660849,0.450396,0.567783,0.106361,0.716814,0.66392,0.291208,0.310599,0.801495,0.635292,0.307435,0.874124,0.497668,0.487088,0.459115,0.733455,0.541818,0.441318,0.31392,0.40309,0.685353,0.60314,0.400552,0.453511,0.634386,0.291547,0.131605,0.368507,0.839907,0.60216,0.288296,0.57967,0.0242493,0.262746,0.368588,0.890284,0.408963,0.556072,0.884427,0.83211,0.612015,0.757176,0.919477,1,0.827963,0.89241,0.0357408,0.480789,0.752872,0.0546301,0.235937,0.362938,0.444472,0.101751,0.703418,0.453136,0.316629,0.490394,0.982508,0.551622,0.602009,0.666957,0.77683,0.905662,0.0987197,0.402968,0.829452,0.307645,0.64048,0.983971,0.584205,0.650365,0.334447,0.58357,0.540191,0.672534,0.245712,0.687298,0.883058,0.79295,0.600619,0.572682,0.122612,0.388248,0.290658,0.380255,0.290967,0.567819,0.0737721,0.42099,0.0786578,0.393995,0.268983,0.260614,0.494086,0.238026,0.0987824,0.277879,0.440563,0.0770212,0.450591,0.128137,0.0368275,0.128699,0.329605,0.374512,0.36359,0.272594,0.379052,0.305241,0.0741129,0.345728,0.29935,0.221284,0.0261391,0.293202,0.361885,0.11433,0.239005,0.434156,0.329583,0.21946,0.284175,0.198555,0.431976,0.302985,1,0.146221,0.140701,0.264243,0.185997,0.426322,0.30478,0.34399,0.19543,0.386955,0.1876,0.172812,0.0434115,0.303761,0.069454,0.453943,0.832451,0.317817,0.940601,1,0.180658,0.737921,0.832297,0.402352,0.126786,0.594398,0.485455,0.32447,0.365102,0.777922,0.588272,0.401353,0.610735,0.158693,0.0746072,0.825099,0.925459,0.65377,0.260792,0.719384,0.559908,0.37259,0.360035,0.622939,0.210271,0.444595,0.311286,0.464309,0.557231,0.52408,0.0701056,0.320749,0.19446,0.727609,0.522062,0.394004,0.235035,0.395646,0.494796,0.517318,0.109752,0.692849,0.00632009,0.0207583,0.00306107,0.0637191,0.081661,0.03511,0.127814,0.202294,0.0764145,0.263127,0.400199,0.267278,0.633385,1,0.739902,0.413763,0.41811,0.612715,0.672374,0.339674,0.21172,0.459645,0.1025,0.32589,0.148154,0.265442,0.0974305,0.286438,0.275213,0.109111,0.575089,0.370283,0.29411,0.259826,0.0648719,0.583418,0.282663,0.182004,0.117421,0.417727,0.16965,0.24853,0.122819,0.185486,0.0433618,0.373849,0.252768,0.195103,0.0927835,0.166543},int(p*nModes+n) : rdtable : select2(modesFreqs(n)<(ma.SR/2-1),0);
-modesT60s(i) = t60*pow(1-(modesFreqRatios(i)/195.955)*t60DecayRatio,t60DecaySlope);
-};
-
-//-------`(pm.)marimbaResTube`----------
-// Simple marimba resonance tube.
-//
-// #### Usage
-//
-// ```
-// marimbaResTube(tubeLength,excitation)
-// ```
-//
-// Where:
-//
-// * `tubeLength`: the length of the tube in meters
-// * `excitation`: the excitation signal (audio in)
-//----------------------------------
-marimbaResTube(tubeLength,excitation) = endChain(tubeChain)
-with{
- maxTubeLength = maxLength;
- lengthTuning = 0.04;
- tunedLength = tubeLength-lengthTuning;
- endTubeReflexion = si.smooth(0.95)*0.99;
- tubeChain =
- chain(
- in(excitation) :
- terminations(endTubeReflexion,
- openTube(maxTubeLength,tunedLength),
- endTubeReflexion) :
- out
- );
-};
-
-//-------`(pm.)marimbaModel`----------
-// Simple marimba physical model implementing a single tone bar connected to
-// tube. This model is scalable and can be adapted to any size of bar/tube
-// (see [`marimbaBarModel`](#marimbabarmodel) to know more about the
-// limitations of this type of system).
-//
-// #### Usage
-//
-// ```
-// excitation : marimbaModel(freq,exPos) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency of the bar/tube couple
-// * `exPos`: excitation position (0-4)
-//----------------------------------
-marimbaModel(freq,exPos) =
-marimbaBarModel(freq,exPos,maxT60,T60Decay,T60Slope) : marimbaResTube(resTubeLength)
-with{
- resTubeLength = freq : f2l;
- maxT60 = 0.1;
- T60Decay = 1;
- T60Slope = 5;
-};
-
-//-------`(pm.)marimba`----------
-// Simple marimba physical model implementing a single tone bar connected to
-// tube. This model is scalable and can be adapted to any size of bar/tube
-// (see [`marimbaBarModel`](#marimbabarmodel) to know more about the
-// limitations of this type of system).
-//
-// This function also implement a virtual exciter to drive the model.
-//
-// #### Usage
-//
-// ```
-// excitation : marimba(freq,strikePosition,strikeCutoff,strikeSharpness,gain,trigger) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `freq`: the frequency of the bar/tube couple
-// * `strikePosition`: strike position (0-4)
-// * `strikeCutoff`: cuttoff frequency of the strike genarator (recommended: ~7000Hz)
-// * `strikeSharpness`: shaarpness of the strike (recommened: ~0.25)
-// * `gain`: gain of the strike (0-1)
-// * `trigger` signal (0: off, 1: on)
-//----------------------------------
-marimba(freq,strikePosition,strikeCutoff,strikeSharpness,gain,trigger) =
-strikeModel(10,strikeCutoff,strikeSharpness,gain,trigger) :
-marimbaModel(freq,strikePosition);
-
-//-------`(pm.)marimba_ui_MIDI`----------
-// Simple MIDI controllable marimba physical model with built-in UI
-// implementing a single tone bar connected to
-// tube. This model is scalable and can be adapted to any size of bar/tube
-// (see [`marimbaBarModel`](#marimbabarmodel) to know more about the
-// limitations of this type of system).
-//
-// #### Usage
-//
-// ```
-// marimba_ui_MIDI : _
-// ```
-//----------------------------------
-marimba_ui_MIDI =
-marimba(freq,strikePosition,strikeCutoff,strikeSharpness,gain,gate)*outGain
-with{
- freq = hslider("v:marimba/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- gain = hslider("v:marimba/h:[0]midi/[2]gain[style:knob]",1,0,1,0.01);
- strikePosition = nentry("v:marimba/h:[1]otherParams/[0]strikePosition
- [midi:ctrl 1]",0,0,4,1);
- strikeCutoff = hslider("v:marimba/h:[1]otherParams/[1]strikeCutOff
- [midi:ctrl 1][style:knob]",6500,20,20000,1);
- strikeSharpness = hslider("v:marimba/h:[1]otherParams/[2]strikeSharpness
- [style:knob]",0.5,0.01,5,0.01);
- outGain = hslider("v:marimba/h:[1]otherParams/[2]outGain
- [style:knob]",0.8,0,1,0.01);
- gate = button("v:marimba/[3]gate");
-};
-
-//-------`(pm.)churchBellModel`----------
-// Generic church bell modal model generated by `mesh2faust` from
-// `libraries/modalmodels/churchBell`.
-//
-// Modeled after T. Rossing and R. Perrin, Vibrations of Bells, Applied
-// Acoustics 2, 1987.
-//
-// Model height is 301 mm.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// #### Usage
-//
-// ```
-// excitation : churchBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope)
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `nModes`: number of synthesized modes (max: 50)
-// * `exPos`: excitation position (0-6)
-// * `t60`: T60 in seconds (recommended value: 0.1)
-// * `t60DecayRatio`: T60 decay ratio (recommended value: 1)
-// * `t60DecaySlope`: T60 decay slope (recommended value: 5)
-//----------------------------------
-churchBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope) = _ <: par(i,nModes,modeFilter(modesFreqs(i),modesT60s(i),modesGains(int(exPos),i))) :> /(nModes)
-with{
-nExPos = 7;
-modesFreqs(n) = ba.take(n+1,(451.918,455,864.643,871.402,1072.47,1073.98,1292.23,1292.48,1504.6,1532.41,1646.2,1647,1677.83,1678.13,1866.63,1882.08,1985.2,1989.87,2114.93,2356.81,2444.32,2446.22,2528.77,2530.92,2668.86,2669.63,2738.06,2749.03,2750.53,2753.11,2827.19,2842.32,2992.56,2996.84,3172.61,3330.79,3390.33,3403.1,3516.43,3538.54,3582.79,3583.82,3730.04,3739.35,3758.66,3903.78,3942.59,3981.74,3983.25,4033.97));
-modesGains(p,n) = waveform{0.525285,0.814174,0.483261,0.296745,0.975056,0.472244,0.409501,0.425364,0.687559,0.288381,0.309285,0.123054,0.286333,0.576706,0.908322,0.626974,0.0801852,0.309835,0.45143,0.132845,0.470635,0.417008,0.265112,0.0752802,0.46347,0.47181,0.275324,0.547027,0.512519,0.394078,0.595404,0.941306,0.392501,0.381435,0.391232,0.118924,0.339495,0.101421,0.241755,0.0873255,0.378944,0.637705,0.171946,0.149859,0.23329,0.54181,1,0.115554,0.244172,0.574329,0.606171,0.938397,0.392555,0.277359,0.86857,0.432489,0.408856,0.407932,0.299815,0.256659,0.549572,0.406347,0.312331,0.627578,0.670167,0.524648,0.406926,0.637524,0.555837,1,0.818979,0.705347,0.678141,0.427382,0.674404,0.636105,0.643635,0.699136,0.836201,0.613085,0.319019,0.725259,0.545519,0.479861,0.49836,0.488654,0.861672,0.314287,0.671052,0.531905,0.421781,0.815066,0.772032,0.488722,0.0896674,0.291286,0.65873,0.635632,0.679357,0.459497,0.36024,0.582289,0.650605,0.49095,0.38191,0.157261,0.479624,0.477491,0.174435,0.013094,0.879113,0.608069,0.268877,0.604479,0.24513,0.170507,0.292888,0.545849,0.476646,0.922316,0.669192,0.578094,0.578797,0.311396,0.60121,0.549955,1,0.66573,0.980115,0.537848,0.0740531,0.252472,0.25575,0.223974,0.0865103,0.138209,0.198623,0.0453034,0.432453,0.292407,0.39441,0.857659,0.271668,0.201545,0.583994,0.0602378,0.190618,0.849505,0.975542,0.17314,0.206472,0.344793,0.761011,0.558125,0.117245,0.0338485,0.337597,0.336646,0.174253,0.23017,0.934873,0.593647,0.393225,0.683704,0.0566093,0.0405012,0.148972,0.338722,0.283419,0.394007,0.237475,0.269964,0.428313,0.177499,0.462585,0.443963,0.981793,0.408239,0.676527,0.402865,0.0163303,0.0515114,0.34139,0.311135,0.613276,0.805884,0.95329,0.406091,0.578705,0.386785,0.434103,0.77526,1,0.635909,0.782052,0.0137183,0.0387725,0.618964,0.857071,0.131522,0.184988,0.299495,0.789212,0.603114,0.0704989,0.0129339,0.252481,0.254121,0.189206,0.357713,0.950308,0.552573,0.466454,0.77736,0.0307886,0.0251943,0.378886,0.740187,0.247637,0.235201,0.493045,0.51785,0.883954,0.429473,0.409433,0.415266,0.940198,0.282334,0.43789,0.375385,0.0157366,0.0171763,0.485555,0.461015,0.858958,0.907991,0.935191,0.37551,1,0.585493,0.269981,0.423053,0.666067,0.43509,0.790252,0.00889586,0.0208844,0.449735,0.790808,0.159856,0.089599,0.161546,0.528168,0.380642,0.0206276,0.00726426,0.0315352,0.0315841,0.197649,0.475057,0.517232,0.360922,0.421204,0.63134,0.00952139,0.016105,0.499615,0.922958,0.214983,0.0655141,0.50397,0.514848,1,0.483619,0.254027,0.228372,0.436105,0.233125,0.152242,0.279513,0.00906739,0.0132332,0.451257,0.388566,0.737226,0.479378,0.233037,0.103767,0.845609,0.644127,0.261359,0.371457,0.527229,0.381373,0.334492,0.00833749,0.00861982,0.255919,0.254197,0.0872333,0.0461512,0.113018,0.345986,0.236344,0.01078,0.00816506,0.405181,0.38718,0.343681,0.816493,0.259082,0.211906,0.432455,0.696886,0.00576224,0.013131,0.455969,0.811609,0.426544,0.128489,0.215937,0.233934,0.72307,0.351623,0.394231,0.323766,0.168803,0.276932,0.264684,0.227703,0.00680935,0.0170703,0.603018,0.476461,0.585925,0.71696,1,0.576527,0.475524,0.447322,0.356902,0.597573,0.697246,0.505333,0.285421,0.0147193,0.0141618,0.136188,0.0336537,0.216437},int(p*nModes+n) : rdtable;
-modesT60s(i) = t60*pow(1-(modesFreqs(i)/4035.44)*t60DecayRatio,t60DecaySlope);
-};
-
-//-------`(pm.)churchBell`----------
-// Generic church bell modal model.
-//
-// Modeled after T. Rossing and R. Perrin, Vibrations of Bells, Applied
-// Acoustics 2, 1987.
-//
-// Model height is 301 mm.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// This function also implement a virtual exciter to drive the model.
-//
-// #### Usage
-//
-// ```
-// excitation : churchBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `strikePosition`: strike position (0-6)
-// * `strikeCutoff`: cuttoff frequency of the strike genarator (recommended: ~7000Hz)
-// * `strikeSharpness`: shaarpness of the strike (recommened: ~0.25)
-// * `gain`: gain of the strike (0-1)
-// * `trigger` signal (0: off, 1: on)
-//----------------------------------
-churchBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) =
-strikeModel(10,strikeCutoff,strikeSharpness,gain,trigger) :
-churchBellModel(50,strikePosition,30,1,2.5);
-
-//-------`(pm.)churchBell_ui`----------
-// Church bell physical model based on [`churchBell`](#churchbell) with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// churchBell_ui : _
-// ```
-//----------------------------------
-churchBell_ui =
-churchBell(strikePosition,strikeCutoff,strikeSharpness,gain,gate)
-with{
- strikePosition = nentry("v:churchBell/[0]strikePosition",
- 0,0,4,1);
- strikeCutoff = hslider("v:churchBell/[1]strikeCutOff",
- 6500,20,20000,1);
- strikeSharpness = hslider("v:churchBell/[2]strikeSharpness",
- 0.5,0.01,5,0.01);
- gain = hslider("v:churchBell/[3]gain",1,0,1,0.01);
- gate = button("v:churchBell/[4]gate");
-};
-
-//-------`(pm.)englishBellModel`----------
-// English church bell modal model generated by `mesh2faust` from
-// `libraries/modalmodels/englishBell`.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 1 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// #### Usage
-//
-// ```
-// excitation : englishBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope)
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `nModes`: number of synthesized modes (max: 50)
-// * `exPos`: excitation position (0-6)
-// * `t60`: T60 in seconds (recommended value: 0.1)
-// * `t60DecayRatio`: T60 decay ratio (recommended value: 1)
-// * `t60DecaySlope`: T60 decay slope (recommended value: 5)
-//----------------------------------
-englishBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope) = _ <: par(i,nModes,modeFilter(modesFreqs(i),modesT60s(i),modesGains(int(exPos),i))) :> /(nModes)
-with{
-nExPos = 7;
-modesFreqs(n) = ba.take(n+1,(259.429,261.855,493.331,494.472,603.048,604.742,724.566,724.777,786.985,931.893,932.846,943.429,946.533,947.109,952.782,1024.24,1034.86,1211.59,1212.21,1236.28,1340.21,1341.15,1452.63,1453.38,1453.77,1457.45,1459.23,1460.7,1482.81,1483.04,1519.55,1547.27,1565.95,1576.95,1697.47,1826.61,1892.56,1896.09,1899.86,1908.29,2003.95,2005.07,2005.89,2005.99,2067.42,2082.42,2086.81,2120.56,2129.79,2133.23));
-modesGains(p,n) = waveform{0.694274,0.471698,0.17239,0.585446,0.397986,0.919579,0.531947,0.100205,0.639469,0.672209,0.144345,0.416595,0.124108,0.380591,0.256578,0.646031,0.8522,0.0224376,0.382762,0.143925,0.368691,0.430556,0.32318,0.142956,0.274521,0.713824,0.442794,0.352473,0.247756,0.415152,1,0.401869,0.197981,0.27951,0.210249,0.36974,0.369227,0.155769,0.272368,0.335712,0.31645,0.714103,0.285781,0.22006,0.827704,0.206342,0.180177,0.311478,0.197607,0.575475,0.473311,0.587232,0.50288,0.337308,0.304514,0.429039,0.351522,0.341373,0.175081,0.561748,0.439172,0.323164,0.540518,0.536523,0.0743865,0.213417,0.358012,0.474494,0.310274,0.839413,0.241372,0.202343,0.480634,0.995685,0.37374,0.133998,0.520674,0.207514,1,0.101239,0.279536,0.185985,0.436293,0.62411,0.334519,0.283585,0.179317,0.353847,0.449545,0.574128,0.135172,0.538275,0.476424,0.832903,0.164198,0.188562,0.135978,0.390128,0.131045,0.312065,0.142139,0.0255901,0.266947,0.371607,0.0168435,0.0249468,0.508917,0.35441,0.283348,0.628155,0.292478,0.35835,0.342569,0.441237,0.886699,0.0174698,0.00641843,0.55532,0.880129,0.0306909,0.290081,0.248816,0.981736,0.324624,0.213676,0.432885,0.0981559,0.444149,0.395554,0.525069,0.0771308,0.0488804,0.591321,0.108044,0.443802,0.740318,0.599438,0.293093,1,0.141662,0.910031,0.226126,0.299702,0.341472,0.0568061,0.222494,0.918718,0.199478,0.21662,0.107759,0.692324,0.556336,0.281718,0.430832,0.341656,0.608095,0.342129,0.311312,0.229953,0.695087,0.0761489,0.349818,0.361706,0.577611,0.147797,0.327376,0.465715,0.342902,0.521381,0.836828,0.241112,0.284394,0.539316,0.143408,0.51702,1,0.236336,0.480333,0.676744,0.807582,0.468621,0.236953,0.411604,0.579251,0.425098,0.37599,0.461176,0.27653,0.462368,0.613004,0.666849,0.954715,0.161507,0.170433,0.290461,0.117303,0.365133,0.233794,0.194568,0.338874,0.523381,0.39835,0.447839,0.652891,0.15708,0.340354,0.44217,0.338764,0.184397,0.771607,0.160502,0.324487,0.477499,0.831519,0.0168764,0.154264,0.201865,0.237786,0.390066,0.880164,0.284234,0.162837,0.437557,0.227846,0.39934,1,0.158107,0.396903,0.513029,0.676457,0.204282,0.0895575,0.55541,0.732486,0.125062,0.171229,0.081646,0.0541394,0.39616,0.454288,0.466863,0.928842,0.155393,0.26285,0.113453,0.133163,0.302021,0.612616,0.228392,0.195617,0.287236,0.198762,0.499884,0.809139,0.00929925,0.0840299,0.286446,0.182112,0.186044,0.754138,0.279556,0.266948,0.494291,1,0.321284,0.0230981,0.0375537,0.262531,0.602204,0.489925,0.633077,0.407409,0.422256,0.0910641,0.357935,0.550179,0.106192,0.132366,0.376231,0.351151,0.0420302,0.0372183,0.696335,0.840821,0.855235,0.249248,0.860011,0.340481,0.28558,0.363039,0.324122,0.515699,0.228131,0.172592,0.0188723,0.168243,0.995105,0.741759,0.107093,0.070349,0.136636,0.0780455,0.315748,0.502201,0.0190422,0.033914,0.225724,0.160236,0.184101,0.564203,0.247317,0.284225,0.327153,0.651443,0.593471,0.0163899,0.0141048,0.52113,1,0.105109,0.530936,0.363724,0.924809,0.25041,0.69288,0.414122,0.0793658,0.347813,0.441731,0.476428,0.0808834,0.0581638,0.557239,0.556515,0.746084,0.582228,0.177231,0.158425,0.850903,0.755271,0.673614,0.31706,0.0515386,0.201898,0.0577938,0.232031,0.734988,0.141594,0.267062,0.145807},int(p*nModes+n) : rdtable;
-modesT60s(i) = t60*pow(1-(modesFreqs(i)/2137.04)*t60DecayRatio,t60DecaySlope);
-};
-
-//-------`(pm.)englishBell`----------
-// English church bell modal model.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 1 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// This function also implement a virtual exciter to drive the model.
-//
-// #### Usage
-//
-// ```
-// excitation : englishBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `strikePosition`: strike position (0-6)
-// * `strikeCutoff`: cuttoff frequency of the strike genarator (recommended: ~7000Hz)
-// * `strikeSharpness`: shaarpness of the strike (recommened: ~0.25)
-// * `gain`: gain of the strike (0-1)
-// * `trigger` signal (0: off, 1: on)
-//----------------------------------
-englishBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) =
-strikeModel(10,strikeCutoff,strikeSharpness,gain,trigger) :
-englishBellModel(50,strikePosition,30,1,3);
-
-//-------`(pm.)englishBell_ui`----------
-// English church bell physical model based on [`englishBell`](#englishbell) with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// englishBell_ui : _
-// ```
-//----------------------------------
-englishBell_ui =
-englishBell(strikePosition,strikeCutoff,strikeSharpness,gain,gate)
-with{
- strikePosition = nentry("v:englishBell/[0]strikePosition",
- 0,0,4,1);
- strikeCutoff = hslider("v:englishBell/[1]strikeCutOff",
- 6500,20,20000,1);
- strikeSharpness = hslider("v:englishBell/[2]strikeSharpness",
- 0.5,0.01,5,0.01);
- gain = hslider("v:englishBell/[3]gain",1,0,1,0.01);
- gate = button("v:englishBell/[4]gate");
-};
-
-//-------`(pm.)frenchBellModel`----------
-// French church bell modal model generated by `mesh2faust` from
-// `libraries/modalmodels/frenchBell`.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 1 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// #### Usage
-//
-// ```
-// excitation : frenchBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope)
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `nModes`: number of synthesized modes (max: 50)
-// * `exPos`: excitation position (0-6)
-// * `t60`: T60 in seconds (recommended value: 0.1)
-// * `t60DecayRatio`: T60 decay ratio (recommended value: 1)
-// * `t60DecaySlope`: T60 decay slope (recommended value: 5)
-//----------------------------------
-frenchBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope) = _ <: par(i,nModes,modeFilter(modesFreqs(i),modesT60s(i),modesGains(int(exPos),i))) :> /(nModes)
-with{
-nExPos = 7;
-modesFreqs(n) = ba.take(n+1,(439.077,440.305,606.452,611.776,709.617,709.877,856.966,899.051,1064.37,1064.75,1073.03,1074.43,1076.58,1145.42,1148.9,1197.09,1199.91,1387.7,1400.16,1402.37,1512.06,1513.06,1592.47,1593.35,1663.45,1666.47,1691.32,1693.77,1804.83,1808.84,1820.07,1847.14,1910.73,1927.7,2035.07,2038.73,2054.66,2055.67,2078.69,2091.76,2115.78,2127.01,2209.86,2214.05,2296.15,2298.08,2298.97,2307.62,2404.44,2408.99));
-modesGains(p,n) = waveform{0.97289,0.542393,0.495832,0.897966,0.552367,0.557895,0.614213,0.353694,0.436039,0.441024,0.674913,0.566754,0.755008,0.69903,0.164398,0.91004,0.628373,0.201718,0.429517,0.503715,0.871174,0.106886,0.761173,0.673602,0.291937,0.58859,0.31528,0.413081,0.274464,0.494062,0.696121,0.61201,0.382757,0.995113,0.228806,0.198449,0.595847,0.306263,0.252397,0.0883567,0.236086,1,0.245278,0.379388,0.198824,0.548892,0.492764,0.420871,0.794637,0.605634,1,0.604159,0.399841,0.799347,0.507187,0.50981,0.477383,0.310226,0.426976,0.437623,0.735712,0.630728,0.625785,0.651168,0.277738,0.850858,0.578079,0.645354,0.3837,0.370598,0.782542,0.181325,0.614391,0.740684,0.342441,0.586186,0.286909,0.405197,0.259215,0.566983,0.748219,0.655898,0.36826,0.940814,0.336157,0.413702,0.561557,0.402176,0.117698,0.329369,0.254571,0.870706,0.260981,0.274122,0.206247,0.6453,0.400758,0.363622,0.636834,0.584566,0.975603,0.616937,0.295401,0.650447,0.464221,0.465057,0.312467,0.238358,0.383695,0.399674,0.753912,0.662012,0.504268,0.599248,0.378665,0.725363,0.493214,1,0.332836,0.265889,0.674073,0.320401,0.440018,0.769782,0.316419,0.529968,0.380509,0.578676,0.249013,0.591384,0.761717,0.687057,0.324437,0.818864,0.505369,0.672485,0.461783,0.426198,0.0678875,0.435329,0.347955,0.708394,0.293322,0.328986,0.258254,0.893512,0.320131,0.433554,0.459302,0.542213,0.817241,0.51623,0.205302,0.467354,0.388683,0.388216,0.171262,0.150865,0.29172,0.311414,0.658876,0.570647,0.383619,0.502455,0.364114,0.532313,0.352989,1,0.261984,0.219591,0.544031,0.337199,0.279173,0.668303,0.208439,0.39923,0.418674,0.648618,0.234133,0.504729,0.645347,0.572851,0.232828,0.614292,0.485272,0.666264,0.31657,0.320355,0.191421,0.340131,0.342069,0.538371,0.281131,0.393115,0.251394,0.890725,0.310644,0.5037,0.29909,0.442478,0.733128,0.455217,0.199322,0.315699,0.375856,0.37649,0.029145,0.0200283,0.279578,0.3168,0.655957,0.546843,0.349666,0.470249,0.353765,0.286794,0.180185,1,0.210831,0.280133,0.535853,0.376488,0.15367,0.634745,0.0510449,0.485575,0.593111,0.917884,0.380477,0.422925,0.599373,0.311421,0.135654,0.359954,0.295748,0.474439,0.353339,0.116743,0.454313,0.112858,0.35931,0.483897,0.301608,0.577342,0.262663,0.794986,0.54958,0.808086,0.152511,0.439591,0.535941,0.308018,0.419837,0.579191,0.250428,0.25212,0.10286,0.288332,0.599679,0.665108,0.636285,0.495234,0.251613,0.208527,0.0939072,0.458415,0.318952,0.23535,0.215189,0.313412,0.0472787,0.0386893,0.0863359,0.222346,0.361511,0.997037,0.238509,0.38214,1,0.203554,0.472087,0.509015,0.206371,0.441013,0.794008,0.971623,0.796384,0.55043,0.68778,0.554298,0.0436545,0.0595577,0.214685,0.58147,0.27732,0.368466,0.121382,0.152739,0.0782244,0.190497,0.316269,0.180456,0.405196,0.518716,0.159365,0.165808,0.194372,0.614764,0.553415,0.644794,0.44178,0.44149,0.221588,1,0.579371,0.606339,0.529167,0.0214475,0.417046,0.663152,0.894841,0.475752,0.168289,0.46859,0.304604,0.666369,0.308337,0.295091,0.768945,0.350911,0.49068,0.516584,0.400117,0.820687,0.545486,0.709357,0.509759,0.472006,0.152455,0.981265,0.459134,0.698666,0.247154,0.623253,0.255508,0.830815,0.088709,0.126082,0.0770623,0.263328},int(p*nModes+n) : rdtable;
-modesT60s(i) = t60*pow(1-(modesFreqs(i)/2555.3)*t60DecayRatio,t60DecaySlope);
-};
-
-//-------`(pm.)frenchBell`----------
-// French church bell modal model.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 1 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// This function also implement a virtual exciter to drive the model.
-//
-// #### Usage
-//
-// ```
-// excitation : frenchBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `strikePosition`: strike position (0-6)
-// * `strikeCutoff`: cuttoff frequency of the strike genarator (recommended: ~7000Hz)
-// * `strikeSharpness`: shaarpness of the strike (recommened: ~0.25)
-// * `gain`: gain of the strike (0-1)
-// * `trigger` signal (0: off, 1: on)
-//----------------------------------
-frenchBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) =
-strikeModel(10,strikeCutoff,strikeSharpness,gain,trigger) :
-frenchBellModel(50,strikePosition,30,1,3);
-
-//-------`(pm.)frenchBell_ui`----------
-// French church bell physical model based on [`frenchBell`](#frenchbell) with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// frenchBell_ui : _
-// ```
-//----------------------------------
-frenchBell_ui =
-frenchBell(strikePosition,strikeCutoff,strikeSharpness,gain,gate)
-with{
- strikePosition = nentry("v:frenchBell/[0]strikePosition",
- 0,0,4,1);
- strikeCutoff = hslider("v:frenchBell/[1]strikeCutOff",
- 6500,20,20000,1);
- strikeSharpness = hslider("v:frenchBell/[2]strikeSharpness",
- 0.5,0.01,5,0.01);
- gain = hslider("v:frenchBell/[3]gain",1,0,1,0.01);
- gate = button("v:frenchBell/[4]gate");
-};
-
-//-------`(pm.)germanBellModel`----------
-// German church bell modal model generated by `mesh2faust` from
-// `libraries/modalmodels/germanBell`.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 1 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// #### Usage
-//
-// ```
-// excitation : germanBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope)
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `nModes`: number of synthesized modes (max: 50)
-// * `exPos`: excitation position (0-6)
-// * `t60`: T60 in seconds (recommended value: 0.1)
-// * `t60DecayRatio`: T60 decay ratio (recommended value: 1)
-// * `t60DecaySlope`: T60 decay slope (recommended value: 5)
-//----------------------------------
-germanBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope) = _ <: par(i,nModes,modeFilter(modesFreqs(i),modesT60s(i),modesGains(int(exPos),i))) :> /(nModes)
-with{
-nExPos = 7;
-modesFreqs(n) = ba.take(n+1,(238.909,240.235,406.25,408.214,561.105,562.923,749.632,749.88,781.389,800.68,801.547,884.486,942.52,942.715,958.571,960.581,1016.87,1018.29,1022.29,1206.2,1206.87,1213.93,1222.77,1231.68,1345.65,1355.18,1356.55,1357.3,1389.29,1391.11,1420.17,1424.05,1424.31,1426.54,1582.3,1631.07,1638.15,1720.28,1726.7,1803.79,1827.08,1829.44,1922.87,1926.94,1940.96,1944.47,1948.2,1969.86,1992.24,2011.85));
-modesGains(p,n) = waveform{0.761411,0.797803,0.586057,0.225039,0.926354,0.813875,0.529871,0.158915,0.662516,0.30841,0.0454785,0.556082,0.784713,0.213035,0.956227,0.795165,0.313508,0.158531,0.301586,0.16832,0.281267,0.154237,0.217235,0.247239,0.522688,0.170303,0.320614,0.154857,0.414941,0.788364,0.713299,0.381592,0.707011,1,0.0106946,0.359763,0.0746156,0.431124,0.118053,0.52729,0.255303,0.646855,0.201145,0.919908,0.359389,0.253494,0.865695,0.0829263,0.222589,0.0415736,0.735774,0.769678,0.381416,0.197543,0.682389,0.614766,0.249525,0.289883,0.300319,0.443691,0.275272,0.370218,0.74879,0.161247,0.634353,0.498498,0.221988,0.350637,0.436817,0.436463,0.52508,0.842646,0.195324,0.224755,0.545681,0.353778,0.269044,0.327814,0.448952,0.852305,0.380503,1,0.458063,0.565058,0.354635,0.659529,0.449485,0.802014,0.283446,0.521563,0.374639,0.652112,0.181042,0.468394,0.430116,0.157207,0.414995,0.292737,0.487785,0.47768,0.481445,0.556988,0.561132,0.378265,0.291462,0.32325,0.482602,0.328248,0.196792,0.712254,0.389806,0.307751,0.792876,0.199098,0.288838,0.146811,0.0178444,0.394017,0.588212,0.489226,0.701486,0.940303,0.213191,0.0778845,0.474463,0.609972,0.16338,0.408376,0.330864,0.88999,0.0798101,1,0.167172,0.208727,0.227549,0.825903,0.531897,0.580946,0.215339,0.247319,0.268148,0.504088,0.160955,0.170316,0.230769,0.151191,0.0825031,0.141328,0.288079,0.499676,0.420355,0.487764,0.75371,0.492248,0.181364,0.20594,0.52497,0.325641,0.236827,0.931842,0.472981,0.312162,0.901032,0.270478,0.167112,0.0709698,0.166004,0.290745,0.425893,0.403633,0.581772,0.855694,0.0325587,0.0568359,0.241923,0.79931,0.181962,0.530283,0.41561,1,0.0291501,0.831155,0.119755,0.102188,0.132037,0.76603,0.442221,0.1749,0.142175,0.0140794,0.4375,0.85186,0.196836,0.0907522,0.551673,0.256528,0.0424377,0.490363,0.108178,0.503276,0.226584,0.312758,0.824079,0.48412,0.0347338,0.0619428,0.255097,0.145273,0.190359,0.995297,0.50342,0.217575,0.793975,0.357179,0.0409728,0.0187931,0.414458,0.15844,0.346233,0.0771673,0.175111,0.380567,0.497409,0.316164,0.488669,1,0.420657,0.442333,0.24706,0.796407,0.0104146,0.227079,0.10684,0.0289873,0.76757,0.0643122,0.0423098,0.715522,0.472117,0.392577,0.660433,0.803575,0.188653,0.0191653,0.873212,0.448719,0.0147128,0.618967,0.30718,0.345899,0.131394,0.193225,0.715283,0.40562,0.040637,0.0503336,0.0544331,0.0452023,0.152302,0.894549,0.443343,0.172071,0.647667,0.328993,0.0416014,0.0229488,0.551071,0.423544,0.862362,0.363526,0.769929,0.123452,0.710702,0.394895,0.556638,1,0.450925,0.422849,0.092187,0.413892,0.00995372,0.321146,0.160624,0.0300681,0.915385,0.4755,0.506951,0.387549,0.275591,0.468281,0.184776,0.186837,0.188195,0.0202785,0.697136,0.408862,0.0116935,0.349823,0.202301,0.461379,0.0559023,0.0582571,0.260608,0.181875,0.0271739,0.0249578,0.685089,0.470384,0.283194,0.33105,0.138349,0.338068,0.481992,0.178242,0.0155942,0.0110435,0.783771,0.442707,0.616478,0.381542,0.510892,0.045985,0.303119,0.0731909,0.547715,0.348941,0.149981,0.302158,0.284482,0.398177,0.00413049,0.180739,0.062839,0.0133459,0.347088,0.57637,0.240764,0.978481,0.452755,0.529742,0.340471,0.662282,0.444305,0.0429901,1,0.36194,0.0183372,0.626893,0.55285,0.384936},int(p*nModes+n) : rdtable;
-modesT60s(i) = t60*pow(1-(modesFreqs(i)/2016.94)*t60DecayRatio,t60DecaySlope);
-};
-
-//-------`(pm.)germanBell`----------
-// German church bell modal model.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 1 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// This function also implement a virtual exciter to drive the model.
-//
-// #### Usage
-//
-// ```
-// excitation : germanBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `strikePosition`: strike position (0-6)
-// * `strikeCutoff`: cuttoff frequency of the strike genarator (recommended: ~7000Hz)
-// * `strikeSharpness`: shaarpness of the strike (recommened: ~0.25)
-// * `gain`: gain of the strike (0-1)
-// * `trigger` signal (0: off, 1: on)
-//----------------------------------
-germanBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) =
-strikeModel(10,strikeCutoff,strikeSharpness,gain,trigger) :
-germanBellModel(50,strikePosition,30,1,2.5);
-
-//-------`(pm.)germanBell_ui`----------
-// German church bell physical model based on [`germanBell`](#germanbell) with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// germanBell_ui : _
-// ```
-//----------------------------------
-germanBell_ui =
-germanBell(strikePosition,strikeCutoff,strikeSharpness,gain,gate)
-with{
- strikePosition = nentry("v:germanBell/[0]strikePosition",
- 0,0,4,1);
- strikeCutoff = hslider("v:germanBell/[1]strikeCutOff",
- 6500,20,20000,1);
- strikeSharpness = hslider("v:germanBell/[2]strikeSharpness",
- 0.5,0.01,5,0.01);
- gain = hslider("v:germanBell/[3]gain",1,0,1,0.01);
- gate = button("v:germanBell/[4]gate");
-};
-
-//-------`(pm.)russianBellModel`----------
-// Russian church bell modal model generated by `mesh2faust` from
-// `libraries/modalmodels/russianBell`.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 2 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// #### Usage
-//
-// ```
-// excitation : russianBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope)
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `nModes`: number of synthesized modes (max: 50)
-// * `exPos`: excitation position (0-6)
-// * `t60`: T60 in seconds (recommended value: 0.1)
-// * `t60DecayRatio`: T60 decay ratio (recommended value: 1)
-// * `t60DecaySlope`: T60 decay slope (recommended value: 5)
-//----------------------------------
-russianBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope) = _ <: par(i,nModes,modeFilter(modesFreqs(i),modesT60s(i),modesGains(int(exPos),i))) :> /(nModes)
-with{
-nExPos = 7;
-modesFreqs(n) = ba.take(n+1,(136.491,136.992,258.958,260.419,316.489,318.411,393.852,393.949,454.677,467.493,503.594,503.637,530.46,531.046,541.16,546.158,578.335,579.863,660.026,708.34,716.915,717.23,775.839,776.066,783.356,783.464,788.826,789.463,800.348,806.758,876.788,880.414,887.297,888.222,916.815,919.711,937.686,984.606,1057.2,1058.45,1065.48,1082.27,1083.93,1086.55,1086.77,1108.2,1116.17,1149,1150.54,1199.54));
-modesGains(p,n) = waveform{0.925507,0.59752,0.0965671,0.45412,0.989773,0.593498,0.512541,0.124241,0.705411,0.292396,0.673399,0.302181,0.026234,0.286249,0.556267,1,0.250426,0.107711,0.427299,0.336295,0.616257,0.21442,0.0845294,0.231363,0.522724,0.559114,0.34847,0.854197,0.835576,0.735036,0.288494,0.117122,0.409686,0.363575,0.484943,0.170862,0.420531,0.164793,0.233847,0.861232,0.214037,0.283462,0.173153,0.876122,0.607809,0.294745,0.143142,0.332009,0.491878,0.626104,0.962027,0.584298,0.213653,0.420452,0.812329,0.545172,0.380744,0.331536,0.386801,0.248909,0.688756,0.313904,0.377894,0.595846,0.412274,0.739626,0.541148,0.393005,0.656637,0.847672,0.930653,0.288289,0.404938,0.657989,0.763949,0.574085,0.282241,1,0.429131,0.572049,0.734868,0.577477,0.520789,0.355593,0.890067,0.272391,0.448223,0.423969,0.392237,0.856091,0.0583794,0.784967,0.359527,0.576567,0.201513,0.642013,0.419308,0.340667,0.42319,0.860812,0.69402,0.423568,0.376987,0.568453,0.502302,0.280716,0.464041,0.395601,0.19985,0.0950398,0.64279,0.228326,0.484911,0.842353,0.161404,0.403432,0.655549,0.409098,0.699392,0.87605,1,0.185606,0.414255,0.695205,0.732612,0.478298,0.24947,0.927739,0.213135,0.227382,0.976352,0.642745,0.376311,0.260674,0.811034,0.264631,0.239979,0.261897,0.191642,0.78167,0.390679,0.382437,0.206714,0.22472,0.0676332,0.502611,0.301455,0.241029,0.224505,0.721193,0.436348,0.254062,0.480496,0.772371,0.210681,0.103415,0.485338,0.378334,0.228484,0.114877,0.68676,0.296942,0.50742,0.99747,0.0377103,0.132212,0.319547,0.192032,0.520574,0.585844,0.419362,0.0847317,0.134544,0.194762,0.616689,0.39736,0.298809,0.914746,0.0513371,0.0543569,0.989159,0.602892,0.145582,0.102149,0.129022,0.116485,0.279988,0.39427,0.290139,1,0.708655,0.780555,0.387526,0.0395217,0.00964067,0.24368,0.0740625,0.619315,0.447395,0.292497,0.295458,0.163748,0.521375,0.864533,0.0773408,0.0334231,0.345121,0.27886,0.223876,0.307756,0.763106,0.424707,0.487201,0.968962,0.00911747,0.0324653,0.334275,0.166787,0.312498,0.264262,0.35488,0.37559,0.261094,0.565006,0.474935,0.31352,0.251249,0.735352,0.0189072,0.0153634,0.786225,0.503299,0.369038,0.250765,0.673019,0.387573,0.742025,0.749056,0.261714,0.751868,0.771816,1,0.459484,0.0124402,0.0105394,0.964109,0.457052,0.532316,0.407128,0.697241,0.1522,0.0895893,0.406175,0.65104,0.0233951,0.010107,0.0722347,0.066634,0.195489,0.41674,0.654451,0.382782,0.305396,0.631501,0.00162802,0.0140906,0.762915,0.410245,0.189436,0.0604462,0.624941,0.439781,0.516273,0.896678,0.273298,0.202868,0.0996022,0.257657,0.0174508,0.0157859,0.429433,0.202184,0.443111,0.343811,0.447562,0.268694,0.753551,0.529426,0.0772973,0.097696,0.446414,0.261678,0.169035,0.0116219,0.0207399,1,0.488856,0.413029,0.252661,0.148369,0.0919644,0.0330634,0.268764,0.441849,0.0139873,0.0108584,0.657799,0.488248,0.375433,0.958179,0.761492,0.40949,0.151709,0.314931,0.0036118,0.013307,1,0.605343,0.550506,0.363516,0.255278,0.137537,0.448881,0.867615,0.483247,0.308622,0.348444,0.534835,0.0157716,0.0128965,0.147608,0.0762611,0.762224,0.511585,0.985863,0.540227,0.691691,0.905296,0.397521,0.69794,0.423289,0.924613,0.491559,0.00567911,0.0106002,0.647916,0.324182,0.579449,0.451936,0.877897},int(p*nModes+n) : rdtable;
-modesT60s(i) = t60*pow(1-(modesFreqs(i)/1201.01)*t60DecayRatio,t60DecaySlope);
-};
-
-//-------`(pm.)russianBell`----------
-// Russian church bell modal model.
-//
-// Modeled after D. Bartocha and . Baron, Influence of Tin Bronze Melting and
-// Pouring Parameters on Its Properties and Bell' Tone, Archives of Foundry
-// Engineering, 2016.
-//
-// Model height is 2 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// This function also implement a virtual exciter to drive the model.
-//
-// #### Usage
-//
-// ```
-// excitation : russianBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `strikePosition`: strike position (0-6)
-// * `strikeCutoff`: cuttoff frequency of the strike genarator (recommended: ~7000Hz)
-// * `strikeSharpness`: shaarpness of the strike (recommened: ~0.25)
-// * `gain`: gain of the strike (0-1)
-// * `trigger` signal (0: off, 1: on)
-//----------------------------------
-russianBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) =
-strikeModel(10,strikeCutoff,strikeSharpness,gain,trigger) :
-russianBellModel(50,strikePosition,30,1,3);
-
-//-------`(pm.)russianBell_ui`----------
-// Russian church bell physical model based on [`russianBell`](#russianbell) with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// russianBell_ui : _
-// ```
-//----------------------------------
-russianBell_ui =
-russianBell(strikePosition,strikeCutoff,strikeSharpness,gain,gate)
-with{
- strikePosition = nentry("v:russianBell/[0]strikePosition",
- 0,0,4,1);
- strikeCutoff = hslider("v:russianBell/[1]strikeCutOff",
- 6500,20,20000,1);
- strikeSharpness = hslider("v:russianBell/[2]strikeSharpness",
- 0.5,0.01,5,0.01);
- gain = hslider("v:russianBell/[3]gain",1,0,1,0.01);
- gate = button("v:russianBell/[4]gate");
-};
-
-//-------`(pm.)standardBellModel`----------
-// Standard church bell modal model generated by `mesh2faust` from
-// `libraries/modalmodels/standardBell`.
-//
-// Modeled after T. Rossing and R. Perrin, Vibrations of Bells, Applied
-// Acoustics 2, 1987.
-//
-// Model height is 1.8 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// #### Usage
-//
-// ```
-// excitation : standardBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope)
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `nModes`: number of synthesized modes (max: 50)
-// * `exPos`: excitation position (0-6)
-// * `t60`: T60 in seconds (recommended value: 0.1)
-// * `t60DecayRatio`: T60 decay ratio (recommended value: 1)
-// * `t60DecaySlope`: T60 decay slope (recommended value: 5)
-//----------------------------------
-standardBellModel(nModes,exPos,t60,t60DecayRatio,t60DecaySlope) = _ <: par(i,nModes,modeFilter(modesFreqs(i),modesT60s(i),modesGains(int(exPos),i))) :> /(nModes)
-with{
-nExPos = 7;
-modesFreqs(n) = ba.take(n+1,(490.25,493.646,924.838,927.779,1181.21,1186.94,1348.84,1349.5,1560.33,1635.97,1706.73,1712.89,1745.05,1745.25,2005.51,2025.47,2053.88,2142.37,2151.4,2408.16,2534.11,2536.42,2623.3,2628.4,2711.57,2712.46,2823.23,2827.22,2863.42,2874.19,2923,2925.69,3032.52,3042.15,3208.57,3392.52,3485.92,3493.65,3539.8,3550.56,3678.71,3719.04,3722.59,3786.28,3789.38,3993.59,3998.43,4123.41,4164.83,4187.98));
-modesGains(p,n) = waveform{0.691911,0.622333,0.548651,0.463306,0.826946,0.749513,0.2242,0.642678,0.760442,0.326054,0.276463,0.359344,0.18258,0.686765,0.457159,0.839015,0.845338,0.372377,0.306417,0.147381,0.359707,0.653537,0.27553,0.401233,0.435417,0.251481,0.190062,0.773372,0.315014,0.228812,0.521512,0.411542,0.720762,1,0.286502,0.338938,0.119995,0.432289,0.409677,0.156272,0.298871,0.250786,0.640776,0.209431,0.17001,0.390014,0.301698,0.799413,0.980581,0.385,0.82544,0.818894,0.349616,0.235396,0.783164,0.821914,0.28411,0.430286,0.507671,0.326254,0.260488,0.273364,0.20518,0.714852,0.47995,0.803637,0.683943,0.355371,0.406924,0.656257,0.423025,0.413515,0.38636,0.384787,0.389448,0.813367,0.234988,1,0.311268,0.350245,0.403856,0.646143,0.500485,0.833553,0.431768,0.467064,0.298979,0.487413,0.514907,0.369383,0.106197,0.494224,0.816079,0.535807,0.379873,0.380201,0.606306,0.516117,0.748449,0.556948,0.587066,0.584423,0.394866,0.341121,0.433458,0.455987,0.361237,0.42939,0.122969,0.133175,0.505176,0.513985,0.0554619,0.604942,0.372074,0.381126,0.314354,0.499636,0.518711,0.923792,0.259544,0.576517,0.553915,0.585444,0.245369,1,0.117757,0.977318,0.652862,0.509314,0.14855,0.506402,0.180059,0.356005,0.38681,0.279354,0.205792,0.551055,0.689107,0.445724,0.306857,0.324747,0.603621,0.394466,0.288613,0.264697,0.60612,0.20274,0.267271,0.925656,0.439228,0.425884,0.626633,0.547204,0.230022,0.225654,0.392697,0.493474,0.149857,0.0604048,0.693889,0.740271,0.175485,0.704998,0.329732,0.153026,0.125744,0.286995,0.278878,0.812372,0.0562174,0.241479,0.294525,0.358834,0.171047,0.847604,0.17228,0.97521,0.892073,0.613987,0.0659213,0.301583,0.0610847,0.125438,0.145151,0.180086,0.124231,0.260161,0.337573,0.203743,0.655798,0.425893,0.902347,0.500686,0.311173,0.215561,0.349591,0.0854218,0.0805062,1,0.338652,0.295396,0.698314,0.664972,0.118983,0.0881905,0.31158,0.391136,0.151915,0.239504,0.685742,0.884332,0.288516,0.768688,0.274851,0.0490311,0.0357865,0.293303,0.249461,0.493771,0.340984,0.467623,0.216631,0.255235,0.0988695,0.46198,0.147247,0.640196,1,0.551938,0.0453732,0.189907,0.0197542,0.0309217,0.769837,0.360418,0.384041,0.867434,0.398948,0.171848,0.748652,0.301957,0.860611,0.958674,0.54903,0.272753,0.372753,0.0180728,0.0292353,0.8502,0.224583,0.214805,0.670319,0.586433,0.0435142,0.0388574,0.144811,0.157061,0.155569,0.418334,0.673656,0.749573,0.337354,0.747254,0.255997,0.0239656,0.0310719,0.721087,0.700616,0.199051,0.511844,0.849485,0.700682,0.778658,0.171289,0.261973,0.129228,0.328597,0.781821,0.583813,0.0806713,0.416876,0.0118202,0.00868563,1,0.461884,0.186882,0.641364,0.994705,0.501902,0.566449,0.0678845,0.139737,0.462582,0.318656,0.233947,0.495941,0.0314028,0.0146478,0.70432,0.124953,0.132549,0.457126,0.378636,0.0169362,0.0195494,0.204155,0.294401,0.271367,0.730857,0.459322,0.433078,0.325171,0.734536,0.416205,0.012873,0.0388489,0.821567,0.863683,0.0920531,0.393972,0.539544,0.832052,0.842732,0.241144,0.479558,0.283092,0.477845,0.385473,0.436587,0.144308,0.642395,0.0215791,0.00779029,0.563714,0.838279,0.410004,0.829086,1,0.630598,0.0233729,0.496217,0.711042,0.914266,0.695042,0.331894,0.898442,0.028568,0.0174966,0.482846},int(p*nModes+n) : rdtable;
-modesT60s(i) = t60*pow(1-(modesFreqs(i)/4191.95)*t60DecayRatio,t60DecaySlope);
-};
-
-//-------`(pm.)standardBell`----------
-// Standard church bell modal model.
-//
-// Modeled after T. Rossing and R. Perrin, Vibrations of Bells, Applied
-// Acoustics 2, 1987.
-//
-// Model height is 1.8 m.
-//
-// This model contains 7 excitation positions going linearly from the
-// bottom to the top of the bell. Obviously, a model with more excitation
-// position could be regenerated using `mesh2faust`.
-//
-// This function also implement a virtual exciter to drive the model.
-//
-// #### Usage
-//
-// ```
-// excitation : standardBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) : _
-// ```
-//
-// Where:
-//
-// * `excitation`: the excitation signal
-// * `strikePosition`: strike position (0-6)
-// * `strikeCutoff`: cuttoff frequency of the strike genarator (recommended: ~7000Hz)
-// * `strikeSharpness`: shaarpness of the strike (recommened: ~0.25)
-// * `gain`: gain of the strike (0-1)
-// * `trigger` signal (0: off, 1: on)
-//----------------------------------
-standardBell(strikePosition,strikeCutoff,strikeSharpness,gain,trigger) =
-strikeModel(10,strikeCutoff,strikeSharpness,gain,trigger) :
-standardBellModel(50,strikePosition,30,1,2.5);
-
-//-------`(pm.)standardBell_ui`----------
-// Standard church bell physical model based on [`standardBell`](#standardbell) with
-// built-in UI.
-//
-// #### Usage
-//
-// ```
-// standardBell_ui : _
-// ```
-//----------------------------------
-standardBell_ui =
-standardBell(strikePosition,strikeCutoff,strikeSharpness,gain,gate)
-with{
- strikePosition = nentry("v:standardBell/[0]strikePosition",
- 0,0,4,1);
- strikeCutoff = hslider("v:standardBell/[1]strikeCutOff",
- 6500,20,20000,1);
- strikeSharpness = hslider("v:standardBell/[2]strikeSharpness",
- 0.5,0.01,5,0.01);
- gain = hslider("v:standardBell/[3]gain",1,0,1,0.01);
- gate = button("v:standardBell/[4]gate");
-};
-
-
-//==============================Vocal Synthesis===========================================
-// Vocal synthesizer functions (source/filter, fof, etc.).
-//========================================================================================
-
-//-------`(pm.)formantValues`----------
-// Formant data values.
-//
-// The formant data used here come from the CSOUND manual
-// .
-//
-// #### Usage
-//
-// ```
-// ba.take(j+1,formantValues.f(i)) : _
-// ba.take(j+1,formantValues.g(i)) : _
-// ba.take(j+1,formantValues.bw(i)) : _
-// ```
-//
-// Where:
-//
-// * `i`: formant number
-// * `j`: (voiceType*nFormants)+vowel
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor, 3:
-// soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-//--------------------------------------
-formantValues = environment {
- f(0) = (800,400,350,450,325,600,400,250,400,350,660,440,270,430,370,800,
- 350,270,450,325,650,400,290,400,350); // formant 0 freqs
- f(1) = (1150,1600,1700,800,700,1040,1620,1750,750,600,1120,1800,1850,820,630,
- 1150,2000,2140,800,700,1080,1700,1870,800,600); // formant 1 freqs
- f(2) = (2800,2700,2700,2830,2530,2250,2400,2600,2400,2400,2750,2700,2900,2700,2750,
- 2900,2800,2950,2830,2700,2650,2600,2800,2600,2700); // formant 2 freqs
- f(3) = (3500,3300,3700,3500,3500,2450,2800,3050,2600,2675,3000,3000,3350,3000,3000,
- 3900,3600,3900,3800,3800,2900,3200,3250,2800,2900); // formant 3 freqs
- f(4) = (4950,4950,4950,4950,4950,2750,3100,3340,2900,2950,3350,3300,3590,3300,3400,
- 4950,4950,4950,4950,4950,3250,3580,3540,3000,3300); // formant 4 freqs
- g(0) = (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); // formant 0 gains
- g(1) = (0.630957,0.063096,0.100000,0.354813,0.251189,0.446684,0.251189,0.031623,
- 0.281838,0.100000,0.501187,0.199526,0.063096,0.316228,0.100000,
- 0.501187,0.100000,0.251189,0.281838,0.158489,0.501187,0.199526,0.177828,
- 0.316228,0.100000); // formant 1 gains
- g(2) = (0.100000,0.031623,0.031623,0.158489,0.031623,0.354813,0.354813,0.158489,
- 0.089125,0.025119,0.070795,0.125893,0.063096,0.050119,0.070795,
- 0.025119,0.177828,0.050119,0.079433,0.017783,0.446684,0.251189,0.125893,
- 0.251189,0.141254); // formant 2 gains
- g(3) = (0.015849,0.017783,0.015849,0.039811,0.010000,0.354813,0.251189,0.079433,
- 0.100000,0.039811,0.063096,0.100000,0.015849,0.079433,0.031623,
- 0.100000,0.010000,0.050119,0.079433,0.010000,0.398107,0.199526,0.100000,
- 0.251189,0.199526); // formant 3 gains
- g(4) = (0.001000,0.001000,0.001000,0.001778,0.000631,0.100000,0.125893,0.039811,
- 0.010000,0.015849,0.012589,0.100000,0.015849,0.019953,0.019953,
- 0.003162,0.001585,0.006310,0.003162,0.001000,0.079433,0.100000,0.031623,
- 0.050119,0.050119); // formant 4 gains
- bw(0) =(80,60,50,70,50,60,40,60,40,40,80,70,40,40,40,80,60,60,40,50,
- 50,70,40,70,40); // formant 0 bandwidths
- bw(1) =(90,80,100,80,60,70,80,90,80,80,90,80,90,80,60,90,100,90,80,60,
- 90,80,90,80,60); // formant 1 bandwidths
- bw(2) =(120,120,120,100,170,110,100,100,100,100,120,100,100,100,100,
- 120,120,100,100,170,120,100,100,100,100); // formant 2 bandwidths
- bw(3) =(130,150,150,130,180,120,120,120,120,120,130,120,120,120,120,
- 130,150,120,120,180,130,120,120,130,120); // formant 3 bandwidths
- bw(4) =(140,200,200,135,200,130,120,120,120,120,140,120,120,120,120,
- 140,200,120,120,200,140,120,120,135,120); // formant 4 bandwidths
-};
-
-// array of values used to multiply BWs by to get attack Bws for FOF version.
-// min/max values per vowel (AEIOU) and per gender (M/F). Index by:
-// gender*5 + vowel;
-// values were chosen based on informal listening tests
-bwMultMins = (1.0, 1.25, 1.25, 1.0, 1.5, 2.0, 3.0, 3.0, 2.0, 2.0);
-bwMultMaxes = (10.0, 2.5, 2.5, 10.0, 4.0, 15.0, 12.0, 12.0, 12.0, 12.0);
-
-// minimum/maximum frequency values per gender (M/F) used in the calculation
-// of the attack Bws from the release Bws in the FOF version
-// values are based on arbitrary maximum/minimum singing values
-// in Hz for male/female voices
-minGenderFreq = (82.41,174.61);
-maxGenderFreq = (523.25,1046.5);
-
-//--------------`(pm.)voiceGender`-----------------
-// Calculate the gender for the provided `voiceType` value. (0: male, 1: female)
-//
-// #### Usage
-//
-// ```
-// voiceGender(voiceType) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-//---------------------------------------------
-// Author: Mike Olsen
-voiceGender(voiceType) = ba.if(voiceType == 0,1,ba.if(voiceType == 3,1,0));
-
-
-//-----------`(pm.)skirtWidthMultiplier`------------
-// Calculates value to multiply bandwidth to obtain `skirtwidth`
-// for a Fof filter.
-//
-// #### Usage
-//
-// ```
-// skirtWidthMultiplier(vowel,freq,gender) : _
-// ```
-//
-// Where:
-//
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `freq`: the fundamental frequency of the excitation signal
-// * `gender`: gender of the voice used in the fof filter (0: male, 1: female)
-//---------------------------------------------
-// Author: Mike Olsen
-skirtWidthMultiplier(vowel,freq,gender) = (multMax-multMin)*skirtParam+multMin
-with {
- nVowels = 5;
- index = gender*nVowels + vowel;
- multMin = bwMultMins : ba.selectn(10,index);
- multMax = bwMultMaxes : ba.selectn(10,index);
- freqMin = minGenderFreq : ba.selectn(2,gender);
- freqMax = maxGenderFreq : ba.selectn(2,gender);
- skirtParam = ba.if(freq <= freqMin,0.0,ba.if(freq >= freqMax,1.0,
- (1.0/(freqMax-freqMin))*(freq-freqMin)));
-};
-
-
-//--------------`(pm.)autobendFreq`-----------------
-// Autobends the center frequencies of formants 1 and 2 based on
-// the fundamental frequency of the excitation signal and leaves
-// all other formant frequencies unchanged. Ported from `chant-lib`.
-// Reference:
-//
-// #### Usage
-//
-// ```
-// _ : autobendFreq(n,freq,voiceType) : _
-// ```
-//
-// Where:
-//
-// * `n`: formant index
-// * `freq`: the fundamental frequency of the excitation signal
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * input is the center frequency of the corresponding formant
-//---------------------------------------------
-// Author: Mike Olsen
-autobendFreq(n,freq,voiceType) = autobend(n)
-with {
- autobend(0) = _ <: ba.if(_ <= freq,freq,_);
- autobend(1) = _ <: ba.if(voiceType != 2,
- _ <: ba.if((_ >= 1300)&(freq >= 200),
- _ - (freq-200)*(_-1300)/1050,
- ba.if(_ <= (30 + 2*freq),30 + 2*freq,_)), _);
- autobend(n) = _;
-};
-
-
-//--------------`(pm.)vocalEffort`-----------------
-// Changes the gains of the formants based on the fundamental
-// frequency of the excitation signal. Higher formants are
-// reinforced for higher fundamental frequencies.
-// Ported from `chant-lib`.
-// Reference:
-//
-// #### Usage
-//
-// ```
-// _ : vocalEffort(freq,gender) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the fundamental frequency of the excitation signal
-// * `gender`: the gender of the voice type (0: male, 1: female)
-// * input is the linear amplitude of the formant
-//---------------------------------------------
-// Author: Mike Olsen
-vocalEffort(freq,gender) = _ <: ba.if(gender == 0,*(3+1.1*(400-freq)/300),
-*(0.8+1.05*(1000-freq)/1250));
-
-
-//-------------------------`(pm.)fof`--------------------------
-// Function to generate a single Formant-Wave-Function.
-// Reference:
-//
-// #### Usage
-//
-// ```
-// _ : fof(fc,bw,a,g) : _
-// ```
-//
-// Where:
-//
-// * `fc`: formant center frequency,
-// * `bw`: formant bandwidth (Hz),
-// * `sw`: formant skirtwidth (Hz)
-// * `g`: linear scale factor (g=1 gives 0dB amplitude response at fc)
-// * input is an impulse signal to excite filter
-//---------------------------------------------------------
-// Author: Mike Olsen
-fof(fc,bw,sw,g) = _ <: (_',_) : (f * s)
-with {
- T = 1/ma.SR; // sample period
- pi = ma.PI; // pi
- u1 = exp(-sw*pi*T); // exponential controlling rise
- u2 = exp(-bw*pi*T); // exponential controlling decay
- a1 = -1*(u1+u2); // a1 filter coefficient
- a2 = u1*u2; // a2 filter coefficient
- G0 = 1/(1+a1+a2); // magnitude at DC
- b0 = g/G0; // filter gain
- s = os.hs_oscsin(fc); // hardsyncing wavetable oscillator
- f = fi.tf2(b0,0,0,a1,a2); // biquad filter
-};
-
-
-//-------------------------`(pm.)fofSH`-------------------------
-// FOF with sample and hold used on `bw` and a parameter
-// used in the filter-cycling FOF function `fofCycle`.
-// Reference:
-//
-// #### Usage
-//
-// ```
-// _ : fofSH(fc,bw,a,g) : _
-// ```
-//
-// Where: all parameters same as for [`fof`](#fof)
-//---------------------------------------------------------
-// Author: Mike Olsen
-fofSH(fc,bw,a,g) = _ <: (((_,bw):ba.sAndH),((_,a):ba.sAndH),_) : (fc,_,_,g,_') : fof;
-
-
-//----------------------`(pm.)fofCycle`-------------------------
-// FOF implementation where time-varying filter parameter noise is
-// mitigated by using a cycle of `n` sample and hold FOF filters.
-// Reference:
-//
-// #### Usage
-//
-// ```
-// _ : fofCycle(fc,bw,a,g,n) : _
-// ```
-//
-// Where:
-//
-// * `n`: the number of FOF filters to cycle through
-// * all other parameters are same as for [`fof`](#fof)
-//---------------------------------------------------------
-// Author: Mike Olsen
-fofCycle(fc,bw,a,g,n) = _ : ba.cycle(n) : par(i,n,fofSH(fc,bw,a,g)) :> _;
-
-//----------------------`(pm.)fofSmooth`-------------------------
-// FOF implementation where time-varying filter parameter
-// noise is mitigated by lowpass filtering the filter
-// parameters `bw` and `a` with [smooth](#smooth).
-//
-// #### Usage
-//
-// ```
-// _ : fofSmooth(fc,bw,sw,g,tau) : _
-// ```
-//
-// Where:
-//
-// * `tau`: the desired smoothing time constant in seconds
-// * all other parameters are same as for [`fof`](#fof)
-//---------------------------------------------------------
-// Author: Mike Olsen
-fofSmooth(fc,bw,sw,g,tau) = fof(fc,bw2,sw2,g)
-with{
- sw2 = sw : si.smooth(ba.tau2pole(tau));
- bw2 = bw : si.smooth(ba.tau2pole(tau));
-};
-
-
-//-------`(pm.)formantFilterFofCycle`--------------
-// Formant filter based on a single FOF filter.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. A cycle of `n` fof filters with sample-and-hold is
-// used so that the fof filter parameters can be varied in realtime.
-// This technique is more robust but more computationally expensive than
-// [`formantFilterFofSmooth`](#formantFilterFofSmooth).Voice type can be
-// selected but must correspond to
-// the frequency range of the provided source to be realistic.
-//
-// #### Usage
-//
-// ```
-// _ : formantFilterFofCycle(voiceType,vowel,nFormants,i,freq) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `nFormants`: number of formant regions in frequency domain, typically 5
-// * `i`: formant number (i.e. 0 - 4) used to index formant data value arrays
-// * `freq`: fundamental frequency of excitation signal. Used to calculate
-// rise time of envelope
-//--------------------------------------
-// Author: Mike Olsen
-formantFilterFofCycle(voiceType,vowel,nFormants,i,freq) =
- fofCycle(formantFreq(i),formantBw(i),formantSw(i),formantGain(i),n)
-with{
- n = 3; // number of fof filters to cycle between
- index = (voiceType*nFormants)+vowel; // index of formant values
- // formant center frequency using autobend correction
- formantFreq(i) = ba.listInterp(formantValues.f(i),index) : autobendFreq(i,freq,voiceType);
- // formant amplitude using vocal effort correction
- formantGain(i) = ba.listInterp(formantValues.g(i),index) : vocalEffort(freq,gender);
- formantBw(i) = ba.listInterp(formantValues.bw(i),index); // formant bandwidth
- // formant skirtwidth
- formantSw(i) = skirtWidthMultiplier(vowel,freq,gender)*formantBw(i);
- gender = voiceGender(voiceType); // gender of voice
-};
-
-
-//-------`(pm.)formantFilterFofSmooth`--------------
-// Formant filter based on a single FOF filter.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Fof filter parameters are lowpass filtered
-// to mitigate possible noise from varying them in realtime.
-// Voice type can be selected but must correspond to
-// the frequency range of the provided source to be realistic.
-//
-// #### Usage
-//
-// ```
-// _ : formantFilterFofSmooth(voiceType,vowel,nFormants,i,freq) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `nFormants`: number of formant regions in frequency domain, typically 5
-// * `i`: formant number (i.e. 1 - 5) used to index formant data value arrays
-// * `freq`: fundamental frequency of excitation signal. Used to calculate
-// rise time of envelope
-//--------------------------------------
-// Author: Mike Olsen
-formantFilterFofSmooth(voiceType,vowel,nFormants,i,freq) =
- fofSmooth(formantFreq(i),formantBw(i),formantSw(i),formantGain(i),tau)
-with{
- tau = 0.001;
- index = (voiceType*nFormants)+vowel; // index of formant values
- // formant center frequency using autobend correction
- formantFreq(i) = ba.listInterp(formantValues.f(i),index) : autobendFreq(i,freq,voiceType);
- // formant amplitude using vocal effort correction
- formantGain(i) = ba.listInterp(formantValues.g(i),index) : vocalEffort(freq,gender);
- formantBw(i) = ba.listInterp(formantValues.bw(i),index); // formant bandwidth
- // formant skirtwidth
- formantSw(i) = skirtWidthMultiplier(vowel,freq,gender)*formantBw(i);
- gender = voiceGender(voiceType); // gender of voice
-};
-
-
-//-------`(pm.)formantFilterBP`--------------
-// Formant filter based on a single resonant bandpass filter.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the provided source to be realistic.
-//
-// #### Usage
-//
-// ```
-// _ : formantFilterBP(voiceType,vowel,nFormants,i,freq) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `nFormants`: number of formant regions in frequency domain, typically 5
-// * `i`: formant index used to index formant data value arrays
-// * `freq`: fundamental frequency of excitation signal.
-//--------------------------------------
-formantFilterBP(voiceType,vowel,nFormants,i,freq) =
- fi.resonbp(formantFreq(i),formantFreq(i)/formantBw(i),
- formantGain(i))
-with{
- index = (voiceType*nFormants)+vowel; // index of formant values
- // formant center frequency using autobend correction
- formantFreq(i) = ba.listInterp(formantValues.f(i),index) : autobendFreq(i,freq,voiceType);
- // formant amplitude using vocal effort correction
- formantGain(i) = ba.listInterp(formantValues.g(i),index) : vocalEffort(freq,gender);
- formantBw(i) = ba.listInterp(formantValues.bw(i),index); // formant bandwidth
- gender = voiceGender(voiceType); // gender of voice
-};
-
-
-//-------`(pm.)formantFilterbank`--------------
-// Formant filterbank which can use different types of filterbank
-// functions and different excitation signals. Formant parameters are
-// linearly interpolated allowing to go smoothly from one vowel to another.
-// Voice type can be selected but must correspond to the frequency range
-// of the provided source to be realistic.
-//
-// #### Usage
-//
-// ```
-// _ : formantFilterbank(voiceType,vowel,formantGen,freq) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `formantGen`: the specific formant filterbank function
-// (i.e. FormantFilterbankBP, FormantFilterbankFof,...)
-// * `freq`: fundamental frequency of excitation signal. Needed for FOF
-// version to calculate rise time of envelope
-//--------------------------------------
-// Author: Mike Olsen
-formantFilterbank(voiceType,vowel,formantGen,freq) =
- _ <: par(i,nFormants,formantGen(voiceType,vowel,nFormants,i,freq)) :> _
-with{
- nFormants = 5;
-};
-
-
-//-----`(pm.)formantFilterbankFofCycle`-----
-// Formant filterbank based on a bank of fof filters.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the provided source to be realistic.
-//
-// #### Usage
-//
-// ```
-// _ : formantFilterbankFofCycle(voiceType,vowel,freq) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `freq`: the fundamental frequency of the excitation signal. Needed to
-// calculate the skirtwidth of the FOF envelopes and for the
-// autobendFreq and vocalEffort functions
-//-------------------------------------
-// Author: Mike Olsen
-formantFilterbankFofCycle(voiceType,vowel,freq) =
-formantFilterbank(voiceType,vowel,formantFilterFofCycle,freq);
-
-
-//-----`(pm.)formantFilterbankFofSmooth`----
-// Formant filterbank based on a bank of fof filters.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the provided source to be realistic.
-//
-// #### Usage
-//
-// ```
-// _ : formantFilterbankFofSmooth(voiceType,vowel,freq) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `freq`: the fundamental frequency of the excitation signal. Needed to
-// calculate the skirtwidth of the FOF envelopes and for the
-// autobendFreq and vocalEffort functions
-//-------------------------------------
-// Author: Mike Olsen
-formantFilterbankFofSmooth(voiceType,vowel,freq) =
-formantFilterbank(voiceType,vowel,formantFilterFofSmooth,freq);
-
-
-//-------`(pm.)formantFilterbankBP`--------------
-// Formant filterbank based on a bank of resonant bandpass filters.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the provided source to be realistic.
-//
-// #### Usage
-//
-// ```
-// _ : formantFilterbankBP(voiceType,vowel) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u)
-// * `freq`: the fundamental frequency of the excitation signal. Needed
-// for the autobendFreq and vocalEffort functions
-//--------------------------------------
-formantFilterbankBP(voiceType,vowel,freq) =
-formantFilterbank(voiceType,vowel,formantFilterBP,freq);
-
-
-//-------`(pm.)SFFormantModel`--------------
-// Simple formant/vocal synthesizer based on a source/filter model. The `source`
-// and `filterbank` must be specified by the user. `filterbank` must take the same
-// input parameters as [`formantFilterbank`](#formantFilterbank) (`BP`/`FofCycle`
-// /`FofSmooth`).
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the synthesized voice to be realistic.
-//
-// #### Usage
-//
-// ```
-// SFFormantModel(voiceType,vowel,exType,freq,gain,source,filterbank,isFof) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u
-// * `exType`: voice vs. fricative sound ratio (0-1 where 1 is 100% fricative)
-// * `freq`: the fundamental frequency of the source signal
-// * `gain`: linear gain multiplier to multiply the source by
-// * `isFof`: whether model is FOF based (0: no, 1: yes)
-//--------------------------------------
-// Author: Mike Olsen
-SFFormantModel(voiceType,vowel,exType,freq,gain,source,filterbank,isFof) =
- excitation : resonance
-with{
- breath = no.noise;
- excitation = ba.if(isFof,source,source*(1-exType) + breath*exType :
- *(gain));
- resonance = filterbank(voiceType,vowel,freq) <: ba.if(isFof,*(gain),_);
-};
-
-
-//-------`(pm.)SFFormantModelFofCycle`-------
-// Simple formant/vocal synthesizer based on a source/filter model. The source
-// is just a periodic impulse and the "filter" is a bank of FOF filters.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the synthesized voice to be realistic. This model
-// does not work with noise in the source signal so exType has been removed
-// and model does not depend on SFFormantModel function.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelFofCycle(voiceType,vowel,freq,gain) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u
-// * `freq`: the fundamental frequency of the source signal
-// * `gain`: linear gain multiplier to multiply the source by
-//---------------------------------------
-// Author: Mike Olsen
-SFFormantModelFofCycle(voiceType,vowel,freq,gain) =
-SFFormantModel(voiceType,vowel,0,freq,gain,os.lf_imptrain(freq),
-formantFilterbankFofCycle,1);
-
-
-//-------`(pm.)SFFormantModelFofSmooth`-------
-// Simple formant/vocal synthesizer based on a source/filter model. The source
-// is just a periodic impulse and the "filter" is a bank of FOF filters.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the synthesized voice to be realistic.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelFofSmooth(voiceType,vowel,freq,gain) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u
-// * `freq`: the fundamental frequency of the source signal
-// * `gain`: linear gain multiplier to multiply the source by
-//---------------------------------------
-// Author: Mike Olsen
-SFFormantModelFofSmooth(voiceType,vowel,freq,gain) =
-SFFormantModel(voiceType,vowel,0,freq,gain,os.lf_imptrain(freq),
-formantFilterbankFofSmooth,1);
-
-
-//-------`(pm.)SFFormantModelBP`--------------
-// Simple formant/vocal synthesizer based on a source/filter model. The source
-// is just a sawtooth wave and the "filter" is a bank of resonant bandpass filters.
-// Formant parameters are linearly interpolated allowing to go smoothly from
-// one vowel to another. Voice type can be selected but must correspond to
-// the frequency range of the synthesized voice to be realistic.
-//
-// The formant data used here come from the CSOUND manual
-// .
-//
-// #### Usage
-//
-// ```
-// SFFormantModelBP(voiceType,vowel,exType,freq,gain) : _
-// ```
-//
-// Where:
-//
-// * `voiceType`: the voice type (0: alto, 1: bass, 2: countertenor,
-// 3: soprano, 4: tenor)
-// * `vowel`: the vowel (0: a, 1: e, 2: i, 3: o, 4: u
-// * `exType`: voice vs. fricative sound ratio (0-1 where 1 is 100% fricative)
-// * `freq`: the fundamental frequency of the source signal
-// * `gain`: linear gain multiplier to multiply the source by
-//---------------------------------------
-SFFormantModelBP(voiceType,vowel,exType,freq,gain) =
-SFFormantModel(voiceType,vowel,exType,freq,gain,os.sawtooth(freq),
-formantFilterbankBP,0);
-
-//-------`(pm.)SFFormantModelFofCycle_ui`----------
-// Ready-to-use source-filter vocal synthesizer with built-in user interface.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelFofCycle_ui : _
-// ```
-//----------------------------------
-// Author: Mike Olsen
-SFFormantModelFofCycle_ui = SFFormantModelFofCycle(voiceType,vowel,freq2,gain*corrFactor)
-with{
- freq1 = hslider("v:vocal/[0]freq",440,50,1000,0.01);
- gain = hslider("v:vocal/[1]gain",0.9,0,1,0.01);
- corrFactor = 75.0;
- voiceType = hslider("v:vocal/[2]voiceType",0,0,4,1);
- vowel = hslider("v:vocal/[3]vowel",0,0,4,0.01) : si.smoo;
- vibratoFreq = hslider("v:vocal/[5]vibratoFreq",6,1,10,0.01);
- vibratoGain = hslider("v:vocal/[6]vibratoGain",0.5,0,1,0.01)*0.1;
- freq2 = freq1*(os.osc(vibratoFreq)*vibratoGain+1);
-};
-
-
-//-------`(pm.)SFFormantModelFofSmooth_ui`----------
-// Ready-to-use source-filter vocal synthesizer with built-in user interface.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelFofSmooth_ui : _
-// ```
-//----------------------------------
-// Author: Mike Olsen
-SFFormantModelFofSmooth_ui = SFFormantModelFofSmooth(voiceType,vowel,freq2,gain*corrFactor)
-with{
- freq1 = hslider("v:vocal/[0]freq",440,50,1000,0.01);
- gain = hslider("v:vocal/[1]gain",0.9,0,1,0.01);
- corrFactor = 25.0;
- voiceType = hslider("v:vocal/[2]voiceType",0,0,4,1);
- vowel = hslider("v:vocal/[3]vowel",0,0,4,0.01) : si.smoo;
- vibratoFreq = hslider("v:vocal/[5]vibratoFreq",6,1,10,0.01);
- vibratoGain = hslider("v:vocal/[6]vibratoGain",0.5,0,1,0.01)*0.1;
- freq2 = freq1*(os.osc(vibratoFreq)*vibratoGain+1);
-};
-
-
-//-------`(pm.)SFFormantModelBP_ui`----------
-// Ready-to-use source-filter vocal synthesizer with built-in user interface.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelBP_ui : _
-// ```
-//----------------------------------
-SFFormantModelBP_ui = SFFormantModelBP(voiceType,vowel,fricative,freq2,gain)
-with{
- freq1 = hslider("v:vocal/[0]freq",440,50,1000,0.01);
- gain = hslider("v:vocal/[1]gain",0.9,0,1,0.01);
- voiceType = hslider("v:vocal/[2]voiceType",0,0,4,1);
- vowel = hslider("v:vocal/[3]vowel",0,0,4,0.01) : si.smoo;
- fricative = hslider("v:vocal/[4]fricative",0,0,1,0.01) : si.smoo;
- vibratoFreq = hslider("v:vocal/[5]vibratoFreq",6,1,10,0.01);
- vibratoGain = hslider("v:vocal/[6]vibratoGain",0.5,0,1,0.01)*0.1;
- freq2 = freq1*(os.osc(vibratoFreq)*vibratoGain+1);
-};
-
-
-//-------`(pm.)SFFormantModelFofCycle_ui_MIDI`----------
-// Ready-to-use MIDI-controllable source-filter vocal synthesizer.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelFofCycle_ui_MIDI : _
-// ```
-//----------------------------------
-SFFormantModelFofCycle_ui_MIDI = SFFormantModelFofCycle(voiceType,vowel,freq2,envelope)*outGain
-with{
- freq1 = hslider("v:vocal/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:vocal/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:vocal/h:[0]midi/[2]gain[style:knob]
- ",0.9,0,1,0.01);
- corrFactor = 75.0;
- envAttack = hslider("v:vocal/h:[0]midi/[3]envAttack[style:knob]
- ",10,0,30,0.01)*0.001;
- s = hslider("v:vocal/h:[0]midi/[4]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- voiceType = hslider("v:vocal/h:[1]otherParams/[0]voiceType
- [style:knob]",0,0,4,1);
- vowel = hslider("v:vocal/h:[1]otherParams/[1]vowel
- [style:knob][midi:ctrl 1]",0,0,4,0.01) : si.smoo;
- vibratoFreq = hslider("v:vocal/h:[1]otherParams/[3]vibratoFreq[style:knob]
- ",6,1,10,0.01);
- vibratoGain = hslider("v:vocal/h:[1]otherParams/[4]vibratoGain[style:knob]
- ",0.5,0,1,0.01)*0.1;
- outGain = hslider("v:vocal/h:[1]otherParams/[5]outGain[style:knob]
- ",0.5,0,1,0.01);
- t = button("v:vocal/[2]gate");
-
- gate = t+s : min(1);
- freq2 = freq1*bend*(os.osc(vibratoFreq)*vibratoGain+1);
- envelope = gate*gain*corrFactor : si.smooth(ba.tau2pole(envAttack));
-};
-
-
-//-------`(pm.)SFFormantModelFofSmooth_ui_MIDI`----------
-// Ready-to-use MIDI-controllable source-filter vocal synthesizer.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelFofSmooth_ui_MIDI : _
-// ```
-//----------------------------------
-SFFormantModelFofSmooth_ui_MIDI = SFFormantModelFofSmooth(voiceType,vowel,freq2,envelope)*outGain
-with{
- freq1 = hslider("v:vocal/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:vocal/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:vocal/h:[0]midi/[2]gain[style:knob]
- ",0.9,0,1,0.01);
- corrFactor = 25.0;
- envAttack = hslider("v:vocal/h:[0]midi/[3]envAttack[style:knob]
- ",10,0,30,0.01)*0.001;
- s = hslider("v:vocal/h:[0]midi/[4]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- voiceType = hslider("v:vocal/h:[1]otherParams/[0]voiceType
- [style:knob]",0,0,4,1);
- vowel = hslider("v:vocal/h:[1]otherParams/[1]vowel
- [style:knob][midi:ctrl 1]",0,0,4,0.01) : si.smoo;
- vibratoFreq = hslider("v:vocal/h:[1]otherParams/[3]vibratoFreq[style:knob]
- ",6,1,10,0.01);
- vibratoGain = hslider("v:vocal/h:[1]otherParams/[4]vibratoGain[style:knob]
- ",0.5,0,1,0.01)*0.1;
- outGain = hslider("v:vocal/h:[1]otherParams/[5]outGain[style:knob]
- ",0.5,0,1,0.01);
- t = button("v:vocal/[2]gate");
-
- gate = t+s : min(1);
- freq2 = freq1*bend*(os.osc(vibratoFreq)*vibratoGain+1);
- envelope = gate*gain*corrFactor : si.smooth(ba.tau2pole(envAttack));
-};
-
-
-//-------`(pm.)SFFormantModelBP_ui_MIDI`----------
-// Ready-to-use MIDI-controllable source-filter vocal synthesizer.
-//
-// #### Usage
-//
-// ```
-// SFFormantModelBP_ui_MIDI : _
-// ```
-//----------------------------------
-SFFormantModelBP_ui_MIDI = SFFormantModelBP(voiceType,vowel,fricative,freq2,envelope)*outGain
-with{
- freq1 = hslider("v:vocal/h:[0]midi/[0]freq[style:knob]",440,50,1000,0.01);
- bend = hslider("v:vocal/h:[0]midi/[1]bend[hidden:1][midi:pitchwheel]
- [style:knob]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
- gain = hslider("v:vocal/h:[0]midi/[2]gain[style:knob]
- ",0.9,0,1,0.01);
- envAttack = hslider("v:vocal/h:[0]midi/[3]envAttack[style:knob]
- ",10,0,30,0.01)*0.001;
- s = hslider("v:vocal/h:[0]midi/[4]sustain[hidden:1][midi:ctrl 64]
- [style:knob]",0,0,1,1);
- voiceType = hslider("v:vocal/h:[1]otherParams/[0]voiceType
- [style:knob]",0,0,4,1);
- vowel = hslider("v:vocal/h:[1]otherParams/[1]vowel
- [style:knob][midi:ctrl 1]",0,0,4,0.01) : si.smoo;
- fricative = hslider("v:vocal/h:[1]otherParams/[2]fricative
- [style:knob]",0,0,1,0.01) : si.smoo;
- vibratoFreq = hslider("v:vocal/h:[1]otherParams/[3]vibratoFreq[style:knob]
- ",6,1,10,0.01);
- vibratoGain = hslider("v:vocal/h:[1]otherParams/[4]vibratoGain[style:knob]
- ",0.5,0,1,0.01)*0.1;
- outGain = hslider("v:vocal/h:[1]otherParams/[5]outGain[style:knob]
- ",0.5,0,1,0.01);
- t = button("v:vocal/[2]gate");
-
- gate = t+s : min(1);
- freq2 = freq1*bend*(os.osc(vibratoFreq)*vibratoGain+1);
- envelope = gate*gain : si.smooth(ba.tau2pole(envAttack));
-};
-
-//===============================Misc Functions===========================================
-// Various miscellaneous functions.
-//========================================================================================
-
-//-------`(pm.)allpassNL`--------------
-// Bidirectional block adding nonlinearities in both directions in a chain.
-// Nonlinearities are created by modulating the coefficients of a passive
-// allpass filter by the signal it is processing.
-//
-// #### Usage
-//
-// ```
-// chain(... : allpassNL(nonlinearity) : ...)
-// ```
-//
-// Where:
-//
-// * `nonlinearity`: amount of nonlinearity to be added (0-1)
-//--------------------------------------
-allpassNL(nonlinearity) = par(i,2,nlf),_
-with{
- nlf = _ <: fi.allpassn(2,par(i,2,*(nonlinearity)*ma.PI));
-};
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-// UNCATEGORIZED FUNCTIONS (TODO)
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-// modalModel
-modalModel(n,modeFreqs,modeRes,modeGains) = _ <: par(i,n,gain(i)*modeFilter(freqs(i),res(i))) :> _
-with{
- freqs(i) = take(i+1,modeFreqs);
- res(i) = take(i+1,modeRes);
- gain(i) = take(i+1,modeGains);
-};
diff --git a/Resources/Libs/reducemaps.lib b/Resources/Libs/reducemaps.lib
deleted file mode 100644
index 21c43b9..0000000
--- a/Resources/Libs/reducemaps.lib
+++ /dev/null
@@ -1,95 +0,0 @@
-/************************************************************************
- ************************************************************************
-FAUST library file
-Copyright (C) 2010-2011 GRAME, Centre National de Creation Musicale
----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
- ************************************************************************
- ************************************************************************/
-
-declare name "Reduce Library";
-declare author "Yann Orlarey (orlarey at grame.fr)";
-declare copyright "Grame";
-declare version "0.1";
-declare license "LGPL";
-
-
-//---------------------------------------------------------------
-// Provides various operations on block of samples
-// using a high order 'reduce(op, n)' fold-like function :
-//
-// sumn(n) : the sum of a block of n input samples
-// maxn(n) : the max of a block of n input samples
-// minn(n) : the min of a block of n input samples
-// mean(n) : the mean of a block of n input samples
-// RMS(n) : the RMS of a block of n input samples
-//---------------------------------------------------------------
-
-
-
-//---------------------------------------------------------------
-// reduce (op, n, x)
-//---------------------------------------------------------------
-// Fold-like high order function. Apply a binary operation
-// on a block of consecutive samples of a signal .
-// For example : reduce(max,128) will compute the maximun of each
-// block of 128 samples. Please note that the resulting
-// value, while produced continuously, will be constant for
-// the duration of a block. A new value is only produced
-// at the end of a block. Note also that blocks should be of at
-// least one sample (n>0).
-reduce(op, n, x) = compute ~ (_,_,_) : (!,!,_)
- with {
- compute (acc, count, val) =
- if(count
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees!)
-
-************************************************************************/
-
-//=============================Schroeder Reverberators======================================
-//==========================================================================================
-
-//------------------------------`(re.)jcrev`------------------------------
-// This artificial reverberator take a mono signal and output stereo
-// (`satrev`) and quad (`jcrev`). They were implemented by John Chowning
-// in the MUS10 computer-music language (descended from Music V by Max
-// Mathews). They are Schroeder Reverberators, well tuned for their size.
-// Nowadays, the more expensive freeverb is more commonly used (see the
-// Faust examples directory).
-//
-// `jcrev` reverb below was made from a listing of "RV", dated April 14, 1972,
-// which was recovered from an old SAIL DART backup tape.
-// John Chowning thinks this might be the one that became the
-// well known and often copied JCREV.
-//
-// `jcrev` is a standard Faust function
-//
-// #### Usage
-//
-// ```
-// _ : jcrev : _,_,_,_
-// ```
-//------------------------------------------------------------
-jcrev = *(0.06) : allpass_chain <: comb_bank : mix_mtx with {
- rev1N = fi.rev1;
- rev12(len,g) = rev1N(2048,len,g);
- rev14(len,g) = rev1N(4096,len,g);
- allpass_chain =
- fi.rev2(512,347,0.7) :
- fi.rev2(128,113,0.7) :
- fi.rev2( 64, 37,0.7);
- comb_bank =
- rev12(1601,.802),
- rev12(1867,.773),
- rev14(2053,.753),
- rev14(2251,.733);
- mix_mtx = _,_,_,_ <: psum, -psum, asum, -asum : _,_,_,_ with {
- psum = _,_,_,_ :> _;
- asum = *(-1),_,*(-1),_ :> _;
- };
-};
-
-
-//------------------------------`(re.)satrev`------------------------------
-// This artificial reverberator take a mono signal and output stereo
-// (`satrev`) and quad (`jcrev`). They were implemented by John Chowning
-// in the MUS10 computer-music language (descended from Music V by Max
-// Mathews). They are Schroeder Reverberators, well tuned for their size.
-// Nowadays, the more expensive freeverb is more commonly used (see the
-// Faust examples directory).
-//
-// `satrev` was made from a listing of "SATREV", dated May 15, 1971,
-// which was recovered from an old SAIL DART backup tape.
-// John Chowning thinks this might be the one used on his
-// often-heard brass canon sound examples, one of which can be found at
-//
-//
-// #### Usage
-//
-// ```
-// _ : satrev : _,_
-// ```
-//------------------------------------------------------------
-satrev = *(0.2) <: comb_bank :> allpass_chain <: _,*(-1) with {
- rev1N = fi.rev1;
- rev11(len,g) = rev1N(1024,len,g);
- rev12(len,g) = rev1N(2048,len,g);
- comb_bank =
- rev11( 778,.827),
- rev11( 901,.805),
- rev11(1011,.783),
- rev12(1123,.764);
- rev2N = fi.rev2;
- allpass_chain =
- rev2N(128,125,0.7) :
- rev2N( 64, 42,0.7) :
- rev2N( 16, 12,0.7);
-};
-
-//======================Feedback Delay Network (FDN) Reverberators========================
-//========================================================================================
-
-//--------------------------------`(re.)fdnrev0`---------------------------------
-// Pure Feedback Delay Network Reverberator (generalized for easy scaling).
-// `fdnrev0` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// <1,2,4,...,N signals> <:
-// fdnrev0(MAXDELAY,delays,BBSO,freqs,durs,loopgainmax,nonl) :>
-// <1,2,4,...,N signals>
-// ```
-//
-// Where:
-//
-// * `N`: 2, 4, 8, ... (power of 2)
-// * `MAXDELAY`: power of 2 at least as large as longest delay-line length
-// * `delays`: N delay lines, N a power of 2, lengths perferably coprime
-// * `BBSO`: odd positive integer = order of bandsplit desired at freqs
-// * `freqs`: NB-1 crossover frequencies separating desired frequency bands
-// * `durs`: NB decay times (t60) desired for the various bands
-// * `loopgainmax`: scalar gain between 0 and 1 used to "squelch" the reverb
-// * `nonl`: nonlinearity (0 to 0.999..., 0 being linear)
-//
-// #### Reference
-//
-//
-//------------------------------------------------------------
-fdnrev0(MAXDELAY, delays, BBSO, freqs, durs, loopgainmax, nonl)
- = (si.bus(2*N) :> si.bus(N) : delaylines(N)) ~
- (delayfilters(N,freqs,durs) : feedbackmatrix(N))
-with {
- N = ba.count(delays);
- NB = ba.count(durs);
-//assert(count(freqs)+1==NB);
- delayval(i) = ba.take(i+1,delays);
- dlmax(i) = MAXDELAY; // must hardwire this from argument for now
-//dlmax(i) = 2^max(1,nextpow2(delayval(i))) // try when slider min/max is known
-// with { nextpow2(x) = ceil(log(x)/log(2.0)); };
-// -1 is for feedback delay:
- delaylines(N) = par(i,N,(de.delay(dlmax(i),(delayval(i)-1))));
- delayfilters(N,freqs,durs) = par(i,N,filter(i,freqs,durs));
- feedbackmatrix(N) = bhadamard(N);
- vbutterfly(n) = si.bus(n) <: (si.bus(n):>bus(n/2)) , ((si.bus(n/2),(si.bus(n/2):par(i,n/2,*(-1)))) :> si.bus(n/2));
- bhadamard(2) = si.bus(2) <: +,-;
- bhadamard(n) = si.bus(n) <: (si.bus(n):>si.bus(n/2)) , ((si.bus(n/2),(si.bus(n/2):par(i,n/2,*(-1)))) :> si.bus(n/2))
- : (bhadamard(n/2) , bhadamard(n/2));
-
- // Experimental nonlinearities:
- // nonlinallpass = apnl(nonl,-nonl);
- // s = nonl*PI;
- // nonlinallpass(x) = allpassnn(3,(s*x,s*x*x,s*x*x*x)); // filters.lib
- nonlinallpass = _; // disabled by default (rather expensive)
-
- filter(i,freqs,durs) = fi.filterbank(BBSO,freqs) : par(j,NB,*(g(j,i)))
- :> *(loopgainmax) / sqrt(N) : nonlinallpass
- with {
- dur(j) = ba.take(j+1,durs);
- n60(j) = dur(j)*ma.SR; // decay time in samples
- g(j,i) = exp(-3.0*log(10.0)*delayval(i)/n60(j));
- // ~ 1.0 - 6.91*delayval(i)/(SR*dur(j)); // valid for large dur(j)
- };
-};
-
-
-//-------------------------------`(re.)zita_rev_fdn`-------------------------------
-// Internal 8x8 late-reverberation FDN used in the FOSS Linux reverb zita-rev1
-// by Fons Adriaensen . This is an FDN reverb with
-// allpass comb filters in each feedback delay in addition to the
-// damping filters.
-//
-// #### Usage
-//
-// ```
-// bus(8) : zita_rev_fdn(f1,f2,t60dc,t60m,fsmax) : bus(8)
-// ```
-//
-// Where:
-//
-// * `f1`: crossover frequency (Hz) separating dc and midrange frequencies
-// * `f2`: frequency (Hz) above f1 where T60 = t60m/2 (see below)
-// * `t60dc`: desired decay time (t60) at frequency 0 (sec)
-// * `t60m`: desired decay time (t60) at midrange frequencies (sec)
-// * `fsmax`: maximum sampling rate to be used (Hz)
-//
-// #### Reference
-//
-// *
-// *
-//------------------------------------------------------------
-zita_rev_fdn(f1,f2,t60dc,t60m,fsmax) =
- ((si.bus(2*N) :> allpass_combs(N) : feedbackmatrix(N)) ~
- (delayfilters(N,freqs,durs) : fbdelaylines(N)))
-with {
- N = 8;
-
- // Delay-line lengths in seconds:
- apdelays = (0.020346, 0.024421, 0.031604, 0.027333, 0.022904,
- 0.029291, 0.013458, 0.019123); // feedforward delays in seconds
- tdelays = ( 0.153129, 0.210389, 0.127837, 0.256891, 0.174713,
- 0.192303, 0.125000, 0.219991); // total delays in seconds
- tdelay(i) = floor(0.5 + ma.SR*ba.take(i+1,tdelays)); // samples
- apdelay(i) = floor(0.5 + ma.SR*ba.take(i+1,apdelays));
- fbdelay(i) = tdelay(i) - apdelay(i);
- // NOTE: Since SR is not bounded at compile time, we can't use it to
- // allocate delay lines; hence, the fsmax parameter:
- tdelaymaxfs(i) = floor(0.5 + fsmax*ba.take(i+1,tdelays));
- apdelaymaxfs(i) = floor(0.5 + fsmax*ba.take(i+1,apdelays));
- fbdelaymaxfs(i) = tdelaymaxfs(i) - apdelaymaxfs(i);
- nextpow2(x) = ceil(log(x)/log(2.0));
- maxapdelay(i) = int(2.0^max(1.0,nextpow2(apdelaymaxfs(i))));
- maxfbdelay(i) = int(2.0^max(1.0,nextpow2(fbdelaymaxfs(i))));
-
- apcoeff(i) = select2(i&1,0.6,-0.6); // allpass comb-filter coefficient
- allpass_combs(N) =
- par(i,N,(fi.allpass_comb(maxapdelay(i),apdelay(i),apcoeff(i)))); // filters.lib
- fbdelaylines(N) = par(i,N,(de.delay(maxfbdelay(i),(fbdelay(i)))));
- freqs = (f1,f2); durs = (t60dc,t60m);
- delayfilters(N,freqs,durs) = par(i,N,filter(i,freqs,durs));
- feedbackmatrix(N) = ro.hadamard(N);
-
- staynormal = 10.0^(-20); // let signals decay well below LSB, but not to zero
-
- special_lowpass(g,f) = si.smooth(p) with {
- // unity-dc-gain lowpass needs gain g at frequency f => quadratic formula:
- p = mbo2 - sqrt(max(0,mbo2*mbo2 - 1.0)); // other solution is unstable
- mbo2 = (1.0 - gs*c)/(1.0 - gs); // NOTE: must ensure |g|<1 (t60m finite)
- gs = g*g;
- c = cos(2.0*ma.PI*f/float(ma.SR));
- };
-
- filter(i,freqs,durs) = lowshelf_lowpass(i)/sqrt(float(N))+staynormal
- with {
- lowshelf_lowpass(i) = gM*low_shelf1_l(g0/gM,f(1)):special_lowpass(gM,f(2));
- low_shelf1_l(G0,fx,x) = x + (G0-1)*fi.lowpass(1,fx,x); // filters.lib
- g0 = g(0,i);
- gM = g(1,i);
- f(k) = ba.take(k,freqs);
- dur(j) = ba.take(j+1,durs);
- n60(j) = dur(j)*ma.SR; // decay time in samples
- g(j,i) = exp(-3.0*log(10.0)*tdelay(i)/n60(j));
- };
-};
-
-// Stereo input delay used by zita_rev1 in both stereo and ambisonics mode:
-zita_in_delay(rdel) = zita_delay_mono(rdel), zita_delay_mono(rdel) with {
- zita_delay_mono(rdel) = de.delay(8192,ma.SR*rdel*0.001) * 0.3;
-};
-
-// Stereo input mapping used by zita_rev1 in both stereo and ambisonics mode:
-zita_distrib2(N) = _,_ <: fanflip(N) with {
- fanflip(4) = _,_,*(-1),*(-1);
- fanflip(N) = fanflip(N/2),fanflip(N/2);
-};
-
-
-//----------------------------`(re.)zita_rev1_stereo`---------------------------
-// Extend `zita_rev_fdn` to include `zita_rev1` input/output mapping in stereo mode.
-// `zita_rev1_stereo` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _,_ : zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax) : _,_
-// ```
-//
-// Where:
-//
-// `rdel` = delay (in ms) before reverberation begins (e.g., 0 to ~100 ms)
-// (remaining args and refs as for `zita_rev_fdn` above)
-//------------------------------------------------------------
-zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax) =
- zita_in_delay(rdel)
- : zita_distrib2(N)
- : zita_rev_fdn(f1,f2,t60dc,t60m,fsmax)
- : output2(N)
-with {
- N = 8;
- output2(N) = outmix(N) : *(t1),*(t1);
- t1 = 0.37; // zita-rev1 linearly ramps from 0 to t1 over one buffer
- outmix(4) = !,ro.butterfly(2),!; // probably the result of some experimenting!
- outmix(N) = outmix(N/2),par(i,N/2,!);
-};
-
-
-//-----------------------------`(re.)zita_rev1_ambi`---------------------------
-// Extend zita_rev_fdn to include zita_rev1 input/output mapping in
-// "ambisonics mode", as provided in the Linux C++ version.
-//
-// #### Usage
-//
-// ```
-// _,_ : zita_rev1_ambi(rgxyz,rdel,f1,f2,t60dc,t60m,fsmax) : _,_,_,_
-// ```
-//
-// Where:
-//
-// `rgxyz` = relative gain of lanes 1,4,2 to lane 0 in output (e.g., -9 to 9)
-// (remaining args and references as for zita_rev1_stereo above)
-//------------------------------------------------------------
-zita_rev1_ambi(rgxyz,rdel,f1,f2,t60dc,t60m,fsmax) =
- zita_in_delay(rdel)
- : zita_distrib2(N)
- : zita_rev_fdn(f1,f2,t60dc,t60m,fsmax)
- : output4(N) // ambisonics mode
-with {
- N=8;
- output4(N) = select4 : *(t0),*(t1),*(t1),*(t1);
- select4 = _,_,_,!,_,!,!,! : _,_,cross with { cross(x,y) = y,x; };
- t0 = 1.0/sqrt(2.0);
- t1 = t0 * 10.0^(0.05 * rgxyz);
-};
-
-// end jos section
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-//===============================Freeverb===================================
-//==========================================================================
-
-//----------------------------`(re.)mono_freeverb`-------------------------
-// A simple Schroeder reverberator primarily developed by "Jezar at Dreampoint" that
-// is extensively used in the free-software world. It uses four Schroeder allpasses in
-// series and eight parallel Schroeder-Moorer filtered-feedback comb-filters for each
-// audio channel, and is said to be especially well tuned.
-//
-// `mono_freeverb` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : mono_freeverb(fb1, fb2, damp, spread) : _;
-// ```
-//
-// Where:
-//
-// * `fb1`: coefficient of the lowpass comb filters (0-1)
-// * `fb2`: coefficient of the allpass comb filters (0-1)
-// * `damp`: damping of the lowpass comb filter (0-1)
-// * `spread`: spatial spread in number of samples (for stereo)
-//
-// #### License
-// While this version is licensed LGPL (with exception) along with other GRAME
-// library functions, the file freeverb.dsp in the examples directory of older
-// Faust distributions, such as faust-0.9.85, was released under the BSD license,
-// which is less restrictive.
-//------------------------------------------------------------
-// TODO: author RM
-mono_freeverb(fb1, fb2, damp, spread) = _ <: par(i,8,lbcf(combtuningL(i)+spread,fb1,damp))
- :> seq(i,4,fi.allpass_comb(1024, allpasstuningL(i)+spread, -fb2))
-with{
- origSR = 44100;
-
- // Filters parameters
- combtuningL(0) = 1116*ma.SR/origSR : int;
- combtuningL(1) = 1188*ma.SR/origSR : int;
- combtuningL(2) = 1277*ma.SR/origSR : int;
- combtuningL(3) = 1356*ma.SR/origSR : int;
- combtuningL(4) = 1422*ma.SR/origSR : int;
- combtuningL(5) = 1491*ma.SR/origSR : int;
- combtuningL(6) = 1557*ma.SR/origSR : int;
- combtuningL(7) = 1617*ma.SR/origSR : int;
-
- allpasstuningL(0) = 556*ma.SR/origSR : int;
- allpasstuningL(1) = 441*ma.SR/origSR : int;
- allpasstuningL(2) = 341*ma.SR/origSR : int;
- allpasstuningL(3) = 225*ma.SR/origSR : int;
- // Lowpass Feedback Combfiler:
- // https://ccrma.stanford.edu/~jos/pasp/Lowpass_Feedback_Comb_Filter.html
- lbcf(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
-};
-
-
-//----------------------------`(re.)stereo_freeverb`-------------------------
-// A simple Schroeder reverberator primarily developed by "Jezar at Dreampoint" that
-// is extensively used in the free-software world. It uses four Schroeder allpasses in
-// series and eight parallel Schroeder-Moorer filtered-feedback comb-filters for each
-// audio channel, and is said to be especially well tuned.
-//
-// #### Usage
-//
-// ```
-// _,_ : stereo_freeverb(fb1, fb2, damp, spread) : _,_;
-// ```
-//
-// Where:
-//
-// * `fb1`: coefficient of the lowpass comb filters (0-1)
-// * `fb2`: coefficient of the allpass comb filters (0-1)
-// * `damp`: damping of the lowpass comb filter (0-1)
-// * `spread`: spatial spread in number of samples (for stereo)
-//------------------------------------------------------------
-// TODO: author RM
-stereo_freeverb(fb1, fb2, damp, spread) = + <: mono_freeverb(fb1, fb2, damp,0), mono_freeverb(fb1, fb2, damp, spread);
-
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
-
-// end further further contributions section
diff --git a/Resources/Libs/routes.lib b/Resources/Libs/routes.lib
deleted file mode 100644
index 904a677..0000000
--- a/Resources/Libs/routes.lib
+++ /dev/null
@@ -1,181 +0,0 @@
-//#################################### routes.lib ########################################
-// A library of basic elements to handle signal routing in Faust. Its official
-// prefix is `ro`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file
-Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale
-----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-ba = library("basics.lib");
-si = library("signals.lib");
-sp = library("spats.lib");
-
-declare name "Faust Signal Routing Library";
-declare version "0.0";
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-//--------------------------------`(ro.)cross`-----------------------------------
-// Cross n signals: `(x1,x2,..,xn) -> (xn,..,x2,x1)`.
-// `cross` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// cross(n)
-// _,_,_ : cross(3) : _,_,_
-// ```
-//
-// Where:
-//
-// * `n`: number of signals (int, must be known at compile time)
-//
-// #### Note
-//
-// Special case: `cross2`:
-//
-// ```
-// cross2 = _,cross(2),_;
-// ```
-//-----------------------------------------------------------------------------
-// cross n cables : (x1,x2,..,xn) -> (xn,..,x2,x1)
-cross(n) = si.bus(n) <: par(i,n,ba.selector(n-i-1,n));
-cross2 = _,cross(2),_; // for compatibility with some old misceffects.lib functions
-
-
-//--------------`(ro.)crossnn`--------------
-// Cross two `bus(n)`s.
-//
-// #### Usage
-//
-// ```
-// _,_,... : crossmm(n) : _,_,...
-// ```
-//
-// Where:
-//
-// * `n`: the number of signals in the `bus`
-//--------------------------------------
-crossnn(n) = si.bus(n),si.bus(n) <: si.block(n),si.bus(n),si.bus(n),si.block(n);
-
-
-//--------------`(ro.)crossn1`--------------
-// Cross bus(n) and bus(1).
-//
-// #### Usage
-//
-// ```
-// _,_,... : crossn1(n) : _,_,...
-// ```
-//
-// Where:
-//
-// * `n`: the number of signals in the first `bus`
-//--------------------------------------
-crossn1(n) = si.bus(n),(si.bus(1)<:si.bus(n)) <: si.block(n),si.bus(n),si.bus(n),
- si.block(n):si.bus(1),si.block(n-1),si.bus(n);
-
-
-//--------------------------`(ro.)interleave`------------------------------
-// Interleave row*col cables from column order to row order.
-// input : x(0), x(1), x(2) ..., x(row*col-1)
-// output: x(0+0*row), x(0+1*row), x(0+2*row), ..., x(1+0*row), x(1+1*row), x(1+2*row), ...
-//
-// #### Usage
-//
-// ```
-// _,_,_,_,_,_ : interleave(row,column) : _,_,_,_,_,_
-// ```
-//
-// Where:
-//
-// * `row`: the number of row (int, known at compile time)
-// * `column`: the number of column (int, known at compile time)
-//-----------------------------------------------------------------------------
-interleave(row,col) = si.bus(row*col) <: par(r, row, par(c, col, ba.selector(r+c*row,row*col)));
-
-
-//-------------------------------`(ro.)butterfly`--------------------------------
-// Addition (first half) then substraction (second half) of interleaved signals.
-//
-// #### Usage
-//
-// ```
-// _,_,_,_ : butterfly(n) : _,_,_,_
-// ```
-//
-// Where:
-//
-// * `n`: size of the butterfly (n is int, even and known at compile time)
-//-----------------------------------------------------------------------------
-butterfly(n) = si.bus(n) <: interleave(n/2,2), interleave(n/2,2) : par(i, n/2, +), par(i, n/2, -);
-
-
-//------------------------------`(ro.)hadamard`----------------------------------
-// Hadamard matrix function of size `n = 2^k`.
-//
-// #### Usage
-//
-// ```
-// _,_,_,_ : hadamard(n) : _,_,_,_
-// ```
-//
-// Where:
-//
-// * `n`: `2^k`, size of the matrix (int, must be known at compile time)
-//
-// #### Note:
-//
-// Implementation contributed by Remy Muller.
-//-----------------------------------------------------------------------------
-// TODO: author: Remy Muller, revised by RM
-hadamard(2) = butterfly(2);
-hadamard(n) = butterfly(n) : (hadamard(n/2) , hadamard(n/2));
-
-
-//---------------`(ro.)recursivize`-------------
-// Create a recursion from two arbitrary processors p and q.
-//
-// #### Usage
-//
-// ```
-// _,_ : recursivize(p,q) : _,_
-//
-// ```
-//
-// Where:
-//
-// * `p`: the forward arbitrary processor
-// * `q`: the feedback arbitrary processor
-//----------------------------------------
-recursivize(p,q) = (_,_,_,_ :> sp.stereoize(p)) ~ sp.stereoize(q);
diff --git a/Resources/Libs/signals.lib b/Resources/Libs/signals.lib
deleted file mode 100644
index 9a8c758..0000000
--- a/Resources/Libs/signals.lib
+++ /dev/null
@@ -1,295 +0,0 @@
-//#################################### signals.lib ########################################
-// A library of basic elements to handle signals in Faust. Its official prefix is `si`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-ba = library("basics.lib");
-ro = library("routes.lib");
-si = library("signals.lib");
-
-declare name "Faust Signal Routing Library";
-declare version "0.0";
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-//--------------------------------`(si.)bus`-------------------------------------
-// n parallel cables.
-// `bus` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// bus(n)
-// bus(4) : _,_,_,_
-// ```
-//
-// Where:
-//
-// * `n`: is an integer known at compile time that indicates the number of parallel cables.
-//-----------------------------------------------------------------------------
-bus(2) = _,_; // avoids a lot of "bus(1)" labels in block diagrams
-bus(n) = par(i, n, _);
-
-
-//--------------`(si.)block`--------------
-// Block - terminate n signals.
-// `block` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _,_,... : block(n) : _,...
-// ```
-//
-// Where:
-//
-// * `n`: the number of signals to be blocked
-//--------------------------------------
-block(n) = par(i,n,!);
-
-
-//-----------------------------`(si.)interpolate`-------------------------------
-// Linear interpolation between two signals.
-//
-// #### Usage
-//
-// ```
-// _,_ : interpolate(i) : _
-// ```
-//
-// Where:
-//
-// * `i`: interpolation control between 0 and 1 (0: first input; 1: second input)
-//-----------------------------------------------------------------------------
-interpolate(i) = *(1.0-i),*(i) : +;
-
-//------------------------`(si.)smoo`---------------------------------------
-// Smoothing function based on `smooth` ideal to smooth UI signals
-// (sliders, etc.) down.
-// `smoo` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// hslider(...) : smoo;
-// ```
-//---------------------------------------------------------------------
-smoo = si.smooth(0.999);
-
-
-//-----------------------`(si.)polySmooth`--------------------------------
-// A smoothing function based on `smooth` that doesn't smooth when a
-// trigger signal is given. This is very useful when making
-// polyphonic synthesizer to make sure that the value of the parameter
-// is the right one when the note is started.
-//
-// #### Usage
-//
-// ```
-// hslider(...) : polysmooth(g,s,d) : _
-// ```
-//
-// Where:
-//
-// * `g`: the gate/trigger signal used when making polyphonic synths
-// * `s`: the smoothness (see `smooth`)
-// * `d`: the number of samples to wait before the signal start being
-// smoothed after `g` switched to 1
-//-------------------------------------------------------------------
-polySmooth(g,s,d) = smooth(s*((g==(g@d)) | (g == 0)));
-
-//-----------------------`(si.)smoothAndH`--------------------------------
-// A smoothing function based on `smooth` that holds its output
-// signal when a trigger is sent to it. This feature is convenient
-// when implementing polyphonic instruments to prevent some
-// smoothed parameter to change when a note-off event is sent.
-//
-// #### Usage
-//
-// ```
-// hslider(...) : smoothAndH(g,s) : _
-// ```
-//
-// Where:
-//
-// * `g`: the hold signal (0 for hold, 1 for bypass)
-// * `s`: the smoothness (see `smooth`)
-//-------------------------------------------------------------------
-smoothAndH(t,s) = smooth(s*t) : ba.sAndH(t);
-
-//-----------------------------`(si.)bsmooth`------------------------------
-// Block smooth linear interpolation during a block of samples.
-//
-// #### Usage
-//
-// ```
-// hslider(...) : bsmooth : _
-// ```
-//-----------------------------------------------------------------------
-bsmooth(c) = +(i) ~ _
-with {
- i = (c-c@n)/n;
- n = min(4096, max(1, fvariable(int count, )));
-};
-
-//-------------------------------`(si.)dot`--------------------------------------
-// Dot product for two vectors of size n.
-//
-// #### Usage
-//
-// ```
-// _,_,_,_,_,_ : dot(n) : _
-// ```
-//
-// Where:
-//
-// * `n`: size of the vectors (int, must be known at compile time)
-//-----------------------------------------------------------------------------
-dot(n) = ro.interleave(n,2) : par(i,n,*) :> _;
-
-// end GRAME section
-//########################################################################################
-/************************************************************************
-FAUST library file, jos section
-
-Except where noted otherwise, The Faust functions below in this
-section are Copyright (C) 2003-2017 by Julius O. Smith III
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees!)
-
-************************************************************************/
-//-------------------`(si.)smooth`-----------------------------------
-// Exponential smoothing by a unity-dc-gain one-pole lowpass.
-// `smooth` is a standard Faust function.
-//
-// #### Usage:
-//
-// ```
-// _ : smooth(tau2pole(tau)) : _
-// ```
-//
-// Where:
-//
-// * `tau`: desired smoothing time constant in seconds, or
-//
-// ```
-// hslider(...) : smooth(s) : _
-// ```
-//
-// Where:
-//
-// * `s`: smoothness between 0 and 1. s=0 for no smoothing, s=0.999 is "very smooth",
-// s>1 is unstable, and s=1 yields the zero signal for all inputs.
-// The exponential time-constant is approximately 1/(1-s) samples, when s is close to
-// (but less than) 1.
-//
-// #### Reference:
-//
-//
-//-------------------------------------------------------------
-smooth(s) = *(1.0 - s) : + ~ *(s);
-
-//--------------------------------`(si.)cbus`-------------------------------------
-// n parallel cables for complex signals.
-// `cbus` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// cbus(n)
-// cbus(4) : (r0,i0), (r1,i1), (r2,i2), (r3,i3)
-// ```
-//
-// Where:
-//
-// * `n`: is an integer known at compile time that indicates the number of parallel cables.
-// * each complex number is represented by two real signals as (real,imag)
-//-----------------------------------------------------------------------------
-cbus(1) = (_,_);
-cbus(n) = par(i, n, (_,_));
-
-//--------------------------------`(si.)cmul`-------------------------------------
-// multiply two complex signals pointwise.
-// `cmul` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// (r1,i1) : cmul(r2,i2) : (_,_);
-// ```
-//
-// Where:
-//
-// * Each complex number is represented by two real signals as (real,imag), so
-// - `(r1,i1)` = real and imaginary parts of signal 1
-// - `(r2,i2)` = real and imaginary parts of signal 2
-//-----------------------------------------------------------------------------
-cmul(r1,i1,r2,i2) = (r1*r2 - i1*i2), (r1*i2 + r2*i1);
-
-// end jos section
-/************************************************************************
-FAUST library file, further contributions section
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
-
-//-------------`(si.)lag_ud`---------------
-// Lag filter with separate times for up and down.
-//
-// #### Usage
-//
-// ```
-// _ : lag_ud(up, dn, signal) : _;
-// ```
-//----------------------------------------------------
-// Author: Jonatan Liljedahl
-// License: STK-4.3
-// MarkDown: Romain Michon
-lag_ud(up,dn) = _ <: ((>,ba.tau2pole(up),ba.tau2pole(dn):select2),_:si.smooth) ~ _;
-
-// end further further contributions section
diff --git a/Resources/Libs/spats.lib b/Resources/Libs/spats.lib
deleted file mode 100644
index 7e98eac..0000000
--- a/Resources/Libs/spats.lib
+++ /dev/null
@@ -1,143 +0,0 @@
-//#################################### spats.lib ##########################################
-// This library contains a collection of tools for sound spatialization.
-// Its official prefix is `sp`.
-//########################################################################################
-
-/************************************************************************
- ************************************************************************
-FAUST library file
-Copyright (C) 2003-2012 GRAME, Centre National de Creation Musicale
-----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-
- ************************************************************************
- ************************************************************************/
-
-si = library("signals.lib");
-
-declare name "Faust Spatialization Library";
-declare version "0.0";
-
-
-//-----------------------`(sp.)panner`------------------------
-// A simple linear stereo panner.
-// `panner` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : panner(g) : _,_
-// ```
-//
-// Where:
-//
-// * `g`: the panning (0-1)
-//------------------------------------------------------------
-panner(g) = _ <: *(1-g), *(g);
-
-// TODO: need demo function for panner here
-
-
-//-----------------------`(sp.)spat`------------------------
-// GMEM SPAT: n-outputs spatializer.
-// `spat` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : spat(n,r,d) : _,_,...
-// ```
-//
-// Where:
-//
-// * `n`: number of outputs
-// * `r`: rotation (between 0 et 1)
-// * `d`: distance of the source (between 0 et 1)
-//------------------------------------------------------
-// TODO: author Laurent Pottier, revised by RM
-spat(n,a,d) = _ <: par(i, n, *( scaler(i, n, a, d) : si.smooth(0.9999) ))
-with {
- scaler(i,n,a,d) = (d/2.0+0.5)
- * sqrt( max(0.0, 1.0 - abs(fmod(a+0.5+float(n-i)/n, 1.0) - 0.5) * n * d) );
-};
-
-
-//---------------`(sp.)stereoize`-------------
-// Transform an arbitrary processor `p` into a stereo processor with 2 inputs
-// and 2 outputs.
-//
-// #### Usage
-//
-// ```
-// _,_ : stereoize(p) : _,_
-// ```
-//
-// Where:
-//
-// * `p`: the arbitrary processor
-//----------------------------------------
-// NOTE: where are inputs and outputs declared?
-stereoize(p) = S(inputs(p), outputs(p))
-with {
- // degenerated processor with no outputs
- S(n,0) = !,! : 0,0; // just in case, probably a rare case
- // processors with no inputs
- S(0,1) = !,! : p <: _,_; // add two fake inputs and split output
- S(0,2) = !,! : p;
- S(0,n) = !,! : p,p :> _,_; // we are sure this will work if n is odd
- // processors with one input
- S(1,1) = p,p; // add two fake inputs and split output
- S(1,n) = p,p :> _,_; // we are sure this will work if n is odd
- // processors with two inputs
- S(2,1) = p <: _,_; // split the output
- S(2,2) = p; // nothing to do, p is already stereo
- // processors with inputs > 2 and outputs > 2
- S(n,m) = _,_ <: p,p :> _,_; // we are sure this works if n or p are odd
-};
-
-// TODO: need demo function of spat here
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// UNDOCUMENTED/DISMISSED ELEMENTS
-//////////////////////////////////////////////////////////////////////////////////////////
-
-// music.lib:
- // The following functions could remain available but they would have to be
- // factorized and reimplemented using the `par` function...
- // bus2 = _,_;
- // bus3 = _,_,_;
- // bus4 = _,_,_,_;
- // bus5 = _,_,_,_,_;
- // bus6 = _,_,_,_,_,_;
- // bus7 = _,_,_,_,_,_,_;
- // bus8 = _,_,_,_,_,_,_,_;
- // gain2(g) = *(g),*(g);
- // gain3(g) = *(g),*(g),*(g);
- // gain4(g) = *(g),*(g),*(g),*(g);
- // gain5(g) = *(g),*(g),*(g),*(g),*(g);
- // gain6(g) = *(g),*(g),*(g),*(g),*(g),*(g);
- // gain7(g) = *(g),*(g),*(g),*(g),*(g),*(g),*(g);
- // gain8(g) = *(g),*(g),*(g),*(g),*(g),*(g),*(g),*(g);
diff --git a/Resources/Libs/stdfaust.lib b/Resources/Libs/stdfaust.lib
deleted file mode 100644
index 81f2207..0000000
--- a/Resources/Libs/stdfaust.lib
+++ /dev/null
@@ -1,27 +0,0 @@
-//################################ stdfaust.lib ##########################################
-// The purpose of this library is to give access to all the Faust standard libraries
-// through a series of environment.
-//########################################################################################
-
-an = library("analyzers.lib");
-ba = library("basics.lib");
-co = library("compressors.lib");
-de = library("delays.lib");
-dm = library("demos.lib");
-dx = library("dx7.lib");
-en = library("envelopes.lib");
-fi = library("filters.lib");
-ho = library("hoa.lib");
-ma = library("maths.lib");
-ef = library("misceffects.lib");
-os = library("oscillators.lib");
-no = library("noises.lib");
-pf = library("phaflangers.lib");
-pm = library("physmodels.lib");
-re = library("reverbs.lib");
-ro = library("routes.lib");
-sp = library("spats.lib");
-si = library("signals.lib");
-sy = library("synths.lib");
-ve = library("vaeffects.lib");
-sf = library("all.lib");
diff --git a/Resources/Libs/synths.lib b/Resources/Libs/synths.lib
deleted file mode 100644
index c9fa018..0000000
--- a/Resources/Libs/synths.lib
+++ /dev/null
@@ -1,206 +0,0 @@
-//################################### synths.lib ##########################################
-// This library contains a collection of envelope generators. Its official
-// prefix is `sy`.
-//########################################################################################
-
-/************************************************************************
-************************************************************************
-FAUST library file
-Copyright (C) 2003-2016 GRAME, Centre National de Creation Musicale
-----------------------------------------------------------------------
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-declare name "Faust Synthesizer Library";
-declare version "0.0";
-
-ma = library("maths.lib");
-ba = library("basics.lib");
-en = library("envelopes.lib");
-fi = library("filters.lib");
-os = library("oscillators.lib");
-no = library("noises.lib");
-
-//-----------------------------------`(sy.)popFilterPerc`--------------------------------------
-// A simple percussion instrument based on a "popped" resonant bandpass filter.
-// `popFilterPerc` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// popFilterDrum(freq,q,gate) : _;
-// ```
-//
-// Where:
-//
-// * `freq`: the resonance frequency of the instrument
-// * `q`: the q of the res filter (typically, 5 is a good value)
-// * `gate`: the trigger signal (0 or 1)
-//----------------------------------------------------------------------------------------
-// TODO: author RM
-popFilterDrum(freq,q,gate) = en.ar(0.001,0.001,gate)*no.noise : fi.resonbp(freq,q,1);
-
-
-//---------------------------------------`(sy.)dubDub`-----------------------------------------
-// A simple synth based on a sawtooth wave filtered by a resonant lowpass.
-// `dubDub` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// dubDub(freq,ctFreq,q,gate) : _;
-// ```
-//
-// Where:
-//
-// * `freq`: frequency of the sawtooth
-// * `ctFreq`: cutoff frequency of the filter
-// * `q`: Q of the filter
-// * `gate`: the trigger signal (0 or 1)
-//----------------------------------------------------------------------------------------
-// TODO: author RM
-dubDub(freq,ctFreq,q,gate) = os.sawtooth(freq)*gainEnvelope : fi.resonlp(ctFreq,q,1)
-with{
- maxGain = 0.5;
- gainEnvelope = en.smoothEnvelope(0.01,gate)*maxGain;
-};
-
-
-//-----------------------------------`(sy.)sawTrombone`----------------------------------------
-// A simple trombone based on a lowpassed sawtooth wave.
-// `sawTrombone` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// sawTrombone(att,freq,gain,gate) : _
-// ```
-//
-// Where:
-//
-// * `att`: exponential attack duration in s (typically 0.01)
-// * `freq`: the frequency
-// * `gain`: the gain (0-1)
-// * `gate`: the gate (0 or 1)
-//----------------------------------------------------------------------------------------
-// TODO: author RM
-sawTrombone(freq,gain,gate) = os.sawtooth(freq)*gainEnvelope : fi.lowpass(3,cutoff)
-with{
- // controls both the gain of the instrument and the lowpass frequency
- gainEnvelope = en.smoothEnvelope(0.01,gate)*gain;
- cutoff = gainEnvelope*5000+50;
-};
-
-
-//-----------------------------------`(sy.)combString`-----------------------------------------
-// Simplest string physical model ever based on a comb filter.
-// `combString` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// combString(freq,res,gate) : _;
-// ```
-//
-// Where:
-//
-// * `freq`: the frequency of the string
-// * `res`: string T60 (resonance time) in second
-// * `gate`: trigger signal (0 or 1)
-//----------------------------------------------------------------------------------------
-// TODO: author RM
-combString(freq,res,gate) = excitation : fi.fb_fcomb(maxDel,N,b0,aN)
-with{
- maxDel = 1024;
- N = ma.SR/freq;
- b0 = 1;
- aN = ba.tau2pole(res*0.001)*-1;
- excitation = no.noise*en.ar(0.001,0.001,gate);
-};
-
-
-//-----------------------------------`(sy.)additiveDrum`---------------------------------------
-// A simple drum using additive synthesis.
-// `additiveDrum` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// additiveDrum(freq,freqRatio,gain,harmDec,att,rel,gate) : _
-// ```
-//
-// Where:
-//
-// * `freq`: the resonance frequency of the drum
-// * `freqRatio`: a list of ratio to choose the frequency of the mode in
-// function of `freq` e.g.(1 1.2 1.5 ...). The first element should always
-// be one (fundamental).
-// * `gain`: the gain of each mode as a list (1 0.9 0.8 ...). The first element
-// is the gain of the fundamental.
-// * `harmDec`: harmonic decay ratio (0-1): configure the speed at which
-// higher modes decay compare to lower modes.
-// * `att`: attack duration in second
-// * `rel`: release duration in second
-// * `gate`: trigger signal (0 or 1)
-//----------------------------------------------------------------------------------------
-// TODO: author RM
-additiveDrum(freq,freqRatio,gain,modeDec,att,rel,gate) = par(i,N,os.osc(modeFreq(i))*gainEnvelope(i)) :> _
-with{
- N = ba.count(freqRatio);
- modeFreq(i) = freq*ba.take(i+1,freqRatio);
- modeGain(i) = ba.take(i+1,gain);
- gainEnvelope(i) = modeGain(i)*en.ar(att,rel*(1-(modeDec*(i/N))),gate);
-};
-
-
-//-----------------------------------`(sy.)fm`---------------------------------------
-// An FM synthesizer with an arbitrary number of modulators connected as a sequence.
-// `fm` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// freqs = (300,400,...);
-// indices = (20,...);
-// fm(freqs,indices) : _
-// ```
-//
-// Where:
-//
-// * `freqs`: a list of frequencies where the first one is the frequency of the carrier
-// and the others, the frequency of the modulator(s)
-// * `indices`: the indices of modulation (Nfreqs-1)
-//----------------------------------------------------------------------------------------
-// TODO: author RM
-fm(freqs,indices) = seq(i,N,fmBlock(i))
-with{
- N = ba.count(freqs);
- freq(i) = ba.take(N-i,freqs);
- gain(i) = ba.take(N-i,indices);
- fmBlock(0) = freq(0) : os.osc;
- fmBlock(i) = *(gain(i))+freq(i) : os.osc;
-};
diff --git a/Resources/Libs/tonestacks.lib b/Resources/Libs/tonestacks.lib
deleted file mode 100644
index 3c51bef..0000000
--- a/Resources/Libs/tonestacks.lib
+++ /dev/null
@@ -1,428 +0,0 @@
-/**
- ** Guitar tone stacks (based on the work from D.T. Yeh)
- ** some values are taken from CAPS plugin tonestack
- **
- ** this tonestacks.library provide the following tonestack models:
- ** bassman, mesa, twin, princeton, jcm800, jcm2000, jtm45, mlead,
- ** m2199, ac30, ac15, soldano, sovtek, peavey, ibanez, roland,
- ** ampeg, ampeg_rev, bogner, groove, crunch, fender_blues,
- ** fender_default, fender_deville, gibsen
- **
- ** USAGE :
- ** _:component("tonestacks.lib").model(t,m,l):_
- ** WHERE :
- ** model is on of the models above.
- ** t is treble freq control in range of (0.0 - 1.0)
- ** m is middle freq control in range of (0.0 - 1.0)
- ** l is low freq control in range of (0.0 - 1.0)
- **
- ** EXAMPLE :
- ** process = component("tonestacks.lib").jcm2000(t,m,l)
- ** with {
- ** t = vslider("Treble ", 0.5, 0, 1, 0.01);
- ** m = vslider("Middle ", 0.5, 0, 1, 0.01);
- ** l = vslider("Bass ", 0.5, 0, 1, 0.01);
- ** };
- **/
-
-declare name "Tonestack Emulation Library";
-declare author "Guitarix project (http://guitarix.sourceforge.net/)";
-declare copyright "Guitarix project";
-declare version "0.28";
-declare license "LGPL";
-
-ma = library("maths.lib");
-fi = library("filters.lib");
-
-
-/****************************************************************
- ** Equalisation 3 bandes
- ** C1
- ** IN >---------||---------
- ** | |
- ** | |
- ** | | R4 | | R1 Treble
- ** | | | |<------< Out
- ** | | | |
- ** | C2 |
- ** |-------||--------|------
- ** | | |
- ** | | | |
- ** | | |<---- R2 Bass
- ** | | |
- ** | |
- ** | C3 | |
- ** --------||------>| | R3 Middle
- ** | |
- ** |
- ** _|_
- ** -
- **
- ****************************************************************/
-
-tonestack(C1,C2,C3,R1,R2,R3,R4,t,m,L) =
- 1/A0*fi.iir((B0,B1,B2,B3),(A1/A0,A2/A0,A3/A0))
- with {
-
- l = L : (_-1)*3.4 : exp;
-
- b1 = t*C1*R1 + m*C3*R3 + l*(C1*R2 + C2*R2) + (C1*R3 + C2*R3);
-
- b2 = t*(C1*C2*R1*R4 + C1*C3*R1*R4) - m*m*(C1*C3*R3*R3 + C2*C3*R3*R3)
- + m*(C1*C3*R1*R3 + C1*C3*R3*R3 + C2*C3*R3*R3)
- + l*(C1*C2*R1*R2 + C1*C2*R2*R4 + C1*C3*R2*R4)
- + l*m*(C1*C3*R2*R3 + C2*C3*R2*R3)
- + (C1*C2*R1*R3 + C1*C2*R3*R4 + C1*C3*R3*R4);
-
- b3 = l*m*(C1*C2*C3*R1*R2*R3 + C1*C2*C3*R2*R3*R4)
- - m*m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
- + m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
- + t*C1*C2*C3*R1*R3*R4 - t*m*C1*C2*C3*R1*R3*R4
- + t*l*C1*C2*C3*R1*R2*R4;
-
- a0 = 1;
-
- a1 = (C1*R1 + C1*R3 + C2*R3 + C2*R4 + C3*R4)
- + m*C3*R3 + l*(C1*R2 + C2*R2);
-
- a2 = m*(C1*C3*R1*R3 - C2*C3*R3*R4 + C1*C3*R3*R3 + C2*C3*R3*R3)
- + l*m*(C1*C3*R2*R3 + C2*C3*R2*R3)
- - m*m*(C1*C3*R3*R3 + C2*C3*R3*R3)
- + l*(C1*C2*R2*R4 + C1*C2*R1*R2 + C1*C3*R2*R4 + C2*C3*R2*R4)
- + (C1*C2*R1*R4 + C1*C3*R1*R4 + C1*C2*R3*R4 + C1*C2*R1*R3 + C1*C3*R3*R4 + C2*C3*R3*R4);
-
- a3 = l*m*(C1*C2*C3*R1*R2*R3 + C1*C2*C3*R2*R3*R4)
- - m*m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
- + m*(C1*C2*C3*R3*R3*R4 + C1*C2*C3*R1*R3*R3 - C1*C2*C3*R1*R3*R4)
- + l*C1*C2*C3*R1*R2*R4
- + C1*C2*C3*R1*R3*R4;
-
- c = 2*float(ma.SR);
-
- B0 = -b1*c - b2*pow(c,2) - b3*pow(c,3);
- B1 = -b1*c + b2*pow(c,2) + 3*b3*pow(c,3);
- B2 = b1*c + b2*pow(c,2) - 3*b3*pow(c,3);
- B3 = b1*c - b2*pow(c,2) + b3*pow(c,3);
- A0 = -a0 - a1*c - a2*pow(c,2) - a3*pow(c,3);
- A1 = -3*a0 - a1*c + a2*pow(c,2) + 3*a3*pow(c,3);
- A2 = -3*a0 + a1*c + a2*pow(c,2) - 3*a3*pow(c,3);
- A3 = -a0 + a1*c - a2*pow(c,2) + a3*pow(c,3);
-};
-
-ts = environment {
- k = *(1e3);
- M = *(1e6);
- nF = *(1e-9);
- pF = *(1e-12);
-
- /* Fender */
-
- bassman = environment { /* 59 Bassman 5F6-A */
- R1 = 250:k;
- R2 = 1:M;
- R3 = 25:k;
- R4 = 56:k;
- C1 = 250:pF;
- C2 = 20:nF;
- C3 = 20:nF;
- };
-
- mesa = environment { /* Mesa Boogie Mark */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 25:k;
- R4 = 100:k;
- C1 = 250:pF;
- C2 = 100:nF;
- C3 = 47:nF;
- };
-
- twin = environment { /* 69 Twin Reverb AA270 */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 10:k;
- R4 = 100:k;
- C1 = 120:pF;
- C2 = 100:nF;
- C3 = 47:nF;
- };
-
- princeton = environment { /* 64 Princeton AA1164 */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 4.8:k;
- R4 = 100:k;
- C1 = 250:pF;
- C2 = 100:nF;
- C3 = 47:nF;
- };
-
- /* Marshall */
-
- jcm800 = environment { /* 59/81 JCM-800 Lead 100 2203 */
- R1 = 220:k;
- R2 = 1:M;
- R3 = 22:k;
- R4 = 33:k;
- C1 = 470:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
- /* 90 JCM-900 Master 2100: same as JCM-800 */
-
- jcm2000 = environment { /* 81 2000 Lead */
- R1 = 250:k;
- R2 = 1:M;
- R3 = 25:k;
- R4 = 56:k; /* a 10 k fixed + 100 k pot in series actually */
- C1 = 500:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- jtm45 = environment { /* JTM 45 */
- R1 = 250:k;
- R2 = 1:M;
- R3 = 25:k;
- R4 = 33:k;
- C1 = 270:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- /* parameter order is R1 - R4, C1 - C3 */
- mlead = environment { /* 67 Major Lead 200 */
- R1 = 250:k;
- R2 = 1:M;
- R3 = 25:k;
- R4 = 33:k;
- C1 = 500:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- m2199 = environment { /* undated M2199 30W solid state */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 25:k;
- R4 = 56:k;
- C1 = 250:pF;
- C2 = 47:nF;
- C3 = 47:nF;
- };
-
- /* Vox */
- ac30 = environment { /* 59/86 AC-30 */
- /* R3 is fixed (circuit differs anyway) */
- R1 = 1:M;
- R2 = 1:M;
- R3 = 10:k;
- R4 = 100:k;
- C1 = 50:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- ac15 = environment { /* VOX AC-15 */
- R1 = 220:k;
- R2 = 220:k;
- R3 = 220:k;
- R4 = 100:k;
- C1 = 470:pF;
- C2 = 100:nF;
- C3 = 47:nF;
- };
-
- soldano = environment { /* Soldano SLO 100 */
- R1 = 250:k;
- R2 = 1:M;
- R3 = 25:k;
- R4 = 47:k;
- C1 = 470:pF;
- C2 = 20:nF;
- C3 = 20:nF;
- };
-
- sovtek = environment { /* MIG 100 H*/
- R1 = 500:k;
- R2 = 1:M;
- R3 = 10:k;
- R4 = 47:k;
- C1 = 470:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- peavey = environment { /* c20*/
- R1 = 250:k;
- R2 = 250:k;
- R3 = 20:k;
- R4 = 68:k;
- C1 = 270:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- ibanez = environment { /* gx20 */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 10:k;
- R4 = 100:k;
- C1 = 270:pF;
- C2 = 100:nF;
- C3 = 40:nF;
- };
-
- roland = environment { /* Cube 60 */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 10:k;
- R4 = 41:k;
- C1 = 240:pF;
- C2 = 33:nF;
- C3 = 82:nF;
- };
-
- ampeg = environment { /* VL 501 */
- R1 = 250:k;
- R2 = 1:M;
- R3 = 25:k;
- R4 = 32:k;
- C1 = 470:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- ampeg_rev = environment { /* reverbrocket*/
- R1 = 250:k;
- R2 = 250:k;
- R3 = 10:k;
- R4 = 100:k;
- C1 = 100:pF;
- C2 = 100:nF;
- C3 = 47:nF;
- };
-
- bogner = environment { /* Triple Giant Preamp */
- R1 = 250:k;
- R2 = 1:M;
- R3 = 33:k;
- R4 = 51:k;
- C1 = 220:pF;
- C2 = 15:nF;
- C3 = 47:nF;
- };
-
- groove = environment { /* Trio Preamp */
- R1 = 220:k;
- R2 = 1:M;
- R3 = 22:k;
- R4 = 68:k;
- C1 = 470:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- crunch = environment { /* Hughes&Kettner */
- R1 = 220:k;
- R2 = 220:k;
- R3 = 10:k;
- R4 = 100:k;
- C1 = 220:pF;
- C2 = 47:nF;
- C3 = 47:nF;
- };
-
- fender_blues = environment { /* Fender blues junior */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 25:k;
- R4 = 100:k;
- C1 = 250:pF;
- C2 = 22:nF;
- C3 = 22:nF;
- };
-
- fender_default = environment { /* Fender */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 10:k;
- R4 = 100:k;
- C1 = 250:pF;
- C2 = 100:nF;
- C3 = 47:nF;
- };
-
- fender_deville = environment { /* Fender Hot Rod */
- R1 = 250:k;
- R2 = 250:k;
- R3 = 25:k;
- R4 = 130:k;
- C1 = 250:pF;
- C2 = 100:nF;
- C3 = 22:nF;
- };
-
- gibsen = environment { /* gs12 reverbrocket */
- R1 = 1:M;
- R2 = 1:M;
- R3 = 94:k; // 47k fixed
- R4 = 270:k;
- C1 = 25:pF;
- C2 = 60:nF;
- C3 = 20:nF;
- };
-
-};
-
-bassman(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.bassman;};
-mesa(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.mesa;};
-twin(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.twin;};
-princeton(T,M,L)= tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.princeton;};
-jcm800(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.jcm800;};
-jcm2000(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.jcm2000;};
-jtm45(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.jtm45;};
-mlead(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.mlead;};
-m2199(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.m2199;};
-ac30(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.ac30;};
-ac15(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.ac15;};
-soldano(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.soldano;};
-sovtek(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.sovtek;};
-peavey(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.peavey;};
-ibanez(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.ibanez;};
-roland(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.roland;};
-ampeg(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.ampeg;};
-ampeg_rev(T,M,L)= tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.ampeg_rev;};
-bogner(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.bogner;};
-groove(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.groove;};
-crunch(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.crunch;};
-fender_blues(T,M,L)= tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.fender_blues;};
-fender_default(T,M,L)= tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.fender_default;};
-fender_deville(T,M,L)= tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.fender_deville;};
-gibsen(T,M,L) = tonestack(t.C1,t.C2,t.C3,t.R1,t.R2,t.R3,t.R4,T,M,L)
- with {t = ts.gibsen;};
-
diff --git a/Resources/Libs/tubes.lib b/Resources/Libs/tubes.lib
deleted file mode 100644
index 0d550eb..0000000
--- a/Resources/Libs/tubes.lib
+++ /dev/null
@@ -1,5035 +0,0 @@
-/******************************************************************************
- ** Guitar(ix) tube amp emulations
- **
- **
- ** this tubes.library provide the following tube models:
- ** T1_12AX7, T2_12AX7, T3_12AX7, T1_12AT7, T2_12AT7, T3_12AT7,
- ** T1_12AU7, T2_12AU7, T3_12AU7, T1_6V6, T2_6V6, T3_6V6,
- ** T1_6DJ8, T2_6DJ8, T3_6DJ8, T1_6C16, T2_6C16, T3_6C16
- **
- **
- ** USAGE:
- ** _:component("tubes.lib").model:_
- ** where
- ** model is on of the models above.
- **
- ** EXAMPLE 2 STAGE TUBE PREAMP:
- ** process = component("tubes.lib").T1_12AX7 : *(preamp):
- ** lowpass(1,6531.0) : component("tubes.lib").T2_12AX7 : *(preamp):
- ** lowpass(1,6531.0) : component("tubes.lib").T3_12AX7 : *(gain) with {
- ** preamp = vslider("Pregain",-6,-20,20,0.1) : db2linear : smooth(0.999);
- ** gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : db2linear : smooth(0.999);
- ** };
- **
- ******************************************************************************/
-
-/*******************************************************************************
- * 1-dimensional function tables for linear interpolation
-*******************************************************************************/
-
-//-- Rdtable from waveform
-rtable(table, r) = (table, int(r)):rdtable;
-
-// Change sign of input signal x;
-inverse(x) = abs(x) * invsign(x);
-
-// function that takes f value and x sign
-ccopysign(f, x) = abs(f)*sign(x);
-
-//-- Get sign and reversed sign of a signal x
-sign (x) = x<0, 1, -1 : select2;
-invsign (x) = x<0, -1, 1 : select2;
-
-//-- Interpolate value between i and i+1 in table with coefficient f.
-interpolation (table, f, i) = rtable(table, i)*(1-f) + rtable(table,i+1)*f;
-
-//-- Bound Index with table boundaries
-boundIndex(size, index) = index : floor: min(size-1) : max(0);
-
-//-- Bound factor of interpolation :
-//if index<0 return 0 | if index>size-1 return size-1
-boundFactor(size, factor, index) =
- select2(0
-([jos](http://ccrma.stanford.edu/~jos/)), and released under the
-(MIT-style) [STK-4.3](#stk-4.3-license) license.
-
-All MarkDown comments in this section are Copyright 2016-2017 by Romain
-Michon and Julius O. Smith III, and are released under the
-[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees!)
-
-************************************************************************/
-
-//=============================Functions Reference========================================
-//========================================================================================
-
-//-------------------------`(ve.)moog_vcf`---------------------------
-// Moog "Voltage Controlled Filter" (VCF) in "analog" form. Moog VCF
-// implemented using the same logical block diagram as the classic
-// analog circuit. As such, it neglects the one-sample delay associated
-// with the feedback path around the four one-poles.
-// This extra delay alters the response, especially at high frequencies
-// (see reference [1] for details).
-// See `moog_vcf_2b` below for a more accurate implementation.
-//
-// #### Usage
-//
-// ```
-// moog_vcf(res,fr)
-// ```
-// Where:
-//
-// * `fr`: corner-resonance frequency in Hz ( less than SR/6.3 or so )
-// * `res`: Normalized amount of corner-resonance between 0 and 1 (0 is no
-// resonance, 1 is maximum)
-//
-// #### References
-// *
-// *
-//------------------------------------------------------------
-moog_vcf(res,fr) = (+ : seq(i,4,fi.pole(p)) : *(unitygain(p))) ~ *(mk)
-with {
- p = 1.0 - fr * 2.0 * ma.PI / ma.SR; // good approximation for fr << SR
- unitygain(p) = pow(1.0-p,4.0); // one-pole unity-gain scaling
- mk = -4.0*max(0,min(res,0.999999)); // need mk > -4 for stability
-};
-
-//-----------------------`(ve.)moog_vcf_2b[n]`---------------------------
-// Moog "Voltage Controlled Filter" (VCF) as two biquads. Implementation
-// of the ideal Moog VCF transfer function factored into second-order
-// sections. As a result, it is more accurate than `moog_vcf` above, but
-// its coefficient formulas are more complex when one or both parameters
-// are varied. Here, res is the fourth root of that in `moog_vcf`, so, as
-// the sampling rate approaches infinity, `moog_vcf(res,fr)` becomes equivalent
-// to `moog_vcf_2b[n](res^4,fr)` (when res and fr are constant).
-// `moog_vcf_2b` uses two direct-form biquads (`tf2`).
-// `moog_vcf_2bn` uses two protected normalized-ladder biquads (`tf2np`).
-//
-// #### Usage
-//
-// ```
-// moog_vcf_2b(res,fr)
-// moog_vcf_2bn(res,fr)
-// ```
-//
-// Where:
-//
-// * `fr`: corner-resonance frequency in Hz
-// * `res`: Normalized amount of corner-resonance between 0 and 1
-// (0 is min resonance, 1 is maximum)
-//------------------------------------------------------------
-moog_vcf_2b(res,fr) = fi.tf2s(0,0,b0,a11,a01,w1) : fi.tf2s(0,0,b0,a12,a02,w1)
-with {
- s = 1; // minus the open-loop location of all four poles
- frl = max(20,min(10000,fr)); // limit fr to reasonable 20-10k Hz range
- w1 = 2*ma.PI*frl; // frequency-scaling parameter for bilinear xform
- // Equivalent: w1 = 1; s = 2*PI*frl;
- kmax = sqrt(2)*0.99999; // 0.99999 gives stability margin (tf2 is unprotected)
- k = min(kmax,sqrt(2)*res); // fourth root of Moog VCF feedback gain
- b0 = s^2;
- s2k = sqrt(2) * k;
- a11 = s * (2 + s2k);
- a12 = s * (2 - s2k);
- a01 = b0 * (1 + s2k + k^2);
- a02 = b0 * (1 - s2k + k^2);
-};
-
-moog_vcf_2bn(res,fr) = fi.tf2snp(0,0,b0,a11,a01,w1) : fi.tf2snp(0,0,b0,a12,a02,w1)
-with {
- s = 1; // minus the open-loop location of all four poles
- w1 = 2*ma.PI*max(fr,20); // frequency-scaling parameter for bilinear xform
- k = sqrt(2)*0.99999*res; // fourth root of Moog VCF feedback gain
- b0 = s^2;
- s2k = sqrt(2) * k;
- a11 = s * (2 + s2k);
- a12 = s * (2 - s2k);
- a01 = b0 * (1 + s2k + k^2);
- a02 = b0 * (1 - s2k + k^2);
-};
-
-//--------------------------`(ve.)wah4`-------------------------------
-// Wah effect, 4th order.
-// `wah4` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : wah4(fr) : _
-// ```
-//
-// Where:
-//
-// * `fr`: resonance frequency in Hz
-//
-// #### Reference
-//
-//
-//------------------------------------------------------------
-wah4(fr) = 4*moog_vcf((3.2/4),fr:si.smooth(0.999));
-
-//------------------------`(ve.)autowah`-----------------------------
-// Auto-wah effect.
-// `autowah` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : autowah(level) : _;
-// ```
-//
-// Where:
-//
-// * `level`: amount of effect desired (0 to 1).
-//------------------------------------------------------------
-autowah(level,x) = level * crybaby(an.amp_follower(0.1,x),x) + (1.0-level)*x;
-
-//--------------------------`(ve.)crybaby`-----------------------------
-// Digitized CryBaby wah pedal.
-// `crybaby` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : crybaby(wah) : _
-// ```
-//
-// Where:
-//
-// * `wah`: "pedal angle" from 0 to 1
-//
-// #### Reference
-//
-//
-//------------------------------------------------------------
-crybaby(wah) = *(gs) : fi.tf2(1,-1,0,a1s,a2s)
-with {
- Q = pow(2.0,(2.0*(1.0-wah)+1.0)); // Resonance "quality factor"
- fr = 450.0*pow(2.0,2.3*wah); // Resonance tuning
- g = 0.1*pow(4.0,wah); // gain (optional)
-
- // Biquad fit using z = exp(s T) ~ 1 + sT for low frequencies:
- frn = fr/ma.SR; // Normalized pole frequency (cycles per sample)
- R = 1 - ma.PI*frn/Q; // pole radius
- theta = 2*ma.PI*frn; // pole angle
- a1 = 0-2.0*R*cos(theta); // biquad coeff
- a2 = R*R; // biquad coeff
-
- // dezippering of slider-driven signals:
- s = 0.999; // smoothing parameter (one-pole pole location)
- a1s = a1 : si.smooth(s);
- a2s = a2 : si.smooth(s);
- gs = g : si.smooth(s);
-
- //tf2 = component("filters.lib").tf2;
-};
-
-// end jos section
-/************************************************************************
-************************************************************************
-FAUST library file, GRAME section
-
-Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
-Centre National de Creation Musicale.
-----------------------------------------------------------------------
-GRAME LICENSE
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with the GNU C Library; if not, write to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
-larger FAUST program which directly or indirectly imports this library
-file and still distribute the compiled code generated by the FAUST
-compiler, or a modified version of this compiled code, under your own
-copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
-grants you the right to freely choose the license for the resulting
-compiled code. In particular the resulting compiled code has no obligation
-to be LGPL or GPL. For example you are free to choose a commercial or
-closed source license or any other license if you decide so.
-************************************************************************
-************************************************************************/
-
-//----------------------------`(ve.)vocoder`-------------------------
-// A very simple vocoder where the spectrum of the modulation signal
-// is analyzed using a filter bank.
-// `vocoder` is a standard Faust function.
-//
-// #### Usage
-//
-// ```
-// _ : vocoder(nBands,att,rel,BWRatio,source,excitation) : _;
-// ```
-//
-// Where:
-//
-// * `nBands`: Number of vocoder bands
-// * `att`: Attack time in seconds
-// * `rel`: Release time in seconds
-// * `BWRatio`: Coefficient to adjust the bandwidth of each band (0.1 - 2)
-// * `source`: Modulation signal
-// * `excitation`: Excitation/Carrier signal
-//------------------------------------------------------------
-// TODO: author RM
-oneVocoderBand(band,bandsNumb,bwRatio,bandGain,x) = x : fi.resonbp(bandFreq,bandQ,bandGain) with{
- bandFreq = 25*pow(2,(band+1)*(9/bandsNumb));
- BW = (bandFreq - 25*pow(2,(band)*(9/bandsNumb)))*bwRatio;
- bandQ = bandFreq/BW;
-};
-
-vocoder(nBands,att,rel,BWRatio,source,excitation) = source <: par(i,nBands,oneVocoderBand(i,nBands,BWRatio,1) :
- an.amp_follower_ar(att,rel) : _,excitation : oneVocoderBand(i,nBands,BWRatio)) :> _ ;
-
-//########################################################################################
-/************************************************************************
-FAUST library file, further contributions section
-
-All contributions below should indicate both the contributor and terms
-of license. If no such indication is found, "git blame" will say who
-last edited each line, and that person can be emailed to inquire about
-license disposition, if their license choice is not already indicated
-elsewhere among the libraries. It is expected that all software will be
-released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
-************************************************************************/
-
-// end further further contributions section
diff --git a/Resources/Styles/Blue.qss b/Resources/Styles/Blue.qss
new file mode 100644
index 0000000..c175752
--- /dev/null
+++ b/Resources/Styles/Blue.qss
@@ -0,0 +1,177 @@
+QPushButton{
+min-width : 80px;
+border: 2px solid grey;
+border-radius: 6px;
+margin-top: 1ex;
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #811453, stop: 1 #702963);
+color: white;
+}
+
+QPushButton:hover{
+border: 2px solid orange;
+}
+
+QPushButton:pressed{
+background-color: orange;
+border-color: grey;
+}
+
+QGroupBox{
+subcontrol: .QGroupBox;
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #003366, stop: 1 #22427C);
+margin-top: 3ex;
+border-radius: 5px;
+font-size: 10pt;
+font-weight: bold;
+color: white;
+}
+
+QGroupBox::title {
+subcontrol-origin: margin;
+subcontrol-position: top center;
+padding: 0 5px;
+color: white;
+}
+
+QMainWindow, QDialog{
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #003366, stop: 1 #22427C);
+border-radius: 5px;
+margin-top: 3ex;
+font-size:10pt;
+font-weight:bold;
+color: white;
+}
+
+QPlainTextEdit, QTextEdit{
+background-color: transparent;
+border: 2px solid #702963;
+border-radius: 5px;
+top: 3px;
+margin-top: 3ex;
+font-size:12pt;
+font-weight:bold;
+color: white;
+}
+
+QTextBrowser {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #003366, stop: 1 #22427C);
+ color: white;
+}
+
+QTextBrowser:document{
+ text-decoration: underline;
+ color: white;
+ font: Menlo;
+ font-size: 14px
+}
+
+QLabel{
+color : white;
+background: transparent;
+}
+
+QSlider::groove:vertical {
+background: red;
+position: absolute;
+left: 13px; right: 13px;
+}
+
+QSlider::handle:vertical {
+height: 40px;
+width: 30px;
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAAAAA, stop : 0.05 #0A0A0A, stop: 0.3 #101010, stop : 0.90 #AAAAAA, stop: 0.91 #000000);
+margin: 0 -5px;
+border-radius: 5px;
+}
+
+QSlider::add-page:vertical {
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 yellow, stop : 0.5 orange);
+}
+
+QSlider::sub-page:vertical {
+background: grey;
+}
+
+QSlider::groove:horizontal {
+background: red;
+position: absolute;
+top: 14px; bottom: 14px;
+}
+
+QSlider::handle:horizontal {
+width: 40px;
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #6A455D, stop : 0.05 #811453, stop: 0.3 #811453, stop : 0.90 #6A455D, stop: 0.91 #702963);
+margin: -5px 0;
+border-radius: 5px;
+}
+
+QSlider::sub-page:horizontal {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 yellow, stop : 0.5 orange);
+}
+
+QSlider::add-page:horizontal {
+background: grey;
+}
+
+QTabWidget::pane {
+color : white;
+border-top: 2px #702963;
+background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #003366, stop: 1.0 #22427C);
+}
+
+QTabWidget::tab-bar {
+left: 5px;
+}
+
+QTabBar::tab {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #003366, stop: 0.4 #22427C, stop: 0.5 #003366, stop: 1.0 #22427C);
+border: 2px solid #808080;
+color : white;
+border-bottom-color: #702963;
+border-top-left-radius: 4px;
+border-top-right-radius: 4px;
+min-width: 8ex;
+padding: 2px;
+}
+
+QTabBar::tab:selected, QTabBar::tab:hover {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #003366, stop: 0.4 #22427C, stop: 0.5 #003366, stop: 1.0 #22427C);
+color : white;
+}
+
+QTabBar::tab:selected {
+color : white;
+border-color: #702963;
+border-bottom-color: #22427C;
+}
+
+QTabBar::tab:!selected {
+margin-top: 2px;
+}
+
+QListWidget{
+background-color: transparent;
+}
+
+QListWidget::item{
+ color: white;
+}
+
+QStatusBar{
+ background-color: transparent;
+ border: 0px;
+ padding:0px 0px 0px 0px;
+ margin:0px;
+}
+
+QScrollArea > QWidget > QWidget{
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #003366, stop: 0.4 #22427C, stop: 0.5 #003366, stop: 1.0 #22427C);
+}
+
+QScrollArea > QWidget {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #003366, stop: 0.4 #22427C, stop: 0.5 #003366, stop: 1.0 #22427C);
+}
+
+QScrollArea {
+ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #003366, stop: 0.4 #22427C, stop: 0.5 #003366, stop: 1.0 #22427C);
+}
\ No newline at end of file
diff --git a/Resources/Styles/Default.qss b/Resources/Styles/Default.qss
new file mode 100644
index 0000000..58ee6e6
--- /dev/null
+++ b/Resources/Styles/Default.qss
@@ -0,0 +1,117 @@
+QPushButton{
+min-width : 80px;
+border: 2px solid grey;
+border-radius: 6px;
+margin-top: 1ex;
+border-color: #811453;
+background-color: transparent;
+}
+
+QPushButton:hover{
+border: 2px;
+border-radius: 6px;
+border-color: #811453;
+background-color: #6A455D;
+}
+
+QPushButton:pressed{
+background-color: #6A455D;
+border-radius: 6px;
+border-color: #811453;
+}
+
+QGroupBox{
+subcontrol: .QGroupBox;
+margin-top: 3ex;
+font-size: 10pt;
+font-weight: bold;
+color: black;
+}
+
+QGroupBox::title {
+subcontrol-origin: margin;
+subcontrol-position: top center;
+padding: 0 5px;
+color: black;
+}
+
+QMainWindow {
+margin-top: 3ex;
+font-size:10pt;
+font-weight:bold;
+color: black;
+}
+
+QPlainTextEdit, QTextEdit{
+background-color: transparent;
+border: 2px solid gray;
+border-radius: 5px;
+top: 3px;
+margin-top: 3ex;
+font-size:12pt;
+font-weight:bold;
+color: black;
+}
+
+QTextBrowser {
+color: black;
+}
+QTextBrowser:document{
+text-decoration: underline;
+color: black;
+font: Menlo;
+font-size: 14px
+}
+
+QLabel{
+color : black;
+background: transparent;
+}
+
+QSlider::groove:vertical {
+background: red;
+position: absolute;
+left: 13px; right: 13px;
+}
+
+QSlider::handle:vertical {
+height: 40px;
+width: 30px;
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E67E30, stop : 0.05 #AD4F09, stop: 0.3 #E67E30, stop : 0.90 #AD4F09, stop: 0.91 #AD4F09);
+margin: 0 -5px;
+border-radius: 5px;
+}
+
+QSlider::add-page:vertical {
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,
+stop: 0 #6A455D, stop : 0.5 #6A455D);
+}
+
+QSlider::sub-page:vertical {
+background: grey;
+}
+
+QSlider::groove:horizontal {
+background: red;
+position: absolute;
+top: 14px; bottom: 14px;
+}
+
+QSlider::handle:horizontal {
+width: 40px;
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #E67E30, stop : 0.05 #AD4F09, stop: 0.3 #E67E30, stop : 0.90 #AD4F09, stop: 0.91 #AD4F09);
+margin: -5px 0;
+border-radius: 5px;
+}
+
+QSlider::sub-page:horizontal {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6A455D, stop : 0.5 #6A455D);
+}
+
+QSlider::add-page:horizontal {
+background: grey;
+}
+
+QListWidget{
+background-color: transparent;
+}
\ No newline at end of file
diff --git a/Resources/Styles/Grey.qss b/Resources/Styles/Grey.qss
new file mode 100644
index 0000000..baa10cd
--- /dev/null
+++ b/Resources/Styles/Grey.qss
@@ -0,0 +1,174 @@
+QPushButton {
+background-color: qlineargradient(x1: 0, y1: 0, x2: 0.8, y2: 0.8,
+stop: 0 #B0B0B0, stop: 1 #404040);
+min-width : 80px;
+border: 2px solid grey;
+border-radius: 6px;
+margin-top: 1ex;
+color:white
+}
+
+QPushButton:hover {
+border: 2px solid orange;
+}
+
+QPushButton:pressed {
+background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #404040, stop: 1 #B0B0B0);
+}
+
+QGroupBox {
+subcontrol: .QGroupBox
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #A0A0A0, stop: 1 #202020);
+margin-top: 3ex;
+border-radius: 5px;
+font-size:10pt;
+font-weight:bold;
+color: white;
+}
+
+QGroupBox::title {
+subcontrol-origin: margin;
+subcontrol-position: top center;
+padding: 0 5px;
+color : white;
+}
+
+QMainWindow, QDialog {
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #A0A0A0, stop: 1 #202020);
+border-radius: 5px;
+margin-top: 3ex;
+font-size:10pt;
+font-weight:bold;
+color: white;
+}
+
+QPlainTextEdit, QTextEdit{
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #A0A0A0, stop: 1 #202020);
+border-color: yellow;
+border-radius: 5px;
+top: 3px;
+margin-top: 3ex;
+font-size:12pt;
+font-weight:bold;
+color: white;
+}
+
+QTextBrowser {
+background-color: qlineargradient(x1: 0, y1: 0, x2: 0.8, y2: 0.8, stop: 0 #A0A0A0, stop: 1 #202020);
+color: white;
+}
+
+QTextDocument{
+text-decoration: underline;
+color: white;
+font: Menlo;
+font-size: 14px
+}
+
+QLabel{
+ color : white;
+ background: transparent;
+}
+
+QSlider::groove:vertical {
+background: red;
+position: absolute;
+left: 13px; right: 13px;
+}
+
+QSlider::handle:vertical {
+height: 40px;
+width: 30px;
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAAAAA, stop : 0.05 #0A0A0A, stop: 0.3 #101010, stop : 0.90 #AAAAAA, stop: 0.91 #000000);
+margin: 0 -5px;
+border-radius: 5px;
+}
+
+QSlider::add-page:vertical {
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 yellow, stop : 0.5 orange);
+}
+
+QSlider::sub-page:vertical {
+background: grey;
+}
+
+QSlider::groove:horizontal {
+background: red;
+position: absolute;
+top: 14px; bottom: 14px;
+}
+
+QSlider::handle:horizontal {
+width: 40px;
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #AAAAAA, stop : 0.05 #0A0A0A, stop: 0.3 #101010, stop : 0.90 #AAAAAA, stop: 0.91 #000000);
+margin: -5px 0;
+border-radius: 5px;
+}
+
+QSlider::sub-page:horizontal {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 yellow, stop : 0.5 orange);
+}
+
+QSlider::add-page:horizontal {
+background: grey;
+}
+
+QTabWidget::pane {
+border-top: 2px solid orange;
+background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A0A0A0, stop: 1 #202020);
+}
+
+QTabWidget::tab-bar {
+left: 5px;
+}
+
+QTabBar::tab {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #909090, stop: 0.4 #888888, stop: 0.5 #808080, stop: 1.0 #909090);
+border: 2px solid #808080;
+border-bottom-color: orange;
+border-top-left-radius: 4px;
+border-top-right-radius: 4px;
+min-width: 8ex;
+padding: 2px;
+}
+
+QTabBar::tab:selected, QTabBar::tab:hover {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D0D0D0, stop: 0.4 #A0A0A0, stop: 0.5 #808080, stop: 1.0 #A0A0A0);
+}
+
+QTabBar::tab:selected {
+border-color: orange;
+border-bottom-color: #A0A0A0;
+}
+
+QTabBar::tab:!selected {
+margin-top: 2px;
+}
+
+QListWidget{
+background-color: transparent;
+}
+
+
+QListWidget::item{
+ color: white;
+}
+
+QStatusBar{
+ background-color: transparent;
+ border: 0px;
+ padding:0px 0px 0px 0px;
+ margin:0px;
+}
+
+QScrollArea > QWidget > QWidget{
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0.8, y2: 0.8, stop: 0 #A0A0A0, stop: 1 #202020);
+}
+
+QScrollArea > QWidget {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0.8, y2: 0.8, stop: 0 #A0A0A0, stop: 1 #202020);
+}
+
+QScrollArea {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0.8, y2: 0.8, stop: 0 #A0A0A0, stop: 1 #202020);
+}
\ No newline at end of file
diff --git a/Resources/Styles/Salmon.qss b/Resources/Styles/Salmon.qss
new file mode 100644
index 0000000..2abcfa2
--- /dev/null
+++ b/Resources/Styles/Salmon.qss
@@ -0,0 +1,171 @@
+QPushButton{
+background-color:#FF5E4D;
+min-width : 80px;
+border: 2px solid grey;
+border-radius: 6px;
+margin-top: 1ex;
+}
+
+QPushButton:hover{
+border: 2px ;
+}
+
+QPushButton:pressed{
+background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FFE4C4, stop: 1 #FEC3AC);
+}
+
+QGroupBox{
+subcontrol: .QGroupBox
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFE4C4, stop: 1 #FEC3AC);
+border-radius: 5px;
+margin-top: 3ex;
+font-size:10pt;
+font-weight:bold;
+color: dark grey;
+color: white;
+}
+
+QGroupBox::title {
+subcontrol-origin: margin;
+subcontrol-position: top center;
+padding: 0 5px;
+color: black;
+}
+
+QMainWindow, QDialog {
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFE4C4,stop: 1 #FEC3AC);
+border-radius: 5px;
+margin-top: 3ex;
+font-size:10pt;
+font-weight:bold;
+color: dark grey;
+color: white;
+}
+
+QPlainTextEdit, QTextEdit {
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFE4C4,stop: 1 #FEC3AC);
+border: 2px solid gray;
+border-radius: 5px;
+top: 3px;
+margin-top: 3ex;
+font-size:12pt;
+font-weight:bold;
+color: black;
+}
+
+QTextBrowser {
+background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFE4C4,stop: 1 #FEC3AC);
+color: black;
+}
+
+QTextBrowser:document{
+text-decoration: underline;
+color: white;
+font: Menlo;
+font-size: 14px
+}
+
+QLabel{
+ color : black;
+ background: transparent;
+}
+
+QSlider::groove:vertical {
+background: red;
+position: absolute;
+left: 13px; right: 13px;
+}
+
+QSlider::handle:vertical {
+height: 40px;
+width: 30px;
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #4E3D28, stop : 0.05 #856D4D, stop: 0.1 #4E3D28, stop : 0.15 #856D4D, stop: 0.2 #4E3D28, stop : 0.25 #856D4D, stop: 0.3 #4E3D28, stop : 0.35 #856D4D, stop: 0.4 #4E3D28, stop : 0.45 #856D4D, stop: 0.5 #4E3D28, stop : 0.55 #856D4D, stop: 0.6 #4E3D28, stop : 0.65 #856D4D, stop: 0.7 #4E3D28, stop : 0.75 #856D4D, stop: 0.8 #4E3D28, stop : 0.85 #856D4D, stop: 0.95 #4E3D28);
+margin: 0 -5px;
+border-radius: 5px;
+}
+
+QSlider::add-page:vertical {
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF5E4D, stop : 0.5 #FF5E4D);
+}
+
+QSlider::sub-page:vertical {
+background: #CECECE;
+}
+
+QSlider::groove:horizontal {
+background: red;
+position: absolute;
+top: 14px; bottom: 14px;
+}
+
+QSlider::handle:horizontal {
+width: 40px;
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #4E3D28, stop : 0.05 #856D4D, stop: 0.1 #4E3D28, stop : 0.15 #856D4D, stop: 0.2 #4E3D28, stop : 0.25 #856D4D, stop: 0.3 #4E3D28, stop : 0.35 #856D4D, stop: 0.4 #4E3D28, stop : 0.45 #856D4D, stop: 0.5 #4E3D28, stop : 0.55 #856D4D, stop: 0.6 #4E3D28, stop : 0.65 #856D4D, stop: 0.7 #4E3D28, stop : 0.75 #856D4D, stop: 0.8 #4E3D28, stop : 0.85 #856D4D, stop: 0.95 #4E3D28);
+margin: -5px 0;
+border-radius: 5px;
+}
+
+QSlider::sub-page:horizontal {
+background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF5E4D stop : 0.5 #FF5E4D);
+}
+
+QSlider::add-page:horizontal {
+background: #CECECE;
+}
+
+QTabWidget::pane {
+color : black;
+border-top: 2px #FF5E4D;
+background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FFE4C4,stop: 1 #FEC3AC);
+}
+
+QTabWidget::tab-bar {
+left: 5px;
+}
+
+QTabBar::tab {
+background: #FFE4C4;
+border: 2px solid #FF5E4D;
+color : black;
+border-bottom-color: #FF5E4D;
+border-top-left-radius: 4px;
+border-top-right-radius: 4px;
+min-width: 8ex;
+padding: 2px;
+}
+
+QTabBar::tab:selected, QTabBar::tab:hover {
+background: #FEC3AC;
+color : white;
+}
+
+QTabBar::tab:!selected {
+margin-top: 2px;
+}
+
+QListWidget{
+background-color: transparent;
+}
+
+QListWidget::item{
+ color: color;
+}
+
+QStatusBar{
+ background-color: transparent;
+ border: 0px;
+ padding:0px 0px 0px 0px;
+ margin:0px;
+}
+
+QScrollArea > QWidget > QWidget{
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFE4C4,stop: 1 #FEC3AC);
+}
+
+QScrollArea > QWidget {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFE4C4,stop: 1 #FEC3AC);
+}
+
+QScrollArea {
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFE4C4,stop: 1 #FEC3AC);
+}
\ No newline at end of file
diff --git a/Resources/application.qrc b/Resources/application.qrc
index 6b6980a..c2de9c3 100755
--- a/Resources/application.qrc
+++ b/Resources/application.qrc
@@ -76,6 +76,7 @@
Examples/stereoEcho.dspExamples/switcher.dspExamples/tapiir.dsp
+ Examples/TestLibs.dspExamples/tibetanBowl.dspExamples/trumpet.dspExamples/turenas.dsp
@@ -116,14 +117,12 @@
Libs/tubes.libLibs/vaeffects.lib
- Libs/llvm_math.ll
- Libs/TestLibs.dsp
+ LLVM/llvm_math.ll
+
Html/ServerAvailableInterfacesHead.htmlHtml/ServerAvailableInterfacesTail.htmlHtml/ServerHead.htmlHtml/ServerTail.html
- buildVersion.txt
- distVersion.txt../Documentation/UserManual.pdf../Documentation/faust-quick-reference.pdf
diff --git a/Resources/distVersion.txt b/Resources/distVersion.txt
deleted file mode 100644
index e72716a..0000000
--- a/Resources/distVersion.txt
+++ /dev/null
@@ -1 +0,0 @@
-2.46
diff --git a/Resources/styles.qrc b/Resources/styles.qrc
new file mode 100644
index 0000000..b49eda0
--- /dev/null
+++ b/Resources/styles.qrc
@@ -0,0 +1,8 @@
+
+
+Styles/Default.qss
+Styles/Blue.qss
+Styles/Grey.qss
+Styles/Salmon.qss
+
+
diff --git a/Resources/styles.qrc.in b/Resources/styles.qrc.in
deleted file mode 100644
index cb119a6..0000000
--- a/Resources/styles.qrc.in
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-@FAUSTDIR@/include/faust/gui/Styles/Default.qss
-@FAUSTDIR@/include/faust/gui/Styles/Blue.qss
-@FAUSTDIR@/include/faust/gui/Styles/Grey.qss
-@FAUSTDIR@/include/faust/gui/Styles/Salmon.qss
-
-
diff --git a/Resources/windows.qrc b/Resources/windows.qrc
index 7e4d5ae..b49eda0 100755
--- a/Resources/windows.qrc
+++ b/Resources/windows.qrc
@@ -1,8 +1,8 @@
-/Users/Sarah/faudiostream-code/architecture/faust/gui/Styles/Default.qss
-/Users/Sarah/faudiostream-code/architecture/faust/gui/Styles/Blue.qss
-/Users/Sarah/faudiostream-code/architecture/faust/gui/Styles/Grey.qss
-/Users/Sarah/faudiostream-code/architecture/faust/gui/Styles/Salmon.qss
+Styles/Default.qss
+Styles/Blue.qss
+Styles/Grey.qss
+Styles/Salmon.qss
diff --git a/changelog.txt b/changelog.txt
new file mode 100644
index 0000000..90fe8b3
--- /dev/null
+++ b/changelog.txt
@@ -0,0 +1,14 @@
+====================================================
+ FaustLive - Change log
+----------------------------------------------------
+GRAME - Centre national de creation musicale
+http://www.grame.fr
+====================================================
+Copyright GRAME (c) 2009-2019
+
+----------------------------------------------------
+Version 2.5.0
+
+ - improves session restoration
+ - integrates faust compiler 2.14.4
+ - based on llvm 7.0.0
diff --git a/package/CMakeLists.txt b/package/CMakeLists.txt
new file mode 100644
index 0000000..ba8ed1a
--- /dev/null
+++ b/package/CMakeLists.txt
@@ -0,0 +1,88 @@
+cmake_minimum_required(VERSION 3.4.0)
+project (faustlive)
+
+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} )
+ string( REGEX REPLACE "([0-9]*)\\.([0-9]*)\\.([0-9]*)" "\\3" VERSION_PATCH ${version} )
+endmacro()
+
+get_filename_component(ROOT ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
+set (FLDIR ${ROOT}/Build/FaustLive)
+set (FLDOC ${ROOT}/Documentation)
+
+#######################################
+# versions management
+file (READ ${ROOT}/version.txt VERSION)
+get_major_minor_patch( ${VERSION} )
+
+message (STATUS "Configuring version ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+
+
+####################################
+# application files
+file (GLOB APP ${FLDIR}/*)
+
+
+####################################
+# install section
+####################################
+set (CMAKE_INSTALL_PREFIX .)
+if (WIN32)
+ set (DEST .)
+else()
+ set (DEST FaustLive-${VERSION})
+endif()
+set (CPACKDEST FaustLive-${VERSION})
+
+####################################
+# install headers
+if(APPLE)
+install (
+ DIRECTORY ${FLDIR}/FaustLive.app DESTINATION ${DEST}
+ FILE_PERMISSIONS USE_SOURCE_PERMISSIONS
+ DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+)
+elseif (WIN32)
+install (
+ DIRECTORY ${FLDIR} DESTINATION ${DEST}
+ FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+ DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ PATTERN ".DS_Store" EXCLUDE
+)
+endif()
+
+install (
+ FILES ${FLDOC}/faust-quick-reference.pdf ${FLDOC}/UserManual.pdf DESTINATION ${DEST}/Documentation
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+)
+install (
+ FILES README.html DESTINATION ${DEST}
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+)
+
+
+####################################
+# cpack section
+####################################
+set (CPACK_PACKAGE_NAME "FaustLive")
+set (CPACK_PACKAGE_VENDOR "GRAME")
+set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "FAUSTLive - an environment for the design of Faust DSP.")
+set (CPACK_PACKAGE_VERSION ${VERSION})
+set (CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
+set (CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+set (CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
+
+set (CPACK_MONOLITHIC_INSTALL true)
+set (CPACK_RESOURCE_FILE_LICENSE ${ROOT}/GPL.txt)
+set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACKDEST})
+
+####################################
+# NSIS specific section
+set (CPACK_NSIS_INSTALL_ROOT "C:\\\\Program Files")
+set (CPACK_NSIS_MODIFY_PATH on)
+set (CPACK_NSIS_MUI_ICON "${ROOT}/Resources/Images/FaustLiveIcon.ico")
+
+include (CPack)
diff --git a/package/Makefile b/package/Makefile
new file mode 100644
index 0000000..e6bd44d
--- /dev/null
+++ b/package/Makefile
@@ -0,0 +1,39 @@
+
+VERSION := $(shell cat ../version.txt)
+FLDIR := ../Build/FaustLive
+NAME := FaustLive-$(VERSION)
+CHGELOG := ../changelog.txt
+
+help:
+ @echo "-- FaustLive packaging --"
+ @echo "Available targets are:"
+ @echo " macos"
+ @echo " windows"
+
+macos: FLIBS := $(otool -L build/$(NAME)/FaustLive.app/Contents/MacOS/FaustLive | grep lib | grep -i faust | sed -e 's/dylib..*/dylib/' | sed -e 's/.rpath.//')
+macos: build README.html
+ macdeployqt $(FLDIR)/FaustLive.app
+ cd build && cmake ..
+ cd build && make install
+ hdiutil create $(NAME)-osx.dmg -fs HFS+ -srcfolder build/$(NAME) -format UDBZ -ov
+
+windows: README.html
+ @echo Run the makepgk.bat script
+
+README.html: N := $(shell wc -l $(CHGELOG) | sed -e 's/ *\([0-9][0-9]*\).*/\1/')
+README.html: N := $(shell expr $(N) - 7)
+README.html: ../README.md
+ @echo "" > README.html
+ cat ../README.md >> README.html
+ @echo "
" >> README.html
+ @echo "###Change log" >> README.html
+ tail -n $(N) $(CHGELOG) >> README.html
+ @echo "" >> README.html
+ @echo "" >> README.html
+ @echo "" >> README.html
+
+build:
+ mkdir build
+
+clean:
+ rm -rf build FaustLive-$(VERSION).dmg
diff --git a/package/README.html b/package/README.html
new file mode 100644
index 0000000..42086ec
--- /dev/null
+++ b/package/README.html
@@ -0,0 +1,39 @@
+
+
+
+FaustLive
+============================
+## The swiss knife for [Faust](https://faust.grame.fr) development.
+--------------
+
+FaustLive is an advanced self-contained prototyping environment for the Faust programming language with an ultra-short edit-compile-run cycle. Thanks to its fully embedded compilation chain, FaustLive is simple to install and doesn't require any external compiler, development toolchain or SDK to run.
+
+FaustLive is the ideal tool for fast prototyping. Faust programs can be compiled and run on the fly by simple drag and drop. They can even be edited and recompiled while running, without sound interruption.
+It supports also native applications generation using the [Faust online compiler](https://faust.grame.fr/tools/onlinecompiler/).
+
+FaustLive is based on the [Faust](https://faust.grame.fr) library and on [LLVM](http://llvm.org).
+
+
+### Limitations and known bugs
+
+ - crashes on Windows when compiling a dsp with input signals, on a machine without input audio device
+ - may crash on startup due to incorrect cache. In this case, find the `FaustLive-CurrentSession-2.0` folder in your home folder, remove it and restart. On Unix like stations (Linux, MacOS), this folder is hidden and located at `$HOME/.FaustLive-CurrentSession-2.0`
+
+
+
+--------------
+#### [Grame](http://www.grame.fr) - Centre National de Creation Musicale
+
+###Change log
+
+----------------------------------------------------
+Version 2.4.6
+
+ - improves session restoration
+ - integrates faust compiler 2.13.11 based on llvm 7.0.0
+
+
+
diff --git a/package/makepkg.bat b/package/makepkg.bat
new file mode 100644
index 0000000..74a877f
--- /dev/null
+++ b/package/makepkg.bat
@@ -0,0 +1,7 @@
+
+
+mkdir build
+cd build
+cmake .. -G "Visual Studio 14 2015 Win64"
+cpack -g NSIS64
+move FaustLive-*.exe ..
diff --git a/src/Audio/AudioFactory.h b/src/Audio/AudioFactory.h
index d4bb190..d551572 100644
--- a/src/Audio/AudioFactory.h
+++ b/src/Audio/AudioFactory.h
@@ -12,11 +12,12 @@
#ifndef _AudioFactory_h
#define _AudioFactory_h
-#include
-#if QT_VERSION >= 0x050000
-#include
-#endif
+//#include
+//#if QT_VERSION >= 0x050000
+//#include
+//#endif
+class QGroupBox;
class AudioSettings;
class AudioManager;
diff --git a/src/Audio/AudioFader_Implementation.h b/src/Audio/AudioFader_Implementation.h
index b2327eb..64e9861 100644
--- a/src/Audio/AudioFader_Implementation.h
+++ b/src/Audio/AudioFader_Implementation.h
@@ -17,7 +17,7 @@
//#define kFadeOutCoefficient 1.000186
#define kNumberOfCrossFadeProcess 60
-#define kFadeCoefficient 0.00003255
+#define kFadeCoefficient 0.00003255f
//#define kFadeOutCoefficient 0.000386
class AudioFader_Implementation
diff --git a/src/Audio/AudioManager.h b/src/Audio/AudioManager.h
index 70fcba8..cf6dff7 100644
--- a/src/Audio/AudioManager.h
+++ b/src/Audio/AudioManager.h
@@ -3,29 +3,33 @@
//
//
// Created by Sarah Denoux on 15/07/13.
-// Copyright (c) 2013 __MyCompanyName__. All rights reserved.
+// Copyright (c) 2013 GRAME. All rights reserved.
//
-// AudioManager is an ameliorated audio. It controls one or two specific audio(s) to implement a crossfade audio between 2 dsp.
+// AudioManager controls one or two specific audio(s) to implement a crossfade audio between 2 dsp.
#ifndef _AudioManager_h
#define _AudioManager_h
-#include "AudioFactory.h"
-#include "faust/audio/audio.h"
-
#include
#include
-using namespace std;
+#if defined(_WIN32) && !defined(GCC)
+# pragma warning (disable: 4100)
+#else
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
-class AudioSettings;
+#include "AudioFactory.h"
+#include "faust/audio/audio.h"
-class AudioManager : public QObject, public audio {
+using namespace std;
- private:
+class AudioSettings;
- Q_OBJECT
+class AudioManager : public QObject, public audio
+{
+ Q_OBJECT
public:
diff --git a/src/Audio/CA/CA_audioFader.h b/src/Audio/CA/CA_audioFader.h
index 95437f0..7eb3e12 100644
--- a/src/Audio/CA/CA_audioFader.h
+++ b/src/Audio/CA/CA_audioFader.h
@@ -19,7 +19,7 @@ class crossfade_TCoreAudioRenderer: public TCoreAudioRenderer, public AudioFader
public:
- crossfade_TCoreAudioRenderer()
+ crossfade_TCoreAudioRenderer(audio* audio) : TCoreAudioRenderer(audio)
{
reset_Values();
}
@@ -62,13 +62,13 @@ class CA_audioFader : public audio, public AudioFader_Interface
public:
- CA_audioFader(int srate, int fpb)
+ CA_audioFader(int srate, int fpb) : fCrossFadeDevice(this)
{
fSampleRate = srate;
fBufferSize = fpb;
}
- CA_audioFader(int fpb)
+ CA_audioFader(int fpb) : fCrossFadeDevice(this)
{
fSampleRate = -1;
fBufferSize = fpb;
diff --git a/src/Audio/CA/CA_audioManager.cpp b/src/Audio/CA/CA_audioManager.cpp
index ac1f88b..5d4aee6 100644
--- a/src/Audio/CA/CA_audioManager.cpp
+++ b/src/Audio/CA/CA_audioManager.cpp
@@ -3,11 +3,21 @@
//
//
// Created by Sarah Denoux on 15/07/13.
-// Copyright (c) 2013 __MyCompanyName__. All rights reserved.
+// Copyright (c) 2013 GRAME. All rights reserved.
//
// CA_audioManager controls 2 CA_audioFader. It can switch from one to another with a crossfade or it can act like a simple coreaudio-dsp
+#include
+
+#if defined(_WIN32) && !defined(GCC)
+# pragma warning (disable: 4100)
+#else
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+# pragma GCC diagnostic ignored "-Wunused-variable"
+# pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
#include "CA_audioFader.h"
#include "CA_audioManager.h"
#include "FLSettings.h"
diff --git a/src/Audio/FJUI.h b/src/Audio/FJUI.h
index b975c81..0d9f651 100755
--- a/src/Audio/FJUI.h
+++ b/src/Audio/FJUI.h
@@ -47,7 +47,7 @@ struct FJUI
std::list > Connections;
while (f.good()) {
-// f>>cote;
+// f>>cote;
cote = f.get();
if (f.good()) {
@@ -56,7 +56,7 @@ struct FJUI
gORn++;
} else if (gORn == 1) {
g += cote;
- }else if (gORn == 3) {
+ } else if (gORn == 3) {
n += cote;
}
@@ -87,7 +87,6 @@ struct FJUI
std::map::iterator it;
for (it = changeTable.begin(); it != changeTable.end() ; it++) {
-
size_t pos = port1.find(it->first);
if (pos != std::string::npos) {
char nextCharacter = port1[pos+it->first.length()];
diff --git a/src/Audio/JA/JA_audioManager.cpp b/src/Audio/JA/JA_audioManager.cpp
index ec12b97..ac5e988 100644
--- a/src/Audio/JA/JA_audioManager.cpp
+++ b/src/Audio/JA/JA_audioManager.cpp
@@ -23,7 +23,7 @@ void JA_audioManager::shutdown_message(const char * msg, void* arg)
JA_audioManager::JA_audioManager(shutdown_callback cb, void* arg): AudioManager(cb, arg)
{
fCurrentAudio = new JA_audioFader;
- fCurrentAudio->shutdown(cb, arg);
+ fCurrentAudio->setShutdownCb(cb, arg);
}
JA_audioManager::~JA_audioManager()
diff --git a/src/Audio/NJ_Slave/NJs_audioFader.cpp b/src/Audio/NJ_Slave/NJs_audioFader.cpp
index d931ad5..3da4d40 100644
--- a/src/Audio/NJ_Slave/NJs_audioFader.cpp
+++ b/src/Audio/NJ_Slave/NJs_audioFader.cpp
@@ -11,7 +11,7 @@
#include "NJs_audioFader.h"
NJs_audioFader::NJs_audioFader(int celt, const std::string master_ip, int master_port, int mtu, int latency, QObject* parent)
-: QObject(parent), netjackaudio(celt, master_ip, master_port, mtu, latency)
+: QObject(parent), netjackaudio(celt, master_ip, master_port, mtu, latency, 1, 1)
{
reset_Values();
fNumberRestartAttempts = 0;
diff --git a/src/Audio/PA/PA_audioFader.cpp b/src/Audio/PA/PA_audioFader.cpp
index aa11522..3ed831c 100644
--- a/src/Audio/PA/PA_audioFader.cpp
+++ b/src/Audio/PA/PA_audioFader.cpp
@@ -8,6 +8,10 @@
// This class adds new features to jackaudio so that the dsp of the audioClient can be dynamically changed. MoreOver, the two dsp will be switched with a crossfade between them.
+#ifdef WIN32
+#pragma warning (disable: 4100)
+#endif
+
#include "PA_audioFader.h"
PA_audioFader::PA_audioFader(long srate, long bsize) : portaudio(srate, bsize) {}
@@ -38,7 +42,3 @@ bool PA_audioFader::get_FadeOut()
{
return get_doWeFadeOut();
}
-
-
-
-
diff --git a/src/Audio/PA/PA_audioSettings.h b/src/Audio/PA/PA_audioSettings.h
index 24ac06f..4247b7b 100644
--- a/src/Audio/PA/PA_audioSettings.h
+++ b/src/Audio/PA/PA_audioSettings.h
@@ -23,7 +23,7 @@
using namespace std;
-class PA_audioSettings : public AudioSettings{
+class PA_audioSettings : public AudioSettings {
private:
diff --git a/src/MainStructure/FLApp.cpp b/src/MainStructure/FLApp.cpp
index a11fe79..9605dfa 100755
--- a/src/MainStructure/FLApp.cpp
+++ b/src/MainStructure/FLApp.cpp
@@ -5,11 +5,20 @@
// Copyright (c) 2013 __MyCompanyName__. All rights reserved.
//
+#if defined(_WIN32) && !defined(GCC)
+# pragma warning (disable: 4100 4005)
+# define WIN32_LEAN_AND_MEAN // this is intended to solve the winsock API redefinitions
+#else
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+# pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
+#include
+
#include "FLServerHttp.h"
#include "FLApp.h"
#ifdef _WIN32
-#include
#include
#endif
@@ -31,11 +40,10 @@
#include "FLSettings.h"
#include "FLWinSettings.h"
#include "FLPreferenceWindow.h"
-
#include "FJUI.h"
-//----------------------CONSTRUCTOR/DESTRUCTOR---------------------------
+//----------------------CONSTRUCTOR/DESTRUCTOR---------------------------
FLApp::FLApp(int& argc, char** argv) : QApplication(argc, argv){
//Create Current Session Folder
@@ -162,8 +170,8 @@ FLApp::~FLApp(){
#endif
}
-void FLApp::create_Session_Hierarchy(){
-
+void FLApp::create_Session_Hierarchy()
+{
QString separationChar;
// Initialization of current Session Path. NOTE: This path must not
@@ -173,17 +181,15 @@ void FLApp::create_Session_Hierarchy(){
environment variable to specify an alternative directory name under
which the Faust session directory will be created. */
const char *sessiondir = getenv("FAUSTLIVE_SESSIONDIR");
- if (sessiondir) {
- fSessionFolder = sessiondir;
- if(!QFileInfo(fSessionFolder).exists()){
- QDir direct(fSessionFolder);
- direct.mkdir(fSessionFolder);
- }
+ if (sessiondir) {
+ fSessionFolder = sessiondir;
+ if (!QFileInfo(fSessionFolder).exists()) {
+ QDir direct(fSessionFolder);
+ direct.mkdir(fSessionFolder);
+ }
} else {
- char path[512];
- if(!SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path))
- fSessionFolder = path;
- }
+ fSessionFolder = QDir::homePath();
+ }
fSessionFolder += "\\FaustLive-CurrentSession-";
separationChar = "\\";
#else
@@ -193,7 +199,7 @@ void FLApp::create_Session_Hierarchy(){
#endif
fSessionFolder += APP_VERSION;
- if(!QFileInfo(fSessionFolder).exists()){
+ if (!QFileInfo(fSessionFolder).exists()) {
QDir direct(fSessionFolder);
direct.mkdir(fSessionFolder);
}
@@ -201,26 +207,23 @@ void FLApp::create_Session_Hierarchy(){
/* ---- Resources that are contained in the QT binary (examples, documentation, libs, html files, etc)
need to be copied in the current session to really be manipulated */
- // Copy QT resources that where loaded at compilation with application.qrc
+ // Copy QT resources that where loaded at compilation with application.qrc
fExamplesFolder = fSessionFolder + separationChar + "Examples";
- if(!QFileInfo(fExamplesFolder).exists()){
+ if (!QFileInfo(fExamplesFolder).exists()) {
QDir direct(fExamplesFolder);
direct.mkdir(fExamplesFolder);
}
QDir exDir(":/");
- if(exDir.cd("Examples")){
+ if (exDir.cd("Examples")) {
QFileInfoList children = exDir.entryInfoList(QDir::Files);
-
QFileInfoList::iterator it;
- for(it = children.begin(); it != children.end(); it++){
-
- QString pathInSession = fExamplesFolder + separationChar + it->baseName() + "." + it->completeSuffix();
-
- if(!QFileInfo(pathInSession).exists()){
+ for (it = children.begin(); it != children.end(); it++) {
+ QString pathInSession = fExamplesFolder + separationChar + it->baseName() + "." + it->completeSuffix();
+ if (!QFileInfo(pathInSession).exists()) {
QFile file(it->absoluteFilePath());
file.copy(pathInSession);
@@ -229,29 +232,26 @@ void FLApp::create_Session_Hierarchy(){
newFile.setPermissions(QFile::ReadOwner);
}
}
-
}
fLibsFolder = fSessionFolder + separationChar + "Libs";
- if(!QFileInfo(fLibsFolder).exists()){
+ if (!QFileInfo(fLibsFolder).exists()){
QDir direct(fLibsFolder);
direct.mkdir(fLibsFolder);
}
QDir libsDir(":/");
- if(libsDir.cd("Libs")){
+ if (libsDir.cd("Libs")) {
QFileInfoList children = libsDir.entryInfoList(QDir::Files);
-
QFileInfoList::iterator it;
for(it = children.begin(); it != children.end(); it++){
QString pathInSession = fLibsFolder + separationChar + it->baseName() + "." + it->completeSuffix();
- if(!QFileInfo(pathInSession).exists()){
-
+ if (!QFileInfo(pathInSession).exists()) {
QFile file(it->absoluteFilePath());
file.copy(pathInSession);
}
@@ -266,17 +266,16 @@ void FLApp::create_Session_Hierarchy(){
QDir htmlDir(":/");
- if(htmlDir.cd("Html")){
+ if (htmlDir.cd("Html")) {
QFileInfoList children = htmlDir.entryInfoList(QDir::Files);
QFileInfoList::iterator it;
- for(it = children.begin(); it != children.end(); it++){
+ for (it = children.begin(); it != children.end(); it++) {
QString pathInSession = fHtmlFolder + separationChar + it->baseName() + "." + it->completeSuffix();
- if(!QFileInfo(pathInSession).exists()){
-
+ if (!QFileInfo(pathInSession).exists()) {
QFile file(it->absoluteFilePath());
file.copy(pathInSession);
}
@@ -291,17 +290,14 @@ void FLApp::create_Session_Hierarchy(){
QDir docDir(":/");
- if(docDir.cd("Documentation")){
+ if (docDir.cd("Documentation")) {
QFileInfoList children = docDir.entryInfoList(QDir::Files);
QFileInfoList::iterator it;
- for(it = children.begin(); it != children.end(); it++){
-
- QString pathInSession = fDocFolder + separationChar + it->baseName() + "." + it->completeSuffix();
-
- if(!QFileInfo(pathInSession).exists()){
-
+ for (it = children.begin(); it != children.end(); it++) {
+ QString pathInSession = fDocFolder + separationChar + it->baseName() + "." + it->completeSuffix();
+ if (!QFileInfo(pathInSession).exists()) {
QFile file(it->absoluteFilePath());
file.copy(pathInSession);
}
@@ -323,18 +319,17 @@ void FLApp::create_Session_Hierarchy(){
windowsDir.mkdir(pathWindows);
QString sched(":/usr/local/lib/faust/scheduler.ll");
- if(QFileInfo(sched).exists()){
+ if (QFileInfo(sched).exists()) {
QString newScheduler = fLibsFolder + "/scheduler.ll";
-
QFile f(sched);
f.copy(newScheduler);
}
}
//-------- Build FaustLive Menu
-QMenu* FLApp::create_FileMenu(){
-
- QMenu* fileMenu = new QMenu(tr("File"), 0);
+QMenu* FLApp::create_FileMenu()
+{
+ QMenu* fileMenu = new QMenu(tr("File"), 0);
QAction* newAction = new QAction(tr("&New Default Window"), NULL);
newAction->setShortcut(tr("Ctrl+N"));
@@ -347,14 +342,14 @@ QMenu* FLApp::create_FileMenu(){
connect(openAction, SIGNAL(triggered()), this, SLOT(open_New_Window()));
QAction* openRemoteAction = new QAction(tr("&Open remote DSP..."),NULL);
-// openAction->setShortcut(tr("Ctrl+O"));
+ // openAction->setShortcut(tr("Ctrl+O"));
openRemoteAction->setToolTip(tr("Open a DSP file"));
connect(openRemoteAction, SIGNAL(triggered()), this, SLOT(open_Remote_Window()));
//SESSION
QAction* componentAction = new QAction(tr("New Component Creator"), fileMenu);
- // componentAction->setShortcut(tr("Ctrl"));
+ // componentAction->setShortcut(tr("Ctrl"));
componentAction->setToolTip(tr("Open a new window to create a 2 dsp component"));
connect(componentAction, SIGNAL(triggered()), this, SLOT(create_Component_Window()));
@@ -374,7 +369,6 @@ QMenu* FLApp::create_FileMenu(){
connect(importSnapshotAction, SIGNAL(triggered()), this, SLOT(importSnapshotFromMenu()));
//SHUT
-
QAction* shutAllAction = new QAction(tr("&Close All Windows"),NULL);
shutAllAction->setShortcut(tr("Ctrl+Alt+W"));
shutAllAction->setToolTip(tr("Close all the Windows"));
@@ -413,27 +407,23 @@ QMenu* FLApp::create_FileMenu(){
return fileMenu;
}
-QMenu* FLApp::create_ExampleMenu(){
-
+QMenu* FLApp::create_ExampleMenu()
+{
QMenu* menuOpen_Example = new QMenu(tr("&Open Example"), NULL);
-
QDir examplesDir(":/");
- if(examplesDir.cd("Examples")){
+ if (examplesDir.cd("Examples")) {
QFileInfoList children = examplesDir.entryInfoList(QDir::Files | QDir::Drives | QDir::NoDotAndDotDot);
-
QFileInfoList::iterator it;
int i = 0;
QAction** openExamples = new QAction* [children.size()];
- for(it = children.begin(); it != children.end(); it++){
-
+ for (it = children.begin(); it != children.end(); it++) {
openExamples[i] = new QAction(it->baseName(), NULL);
openExamples[i]->setData(QVariant(it->absoluteFilePath()));
connect(openExamples[i], SIGNAL(triggered()), this, SLOT(open_Example_From_FileMenu()));
-
menuOpen_Example->addAction(openExamples[i]);
i++;
}
@@ -442,22 +432,23 @@ QMenu* FLApp::create_ExampleMenu(){
return menuOpen_Example;
}
-QMenu* FLApp::create_RecentFileMenu(){
-
+QMenu* FLApp::create_RecentFileMenu()
+{
QMenu* openRecentAction = new QMenu(tr("&Open Recent File"), NULL);
- for(int i=0; iaddAction(fRecentFileAction[i]);
+ }
return openRecentAction;
}
//@param recallOrImport : true = Recall ||| false = Import
-QMenu* FLApp::create_LoadSessionMenu(bool recallOrImport){
-
+QMenu* FLApp::create_LoadSessionMenu(bool recallOrImport)
+{
QString menuName("");
- if(recallOrImport)
+ if (recallOrImport)
menuName = "Recall Recent Snapshot";
else
menuName = "Import Recent Snapshot";
@@ -475,15 +466,14 @@ QMenu* FLApp::create_LoadSessionMenu(bool recallOrImport){
return loadRecentMenu;
}
-QMenu* FLApp::create_NavigateMenu(){
-
+QMenu* FLApp::create_NavigateMenu()
+{
QMenu* navigateMenu = new QMenu(tr("Navigate"), 0);
-
return navigateMenu;
}
-QMenu* FLApp::create_HelpMenu(){
-
+QMenu* FLApp::create_HelpMenu()
+{
QMenu* helpMenu = new QMenu(tr("Help"), 0);
QAction* versionAction = new QAction(tr("&Version"), this);
@@ -534,10 +524,9 @@ QMenu* FLApp::create_HelpMenu(){
return helpMenu;
}
-void FLApp::setup_Menu(){
-
+void FLApp::setup_Menu()
+{
//---------------------Presentation MENU
-
connect(FLPreferenceWindow::_Instance(), SIGNAL(newStyle(const QString&)), this, SLOT(styleClicked(const QString&)));
connect(FLPreferenceWindow::_Instance(), SIGNAL(dropPortChange()), this, SLOT(changeDropPort()));
@@ -547,145 +536,142 @@ void FLApp::setup_Menu(){
fAudioCreator = AudioCreator::_Instance(NULL);
//--------------------HELP Menu
- FLHelpWindow::createInstance(fLibsFolder);
-
+#ifdef _WIN32
+ QString separationChar = "\\";
+#else
+ QString separationChar = "/";
+#endif
+ fLibsFolder = fSessionFolder + separationChar + "Libs";
+ QString testDSPPath = fSessionFolder + separationChar + "Examples" + separationChar + "TestLibs.dsp";
+ FLHelpWindow::createInstance(fLibsFolder, testDSPPath);
QMenu* fileMenu = create_FileMenu();
- //----------------MenuBar setups ---
-
+ //----------------MenuBar setups ---
fMenuBar->addMenu(fileMenu);
-
fMenuBar->addSeparator();
-
fNavigateMenu = create_NavigateMenu();
fMenuBar->addMenu(fNavigateMenu);
fMenuBar->addSeparator();
-
QMenu* helpMenu = create_HelpMenu();
-
fMenuBar->addMenu(helpMenu);
}
//--Update all guis
-void FLApp::updateGuis(){
+void FLApp::updateGuis()
+{
FLInterfaceManager::_Instance()->updateAllGuis();
}
//--Starts the presentation menu if no windows are opened (session restoration or drop on icon that opens the application)
-void FLApp::init_Timer_Action(){
+void FLApp::init_Timer_Action()
+{
fInitTimer->stop();
-
- if(FLW_List.size()==0){
- if(!recall_CurrentSession())
+ if (FLW_List.size() == 0){
+ if (!recall_CurrentSession()) {
show_presentation_Action();
+ }
}
}
//--Print errors in errorWindow
-void FLApp::errorPrinting(const QString& msg){
+void FLApp::errorPrinting(const QString& msg)
+{
FLErrorWindow::_Instance()->print_Error(msg);
}
//--------- OPERATIONS ON WINDOWS INDEXES
-QList FLApp::get_currentIndexes(){
-
+QList FLApp::get_currentIndexes()
+{
QList currentIndexes;
- for( QList::iterator it = FLW_List.begin(); it != FLW_List.end(); it++){
+ for (QList::iterator it = FLW_List.begin(); it != FLW_List.end(); it++) {
currentIndexes.push_back((*it)->get_indexWindow());
}
return currentIndexes;
}
-int FLApp::find_smallest_index(QList currentIndexes){
-
+int FLApp::find_smallest_index(QList currentIndexes)
+{
QList::iterator it;
bool found = true;
int i = 0;
- while(found && currentIndexes.size() != 0){
+ while(found && currentIndexes.size() != 0) {
i++;
for (it = currentIndexes.begin(); it != currentIndexes.end(); it++){
- if(*it == i){
+ if (*it == i) {
found = true;
break;
- }
- else
+ } else {
found = false;
+ }
}
}
- if(i == 0)
+ if (i == 0) {
i = 1;
+ }
return i;
}
//Calculates the position of a new window to avoid overlapping
-void FLApp::calculate_position(int index, int* x, int* y){
-
+void FLApp::calculate_position(int index, int* x, int* y)
+{
int multiplCoef = index;
- while(multiplCoef > 20){
+ while(multiplCoef > 20) {
multiplCoef-=20;
}
-
*x = fScreenWidth/3 + multiplCoef*10;
*y = fScreenHeight/3 + multiplCoef*10;
}
//---------GET WINDOW FROM ONE OF IT'S PARAMETER
-FLWindow* FLApp::getActiveWin(){
-
+FLWindow* FLApp::getActiveWin()
+{
QList::iterator it;
-
for (it = FLW_List.begin(); it != FLW_List.end(); it++) {
-
- if((*it)->isActiveWindow())
+ if ((*it)->isActiveWindow()) {
return *it;
+ }
}
-
return NULL;
}
//--------------------------------FILE-----------------------------
-QString FLApp::createWindowFolder(const QString& sessionFolder, int index){
-
+QString FLApp::createWindowFolder(const QString& sessionFolder, int index)
+{
QString path = sessionFolder + "/Windows/" + fWindowBaseName + QString::number(index);
-
QDir dir(path);
- if(!dir.exists())
+ if (!dir.exists()) {
dir.mkdir(path);
-
+ }
return path;
}
-QString FLApp::copyWindowFolder(const QString& sessionNewFolder, int newIndex, const QString& sessionFolder, int index, map indexChanges){
-
+QString FLApp::copyWindowFolder(const QString& sessionNewFolder, int newIndex, const QString& sessionFolder, int index, map indexChanges)
+{
QString newPath = sessionNewFolder + "/Windows/" + fWindowBaseName + QString::number(newIndex);
QString oldPath = sessionFolder + "/Windows/" + fWindowBaseName + QString::number(index);
-
cpDir(oldPath, newPath);
-
QString jcPath = newPath + "/Connections.jc";
-
map indexStringChanges;
- for(map::iterator it = indexChanges.begin(); it!= indexChanges.end(); it++){
+ for(map::iterator it = indexChanges.begin(); it!= indexChanges.end(); it++) {
string oldN = fWindowBaseName.toStdString() + QString::number(it->first).toStdString();
string newN = fWindowBaseName.toStdString() + QString::number(it->second).toStdString();
indexStringChanges[oldN] = newN;
}
FJUI::update(jcPath.toStdString().c_str(), indexStringChanges);
-
return newPath;
}
-void FLApp::connectWindowSignals(FLWindow* win){
-
+void FLApp::connectWindowSignals(FLWindow* win)
+{
connect(win, SIGNAL(drop(QList)), this, SLOT(drop_Action(QList)));
connect(win, SIGNAL(closeWin()), this, SLOT(close_Window_Action()));
connect(win, SIGNAL(shut_AllWindows()), this, SLOT(shut_AllWindows_FromWindow()));
@@ -697,62 +683,49 @@ void FLApp::connectWindowSignals(FLWindow* win){
//---------------NEW WINDOW
//--General creation function
-FLWindow* FLApp::createWindow(int index, const QString& mySource, FLWinSettings* windowSettings, QString& error){
-
- if(FLW_List.size() >= numberWindows){
+FLWindow* FLApp::createWindow(int index, const QString& mySource, FLWinSettings* windowSettings, QString& error)
+{
+ if (FLW_List.size() >= numberWindows) {
error = "You cannot open more windows. If you are not happy with this limit, feel free to contact us : research.grame@gmail.com ^^";
return NULL;
}
int init = kNoInit;
-
QString source(mySource);
//In case the source is empty, the effect is chosen by default
- if(source.compare("") == 0){
-
+ if (source.compare("") == 0) {
source = "process = !,!:0,0;";
-
- if(QString::compare(FLSettings::_Instance()->value("General/Style", "Blue").toString(), "Blue") == 0 || QString::compare(FLSettings::_Instance()->value("General/Style", "Grey").toString(), "Grey") == 0)
+ if (QString::compare(FLSettings::_Instance()->value("General/Style", "Blue").toString(), "Blue") == 0 || QString::compare(FLSettings::_Instance()->value("General/Style", "Grey").toString(), "Grey") == 0) {
init = kInitWhite;
- else
+ } else {
init = kInitBlue;
+ }
}
// Menus have to be created to be passed to the window
QList appMenus;
appMenus.push_back(create_FileMenu());
-
QMenu* navigateMenu = create_NavigateMenu();
appMenus.push_back(navigateMenu);
-
appMenus.push_back(create_HelpMenu());
-
FLWindow* win = new FLWindow(fWindowBaseName, index, fSessionFolder, windowSettings,appMenus);
// Initialization of the window
// Some of its signals have to be connected to the application slots
- if(win->init_Window(init, source, error)){
-
+ if (win->init_Window(init, source, error)) {
FLW_List.push_back(win);
-
connectWindowSignals(win);
-
fNavigateMenus[win] = navigateMenu;
-
QString name = win->get_nameWindow();
name+=" : ";
name+= win->getName();
-
QAction* navigate = new QAction( name, NULL);
connect(navigate, SIGNAL(triggered()), this, SLOT(frontShow()));
-
fFrontWindow[navigate] = win;
updateNavigateMenus();
-
return win;
- }
- else{
+ } else {
delete win;
delete windowSettings;
return NULL;
@@ -760,15 +733,14 @@ FLWindow* FLApp::createWindow(int index, const QString& mySource, FLWinSettings*
}
//--Creation accessed from Menu
-void FLApp::create_New_Window(const QString& source){
-
+void FLApp::create_New_Window(const QString& source)
+{
QString error("");
//Choice of new Window's index
int val = find_smallest_index(get_currentIndexes());
int x, y;
calculate_position(val, &x, &y);
-
QString windowPath = createWindowFolder(fSessionFolder, val);
QString settingPath = windowPath + "/Settings.ini";
@@ -777,28 +749,29 @@ void FLApp::create_New_Window(const QString& source){
windowSettings->setValue("Position/y", y);
FLWindow* win = createWindow(val, source, windowSettings, error);
-
- if(!win)
+ if (!win) {
errorPrinting(error);
+ }
}
//--Creation of Default Window from Menu
-void FLApp::create_Empty_Window(){
+void FLApp::create_Empty_Window()
+{
create_New_Window("");
}
//--------------NEW COMPONENT
-void FLApp::create_Component_Window(){
-
+void FLApp::create_Component_Window()
+{
FLComponentWindow* componentWindow = new FLComponentWindow();
-
connect(componentWindow, SIGNAL(newComponent(const QString&)), this, SLOT(create_New_Window(const QString&)));
connect(componentWindow, SIGNAL(deleteIt()), this, SLOT(deleteComponent()));
componentWindow->show();
}
-void FLApp::deleteComponent(){
+void FLApp::deleteComponent()
+{
FLComponentWindow* senderWindow = qobject_cast(sender());
senderWindow->hide();
senderWindow->deleteLater();
@@ -807,16 +780,16 @@ void FLApp::deleteComponent(){
//--------------OPEN
//--In the case of a DSP dropped on the Application's icon, this event is called
-bool FLApp::event(QEvent *ev){
-
+bool FLApp::event(QEvent *ev)
+{
if (ev->type() == QEvent::FileOpen) {
-
QString fileName = static_cast(ev)->file();
-
- if(fileName.indexOf(".tar") != -1)
+ if (fileName.indexOf(".tar") != -1) {
recall_Snapshot(fileName, true);
- if(fileName.indexOf(".dsp") != -1)
+ }
+ if (fileName.indexOf(".dsp") != -1) {
create_New_Window(fileName);
+ }
return true;
}
@@ -824,29 +797,24 @@ bool FLApp::event(QEvent *ev){
}
//--Open a dsp from disk
-void FLApp::open_New_Window(){
-
- // In case we are opening a new Window from the presentation Menu --> the application must not close : turning fRecalling to true is the trick
+void FLApp::open_New_Window()
+{
+ // In case we are opening a new Window from the presentation Menu --> the application must not close : turning fRecalling to true is the trick
fRecalling = true;
-
FLWindow* win = getActiveWin();
-
QStringList fileNames = QFileDialog::getOpenFileNames(NULL, tr("Open one or several DSPs"), fLastOpened, tr("Files (*.dsp)"));
-
QStringList::iterator it;
- for(it = fileNames.begin(); it != fileNames.end(); it++){
+ for (it = fileNames.begin(); it != fileNames.end(); it++) {
- if((*it) != ""){
-
- QString inter(*it);
-
+ if ((*it) != "") {
+ QString inter(*it);
fLastOpened = QFileInfo(inter).absolutePath();
-
- if(win != NULL && win->is_Default())
+ if (win != NULL && win->is_Default()) {
win->update_Window(inter);
- else
+ } else {
create_New_Window(inter);
+ }
}
}
@@ -855,107 +823,89 @@ void FLApp::open_New_Window(){
//--------------OPEN EXAMPLE
-void FLApp::open_Example_From_FileMenu(){
-
+void FLApp::open_Example_From_FileMenu()
+{
QAction* action = qobject_cast(sender());
QString toto(action->data().toString());
-
open_Example_Action(toto);
}
-void FLApp::open_Example_Action(QString pathInQResource){
-
+void FLApp::open_Example_Action(QString pathInQResource)
+{
QFileInfo toOpen(pathInQResource);
openExampleAction(toOpen.baseName());
}
-void FLApp::openExampleAction(const QString& exampleName){
-
+void FLApp::openExampleAction(const QString& exampleName)
+{
QString pathInSession = fExamplesFolder + "/" + exampleName + ".dsp";
-
QString codeToCompile = pathToContent(pathInSession);
-
FLWindow* win = getActiveWin();
- if(win != NULL && win->is_Default())
+ if (win != NULL && win->is_Default()) {
win->update_Window(codeToCompile);
- else
- create_New_Window(codeToCompile);
+ } else {
+ create_New_Window(codeToCompile);
+ }
}
//-------------RECENT FILES MANAGEMENT
-void FLApp::save_Recent(QList& recents, const QString& pathToSettings){
-
+void FLApp::save_Recent(QList& recents, const QString& pathToSettings)
+{
int index = 1;
-
for (QList::iterator it=recents.begin(); it!=recents.end(); it++) {
- if(indexsetValue(settingPath, *it);
-
index++;
- }
- else
+ } else
break;
}
}
-void FLApp::recall_Recent(QList& recents, const QString& pathToSettings){
-
- for(int i=1; i<=kMAXRECENT; i++){
-
+void FLApp::recall_Recent(QList& recents, const QString& pathToSettings)
+{
+ for (int i = 1; i <= kMAXRECENT; i++) {
QString settingPath = pathToSettings + QString::number(i);
-
QString path = FLSettings::_Instance()->value(settingPath, "").toString();
recents.push_back(path);
}
-
}
//--Save/Recall from file
-void FLApp::save_Recent_Files(){
-
+void FLApp::save_Recent_Files()
+{
QString settingPath = "General/RecentFiles/";
-
save_Recent(fRecentFiles, settingPath);
}
-void FLApp::recall_Recent_Files(){
-
+void FLApp::recall_Recent_Files()
+{
QString settingPath = "General/RecentFiles/";
recall_Recent(fRecentFiles, settingPath);
-
update_Recent_File();
}
//--Add new recent file
-void FLApp::set_Current_File(const QString& path){
-
+void FLApp::set_Current_File(const QString& path)
+{
fRecentFiles.removeOne(path);
fRecentFiles.push_front(path);
-
update_Recent_File();
-
}
//--Visual Update
-void FLApp::update_Recent_File(){
-
+void FLApp::update_Recent_File()
+{
int index = 0;
-
- for(QList::iterator it=fRecentFiles.begin(); it!=fRecentFiles.end(); it++){
+ for (QList::iterator it = fRecentFiles.begin(); it != fRecentFiles.end(); it++) {
- if(indexsetText(text);
fRecentFileAction[index]->setData(path);
fRecentFileAction[index]->setVisible(true);
@@ -967,19 +917,18 @@ void FLApp::update_Recent_File(){
}
}
-void FLApp::open_Recent_File(){
+void FLApp::open_Recent_File()
+{
QAction* action = qobject_cast(sender());
QString toto(action->data().toString());
-
open_Recent_File(toto);
}
//--Open a recent file
-void FLApp::open_Recent_File(const QString& toto){
-
+void FLApp::open_Recent_File(const QString& toto)
+{
FLWindow* win = getActiveWin();
-
- if(win != NULL && win->is_Default())
+ if( win != NULL && win->is_Default())
win->update_Window(toto);
else
create_New_Window(toto);
@@ -1008,36 +957,33 @@ void FLApp::open_Remote_Window(){
//--------------RECENTLY OPENED
//--Save/Recall from file
-void FLApp::save_Recent_Sessions(){
-
+void FLApp::save_Recent_Sessions()
+{
QString settingPath = "General/RecentSessions/";
-
save_Recent(fRecentSessions, settingPath);
}
-void FLApp::recall_Recent_Sessions(){
-
+void FLApp::recall_Recent_Sessions()
+{
QString settingPath = "General/RecentSessions/";
recall_Recent(fRecentSessions, settingPath);
-
update_Recent_Session();
}
//Add new recent session
-void FLApp::set_Current_Session(const QString& path){
-
+void FLApp::set_Current_Session(const QString& path)
+{
fRecentSessions.removeOne(path);
fRecentSessions.push_front(path);
-
update_Recent_Session();
}
//Visual Update
-void FLApp::update_Recent_Session(){
-
+void FLApp::update_Recent_Session()
+{
int index = 0;
- for(QList::iterator it=fRecentSessions.begin(); it!=fRecentSessions.end(); it++){
+ for (QList::iterator it = fRecentSessions.begin(); it != fRecentSessions.end(); it++){
printf("Index = %i || Size = %i || Session = %s\n", index, fRecentSessions.size(), it->toStdString().c_str());
@@ -1534,31 +1480,32 @@ void FLApp::version_Action(){
QVBoxLayout* layoutGeneral = new QVBoxLayout;
- QString text = "FAUSTLIVE \n- Dist version ";
- text += readFile(":/distVersion.txt");
- text += "- Build version ";
- text += readFile(":/buildVersion.txt");
- text += "\nThis application is using ";
- text += "\n""- LLVM Compiler ";
+ QString text = "FAUSTLIVE Version ";
+ text += VERSION;
+// text += readFile(":/distVersion.txt");
+// text += "- Build version ";
+// text += readFile(":/buildVersion.txt");
+ text += "\n\nBased on ";
+ text += "\n - LLVM Compiler ";
text += LLVM_VERSION;
#ifdef ALSA
- text += "\n""- ALSA ";
+ text += "\n - ALSA ";
text += "1.0";
#endif
#ifdef COREAUDIO
- text += "\n""- CoreAudio API ";
+ text += "\n - CoreAudio API ";
text += "4.0";
#endif
#ifdef JACK
- text += "\n""- Jack 2";
+ text += "\n - Jack 2";
// text += jack_get_version_string();
#endif
#ifdef NETJACK
- text += "\n""- NetJack ";
+ text += "\n - NetJack ";
text += "2.1";
#endif
#ifdef PORTAUDIO
- text += "\n""- PortAudio ";
+ text += "\n - PortAudio ";
text += "v19";
#endif
@@ -1787,15 +1734,15 @@ void FLApp::launch_Server(){
}
//Stop FaustLive Server
-void FLApp::stop_Server(){
+void FLApp::stop_Server()
+{
FLServerHttp::_Instance()->stop();
}
//Update when a file is dropped on HTTP interface (it has the same behavior as a drop in FaustLive window)
-void FLApp::compile_HttpData(const char* data, int port){
-
+void FLApp::compile_HttpData(const char* data, int port)
+{
FLWindow* win;
-
QString source(data);
QString error("");
diff --git a/src/MainStructure/FLApp.h b/src/MainStructure/FLApp.h
index bd8c619..437e847 100755
--- a/src/MainStructure/FLApp.h
+++ b/src/MainStructure/FLApp.h
@@ -12,10 +12,13 @@
#ifndef _FLApp_h
#define _FLApp_h
+#include