summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Arndt2024-04-12 00:32:04 +0200
committerChristopher Arndt2024-04-12 00:32:04 +0200
commit8fa04b43bc4e3bcd52afc7ffc2741d1f7ccb12a7 (patch)
tree69cf00913baab05497eab99751e4e50e3c2d17cd
parent37b7da42da5d4b663bb80c92ee8667c36bd006e3 (diff)
downloadaur-8fa04b43bc4e3bcd52afc7ffc2741d1f7ccb12a7.tar.gz
Remove `units:render' from custom units since it confuses Ardour
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--polyphony-param.patch95
3 files changed, 90 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 01bf0b8fde49..7a9ce57bd755 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mod-mda-lv2-git
pkgdesc = MOD fork of the LV2 port of the MDA plugins (git version)
pkgver = 1.1.0.r217.b2df88c
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/moddevices/mda-lv2
arch = x86_64
groups = lv2-plugins
@@ -22,6 +22,6 @@ pkgbase = mod-mda-lv2-git
source = polyphony-param.patch
sha256sums = SKIP
sha256sums = d65b3202225da4bb57611ec0f53b038386ae3f58d91fdbc7502c1ab032e62e80
- sha256sums = 8f7f61df6823d9f501d098acad4987b632d8ef2cfd9f4c819e0b548025dfbe04
+ sha256sums = ca15c7b115f73e0ddca0c7835e3bcb874747130a465c1e994a7187f4efca4b24
pkgname = mod-mda-lv2-git
diff --git a/PKGBUILD b/PKGBUILD
index f084281fd8d9..bf3f5403e3e9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_pkgname=mod-mda-lv2
pkgname=$_pkgname-git
pkgver=1.1.0.r217.b2df88c
-pkgrel=3
+pkgrel=4
pkgdesc='MOD fork of the LV2 port of the MDA plugins (git version)'
arch=(x86_64)
url='https://github.com/moddevices/mda-lv2'
@@ -20,7 +20,7 @@ source=("$_pkgname::git+https://github.com/moddevices/mda-lv2.git"
'polyphony-param.patch')
sha256sums=('SKIP'
'd65b3202225da4bb57611ec0f53b038386ae3f58d91fdbc7502c1ab032e62e80'
- '8f7f61df6823d9f501d098acad4987b632d8ef2cfd9f4c819e0b548025dfbe04')
+ 'ca15c7b115f73e0ddca0c7835e3bcb874747130a465c1e994a7187f4efca4b24')
pkgver() {
cd $_pkgname
diff --git a/polyphony-param.patch b/polyphony-param.patch
index 07f5e060bce5..cfec9ebdba2d 100644
--- a/polyphony-param.patch
+++ b/polyphony-param.patch
@@ -1,8 +1,8 @@
diff --git a/bundles/mod-mda-EPiano.lv2/EPiano.ttl b/bundles/mod-mda-EPiano.lv2/EPiano.ttl
-index b9d6652..31b8f13 100644
+index b9d6652..d6dfd27 100644
--- a/bundles/mod-mda-EPiano.lv2/EPiano.ttl
+++ b/bundles/mod-mda-EPiano.lv2/EPiano.ttl
-@@ -130,13 +130,18 @@ Rhodes© Pianos are a trademark or trade name of another manufacturer and were u
+@@ -130,13 +130,17 @@ Rhodes© Pianos are a trademark or trade name of another manufacturer and were u
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 8 ;
@@ -22,8 +22,7 @@ index b9d6652..31b8f13 100644
+ units:unit [
+ a units:Unit ;
+ rdfs:label "voice" ;
-+ units:symbol "vox" ;
-+ units:render "%d voices"
++ units:symbol "vox"
+ ]
] , [
a lv2:InputPort ,
@@ -97,10 +96,10 @@ index c06a33d..f5e836c 100644
] .
-
diff --git a/bundles/mod-mda-Piano.lv2/Piano.ttl b/bundles/mod-mda-Piano.lv2/Piano.ttl
-index 3cbace0..a1d2b15 100644
+index 3cbace0..5faf23d 100644
--- a/bundles/mod-mda-Piano.lv2/Piano.ttl
+++ b/bundles/mod-mda-Piano.lv2/Piano.ttl
-@@ -145,16 +145,15 @@ Modeled by MDA
+@@ -145,16 +145,14 @@ Modeled by MDA
lv2:index 8 ;
lv2:name "Polyphony" ;
lv2:symbol "polyphony" ;
@@ -120,9 +119,8 @@ index 3cbace0..a1d2b15 100644
+ lv2:maximum 32 ;
+ units:unit [
+ a units:Unit ;
-+ rdfs:label "vox" ;
-+ units:symbol "voices" ;
-+ units:render "%d voices"
++ rdfs:label "voices" ;
++ units:symbol "vox"
]
] , [
a lv2:InputPort ,
@@ -210,6 +208,58 @@ diff --git a/lvz/wrapper.cpp b/lvz/wrapper.cpp
index 34bd836..3db5b34 100644
--- a/lvz/wrapper.cpp
+++ b/lvz/wrapper.cpp
+@@ -49,7 +49,7 @@
+ // para valores de 0 a 1, pois o código do mda foi projetado para trabalhar com esses valores
+
+
+-float translateParameter(PLUGIN_CLASS* effect,int port,float value,bool inverted) {
++float translateParameter(PLUGIN_CLASS* effect,int port,float value,bool inverted) {
+ if(strcmp(effect->getUniqueID(), "mdaAmb") == 0) {
+ switch(port) {
+ case 0:
+@@ -224,17 +224,17 @@ float translateParameter(PLUGIN_CLASS* effect,int port,float value,bool inverted
+ }
+ }
+ else if(strcmp(effect->getUniqueID(), "mdaDX10") == 0) {
+- /*
+- Scaling process is convoluted but here is an explanation,
++ /*
++ Scaling process is convoluted but here is an explanation,
+ but just plugging through a bunch of values would make the presets not work:
+-
++
+ All envelope time based parameters are implemented as a recursive equation within the synth.
+ This means that at each sample it calculated something along the lines of: env_volume = env_volume * 0.999...
+ Here the 0.999... parameter is a decayparameter which will be explained later, for now let's call it dec.
+ The volume over time can then be found as: amp = dec^[n_samples].
+ Thus the decay time can be found when subsituting a "silence ratio" for amp, in this case -60db -> 0.001.
+- This gives n_samples = log_{dec}(amp) or in c++ terms: log(0.001)/log(dec). (as log_a(b) = log(b)/log(a))
+-
++ This gives n_samples = log_{dec}(amp) or in c++ terms: log(0.001)/log(dec). (as log_a(b) = log(b)/log(a))
++
+ Now the host provides the value as a linear interpolation from min to max, no matter if you specify it as logarithmic.
+ F.Y.I. the scaling they use for logarithmic is min*e^(x * ln(max/min)) where x = [0,1].
+ The different time parameters have different equations for how they calculate the parameters:
+@@ -245,7 +245,7 @@ float translateParameter(PLUGIN_CLASS* effect,int port,float value,bool inverted
+ - Modulator Release = exp( -(1/samplerate) * exp(5-8x) )
+ However these map exactly to the way the logarithmic parameter mapping in the host works.
+ Given that the output needs to be scaled the same way we can solve the equation for x given a value between min and max:
+- value = min*e^(x * ln(max/min)) -> x = ln(value/min)/ln(max/min).
++ value = min*e^(x * ln(max/min)) -> x = ln(value/min)/ln(max/min).
+ Put this value in the equation and it should return the correct value for x for the time parameter.
+ However some parameters have insanely long times so there is some additional stretching going on for the last ten percent of the range.
+ */
+@@ -254,8 +254,8 @@ float translateParameter(PLUGIN_CLASS* effect,int port,float value,bool inverted
+ return inverted ? 2.5*expf(value * logf(4000.f/2.5)) : logf(value/2.5)/logf(4000.f/2.5);
+ //return inverted ? value*100 : value/(100);
+ case(1):
+- /*
+- carrier decay times range from ~45ms to ~135 seconds
++ /*
++ carrier decay times range from ~45ms to ~135 seconds
+ so in order to make it useful some stretching is applied to the value input for 6s to 7s to make it stretch
+ stretching should happen from 6000ms to 7000ms value input
+ log(6000/46.5)/log(7000/46.5) = ~0.97
@@ -412,7 +412,7 @@ float translateParameter(PLUGIN_CLASS* effect,int port,float value,bool inverted
case(7):
return inverted ? value*200 : value/(200);
@@ -249,6 +299,15 @@ index 6684e98..79a6b9a 100644
setProgram(0);
}
+@@ -127,7 +127,7 @@ mdaEPiano::mdaEPiano(audioMasterCallback audioMaster) : AudioEffectX(audioMaster
+
+ //initialise...
+ memset(voice, 0, sizeof(voice));
+- for(int32_t v=0; v<NVOICES; v++)
++ for(int32_t v=0; v<NVOICES; v++)
+ {
+ voice[v].env = 0.0f;
+ voice[v].dec = 0.99f; //all notes off
@@ -163,7 +163,7 @@ void mdaEPiano::update() //parameter change
if(param[6] < 0.25f) velsens -= 0.75f - 3.0f * param[6];
@@ -267,3 +326,21 @@ index 6684e98..79a6b9a 100644
case 9: strcpy(label, "Fine Tuning"); break;
case 10: strcpy(label, "Random Tuning"); break;
+@@ -408,7 +408,7 @@ void mdaEPiano::processReplacing(float **inputs, float **outputs, int32_t sample
+
+ if(frame<sampleFrames)
+ {
+- if(activevoices == 0 && programs[curProgram].param[4] > 0.5f)
++ if(activevoices == 0 && programs[curProgram].param[4] > 0.5f)
+ { lfo0 = -0.7071f; lfo1 = 0.7071f; } //reset LFO phase - good idea?
+
+ if (!end) {
+@@ -541,7 +541,7 @@ int32_t mdaEPiano::processEvent(const LV2_Atom_Event* ev)
+ sustain = midiData[2] & 0x40;
+ if(sustain==0)
+ {
+- noteOn(SUSTAIN, 0); //end all sustained notes
++ noteOn(SUSTAIN, 0); //end all sustained notes
+ }
+ break;
+