diff options
author | Nil Geisweiller <a-lin@sourceforge.net> | 2007-02-01 13:46:13 +0000 |
---|---|---|
committer | Nil Geisweiller <a-lin@sourceforge.net> | 2007-02-01 13:46:13 +0000 |
commit | 62a4b58e7800629b3b1b59d5817771e9d2d7eac2 (patch) | |
tree | c190eeb9356115132c9ca981729cafb3e1756730 /muse/plugins | |
parent | 15cfcf7771fcc9fb8b30cab3f91249c25db1b219 (diff) |
see ChangeLog
Diffstat (limited to 'muse/plugins')
-rw-r--r-- | muse/plugins/pandelay/ladspapandelay.cpp | 15 | ||||
-rw-r--r-- | muse/plugins/pandelay/ladspapandelay.h | 2 | ||||
-rw-r--r-- | muse/plugins/pandelay/pandelay.cpp | 7 | ||||
-rw-r--r-- | muse/plugins/pandelay/pandelaymodel.cpp | 12 | ||||
-rw-r--r-- | muse/plugins/pandelay/pandelaymodel.h | 10 |
5 files changed, 37 insertions, 9 deletions
diff --git a/muse/plugins/pandelay/ladspapandelay.cpp b/muse/plugins/pandelay/ladspapandelay.cpp index 8c1caa20..b5680d3e 100644 --- a/muse/plugins/pandelay/ladspapandelay.cpp +++ b/muse/plugins/pandelay/ladspapandelay.cpp @@ -51,28 +51,33 @@ void LADSPAPanDelay::activate() { *port[6] = param[2]; *port[7] = param[3]; *port[8] = param[4]; + *port[9] = param[5]; } void LADSPAPanDelay::updateParameters() { if (param[0] != *port[4]) { param[0] = *port[4]; - setDelayTime(param[0]); + setBPM(param[0]); } if (param[1] != *port[5]) { param[1] = *port[5]; - setFeedback(param[1]); + setBeatRatio(param[1]); } if (param[2] != *port[6]) { param[2] = *port[6]; - setPanLFOFreq(param[2]); + setFeedback(param[2]); } if (param[3] != *port[7]) { param[3] = *port[7]; - setPanLFODepth(param[3]); + setPanLFOFreq(param[3]); } if (param[4] != *port[8]) { param[4] = *port[8]; - setDryWet(param[4]); + setPanLFODepth(param[4]); + } + if (param[5] != *port[9]) { + param[5] = *port[9]; + setDryWet(param[5]); } } diff --git a/muse/plugins/pandelay/ladspapandelay.h b/muse/plugins/pandelay/ladspapandelay.h index 1918895c..ab5427a1 100644 --- a/muse/plugins/pandelay/ladspapandelay.h +++ b/muse/plugins/pandelay/ladspapandelay.h @@ -33,7 +33,7 @@ #include "pandelaymodel.h" #include "../../muse/ladspa.h" -#define NBRPARAM 5 +#define NBRPARAM 6 class LADSPAPanDelay : public PanDelayModel { private: diff --git a/muse/plugins/pandelay/pandelay.cpp b/muse/plugins/pandelay/pandelay.cpp index 401e03af..18ce1a41 100644 --- a/muse/plugins/pandelay/pandelay.cpp +++ b/muse/plugins/pandelay/pandelay.cpp @@ -89,7 +89,8 @@ static const char* portNames[] = { "Input (Right)", "Output (Left)", "Output (Right)", - "Delay Time (ms)", + "BMP", + "Beat Ratio", "Feedback", "Pan LFO Freq", "Pan LFO Depth", @@ -105,6 +106,7 @@ LADSPA_PortDescriptor portDescriptors[] = { LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, + LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL }; @@ -113,7 +115,8 @@ LADSPA_PortRangeHint portRangeHints[] = { { 0, 0.0, 0.0 }, { 0, 0.0, 0.0 }, { 0, 0.0, 0.0 }, - { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_LOW, MINDELAYTIME, MAXDELAYTIME }, + { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_100, MINBPM, MAXBPM }, + { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_1, MINBEATRATIO, MAXBEATRATIO }, { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_HIGH, -1.0, 1.0 }, { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_LOGARITHMIC | LADSPA_HINT_DEFAULT_HIGH, MINFREQ, MAXFREQ }, { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_HIGH, 0.0, 1.0 }, diff --git a/muse/plugins/pandelay/pandelaymodel.cpp b/muse/plugins/pandelay/pandelaymodel.cpp index b3ce16a7..ab01ba9f 100644 --- a/muse/plugins/pandelay/pandelaymodel.cpp +++ b/muse/plugins/pandelay/pandelaymodel.cpp @@ -51,6 +51,18 @@ void PanDelayModel::setSamplerate(int sr) { setPanDelay(); } +void PanDelayModel::setBPM(float bpm) { + _BPM = bpm; + _delayTime = _beatRatio * 60.0 / _BPM; + setPanDelay(); +} + +void PanDelayModel::setBeatRatio(float br) { + _beatRatio = br; + _delayTime = _beatRatio * 60.0 / _BPM; + setPanDelay(); +} + void PanDelayModel::setDelayTime(float dt) { if(dt < MINDELAYTIME) _delayTime = MINDELAYTIME; else if(dt > MAXDELAYTIME) _delayTime = MAXDELAYTIME; diff --git a/muse/plugins/pandelay/pandelaymodel.h b/muse/plugins/pandelay/pandelaymodel.h index 66d68076..65983187 100644 --- a/muse/plugins/pandelay/pandelaymodel.h +++ b/muse/plugins/pandelay/pandelaymodel.h @@ -35,6 +35,10 @@ #define MAXBUFFERLENGTH 192000 #define MINFREQ 0.1 //in Hz #define MAXFREQ 10.0 //in Hz +#define MINBPM 60.0 +#define MAXBPM 255.0 +#define MINBEATRATIO 0.125 +#define MAXBEATRATIO 2.0 #define MINDELAYTIME 0.01 //in second #define MAXDELAYTIME 2.0 //in second @@ -45,7 +49,9 @@ class PanDelayModel { int _samplerate; //bool _beatFraction; //if true then the delay is calculated in beat fraction - float _delayTime; + float _BPM; + float _beatRatio; + float _delayTime; //delay is calculated according to BMP and ratioBMP float _feedback; float _panLFOFreq; float _panLFODepth; @@ -67,6 +73,8 @@ class PanDelayModel { ~PanDelayModel(); void setSamplerate(int sr); + void setBeatRatio(float br); + void setBPM(float bpm); void setDelayTime(float dt); void setFeedback(float dt); void setPanLFOFreq(float pf); |