Login / Register 0 items | $0.00 New @ KVR
User avatar
Guillaume Piolat
KVRist
 
152 posts since 21 Sep, 2015, from Grenoble

Postby Guillaume Piolat; Tue Apr 03, 2018 5:45 am Dplug got AAX Support

Some news about Dplug, which is a library for creating native audio plugins (AAX / AU / VST2), for Windows, macOS and Linux.

https://github.com/AuburnSounds/Dplug

Latest news:
A full account of technical limitations (debt) is available from the bug-tracker.

Why use Dplug?
Dplug has a bug-tracker, a changelog, a roadmap, a stability guarantee (SemVer), and is supported by product sales => unlimited shelf life. It has a commitment to "quality of life", so you won't have to deal with: resource compilers, IDE project files, Xcode, Info.plist, macOS SDKs.
User avatar
syntonica
KVRist
 
374 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Tue Apr 03, 2018 8:50 am Re: Dplug got AAX Support

Thanks, Guillaume!

A few quick questions from someone who's kind of poking this with a stick to see if he likes it:

Which IDE do you recommend? I develop on a Mac, but I'm not especially enamored of Xcode.

I do all my own GUI drawing using primitives (rect, arc, line and text) and handle my own redrawing of dirty components. Is this easily done?

How good is debug support? I'm having a hell of a time trying to get debugging going in Windows right now. I just need step debugging and state inspection. Nothing fancy. ;)

The majority of my code is C++, including GUI drawing, so I'd like to just be able to copy and paste it and then D-ify it, as it were. (Still have to learn D.)
User avatar
Guillaume Piolat
KVRist
 
152 posts since 21 Sep, 2015, from Grenoble

Postby Guillaume Piolat; Tue Apr 03, 2018 10:00 am Re: Dplug got AAX Support

syntonica wrote:Which IDE do you recommend? I develop on a Mac, but I'm not especially enamored of Xcode.


To my knowledge current users do most development in Visual Studio with the VisualD add-on, and we debug within Visual Studio or with lldb on macOS.

On macOS, I don't think you can use Xcode, but some use VSCode with one of the D plug-ins.
I've tried to make the macOS debugging story better, but failed to install the "native-debug" VSCode plug-in and left there (I kind of like lldb for the text output). It's probably possible to succeed in this.

syntonica wrote:I do all my own GUI drawing using primitives (rect, arc, line and text) and handle my own redrawing of dirty components. Is this easily done?


dplug:graphics can draw rectangles, arcs, lines and text so you can look there to help translate.
You can use whatever CPU routines you prefer while drawing your own widgets, Dplug uses an Image "concept".

How dirtiness work in Dplug : there is one global list of (possibly overlapping) rectangles, assembled from many threads.

What an UIElement has is :
A) A way to invalidate a whole or part of its position rect.
B) a redraw() method which takes several (non-overlapping) rectangles within the widget position rect, that have to be updated (and not the rest of the widget). This part probably don't match yours.

syntonica wrote:How good is debug support? I'm having a hell of a time trying to get debugging going in Windows right now. I just need step debugging and state inspection. Nothing fancy. ;)


You can generate a VisualD .sln project using
Code: Select all
dub generate visuald
. From there it's like in C++ you press F5 to debug. There are two available debuggers: Mago and the Visual Studio one, sometimes one work better than the other. :wink:

syntonica wrote:The majority of my code is C++, including GUI drawing, so I'd like to just be able to copy and paste it and then D-ify it, as it were. (Still have to learn D.)


It's much harder than that :? Translations are a special kind of hell.

Dplug disable the D runtime and use a restricted subset (else each incoming thread would have to be "attached"). All your translated code will need to be
Code: Select all
nothrow @nogc
. There is a Wiki article on that topic.

There is an automatic translator in VisualD, I've never used it and I expect it would still need pampering.
There are also ways to link with C++, you could define extern(C++) signatures in the D code, and link with object code but this is risky and I would avoid even trying.

Most practical(?) would be to derive UIElement once, for an adapter to your own UI widget abstraction. And your own widgets would inherit from that.

There is also the prettier solution of not using "dplug:gui" at all, and rewrite a "GUIGraphics" equivalent: this is the bridge between windowing and the UI widget systems.
You would have to implement "IGraphics", and instantiate your own subclass in your plugin client instead of a "GUIGraphics". The more I think of it, the more adequate it seems because you don't have to care about whatever Dplug does with its widgets. But more involved.
User avatar
syntonica
KVRist
 
374 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Tue Apr 03, 2018 10:32 am Re: Dplug got AAX Support

