Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ZynAddSubFx to version 2.5 #1991

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d71e78b
Integrated latest ZynAddSubFX from upstream
tobydox Mar 15, 2015
882aff6
added rtosc and liblo to zynaddsubfxcore
curlymorphic Apr 2, 2015
482c379
audio working, no ui
curlymorphic Apr 5, 2015
1a251ff
ZynAddSubFx first working commit, untested
curlymorphic Apr 9, 2015
d25697b
manually add patch to make ring buffers non global
curlymorphic Apr 10, 2015
bfb35bd
zyn 2.5 gui refreshing
curlymorphic Apr 10, 2015
bd2d847
multiple internal instances
curlymorphic Apr 11, 2015
a33a05c
zyn 2.5 presets load
curlymorphic Apr 11, 2015
bdd3f3d
zyn 2.5 tidy up
curlymorphic Apr 11, 2015
328f409
unfa spoken workes, with gui
curlymorphic Apr 13, 2015
dbe48a1
sorting out memory error
curlymorphic Apr 14, 2015
7cc8045
added Zyn namespace to the Effect class, to stop linker error
curlymorphic Apr 15, 2015
b8c6e7e
remove debug spam
curlymorphic Apr 15, 2015
73959be
zyn, revert to Allocator memory managment
curlymorphic Apr 15, 2015
076d9ab
Zyn , routed all cc,s to channel 0
curlymorphic Apr 20, 2015
d9ba192
Upgrade to ZynAddSubFx 2.5
curlymorphic Apr 20, 2015
ceba45a
ZynAddSubFx remove autoformming from an un needfile
curlymorphic Apr 20, 2015
8c99965
ZynAddSubFx stopped the Freeze when opening the ui
curlymorphic Apr 21, 2015
bc5dfd9
ZASF 2.5 upgrade. edit whitespace
curlymorphic Apr 21, 2015
0248a64
added rtosc as submodule, added cmake code
curlymorphic Apr 22, 2015
e115c7c
ZASF 2.5 upgrade added RTOSC as git submodule
curlymorphic Apr 22, 2015
36770b5
added liblo7 to travis
curlymorphic Apr 22, 2015
3cee26b
remover liblo-dev and loblo 7 from travis as the ubuntu reo is too ol…
curlymorphic Apr 22, 2015
0917fad
change gcc in linux..before_install
curlymorphic Apr 22, 2015
48af74b
added wine1.4-amd64 to travis, required now upgraded gcc
curlymorphic Apr 22, 2015
61b927c
added wine1.4-common to travis build for new gcc
curlymorphic Apr 22, 2015
cc27fdd
added wine1.4 to linix..
curlymorphic Apr 22, 2015
fb70185
added wine1.4-i386 as a dependacy
curlymorphic Apr 22, 2015
520695d
remove all new wine deps
curlymorphic Apr 22, 2015
a3b6e90
removed changing the gcc
curlymorphic Apr 22, 2015
365fdc2
change override to -Doverride in zym cmakelists
curlymorphic Apr 22, 2015
9e52ba3
remove old rtosc submodule
curlymorphic Apr 23, 2015
1e0515a
added no travis save rtosc submodule
curlymorphic Apr 23, 2015
a227fc4
removed over ride declarations
curlymorphic Apr 23, 2015
642fc0f
removed override declaration in Fl_Osc_Dial.H
curlymorphic Apr 23, 2015
6b73172
remove override from headder files
curlymorphic Apr 23, 2015
bd87884
removed more override
curlymorphic Apr 23, 2015
eed72b2
remove override from headders
curlymorphic Apr 23, 2015
229b0e3
more remove override
curlymorphic Apr 23, 2015
7fae371
removed double entry for liblo
curlymorphic Apr 23, 2015
fc5cf8b
added cxxtest
curlymorphic Apr 23, 2015
4d62a8a
removed nsm liblo from ubuntu repo
curlymorphic Apr 23, 2015
1f458e3
changed git submodule
curlymorphic Apr 23, 2015
16e75e0
removed non static data member initializers to comply with gcc 4.6
curlymorphic Apr 23, 2015
a8a8a83
make middleware gcc 4.6 compliant
curlymorphic Apr 23, 2015
58fb41b
make middleware gcc 4.6 compliant
curlymorphic Apr 23, 2015
637e241
make middleware gcc 4.6 compliant
curlymorphic Apr 23, 2015
4332ebd
make middleware gcc 4.6 compliant
curlymorphic Apr 23, 2015
761c4fd
make middleware gcc 4.6 compliant
curlymorphic Apr 23, 2015
2ec35c8
remove rtosc submodule
curlymorphic Apr 24, 2015
350f9f1
re added rtosc travis-test
curlymorphic Apr 24, 2015
d37427a
moved rtosc submodule
curlymorphic Apr 24, 2015
df5a62b
moved getting submodele to main CMakeList.txt
curlymorphic Apr 24, 2015
aedf104
add path to rtosc module import
curlymorphic Apr 24, 2015
3a1e9eb
Changes To build on GCC 4.6 Travis
curlymorphic Apr 24, 2015
710091e
Merge pull request #19 from curlymorphic/zs4
curlymorphic Apr 25, 2015
dc64751
chanhed memory fencing to use __sync_synchronize();
curlymorphic Apr 25, 2015
bfc54a6
use c++11 atomic, but fall back to __sync__synchronize() if gcc < 4.7…
curlymorphic Apr 26, 2015
ea433a2
submodule now from master branch
curlymorphic Apr 26, 2015
6476279
incresed wait tine while loading
curlymorphic Apr 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "plugins/zynaddsubfx/rtosc"]
path = plugins/zynaddsubfx/rtosc
url = https://github.com/fundamental/rtosc.git
1 change: 1 addition & 0 deletions .travis/linux..before_install.sh
@@ -1,2 +1,3 @@
sudo add-apt-repository ppa:kalakris/cmake -y;
sudo apt-get update -qq

