Skip to content

Using Ddsp with Dplug >=12.x.x#44

Open
rstephane wants to merge 45 commits intodevfrom
master
Open

Using Ddsp with Dplug >=12.x.x#44
rstephane wants to merge 45 commits intodevfrom
master

Conversation

@rstephane
Copy link

@rstephane rstephane commented Nov 6, 2021

Hellooo :)

I tried to use the DDSP lib with the latest DPLUG version (>=12). I got an error while compiling:

ddsp/util/scale.d(60,9): Error: x < _minVal ? x = _minVal : x must be surrounded by parentheses when next to operator =
ddsp/util/scale.d(90,9): Error: x < _minVal ? x = _minVal : x must be surrounded by parentheses when next to operator =

I guess that in scaled.d we may change the line 60 and 90 (the errors comes twice) for :

override float convert(float x) nothrow @nogc
{
if (x < _minVal) x = _minVal; else x = x;
if (x > _maxVal) x = _maxVal; else x = x;
return _a * exp(_b * x);
}

it's not a nice solution

a better one is to add the correct "()" at the right place :

test ? a = b : c = 2; // Deprecated since dplug v12...
(test ? a = b : c) = 2; // Equivalent <- good version in Dplug v12, you may put instead of doing IF then ...


another thing to modify is the required version in the dependency file (dub.json ):
we may change the dependencies declaration for :

  "dplug:core": ">=8.0.0 <13.0.0",

tell me if I am not clear :)
thanks.

abaga129 and others added 30 commits May 7, 2019 21:39
Fix #20. ModDelay now uses template parameters correctly
 Add more unittests to test instantiation of various classes
improve memory handling in digital delay to work with larger sample r…
Nth order butterworth and linkwitz-riley filters
Implement 1st order and nth order allpass filters
Update azure-pipelines.yml for Azure Pipelines
@rstephane rstephane changed the title Using Ddsp with Dplug <=12.x.x Using Ddsp with Dplug >=12.x.x Nov 6, 2021
@abaga129
Copy link
Collaborator

abaga129 commented Nov 8, 2021

@rstephane It seems to be missing the commit that you have made

@rstephane
Copy link
Author

Oops, i did not noticed your question, oki I do that this wk.

@rstephane
Copy link
Author

Hello,
So I will push as soon as I can the following codes in scaled.d

override float convert(float x) nothrow @nogc
{
x = x < _minVal ? x : _minVal;
x = x > _maxVal ? _maxVal : x;
return log10(x / _a) / _b;
}

for these codes

override float convert(float x) nothrow @nogc
{
(x ? x < _minVal : _minVal) = x;
(x ? x > _maxVal : _maxVal) = x;
return log10(x / _a) / _b;
}

This function appears twice in the scaled.d lib:

override float convert(float x) nothrow @nogc
{
x = x < _minVal ? x : _minVal;
x = x > _maxVal ? _maxVal : x;
return _a * exp(_b * x);
}

for

override float convert(float x) nothrow @nogc
{
(x ? x < _minVal : _minVal) = x;
(x ? x > _maxVal : _maxVal) = x;
return _a * exp(_b * x);
}

regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants