commit ddc646792d0f0f4557d08db0a8055c968c6b1c12
parent c48ea3fece779ec8009909b0b2c0dd40d47200b4
Author: fundamental <[email protected]>
Date: Sun, 9 May 2010 16:32:25 -0400
Merge branch 'master' of ssh://zynaddsubfx.git.sourceforge.net/gitroot/zynaddsubfx/zynaddsubfx
Diffstat:
10 files changed, 11 insertions(+), 228 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -175,7 +175,6 @@ set(NONGUI_LIBRARIES
zynaddsubfx_params
zynaddsubfx_dsp
zynaddsubfx_samples
- zynaddsubfx_controls
)
set(CXXTEST_LINK_LIBS ${NONGUI_LIBRARIES})
@@ -183,7 +182,6 @@ set(MIDIINPUT_LIBRARIES "")
add_subdirectory(Misc)
add_subdirectory(Input)
-add_subdirectory(Controls)
add_subdirectory(Synth)
add_subdirectory(Output)
add_subdirectory(Seq)
diff --git a/src/Controls/CMakeLists.txt b/src/Controls/CMakeLists.txt
@@ -1,8 +0,0 @@
-set(zynaddsubfx_controls_SRCS
- Control.cpp
- DelayCtl.cpp
-)
-
-add_library(zynaddsubfx_controls STATIC
- ${zynaddsubfx_controls_SRCS}
- )
diff --git a/src/Controls/Control.cpp b/src/Controls/Control.cpp
@@ -1,40 +0,0 @@
-/*
- ZynAddSubFX - a software synthesizer
-
- Control.cpp - Control base class
- Copyright (C) 2009-2009 Mark McCurry
- Author: Mark McCurry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License
- as published by the Free Software Foundation.
-
- 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 General Public License (version 2 or later) for more details.
-
- You should have received a copy of the GNU General Public License (version 2)
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-#include "Control.h"
-
-Control::Control(char ndefaultval)
- :defaultval(ndefaultval), lockqueue(-1), locked(false)
-{}
-
-void Control::lock()
-{
- locked = true;
- lockqueue = -1;
-}
-
-void Control::ulock()
-{
- if(locked && (lockqueue >= 0))
- setmVal(lockqueue);
- locked = false;
-}
-
diff --git a/src/Controls/Control.h b/src/Controls/Control.h
@@ -1,58 +0,0 @@
-/*
- ZynAddSubFX - a software synthesizer
-
- Control.h - Control base class
- Copyright (C) 2009-2009 Mark McCurry
- Author: Mark McCurry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License
- as published by the Free Software Foundation.
-
- 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 General Public License (version 2 or later) for more details.
-
- You should have received a copy of the GNU General Public License (version 2)
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-#ifndef CONTROL_H
-#define CONTROL_H
-#include <string>
-/**A control for a parameter within the program*/
-class Control
-{
- public:
- Control(char ndefaultval); /**\todo create proper initialization list*/
- ~Control() {}
- /**Return the string, which represents the internal value
- * @return a string representation of the current value*/
- virtual std::string getString() const = 0;
- /**Set the Control to the given value
- * @param nval A number 0-127*/
- virtual void setmVal(char nval) = 0;
- /**Return the midi value (aka the char)
- * @return the current value*/
- virtual char getmVal() const = 0;
- /** Will lock the Control until it is ulocked
- *
- * Locking a Control will Stop it from having
- * its internal data altered*/
- void lock();
- /** Will unlock the Control
- *
- * This will also update the Control
- * if something attempted to update it while it was locked*/
- void ulock();
- private:
- char defaultval; /**<Default value of the Control*/
- char lockqueue; /**<The value is that is stored, while the Control is locked
- * and something attempts to update it*/
- bool locked; //upgrade this to a integer lock level if problems occur
-};
-
-#endif
-
diff --git a/src/Controls/DelayCtl.cpp b/src/Controls/DelayCtl.cpp
@@ -1,51 +0,0 @@
-/*
- ZynAddSubFX - a software synthesizer
-
- DelayCtl.cpp - Control For Delays
- Copyright (C) 2009-2009 Mark McCurry
- Author: Mark McCurry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License
- as published by the Free Software Foundation.
-
- 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 General Public License (version 2 or later) for more details.
-
- You should have received a copy of the GNU General Public License (version 2)
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-#include "DelayCtl.h"
-#include <sstream>
-
-DelayCtl::DelayCtl()
- :Control(64), value(64 / 127.0 * 1.5) {} /**\todo finishme*/
-
-std::string DelayCtl::getString() const
-{
- std::ostringstream buf;
- buf << value;
- return buf.str() + " Seconds";
-}
-
-void DelayCtl::setmVal(char nval)
-{
- /**\todo add locking code*/
- //value=1+(int)(nval/127.0*SAMPLE_RATE*1.5);//0 .. 1.5 sec
- value = (nval / 127.0 * 1.5); //0 .. 1.5 sec
-}
-
-char DelayCtl::getmVal() const
-{
- return (char)(value / 1.5 * 127.0);
-}
-
-float DelayCtl::getiVal() const
-{
- return value;
-}
-
diff --git a/src/Controls/DelayCtl.h b/src/Controls/DelayCtl.h
@@ -1,43 +0,0 @@
-/*
- ZynAddSubFX - a software synthesizer
-
- DelayCtl.h - Control For Delays
- Copyright (C) 2009-2009 Mark McCurry
- Author: Mark McCurry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License
- as published by the Free Software Foundation.
-
- 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 General Public License (version 2 or later) for more details.
-
- You should have received a copy of the GNU General Public License (version 2)
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-#include "Control.h"
-
-#ifndef DELAYCTL_H
-#define DELAYCTL_H
-/**A Control for Delays
- *
- * Will vary from 0 seconds to 1.5 seconds*/
-class DelayCtl:public Control
-{
- public:
- DelayCtl();
- ~DelayCtl() {}
- std::string getString() const;
- void setmVal(char nval);
- char getmVal() const;
- float getiVal() const;
- private:
- float value;
-};
-
-#endif
-
diff --git a/src/Controls/Makefile b/src/Controls/Makefile
@@ -1,14 +0,0 @@
-include ../Makefile.inc
-
-objects=Control.o DelayCtl.o
-
-
-all: $(objects)
-
--include ../Make.deps
-
-.PHONY : clean
-clean:
- rm -f $(objects)
- rm -f makeinclude.deps
-
diff --git a/src/Effects/Echo.cpp b/src/Effects/Echo.cpp
@@ -31,9 +31,9 @@ Echo::Echo(const int &insertion_,
REALTYPE *const efxoutl_,
REALTYPE *const efxoutr_)
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0),
- Pvolume(50), Ppanning(64), //Pdelay(60),
+ Pvolume(50), Ppanning(64), Pdelay(60),
Plrdelay(100), Plrcross(100), Pfb(40), Phidamp(60),
- delayTime(1), lrdelay(0),
+ delayTime(1), lrdelay(0), avgDelay(0),
delay(new REALTYPE[(int)(MAX_DELAY * SAMPLE_RATE)],
new REALTYPE[(int)(MAX_DELAY * SAMPLE_RATE)]),
old(0.0), pos(0), delta(1), ndelta(1)
@@ -70,10 +70,10 @@ void Echo::initdelays()
{
cleanup();
//number of seconds to delay left chan
- float dl = delayCtl.getiVal() - lrdelay;
+ float dl = avgDelay - lrdelay;
//number of seconds to delay right chan
- float dr = delayCtl.getiVal() + lrdelay;
+ float dr = avgDelay + lrdelay;
ndelta.l() = max(1,(int) (dl * SAMPLE_RATE));
ndelta.r() = max(1,(int) (dr * SAMPLE_RATE));
@@ -140,9 +140,8 @@ void Echo::setpanning(unsigned char Ppanning)
void Echo::setdelay(unsigned char Pdelay)
{
- delayCtl.setmVal(Pdelay);
- //this->Pdelay=Pdelay;
- //delay=1+(int)(Pdelay/127.0*SAMPLE_RATE*1.5);//0 .. 1.5 sec
+ this->Pdelay=Pdelay;
+ avgDelay=(Pdelay/127.0*1.5);//0 .. 1.5 sec
initdelays();
}
@@ -250,7 +249,7 @@ unsigned char Echo::getpar(int npar) const
return Ppanning;
break;
case 2:
- return delayCtl.getmVal();
+ return Pdelay;
break;
case 3:
return Plrdelay;
diff --git a/src/Effects/Echo.h b/src/Effects/Echo.h
@@ -27,7 +27,6 @@
#include "Effect.h"
#include "../Misc/Stereo.h"
#include "../Samples/Sample.h"
-#include "../Controls/DelayCtl.h"
/**Echo Effect*/
class Echo:public Effect
@@ -102,7 +101,7 @@ class Echo:public Effect
//Parameters
char Pvolume; /**<#1 Volume or Dry/Wetness*/
char Ppanning; /**<#2 Panning*/
- DelayCtl delayCtl; /**<#3 Delay of the Echo*/
+ char Pdelay; /**<#3 Delay of the Echo*/
char Plrdelay; /**<#4 L/R delay difference*/
char Plrcross; /**<#5 L/R Mixing*/
char Pfb; /**<#6Feedback*/
@@ -120,7 +119,8 @@ class Echo:public Effect
REALTYPE panning, lrcross, fb, hidamp;
//Left/Right delay lengths
Stereo<int> delayTime;
- float lrdelay;
+ REALTYPE lrdelay;
+ REALTYPE avgDelay;
void initdelays();
//2 channel ring buffer
diff --git a/src/Makefile b/src/Makefile
@@ -77,7 +77,7 @@ endif
objects=main.o
-SUBDIRS=Controls DSP Effects Input Misc Output Params Samples Synth Seq
+SUBDIRS=DSP Effects Input Misc Output Params Samples Synth Seq
.PHONY: subdirs $(SUBDIRS)