2 changes: 1 addition & 1 deletion .travis/linux..install.sh
@@ -1,4 +1,4 @@
sudo apt-get install -y cmake libqt4-dev libsndfile-dev fftw3-dev libvorbis-dev \
libogg-dev libasound2-dev libjack-dev libsdl-dev libsamplerate0-dev \
libstk0-dev libfluidsynth-dev portaudio19-dev wine-dev g++-multilib \
libfltk1.3-dev libgig-dev
libfltk1.3-dev libgig-dev liblo-dev liblo7
21 changes: 21 additions & 0 deletions CMakeLists.txt
Expand Up @@ -24,6 +24,27 @@ ENDIF(VERSION_SUFFIX)

INCLUDE(DetectMachine)

#Include RTOSC
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugins/zynaddsubfx/rtosc/CMakeLists.txt")
message(STATUS "RTOSC NOT FOUND")
message(STATUS "Attempting to checkout submodule")
find_package(Git REQUIRED)
set(THISDIR ${CMAKE_BINARY_DIR})
execute_process(COMMAND git submodule update --init WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugins/zynaddsubfx/rtosc/CMakeLists.txt")
message(FATAL_ERROR "FAILED TO CHECKOUT RTOSC\n"
"please check file permissions and your network")
endif()
execute_process(COMMAND git branch WORKING_DIRECTORY ${THISDIR}) #return to corrent folder
else()
message(STATUS "Found Rtosc Submodule...")
endif()

set(RTOSC_NO_INSTALL TRUE)
include("plugins/zynaddsubfx/rtosc/cmake/ColorMessage.cmake")
add_subdirectory(plugins/zynaddsubfx/rtosc)
include_directories(plugins/zynaddsubfx/rtosc/include)


OPTION(WANT_ALSA "Include ALSA (Advanced Linux Sound Architecture) support" ON)
OPTION(WANT_CALF "Include CALF LADSPA plugins" ON)
Expand Down
22 changes: 17 additions & 5 deletions plugins/zynaddsubfx/CMakeLists.txt
@@ -1,5 +1,11 @@
INCLUDE(BuildPlugin)

# ADD_DEFINITIONS("-Doverride") removed because removed overrides statements

# build ZynAddSubFX with full optimizations
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fexceptions -Wno-write-strings -Wno-deprecated-declarations -std=c++0x ")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")


# definitions for ZynAddSubFX
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE)
Expand All @@ -8,6 +14,9 @@ ELSE(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE)
ADD_DEFINITIONS(-DOS_WINDOWS)
ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE)

