From ec921274a045b65bcd3412f3d114a4fe6f3b62b9 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Fri, 25 Nov 2016 11:04:52 +0100 Subject: [PATCH] Added code for setting live=false when decay of amp envelope is under a special limit. --- Makefile.juce | 310 -------------------------------------------------- src/dexed.cpp | 24 +++- src/dexed.mh | 2 +- 3 files changed, 24 insertions(+), 312 deletions(-) delete mode 100644 Makefile.juce diff --git a/Makefile.juce b/Makefile.juce deleted file mode 100644 index 4935c8a..0000000 --- a/Makefile.juce +++ /dev/null @@ -1,310 +0,0 @@ -# Automatically generated makefile, created by the Introjucer -# Don't edit this file! Your changes will be overwritten when you re-save the Introjucer project! - -# (this disables dependency generation if multiple architectures are set) -DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD) - -ifndef CONFIG - CONFIG=Debug -endif - -ifeq ($(CONFIG),Debug) - BINDIR := build - LIBDIR := build - OBJDIR := build/intermediate/Debug - OUTDIR := build - - ifeq ($(TARGET_ARCH),) - TARGET_ARCH := -march=native - endif - - CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ~/src/vstsdk2.4 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules - CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -fPIC -O0 - CXXFLAGS += $(CFLAGS) -std=c++11 - LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -Wl,--no-undefined -shared -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt - - TARGET := Dexed.so - BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) - CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR) -endif - -ifeq ($(CONFIG),Release) - BINDIR := build - LIBDIR := build - OBJDIR := build/intermediate/Release - OUTDIR := build - - ifeq ($(TARGET_ARCH),) - TARGET_ARCH := -march=native - endif - - CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ~/src/vstsdk2.4 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules - CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -Os - CXXFLAGS += $(CFLAGS) -std=c++11 - LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -Wl,--no-undefined -shared -fvisibility=hidden -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt - - TARGET := Dexed.so - BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) - CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR) -endif - -OBJECTS := \ - $(OBJDIR)/PluginFx_d84f776e.o \ - $(OBJDIR)/EngineMkI_615efdaa.o \ - $(OBJDIR)/EngineOpl_d5a0e5ea.o \ - $(OBJDIR)/PluginEditor_94d4fb09.o \ - $(OBJDIR)/CartManager_8ad0044e.o \ - $(OBJDIR)/ProgramListBox_58735432.o \ - $(OBJDIR)/ParamDialog_aca81c16.o \ - $(OBJDIR)/AlgoDisplay_895ecdd0.o \ - $(OBJDIR)/DXLookNFeel_cfc3afa2.o \ - $(OBJDIR)/DXComponents_a6963633.o \ - $(OBJDIR)/OperatorEditor_b03d363a.o \ - $(OBJDIR)/GlobalEditor_4b9bc379.o \ - $(OBJDIR)/freqlut_ca864b55.o \ - $(OBJDIR)/lfo_a7533573.o \ - $(OBJDIR)/dx7note_176ee213.o \ - $(OBJDIR)/env_9bd533bb.o \ - $(OBJDIR)/exp2_ef8e37bf.o \ - $(OBJDIR)/fm_core_963f4751.o \ - $(OBJDIR)/fm_op_kernel_f831cdd1.o \ - $(OBJDIR)/pitchenv_d3341dc7.o \ - $(OBJDIR)/sin_b36ef3f0.o \ - $(OBJDIR)/PluginProcessor_a059e380.o \ - $(OBJDIR)/PluginParam_c683be7b.o \ - $(OBJDIR)/PluginData_e9169086.o \ - $(OBJDIR)/SysexComm_f57b4ecd.o \ - $(OBJDIR)/BinaryData_ce4232d4.o \ - $(OBJDIR)/juce_audio_basics_2442e4ea.o \ - $(OBJDIR)/juce_audio_devices_a4c8a728.o \ - $(OBJDIR)/juce_audio_formats_d349f0c8.o \ - $(OBJDIR)/juce_audio_processors_44a134a2.o \ - $(OBJDIR)/juce_audio_utils_f63b12e8.o \ - $(OBJDIR)/juce_core_aff681cc.o \ - $(OBJDIR)/juce_data_structures_bdd6d488.o \ - $(OBJDIR)/juce_events_79b2840.o \ - $(OBJDIR)/juce_graphics_c8f1e7a4.o \ - $(OBJDIR)/juce_gui_basics_a630dd20.o \ - $(OBJDIR)/juce_gui_extra_7767d6a8.o \ - $(OBJDIR)/juce_PluginUtilities_e2e19a34.o \ - $(OBJDIR)/juce_VST_Wrapper_bb62e93d.o \ - $(OBJDIR)/juce_VST3_Wrapper_77e7c73b.o \ - -.PHONY: clean - -$(OUTDIR)/$(TARGET): $(OBJECTS) $(RESOURCES) - @echo Linking Dexed - -@mkdir -p $(BINDIR) - -@mkdir -p $(LIBDIR) - -@mkdir -p $(OUTDIR) - @$(BLDCMD) - -clean: - @echo Cleaning Dexed - @$(CLEANCMD) - -strip: - @echo Stripping Dexed - -@strip --strip-unneeded $(OUTDIR)/$(TARGET) - -$(OBJDIR)/PluginFx_d84f776e.o: ../../Source/PluginFx.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling PluginFx.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/EngineMkI_615efdaa.o: ../../Source/EngineMkI.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling EngineMkI.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/EngineOpl_d5a0e5ea.o: ../../Source/EngineOpl.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling EngineOpl.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/PluginEditor_94d4fb09.o: ../../Source/PluginEditor.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling PluginEditor.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/CartManager_8ad0044e.o: ../../Source/CartManager.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling CartManager.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/ProgramListBox_58735432.o: ../../Source/ProgramListBox.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling ProgramListBox.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/ParamDialog_aca81c16.o: ../../Source/ParamDialog.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling ParamDialog.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/AlgoDisplay_895ecdd0.o: ../../Source/AlgoDisplay.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling AlgoDisplay.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/DXLookNFeel_cfc3afa2.o: ../../Source/DXLookNFeel.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling DXLookNFeel.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/DXComponents_a6963633.o: ../../Source/DXComponents.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling DXComponents.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/OperatorEditor_b03d363a.o: ../../Source/OperatorEditor.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling OperatorEditor.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/GlobalEditor_4b9bc379.o: ../../Source/GlobalEditor.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling GlobalEditor.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/freqlut_ca864b55.o: ../../Source/msfa/freqlut.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling freqlut.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/lfo_a7533573.o: ../../Source/msfa/lfo.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling lfo.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/dx7note_176ee213.o: ../../Source/msfa/dx7note.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling dx7note.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/env_9bd533bb.o: ../../Source/msfa/env.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling env.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/exp2_ef8e37bf.o: ../../Source/msfa/exp2.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling exp2.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/fm_core_963f4751.o: ../../Source/msfa/fm_core.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling fm_core.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/fm_op_kernel_f831cdd1.o: ../../Source/msfa/fm_op_kernel.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling fm_op_kernel.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/pitchenv_d3341dc7.o: ../../Source/msfa/pitchenv.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling pitchenv.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/sin_b36ef3f0.o: ../../Source/msfa/sin.cc - -@mkdir -p $(OBJDIR) - @echo "Compiling sin.cc" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/PluginProcessor_a059e380.o: ../../Source/PluginProcessor.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling PluginProcessor.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/PluginParam_c683be7b.o: ../../Source/PluginParam.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling PluginParam.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/PluginData_e9169086.o: ../../Source/PluginData.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling PluginData.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/SysexComm_f57b4ecd.o: ../../Source/SysexComm.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling SysexComm.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/BinaryData_ce4232d4.o: ../../JuceLibraryCode/BinaryData.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling BinaryData.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_audio_basics_2442e4ea.o: ../../JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_audio_basics.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_audio_devices_a4c8a728.o: ../../JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_audio_devices.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_audio_formats_d349f0c8.o: ../../JuceLibraryCode/modules/juce_audio_formats/juce_audio_formats.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_audio_formats.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_audio_processors_44a134a2.o: ../../JuceLibraryCode/modules/juce_audio_processors/juce_audio_processors.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_audio_processors.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_audio_utils_f63b12e8.o: ../../JuceLibraryCode/modules/juce_audio_utils/juce_audio_utils.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_audio_utils.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_core_aff681cc.o: ../../JuceLibraryCode/modules/juce_core/juce_core.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_core.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_data_structures_bdd6d488.o: ../../JuceLibraryCode/modules/juce_data_structures/juce_data_structures.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_data_structures.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_events_79b2840.o: ../../JuceLibraryCode/modules/juce_events/juce_events.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_events.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_graphics_c8f1e7a4.o: ../../JuceLibraryCode/modules/juce_graphics/juce_graphics.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_graphics.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_gui_basics_a630dd20.o: ../../JuceLibraryCode/modules/juce_gui_basics/juce_gui_basics.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_gui_basics.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_gui_extra_7767d6a8.o: ../../JuceLibraryCode/modules/juce_gui_extra/juce_gui_extra.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_gui_extra.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_PluginUtilities_e2e19a34.o: ../../JuceLibraryCode/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_PluginUtilities.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_VST_Wrapper_bb62e93d.o: ../../JuceLibraryCode/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_VST_Wrapper.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - -$(OBJDIR)/juce_VST3_Wrapper_77e7c73b.o: ../../JuceLibraryCode/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling juce_VST3_Wrapper.cpp" - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - --include $(OBJECTS:%.o=%.d) diff --git a/src/dexed.cpp b/src/dexed.cpp index b06c5e9..e65653f 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -328,9 +328,31 @@ void Dexed::run (uint32_t sample_count) void Dexed::GetSamples(int n_samples, float *buffer) { int i; + VoiceStatus vs; + + for(i=0;i < MAX_ACTIVE_NOTES;i++) { + if(voices[i].live==true &&voices[i].keydown==false) + { + uint8_t op_amp=0; + + voices[i].dx7_note->peekVoiceStatus(vs); + + for(int op=0;op<6;op++) + { + TRACE("Voice[%2d] OP [%d] amp=%ld,amp_step=%d,pitch_step=%d",i,op,vs.amp[op],vs.ampStep[op],vs.pitchStep); + + if(vs.amp[op]<=1069) + op_amp++; + + } + if(op_amp==6) + voices[i].live=false; + } + TRACE("Voice[%2d] live=%d keydown=%d",i,voices[i].live,voices[i].keydown); + } + if ( refreshVoice ) { for(i=0;i < MAX_ACTIVE_NOTES;i++) { - TRACE("Voice[%d] live=%d keydown=%d",i,voices[i].live,voices[i].keydown); if ( voices[i].live ) voices[i].dx7_note->update(data, voices[i].midi_note, feedback_bitdepth); } diff --git a/src/dexed.mh b/src/dexed.mh index 4a6c644..ae6a18f 100644 --- a/src/dexed.mh +++ b/src/dexed.mh @@ -1,5 +1,5 @@ add https://github.com/dcoredump/dexed.lv2 0 -add http://gareus.org/oss/lv2/stepseq#s4n4 1 +add http://gareus.org/oss/lv2/stepseq#s8n8 1 connect effect_1:midiout effect_0:midi_in connect effect_0:audio_out system:playback_1 connect effect_0:audio_out system:playback_2