@@ -1,9 +0,0 @@ | |||||
set(zynaddsubfx_dsp_SRCS | |||||
DSP/AnalogFilter.cpp | |||||
DSP/FFTwrapper.cpp | |||||
DSP/Filter.cpp | |||||
DSP/FormantFilter.cpp | |||||
DSP/SVFilter.cpp | |||||
DSP/Unison.cpp | |||||
PARENT_SCOPE | |||||
) |
@@ -27,6 +27,10 @@ | |||||
#include "../Misc/Util.h" | #include "../Misc/Util.h" | ||||
#include "SVFilter.h" | #include "SVFilter.h" | ||||
#ifndef errx | |||||
#include <err.h> | |||||
#endif | |||||
SVFilter::SVFilter(unsigned char Ftype, float Ffreq, float Fq, | SVFilter::SVFilter(unsigned char Ftype, float Ffreq, float Fq, | ||||
unsigned char Fstages, unsigned int srate, int bufsize) | unsigned char Fstages, unsigned int srate, int bufsize) | ||||
:Filter(srate, bufsize), | :Filter(srate, bufsize), | ||||
@@ -25,6 +25,10 @@ | |||||
#include "../Misc/Allocator.h" | #include "../Misc/Allocator.h" | ||||
#include "Unison.h" | #include "Unison.h" | ||||
#ifndef errx | |||||
#include <err.h> | |||||
#endif | |||||
Unison::Unison(Allocator *alloc_, int update_period_samples_, float max_delay_sec_, float srate_f) | Unison::Unison(Allocator *alloc_, int update_period_samples_, float max_delay_sec_, float srate_f) | ||||
:unison_size(0), | :unison_size(0), | ||||
base_freq(1.0f), | base_freq(1.0f), | ||||
@@ -1,14 +0,0 @@ | |||||
set(zynaddsubfx_effect_SRCS | |||||
Effects/Alienwah.cpp | |||||
Effects/Chorus.cpp | |||||
Effects/Distorsion.cpp | |||||
Effects/DynamicFilter.cpp | |||||
Effects/Echo.cpp | |||||
Effects/Effect.cpp | |||||
Effects/EffectLFO.cpp | |||||
Effects/EffectMgr.cpp | |||||
Effects/EQ.cpp | |||||
Effects/Phaser.cpp | |||||
Effects/Reverb.cpp | |||||
PARENT_SCOPE | |||||
) |
@@ -1,30 +0,0 @@ | |||||
include_directories(${MXML_INCLUDE_DIR}) | |||||
set(zynaddsubfx_misc_SRCS | |||||
Misc/Bank.cpp | |||||
Misc/Config.cpp | |||||
Misc/Master.cpp | |||||
Misc/Microtonal.cpp | |||||
Misc/Part.cpp | |||||
Misc/Util.cpp | |||||
Misc/XMLwrapper.cpp | |||||
Misc/Recorder.cpp | |||||
Misc/WavFile.cpp | |||||
Misc/WaveShapeSmps.cpp | |||||
Misc/MiddleWare.cpp | |||||
Misc/PresetExtractor.cpp | |||||
Misc/Allocator.cpp | |||||
) | |||||
if(LashEnable) | |||||
set(zynaddsubfx_misc_SRCS | |||||
${zynaddsubfx_misc_SRCS} | |||||
Misc/LASHClient.cpp | |||||
PARENT_SCOPE) | |||||
else() | |||||
set(zynaddsubfx_misc_SRCS | |||||
${zynaddsubfx_misc_SRCS} | |||||
PARENT_SCOPE) | |||||
endif() |
@@ -35,7 +35,7 @@ | |||||
#include <list> | #include <list> | ||||
#ifndef errx | #ifndef errx | ||||
# include <err.h> | |||||
#include <err.h> | |||||
#endif | #endif | ||||
using std::string; | using std::string; | ||||
@@ -209,7 +209,7 @@ void refreshBankView(const Bank &bank, unsigned loc, Fl_Osc_Interface *osc) | |||||
if (osc) | if (osc) | ||||
osc->tryLink(response); | |||||
osc->tryLink(response); | |||||
} | } | ||||
void bankList(Bank &bank, Fl_Osc_Interface *osc) | void bankList(Bank &bank, Fl_Osc_Interface *osc) | ||||
@@ -251,7 +251,7 @@ void bankPos(Bank &bank, Fl_Osc_Interface *osc) | |||||
if(!rtosc_message(response, 2048, "/loadbank", "i", bank.bankpos)) | if(!rtosc_message(response, 2048, "/loadbank", "i", bank.bankpos)) | ||||
errx(1, "Failure to handle bank update properly..."); | errx(1, "Failure to handle bank update properly..."); | ||||
if (osc) | |||||
if(osc) | |||||
osc->tryLink(response); | osc->tryLink(response); | ||||
} | } | ||||
@@ -628,7 +628,7 @@ public: | |||||
[master,filename,this,npart](){ | [master,filename,this,npart](){ | ||||
Part *p = new Part(*master->memory, synth, &master->microtonal, master->fft); | Part *p = new Part(*master->memory, synth, &master->microtonal, master->fft); | ||||
if(p->loadXMLinstrument(filename)) | if(p->loadXMLinstrument(filename)) | ||||
fprintf(stderr, "Warning: failed to load part!\n"); | |||||
fprintf(stderr, "Warning: failed to load part<%s>!\n", filename); | |||||
auto isLateLoad = [this,npart]{ | auto isLateLoad = [this,npart]{ | ||||
return actual_load[npart] != pending_load[npart]; | return actual_load[npart] != pending_load[npart]; | ||||
@@ -839,7 +839,7 @@ public: | |||||
}; | }; | ||||
MiddleWareImpl::MiddleWareImpl(MiddleWare *mw, SYNTH_T synth_, int prefered_port) | MiddleWareImpl::MiddleWareImpl(MiddleWare *mw, SYNTH_T synth_, int prefered_port) | ||||
:parent(mw), synth(synth_) | |||||
:parent(mw), ui(nullptr), synth(synth_) | |||||
{ | { | ||||
bToU = new rtosc::ThreadLink(4096*2,1024); | bToU = new rtosc::ThreadLink(4096*2,1024); | ||||
uToB = new rtosc::ThreadLink(4096*2,1024); | uToB = new rtosc::ThreadLink(4096*2,1024); | ||||
@@ -899,6 +899,8 @@ MiddleWareImpl::~MiddleWareImpl(void) | |||||
warnMemoryLeaks(); | warnMemoryLeaks(); | ||||
lo_server_free(server); | |||||
delete master; | delete master; | ||||
delete osc; | delete osc; | ||||
delete bToU; | delete bToU; | ||||
@@ -1350,7 +1352,7 @@ void MiddleWare::activeUrl(std::string u) | |||||
{ | { | ||||
impl->last_url = u; | impl->last_url = u; | ||||
} | } | ||||
const SYNTH_T &MiddleWare::getSynth(void) const | const SYNTH_T &MiddleWare::getSynth(void) const | ||||
{ | { | ||||
return impl->synth; | return impl->synth; | ||||
@@ -4,6 +4,7 @@ | |||||
#include <string> | #include <string> | ||||
struct SYNTH_T; | struct SYNTH_T; | ||||
class Master; | |||||
//Link between realtime and non-realtime layers | //Link between realtime and non-realtime layers | ||||
class MiddleWare | class MiddleWare | ||||
{ | { | ||||
@@ -37,6 +37,9 @@ | |||||
#include <sched.h> | #include <sched.h> | ||||
#endif | #endif | ||||
#ifndef errx | |||||
#include <err.h> | |||||
#endif | |||||
prng_t prng_state = 0x1234; | prng_t prng_state = 0x1234; | ||||
@@ -1,52 +0,0 @@ | |||||
#Defaults: | |||||
# - Wave Output (enabled with the record function) | |||||
# - Null Output | |||||
# - Null Output Running by default | |||||
# - Managed with OutMgr | |||||
set(zynaddsubfx_nio_SRCS | |||||
WavEngine.cpp | |||||
NulEngine.cpp | |||||
AudioOut.cpp | |||||
MidiIn.cpp | |||||
OutMgr.cpp | |||||
InMgr.cpp | |||||
Engine.cpp | |||||
EngineMgr.cpp | |||||
Nio.cpp | |||||
) | |||||
set(zynaddsubfx_nio_lib) | |||||
add_definitions(-DOUT_DEFAULT="${DefaultOutput}") | |||||
add_definitions(-DIN_DEFAULT="${DefaultInput}") | |||||
if(JackEnable) | |||||
include_directories(${JACK_INCLUDE_DIR}) | |||||
list(APPEND zynaddsubfx_nio_SRCS JackEngine.cpp JackMultiEngine.cpp) | |||||
list(APPEND zynaddsubfx_nio_lib ${JACK_LIBRARIES}) | |||||
CHECK_INCLUDE_FILES("jack/metadata.h" JACK_HAS_METADATA_API) | |||||
if(JACK_HAS_METADATA_API) | |||||
add_definitions(-DJACK_HAS_METADATA_API) | |||||
endif(JACK_HAS_METADATA_API) | |||||
endif(JackEnable) | |||||
if(PaEnable) | |||||
include_directories(${PORTAUDIO_INCLUDE_DIRS}) | |||||
list(APPEND zynaddsubfx_nio_SRCS PaEngine.cpp) | |||||
list(APPEND zynaddsubfx_nio_lib ${PORTAUDIO_LIBRARIES}) | |||||
endif(PaEnable) | |||||
if(AlsaEnable) | |||||
list(APPEND zynaddsubfx_nio_SRCS AlsaEngine.cpp) | |||||
list(APPEND zynaddsubfx_nio_lib ${ASOUND_LIBRARY}) | |||||
endif(AlsaEnable) | |||||
if(OssEnable) | |||||
list(APPEND zynaddsubfx_nio_SRCS OssEngine.cpp OssMultiEngine.cpp) | |||||
endif(OssEnable) | |||||
add_library(zynaddsubfx_nio STATIC | |||||
${zynaddsubfx_nio_SRCS} | |||||
) |
@@ -1,13 +0,0 @@ | |||||
set(zynaddsubfx_params_SRCS | |||||
Params/ADnoteParameters.cpp | |||||
Params/Controller.cpp | |||||
Params/EnvelopeParams.cpp | |||||
Params/FilterParams.cpp | |||||
Params/LFOParams.cpp | |||||
Params/PADnoteParameters.cpp | |||||
Params/Presets.cpp | |||||
Params/PresetsArray.cpp | |||||
Params/PresetsStore.cpp | |||||
Params/SUBnoteParameters.cpp | |||||
PARENT_SCOPE | |||||
) |
@@ -127,6 +127,7 @@ static const rtosc::Ports PADnotePorts = | |||||
PADnoteParameters *p = ((PADnoteParameters*)d.obj); | PADnoteParameters *p = ((PADnoteParameters*)d.obj); | ||||
const unsigned n = p->synth.oscilsize / 2; | const unsigned n = p->synth.oscilsize / 2; | ||||
float *tmp = new float[n]; | float *tmp = new float[n]; | ||||
*tmp = 0; | |||||
for(unsigned i=1; i<n; ++i) | for(unsigned i=1; i<n; ++i) | ||||
tmp[i] = p->getNhr(i); | tmp[i] = p->getNhr(i); | ||||
d.reply(d.loc, "b", n*sizeof(float), tmp); | d.reply(d.loc, "b", n*sizeof(float), tmp); | ||||
@@ -134,7 +135,9 @@ static const rtosc::Ports PADnotePorts = | |||||
{"profile:i", rProp(non-realtime) rDoc("UI display of the harmonic profile"), | {"profile:i", rProp(non-realtime) rDoc("UI display of the harmonic profile"), | ||||
NULL, [](const char *m, rtosc::RtData &d) { | NULL, [](const char *m, rtosc::RtData &d) { | ||||
PADnoteParameters *p = ((PADnoteParameters*)d.obj); | PADnoteParameters *p = ((PADnoteParameters*)d.obj); | ||||
const unsigned n = rtosc_argument(m, 0).i; | |||||
const int n = rtosc_argument(m, 0).i; | |||||
if(n<=0) | |||||
return; | |||||
float *tmp = new float[n]; | float *tmp = new float[n]; | ||||
float realbw = p->getprofile(tmp, n); | float realbw = p->getprofile(tmp, n); | ||||
d.reply(d.loc, "b", n*sizeof(float), tmp); | d.reply(d.loc, "b", n*sizeof(float), tmp); | ||||
@@ -1,11 +0,0 @@ | |||||
set(zynaddsubfx_synth_SRCS | |||||
Synth/SynthNote.cpp | |||||
Synth/ADnote.cpp | |||||
Synth/Envelope.cpp | |||||
Synth/LFO.cpp | |||||
Synth/OscilGen.cpp | |||||
Synth/PADnote.cpp | |||||
Synth/Resonance.cpp | |||||
Synth/SUBnote.cpp | |||||
PARENT_SCOPE | |||||
) |
@@ -1,77 +0,0 @@ | |||||
set(UI_fl_files | |||||
ADnoteUI.fl | |||||
BankUI.fl | |||||
ConfigUI.fl | |||||
EffUI.fl | |||||
EnvelopeUI.fl | |||||
FilterUI.fl | |||||
LFOUI.fl | |||||
MasterUI.fl | |||||
MicrotonalUI.fl | |||||
OscilGenUI.fl | |||||
PADnoteUI.fl | |||||
PartUI.fl | |||||
PresetsUI.fl | |||||
ResonanceUI.fl | |||||
SUBnoteUI.fl | |||||
VirKeyboard.fl | |||||
) | |||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}) | |||||
set_source_files_properties(UI/MasterUI.h PROPERTIES GENERATED 1) | |||||
fltk_wrap_ui(zynaddsubfx_gui ${UI_fl_files}) | |||||
if(LibloEnable) | |||||
set(zynaddsubfx_gui_FLTK_UI_SRCS ${zynaddsubfx_gui_FLTK_UI_SRCS} NSM.C NSM/Client.C) | |||||
endif() | |||||
if(NtkGui) | |||||
add_definitions(-DPIXMAP_PATH="${CMAKE_INSTALL_PREFIX}/share/zynaddsubfx/pixmaps/") | |||||
add_definitions(-DSOURCE_DIR="${CMAKE_SOURCE_DIR}") | |||||
endif() | |||||
if(FltkGui) | |||||
add_executable(zynaddsubfx_ext_gui guimain.cpp) | |||||
target_link_libraries(zynaddsubfx_ext_gui zynaddsubfx_gui ${FLTK_LIBRARIES} | |||||
${FLTK_LIBRARIES} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${LIBLO_LIBRARIES} rtosc rtosc-cpp) | |||||
endif() | |||||
add_library(zynaddsubfx_gui STATIC | |||||
${UI_objs} | |||||
${zynaddsubfx_gui_FLTK_UI_SRCS} | |||||
NioUI.cpp | |||||
WidgetPDial.cpp | |||||
PartNameButton.cpp | |||||
Fl_Osc_Pane.cpp | |||||
Fl_Osc_Widget.cpp | |||||
Fl_Osc_Dial.cpp | |||||
Fl_Osc_DialF.cpp | |||||
Fl_Osc_Slider.cpp | |||||
Fl_Osc_VSlider.cpp | |||||
Fl_Osc_Button.cpp | |||||
Fl_Osc_Check.cpp | |||||
Fl_Osc_Choice.cpp | |||||
Fl_Osc_Roller.cpp | |||||
Fl_Osc_Output.cpp | |||||
Fl_Osc_Counter.cpp | |||||
Fl_Osc_Input.cpp | |||||
Fl_Osc_Value.cpp | |||||
Fl_Osc_ListView.cpp | |||||
Fl_Resonance_Graph.cpp | |||||
Fl_EQGraph.cpp | |||||
FormantFilterGraph.cpp | |||||
EnvelopeFreeEdit.cpp | |||||
BankView.cpp | |||||
) | |||||
add_library(zynaddsubfx_gui_bridge STATIC | |||||
Connection.cpp) | |||||
add_dependencies(zynaddsubfx_gui_bridge zynaddsubfx_gui) | |||||
if(NtkGui) | |||||
target_link_libraries(zynaddsubfx_gui ${NTK_LIBRARIES} ${NTK_IMAGES_LIBRARIES}) | |||||
endif(NtkGui) | |||||
if(FltkGui) | |||||
target_link_libraries(zynaddsubfx_gui ${FLTK_LIBRARIES}) | |||||
endif(FltkGui) |
@@ -107,16 +107,18 @@ class Fl_Oscilloscope : public Fl_Box, public Fl_Osc_Widget | |||||
fl_color( fl_color_add_alpha( fl_color(), 127 ) ); | fl_color( fl_color_add_alpha( fl_color(), 127 ) ); | ||||
int lw=2; | |||||
fl_line_style(FL_SOLID,lw); | |||||
fl_begin_line(); | |||||
double ph=((phase-64.0)/128.0*oscilsize+oscilsize); | |||||
for (int i=1;i<lx;i++){ | |||||
int k2=(oscilsize*i/lx)+ph; | |||||
double y2=smps[k2%oscilsize]; | |||||
fl_vertex(i+ox,y2*ly/2.0+oy+ly/2); | |||||
if(smps) { | |||||
int lw=2; | |||||
fl_line_style(FL_SOLID,lw); | |||||
fl_begin_line(); | |||||
double ph=((phase-64.0)/128.0*oscilsize+oscilsize); | |||||
for (int i=1;i<lx;i++){ | |||||
int k2=(oscilsize*i/lx)+ph; | |||||
double y2=smps[k2%oscilsize]; | |||||
fl_vertex(i+ox,y2*ly/2.0+oy+ly/2); | |||||
} | |||||
fl_end_line(); | |||||
} | } | ||||
fl_end_line(); | |||||
fl_line_style(FL_SOLID,0); | fl_line_style(FL_SOLID,0); | ||||
} | } | ||||
@@ -1495,7 +1495,7 @@ configui=new ConfigUI(osc); | |||||
make_window(); | make_window(); | ||||
fl_open_display(); | fl_open_display(); | ||||
\#ifdef HAVE_X11 | |||||
\#ifdef __linux__ | |||||
Pixmap p = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display), | Pixmap p = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display), | ||||
(char*)zynaddsubfx_bits, zynaddsubfx_width, zynaddsubfx_height); | (char*)zynaddsubfx_bits, zynaddsubfx_width, zynaddsubfx_height); | ||||
masterwindow->icon((char *)p); | masterwindow->icon((char *)p); | ||||
@@ -519,10 +519,12 @@ static int handler_function(const char *path, const char *types, lo_arg **argv, | |||||
(void) argv; | (void) argv; | ||||
(void) argc; | (void) argc; | ||||
(void) user_data; | (void) user_data; | ||||
char buffer[2048]; | |||||
char buffer[8192]; | |||||
memset(buffer, 0, sizeof(buffer)); | memset(buffer, 0, sizeof(buffer)); | ||||
size_t size = 2048; | |||||
size_t size = sizeof(buffer); | |||||
assert(lo_message_length(msg, path) <= sizeof(buffer)); | |||||
lo_message_serialise(msg, path, buffer, &size); | lo_message_serialise(msg, path, buffer, &size); | ||||
assert(size <= sizeof(buffer)); | |||||
raiseUi(gui, buffer); | raiseUi(gui, buffer); | ||||
return 0; | return 0; | ||||
@@ -432,7 +432,7 @@ int main(int argc, char *argv[]) | |||||
if(!noui) | if(!noui) | ||||
gui = GUI::createUi(middleware->spawnUiApi(), &Pexitprogram); | gui = GUI::createUi(middleware->spawnUiApi(), &Pexitprogram); | ||||
middleware->setUiCallback(GUI::raiseUi, gui); | middleware->setUiCallback(GUI::raiseUi, gui); | ||||
middleware->setIdleCallback([](){GUI::tickUi(gui);}); | |||||
middleware->setIdleCallback([](void*){GUI::tickUi(gui);}, NULL); | |||||
if(!noui) | if(!noui) | ||||
{ | { | ||||