# build against FLTK - to be changed once we support NTK as well
ADD_DEFINITIONS(-DFLTK_GUI)

# do not conflict with LMMS' Controller class
ADD_DEFINITIONS(-DController=ZynController)

Expand All @@ -16,8 +25,6 @@ IF(LMMS_HOST_X86 OR LMMS_HOST_X86_64)
ADD_DEFINITIONS(-DASM_F2I_YES)
ENDIF(LMMS_HOST_X86 OR LMMS_HOST_X86_64)

# build ZynAddSubFX with full optimizations
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations")

# link system-libraries when on win32
IF(LMMS_BUILD_WIN32)
Expand Down Expand Up @@ -76,12 +83,15 @@ SET(zynaddsubfx_core_SRCS
zynaddsubfx/src/Effects/EQ.cpp
zynaddsubfx/src/Effects/Phaser.cpp
zynaddsubfx/src/Effects/Reverb.cpp
zynaddsubfx/src/Misc/Allocator.cpp
zynaddsubfx/src/Misc/Bank.cpp
zynaddsubfx/src/Misc/Config.cpp
zynaddsubfx/src/Misc/Dump.cpp
zynaddsubfx/src/Misc/Master.cpp
zynaddsubfx/src/Misc/Microtonal.cpp
zynaddsubfx/src/Misc/MiddleWare.cpp
zynaddsubfx/src/Misc/Part.cpp
zynaddsubfx/src/Misc/PresetExtractor.cpp
zynaddsubfx/src/Misc/Util.cpp
zynaddsubfx/src/Misc/QtXmlWrapper.cpp
zynaddsubfx/src/Misc/Recorder.cpp
Expand All @@ -105,11 +115,12 @@ SET(zynaddsubfx_core_SRCS
zynaddsubfx/src/Synth/PADnote.cpp
zynaddsubfx/src/Synth/Resonance.cpp
zynaddsubfx/src/Synth/SUBnote.cpp
zynaddsubfx/tlsf/tlsf.c
)


ADD_LIBRARY(ZynAddSubFxCore SHARED LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS})
TARGET_LINK_LIBRARIES(ZynAddSubFxCore zynaddsubfx_nio ${FFTW3F_LIBRARIES} ${QT_LIBRARIES} -lz -lpthread)
TARGET_LINK_LIBRARIES(ZynAddSubFxCore zynaddsubfx_gui zynaddsubfx_nio rtosc rtosc-cpp ${FFTW3F_LIBRARIES} ${QT_LIBRARIES} -lpthread -lz -llo -lm )
IF(QT5)
TARGET_LINK_LIBRARIES(ZynAddSubFxCore Qt5::Widgets Qt5::Xml)
ENDIF()
Expand All @@ -122,7 +133,8 @@ ELSE(LMMS_BUILD_WIN32)
ENDIF(LMMS_BUILD_WIN32)

BUILD_PLUGIN(zynaddsubfx ZynAddSubFx.cpp ZynAddSubFx.h MOCFILES ZynAddSubFx.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
TARGET_LINK_LIBRARIES(zynaddsubfx ZynAddSubFxCore)
TARGET_LINK_LIBRARIES(zynaddsubfx zynaddsubfx_gui zynaddsubfx_nio rtosc rtosc-cpp
ZynAddSubFxCore -llo -lm )

IF(WIN32)
SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfxrc.obj")
Expand All @@ -138,7 +150,7 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
ADD_EXECUTABLE(RemoteZynAddSubFx RemoteZynAddSubFx.cpp "${WINRC}")
INSTALL(TARGETS RemoteZynAddSubFx RUNTIME DESTINATION "${PLUGIN_DIR}")
TARGET_LINK_LIBRARIES(RemoteZynAddSubFx zynaddsubfx_gui ZynAddSubFxCore ${FLTK_LIBRARIES} -lpthread )
TARGET_LINK_LIBRARIES(RemoteZynAddSubFx zynaddsubfx_gui zynaddsubfx_nio ZynAddSubFxCore rtosc rtosc-cpp ${FLTK_LIBRARIES} -lpthread -llo -lm)

# link Qt libraries when on win32
IF(LMMS_BUILD_WIN32)
Expand Down
24 changes: 14 additions & 10 deletions plugins/zynaddsubfx/LocalZynAddSubFx.cpp
Expand Up @@ -30,18 +30,22 @@

#include "LocalZynAddSubFx.h"

#include "zynaddsubfx/src/Misc/MiddleWare.h"
#include "zynaddsubfx/src/Nio/NulEngine.h"
#include "zynaddsubfx/src/Misc/Master.h"
#include "zynaddsubfx/src/Misc/Part.h"
#include "zynaddsubfx/src/Misc/Dump.h"
#include "zynaddsubfx/src/Nio/Nio.h"


SYNTH_T* synth = NULL;
MiddleWare *middleware = NULL;

int LocalZynAddSubFx::s_instanceCount = 0;


LocalZynAddSubFx::LocalZynAddSubFx() :
m_middleWare( NULL ),
m_master( NULL ),
m_ioEngine( NULL )
{
Expand All @@ -60,9 +64,10 @@ LocalZynAddSubFx::LocalZynAddSubFx() :
#endif
#endif

initConfig();
++s_instanceCount;

synth = new SYNTH_T;
initConfig();
synth->oscilsize = config.cfg.OscilSize;
synth->alias();

Expand All @@ -74,27 +79,30 @@ LocalZynAddSubFx::LocalZynAddSubFx() :
denormalkillbuf[i] = (RND-0.5)*1e-16;
}
}