Guillaume Piolat wrote:
syntonica wrote:Which IDE do you recommend? I develop on a Mac, but I'm not especially enamored of Xcode.


To my knowledge current users do most development in Visual Studio with the VisualD add-on, and we debug within Visual Studio or with lldb on macOS.

On macOS, I don't think you can use Xcode, but some use VSCode with one of the D plug-ins.
I've tried to make the macOS debugging story better, but failed to install the "native-debug" VSCode plug-in and left there (I kind of like lldb for the text output). It's probably possible to succeed in this.

syntonica wrote:I do all my own GUI drawing using primitives (rect, arc, line and text) and handle my own redrawing of dirty components. Is this easily done?


dplug:graphics can draw rectangles, arcs, lines and text so you can look there to help translate.
You can use whatever CPU routines you prefer while drawing your own widgets, Dplug uses an Image "concept".

How dirtiness work in Dplug : there is one global list of (possibly overlapping) rectangles, assembled from many threads.

What an UIElement has is :
A) A way to invalidate a whole or part of its position rect.
B) a redraw() method which takes several (non-overlapping) rectangles within the widget position rect, that have to be updated (and not the rest of the widget). This part probably don't match yours.

syntonica wrote:How good is debug support? I'm having a hell of a time trying to get debugging going in Windows right now. I just need step debugging and state inspection. Nothing fancy. ;)


You can generate a VisualD .sln project using
Code: Select all
dub generate visuald
. From there it's like in C++ you press F5 to debug. There are two available debuggers: Mago and the Visual Studio one, sometimes one work better than the other. :wink:

syntonica wrote:The majority of my code is C++, including GUI drawing, so I'd like to just be able to copy and paste it and then D-ify it, as it were. (Still have to learn D.)


It's much harder than that :? Translations are a special kind of hell.

Dplug disable the D runtime and use a restricted subset (else each incoming thread would have to be "attached"). All your translated code will need to be
Code: Select all
nothrow @nogc
. There is a Wiki article on that topic.

There is an automatic translator in VisualD, I've never used it and I expect it would still need pampering.
There are also ways to link with C++, you could define extern(C++) signatures in the D code, and link with object code but this is risky and I would avoid even trying.

Most practical(?) would be to derive UIElement once, for an adapter to your own UI widget abstraction. And your own widgets would inherit from that.

There is also the prettier solution of not using "dplug:gui" at all, and rewrite a "GUIGraphics" equivalent: this is the bridge between windowing and the UI widget systems.
You would have to implement "IGraphics", and instantiate your own subclass in your plugin client instead of a "GUIGraphics". The more I think of it, the more adequate it seems because you don't have to care about whatever Dplug does with its widgets. But more involved.

Wow! That was way more of an answer than I could hope for.

I think since I just use five different widgets, I can just add them to the other widgets.

I'll give VS for Mac a go, looking atVisualD.

As for translating my code, it'll just make me learn D. ;)
User avatar
Guillaume Piolat
KVRist
 
152 posts since 21 Sep, 2015, from Grenoble

Postby Guillaume Piolat; Tue Apr 03, 2018 10:41 am Re: Dplug got AAX Support

Oh I had assumed there was a lot of code.
Anyway be sure to read this: https://github.com/AuburnSounds/Dplug/w ... nvironment it will be a rough ride anyway but less rough with this info.
User avatar
syntonica
KVRist
 
374 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Tue Apr 03, 2018 2:34 pm Re: Dplug got AAX Support

Guillaume Piolat wrote:Oh I had assumed there was a lot of code.
Anyway be sure to read this: https://github.com/AuburnSounds/Dplug/w ... nvironment it will be a rough ride anyway but less rough with this info.


I got it working and compiled the VST and AU versions of the distort plugin. It took lots of homebrew (both digital and actual :wink:), some hand waving and a little CLI, but it all seems to work in VS Code.

Now I need to see if I can debug... Wish me luck!
User avatar
syntonica
KVRist
 
374 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Wed Apr 04, 2018 1:38 am Re: Dplug got AAX Support

Sadly, I cannot find a working debug solution on the Mac. VSCode refuses to spin up the debugger as Attach to PID. :evil: Every other solution I tried is severely broken...
User avatar
Guillaume Piolat
KVRist
 
152 posts since 21 Sep, 2015, from Grenoble

Postby Guillaume Piolat; Wed Apr 04, 2018 1:43 am Re: Dplug got AAX Support

Mmm, transmitting to those concerned.

Moderator: Moderators (Main)

Return to DSP and Plug-in Development