++s_instanceCount;
m_middleWare = new MiddleWare();
middleware = m_middleWare;

m_ioEngine = new NulEngine;

m_master = new Master();
m_master = m_middleWare->spawnMaster();
m_master->swaplr = 0;

Nio::init( m_master );

}




LocalZynAddSubFx::~LocalZynAddSubFx()
{
delete m_master;
delete m_ioEngine;
delete m_middleWare;

if( --s_instanceCount == 0 )
{
delete[] denormalkillbuf;
}

}


Expand Down Expand Up @@ -142,10 +150,8 @@ void LocalZynAddSubFx::loadXML( const std::string & _filename )
{
char * f = strdup( _filename.c_str() );

pthread_mutex_lock( &m_master->mutex );
m_master->defaults();
m_master->loadXML( f );
pthread_mutex_unlock( &m_master->mutex );

m_master->applyparameters();

Expand All @@ -160,10 +166,8 @@ void LocalZynAddSubFx::loadPreset( const std::string & _filename, int _part )
{
char * f = strdup( _filename.c_str() );

pthread_mutex_lock( &m_master->mutex );
m_master->part[_part]->defaultsinstrument();
m_master->part[_part]->loadXMLinstrument( f );
pthread_mutex_unlock( &m_master->mutex );

m_master->applyparameters();

Expand Down
5 changes: 4 additions & 1 deletion plugins/zynaddsubfx/LocalZynAddSubFx.h
@@ -1,7 +1,7 @@
/*
* LocalZynAddSubFx.h - local implementation of ZynAddSubFx plugin
*
* Copyright (c) 2009-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2009-2015 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of LMMS - http://lmms.io
*
Expand Down Expand Up @@ -29,6 +29,7 @@
#include "Note.h"

class Master;
class MiddleWare;
class NulEngine;

class LocalZynAddSubFx
Expand Down Expand Up @@ -68,6 +69,8 @@ class LocalZynAddSubFx
std::string m_presetsDir;

int m_runningNotes[NumKeys];

MiddleWare* m_middleWare;
Master * m_master;
NulEngine* m_ioEngine;

Expand Down
61 changes: 29 additions & 32 deletions plugins/zynaddsubfx/RemoteZynAddSubFx.cpp
Expand Up @@ -37,6 +37,8 @@

#include "zynaddsubfx/src/Nio/Nio.h"
#include "zynaddsubfx/src/UI/MasterUI.h"
#include "zynaddsubfx/src/UI/Connection.h"
#include "zynaddsubfx/src/Misc/MiddleWare.h"

#include <FL/x.H>

Expand All @@ -50,8 +52,6 @@ class RemoteZynAddSubFx : public RemotePluginClient, public LocalZynAddSubFx
m_guiSleepTime( 100 ),
m_guiExit( false )
{
Nio::start();

setInputCount( 0 );
sendMessage( IdInitDone );
waitForMessage( IdInitDone );
Expand Down Expand Up @@ -87,9 +87,7 @@ class RemoteZynAddSubFx : public RemotePluginClient, public LocalZynAddSubFx
message m;
while( ( m = receiveMessage() ).id != IdQuit )
{
pthread_mutex_lock( &m_master->mutex );
processMessage( m );
pthread_mutex_unlock( &m_master->mutex );
}
}

Expand Down Expand Up @@ -128,9 +126,15 @@ class RemoteZynAddSubFx : public RemotePluginClient, public LocalZynAddSubFx
LocalZynAddSubFx::setPitchWheelBendRange( _m.getInt() );
break;

case IdSampleRateInformation:
LocalZynAddSubFx::setSampleRate( _m.getInt() );
break;

default:
return RemotePluginClient::processMessage( _m );
}
GUI::tickUi(gui);
m_middleWare->tick();
return true;
}

Expand Down Expand Up @@ -166,10 +170,12 @@ class RemoteZynAddSubFx : public RemotePluginClient, public LocalZynAddSubFx
pthread_mutex_t m_guiMutex;
std::queue<RemotePluginClient::message> m_guiMessages;
bool m_guiExit;
static GUI::ui_handle_t gui;

} ;


GUI::ui_handle_t RemoteZynAddSubFx::gui = NULL;


void RemoteZynAddSubFx::guiThread()
Expand All @@ -193,10 +199,8 @@ void RemoteZynAddSubFx::guiThread()
}
if( exitProgram == 1 )
{
pthread_mutex_lock( &m_master->mutex );
sendMessage( IdHideUI );
exitProgram = 0;
pthread_mutex_unlock( &m_master->mutex );
}
pthread_mutex_lock( &m_guiMutex );
while( m_guiMessages.size() )
Expand All @@ -210,9 +214,17 @@ void RemoteZynAddSubFx::guiThread()
if( !ui )
{
Fl::scheme( "plastic" );
ui = new MasterUI( m_master, &exitProgram );

gui = GUI::createUi( m_middleWare->spawnUiApi(), &exitProgram );
m_middleWare->setUiCallback( GUI::raiseUi, gui );
m_middleWare->setIdleCallback([](){GUI::tickUi(gui);});
middlewarepointer = m_middleWare; //added curlymorphic

ui = static_cast<MasterUI *>( gui );
}
ui->showUI();
ui->npartcounter->do_callback();
ui->updatepanel();
ui->refresh_master_ui();
break;

Expand All @@ -221,11 +233,11 @@ void RemoteZynAddSubFx::guiThread()
LocalZynAddSubFx::loadXML( m.getString() );
if( ui )
{
ui->npartcounter->do_callback();
ui->updatepanel();
ui->refresh_master_ui();
}
pthread_mutex_lock( &m_master->mutex );
sendMessage( IdLoadSettingsFromFile );
pthread_mutex_unlock( &m_master->mutex );
break;
}

Expand All @@ -239,21 +251,25 @@ void RemoteZynAddSubFx::guiThread()
ui->updatepanel();
ui->refresh_master_ui();
}
pthread_mutex_lock( &m_master->mutex );
sendMessage( IdLoadPresetFile );
pthread_mutex_unlock( &m_master->mutex );
break;
}

case IdSampleRateInformation:
LocalZynAddSubFx::setSampleRate( m.getInt() );
break;

default:
break;
}

}
pthread_mutex_unlock( &m_guiMutex );

m_middleWare->tick();
}
Fl::flush();

delete ui;
GUI::destroyUi( gui );
}


Expand Down Expand Up @@ -295,22 +311,3 @@ int main( int _argc, char * * _argv )
}


#ifdef NTK_GUI
static Fl_Tiled_Image *module_backdrop;
#endif

void set_module_parameters ( Fl_Widget *o )
{
#ifdef NTK_GUI
o->box( FL_DOWN_FRAME );
o->align( o->align() | FL_ALIGN_IMAGE_BACKDROP );
o->color( FL_BLACK );
o->image( module_backdrop );
o->labeltype( FL_SHADOW_LABEL );
#else
o->box( FL_PLASTIC_UP_BOX );
o->color( FL_CYAN );
o->labeltype( FL_EMBOSSED_LABEL );
#endif
}