 So, hello everyone. I'm doing a small workshop about making plugins and making plugins specifically with DPF and First of all If you're here, you probably know what the plugin is right I hope so and You probably know there's different types of plugins. There's Simple audio effects that just get audio applies some effect and I'll put some audio. There's MIDI filters There's synthesizers to take MIDI and produce some other audio without audio input stuff like that and You probably need to know there's different formats, you know, there's lots, but there's DSSI. There's LB to their VST And then you can also have standalone some things like that And I want to talk about why I made DPF When I was starting to make plugins there was kind of Several formats I needed to support at the same time LV2 was still a new thing. So a lot of hosts still support Latspar not not all hosts support LV2 and And it's still kind of the same situation today most Most hosts don't support LV2 yet quite often now supports VST. I Also had to repeat The same code for every plugin like if I want to support MIDI in LV2 I have to support the atoms everything like that if I want to support time position to get to know where what's to be PM what's Well, the host information about the tempo I need every single time to have that specific code and It's time-consuming and it's repeated in all of the single plugins well Sometimes it is not always easy to understand and documentation Sometimes it's also not clear enough especially for the VST There's always some confusion between the developers Well, it's a bit a little bit messy Especially on Latspar and LV2 and Linux APIs There's usually not high-level C++ abstractions Like a C++ class that I can just use and then get a plugin right away and well There are already some projects that do things like this like the juice and I plug But some of them don't support Linux Some of them support Linux but not so great and Well, in the case of juice, it doesn't have a liberal license So if you want to make a commercial plugin you have to buy an expensive license And Also, there's issues with the VST SDK because it's not compatible with GPL So if you want to release a VST plugin using GPL code Some people don't don't like the situation so These are the main reasons why I made DPS on DPS There's no VST the STK issues because I don't actually use the STK. I Use the free header and then some custom code to handle everything that is needed on DPS you have a Very simple. It's limited on purpose I don't want to support everything to make a big mess of it and it's a C++ API as simple as possible It exports different plugin formats right now. There's Latspar, DSSI, LV2, VST And also a Jack standalone mode. It's easy for testing There's UI support built-in in this case is using Puggle that a lot of people are liking right now the OpenGL Variant I made some classes to make the beginning a bit easier Everything regarding atoms regarding connect port regarding VST stuff everything is hidden away you only have the simple API to work with and then your plugin is ready and Well, this is also a nice thing. It's cross-platform not only you can build it on Linux you can also build it on macOS and Windows and Recently I know that it works on free VST so it should work If it has x11 it should work there There's a couple things that DPF cannot do in this case the complex buses setup if you have like There's some complex spatial Setup I don't want to support it. I just want some more kind of simple plugins Because every API is different and LV2 doesn't support buses yet The like extra ports dynamically So maybe for the future, but yes He asked about sidechain there is a sidechain already in there a sidechain property for a audio port But besides that's nothing else For Example if you if you have a plugin that can work on mono stereo surround Some weird setup all at the same time There's the VST tree standards and audio audio units and Maybe some other standard support that that you can just load the plugin Then the host tells the plugin. I want you to work like this then it just works On DPF the ports are static you have a mono version or serial version and nothing besides that Okay, one another thing that doesn't do although you can work around it with instant success, but it's not I Don't recommend it. It's sending messages from the DSP to the UI It's usually the other way around when you load the file UI tells DSP a little of this and then the state is Save it automatically for you If I implement this I break some compatibility with some standards, which I don't want and You'll see it later. Why? It also doesn't support some advanced performance stuff in this case. This is just for Lv2 the multiple MIDI ports, it's an Lv2 specific thing and Variable tempo in the same process in the same run like If you have a timeline and then the tempo is ramping up the host can process the plugin on that On that period of time where the tempo is ramping On VST on Jack and I'm not sure if owners understood like this. You cannot have tempo Variations in same process callback Lv2 can because it's out on ports. They can send the events as they as they are needed, but other standards not and Well to make it more simple. It doesn't support that and I don't think There's a single plugin that handles this well, but Well, if it becomes an issue then we'll do something about it Yeah, there's no audio unit support for now because I'm not really a Mac guy If someone wants to do it, it's fine So well assuming everyone here has a lot as a laptop I want to go Go with you go through with you to set up an In example plugin right now. We'll set up the name Some license if you want the sub module or not, I'll explain it and what built system To make things easier We can just take one of the plugins are already made and fork it and Then start making our own changes and about the sub module You might want to have DPF as a git sub module then you can just update it every time there's some change Or you can have it as a local folder that you have to manually update and merge changes or something like that If you have a local copy you have it manage it yourself like a fork of DPF If you have it as a simple sub module, you can just Send me the fix I'll implement the fix and then you update It depends if you want to make changes to the actual DPF code or not Let's see if you don't know the The full code is on github and I'm not sure if that URL is visible. I'll open a text editor and make this big You have it on github Com slash this throw then you have DPF for the actual DPF code and What what we actually want now is to plug in examples so dpi distrub.com slash distrub slash plug-in examples and I can actually if you have a github account you can fork it now or just get the clone address there and Make a local copy I'm going to fork this for myself. You're familiar with github. I hope right Kinda And well now I'm going to take The URL and clone it here somewhere. Oh, let's forget something I Kind of want you to follow with the laptop is possible. So I'm I can paste here Some URL that you can work with Without making Without having a github account This this throw bit Yes, yes The URL on the bottom allows you to clone it without having read write access and Let's see, let's see. Do you guys want to follow right? I hope so Do you have it? Just a second you also have it Okay, okay, okay, so let's see First we need to decide on a name for the project I listen For making things simple will do as the simple gain plug-in. They just And Raises the volume or lowers the volume something simple Yes, I use it. I didn't explain this When you clone that repository you can do a key clone with a recursive That's takes the sub modules in that into account If you didn't you should still cloning when using sub modules You can do this Okay, and then that Automatically clones the dpf for you in the dpf folder the plug-in samples through Still cloning I Can show the rest of Okay while it's still cloning I Can show you If when you want when you have a plugin the first file you need to do is the distro plugin info dot H which defines Defines How to plug in what the plug-in is what it has stuff like that you can see it it has a name Whatever it has a UI or not If it's a synth or not the number of inputs in the case audio Outputs as well and then some features In dpf when you disable some features they actually get Kind of commented commented out from the code for example, if you don't want time position You you won't have on your final plug-in at time position part in LV2 and In this is so that if you want to build a simple plug-in The output is actually simple plug-in and not a generic wrapper that's supposed to work for all the plugins Yeah, next you have Your plug-in class This is just a basic overview You subclass to pull the plug-in you have the basic information saying the name the maker license stuff like that Parameters and a process as simple as possible For do I is also simple as possible in this case. I have an image knob I'll show you in this in a bit at DSP callback So that's when the programs are changes you get in your new UI saying this parameter has changed And I also have an op Which yes, this is now clone it Do you guys have the repository going there already? Yes, so let's start In the usually in my repositories. I have everything inside the plugins the plugins code We can take for example the information Can call it gain Delete everything else and then on my make main make file Yes, I just renamed the info into gain and then open the main make file On the route on the route On the main source code folder and you can see it very well But it's basically you would have like this all the plugins that were in there I Just made it so it's just the game plugin Okay, so far Hopefully you'll understand soon You can on the main source code Not in the plugins no Outside on the main folder Yes, you probably want to let me check if everyone has Do you have it there? I'll keep going then Just you so you guys have an overview of what's going on Is it possible to turn down lights Because the screen is dark and then we can see it Okay, okay Now we can see it slightly better Yeah, I can also also maybe We can see it better if I switch to is this better. Yes Okay, so this is the actually the distroplugin.h file Hello, which describes the plugin I Really you already have here some of the Fields define it This one we don't need the plugin name we can call it My gain or something You can have it new right? This will be used it for Lv2 Lv2 the brand you don't actually need it for now and We take all this well inputs one outputs one Yes, one input when output actually we can make it to Make it class boring Yes, everything else you can delete it if it's not there It assumes some default It assumes you don't have it if you don't define for example the UI UI in that case is Zero if you don't define it the default is none doesn't have it same for the Time position everything else and let's go back to where this was to Okay, so it's pretty simple. I think If you just copying you already know how it's going to happen We have or plug-in file First we have well for the regular codes the import in this case of this through plug-in class and Here you subscribe with the plug-in class I Think it's very if I actually show you the plug-in class itself Just a sec. This is the plug-in you can see it at the top the plug-in class has three Constructor variables on the constructor to tell the number of parameters the number of programs and the number of states We won't go through programs and states right now, but For parameters it's just Something yet that you can control with your if you use plugins you probably know what the parameter is and for programs it's the The factory It's called factory provided presents But so in this case, we know it's parameters programs and states So on this little file we have here We wanted to make a gain so we just make one parameter it's going to be the game and Then zero programs zero states for now And for the members at the bottom I can make this the gain Okay This simple I think So next as we saw in the example we have the some Met information about the plug-in you can just give it a name and stuff like that In this case we have the label Maker I don't we don't need the home page License where a license you want and then a version in this case We use an internal function just to get the next decimal version of one zero zero You also have a unique ID that is used for VST and Latzba But it well not how hosts Support is some hosts actually ignore this when yeah, see it means So the functions you're just thrown away are optional. Yes, the ones that you need I put it Yeah Well, I can't click it Are the label maker license version and unique ID. I added some recently about the description and Homepage there are just metadata for LV2 But these are the ones that you actually need and you can see it on the district plug-in class Let me show you. Yes about the information You have a get name that already has an implementation These ones are Zero so that means you have to implement them yourself The description is empty by default. There's so it's optional Homepage is also optional The maker license version unique ID is not optional. Okay The next thing you'll have to implement is the innate parameter There's just so the host knows What kind of parameters the plug-in has? and the class the file I'm showing already has a An implementation that you can we can just Modify how you want It's not a Boolean this automable. Let's see. Let's see. We only have a parameter one single parameter. So we can just call this Gain and here again, okay Let's see if I can explain this In a parameter you have hints To say what kind of parameter it is In this case, it's just an automable parameter You have a ranges to say what's the minimum value? What's the maximum and what's the default of that parameter? You have your name You have this symbol Which is only used for LV2 right now and the symbols must be unique You can also have a unit and I can show you here This is the parameter First you have the hints which is described So let's see. Let's see here The first one is whatever is automable or not if it's not automable you well the hosts won't allow To automate the value the parameter Whatever it's a Boolean Then an integer and logarithmic and the last one if it's output or not VST doesn't support parameter outputs. So just take that into account So next Then we have the ranges. Let's see if I can show that again Yes The name of the symbol and units Name and symbol are not optional. You have to define it something unit is optional and It's used one year Well to make things a bit better. So the whole user knows what it's modifying and The ranges it just minimum maximum default. Yeah, the unique ID Well, the unique ID is a complex thing Did I write it in documentation there Wait, wait, wait. Yes The unique ID is something Well, it was original done originally done for VST and last lots but adopted it as well But as I said Some hosts right now actually ignore the unique ID If you can get one that is not used by any other plugin cool, but Well so far I only know one hosts that doesn't allow to load the plugin if it's the unique ID is duplicated Well, the default implementation that I have it there. Let me show you. Yeah, I Just have four characters I'll see characters to define the unique ID This gets transformed into a big number. That's if it's unique enough It should not have conflicts in this case we can call it Big M then G Sample like that and well it gets into early really big number I Don't give too much attention to the unique ID if it has a conflict you change it, but if not fine Then okay After the neat parameter you actually need to implement parameter stuff The first the first one is just to return whatever the parameter value is because we just have one I put it there I'll I'll return the game right away and when we set the parameter value I Can just say this is equal to value. Yes Every well in Lv2 everything is floating us by Lv2 is everything is float as well on VST is the same thing Jack doesn't have parameters, but well float is the common denominator for parameters Even even if you say is if it's a Boolean or is an integer the value that the host stores it's a float and Actually, I forgot to do one thing. I actually need to initiate initialize the value to something and the maximum should probably be to default one and Minimum zero so that this way Default gets the audio as it is maximum duplicates minimum makes it silent I'll clear Okay, we have No, this is I just Committed out before because because we only have one single parameter The index will always be zero in that case parameters Yes, the previous implementation that I had here If I control Z enough I Had it here an array then the parameter count was an enumeration and Yes, enumeration C That was some random value and at the top. I made all the values zero This was a special one and then Let's see. Let's see. Let's see here I'm getting parameter value. It was just returning the index of the array You can make it whatever you want to different variables and array or Wherever works. Yes parameters are always asked by the host by index So You probably will want to have the Parameter this description of the parameters in your header file. I had it here In the distro plugin info.h So that way the UI and the DSP code all share the same parameters so the only other thing that is left is just the process function and Actually, there's a bunch of code here that it don't need So if this is the gain you probably we've already did this Hmm The input and outputs you can see there are a race of arrays in this case Is a stereo plugin? So I can write it like this Equals in the first input and For the outputs is something like that as well except this is Yes, this is well something common and now we just Multiply everything By our gain of value. Let's see. Yes, I Hope this is clear enough If you already did the plugin before This is usually how it goes You have your inputs your outputs of audio and the number of frames and The number of frames is just how many Samples there are on each of those arrays so we to iterate the arrays and then Multiply its value from the inputs to the outputs by the gain That is our parameter Do you guys understand this? Okay, nice Yes You mean for a MIDI filter Yes If you set it on the I Have it you can check it documentation after this Well, let me see if I can if I know the URL like this Yeah, yes Hello Yes, yeah, I was asking the question that if you we declared two inputs and two outputs and this would be For example would be a plug-in you put an audio stream in otherwise it would have no effect So my question was if I remove the input or that is set it to zero It will be automatically compared to something like a synthesizer Yeah, you have some macro specifically for that Which I was hoping to I was hoping to show here somewhere. Yes The list of macros which is also In here Where is it? Where is it? Where is it? Yes, you have a macro that is plug-in is synth if you define this the Distro plug-in I want me the input is automatically defined as well if you don't define it for some reason So in this case the process function will be different Let's see if I can show one example of this in this through plug-in Yes here If it has MIDI input the process function will have the inputs outputs Some of them can be null if you don't have inputs or outputs then you have your MIDI events and Well, how many mini events they are If you don't have MIDI in the case we're talking about right now the gain the process function is the one Below so let's see. Let's see. We're almost done with this Small small example. This one had a callback for the buffer when the buffer size is changed. We don't actually don't need and Let's think you need and bottom is the Entry point that is just a create plug-in then you return a new instance of your plug-in as simple as that and Let's see to make file for the where the source code for this is I can just change some parts I'm going to delete this Leave everything as it is just for this example and If it doesn't take too long, I hope now I'm actually just compiling it It compiles the the DGL model. There's just UI stuff first It's a single build for all the plugins. So after that it will compile the plugin that we have Yes, the VST Lv2. All right And on our bin folder, we actually have now the VST version and the Lv2 version You can see it generated the money the Lv2 manifest for us And you can check We have here or plug-in in Lv2 audio inputs audio outputs or gain that has the default minimum maximum and then the license Maintainer stuff like that and the version as well and Now we can just run it if I set this Party you don't have to follow. It's just proving that it actually works Yes So in this little window here, we have the plug-in that we just made now loaded in Jalvi with the gain parameter that goes from zero to Two Right Simple so far No Yes Yes, I commented out in there We don't have a UI made right now if you commented out it will build the way I set up this make files is a bit complex to understand but Basically, we just have the name name on the top Then there's the files for the DSP the files for the UI Which is just the file dot O for the object This includes the main make file magic some nice tricks in there and then depending on Well depending on the on the Features you have enabled it if you have open jail if you have Jack stuff like that It modifies the targets If you just want to compile, let's say a lot per version Yes, it's possible as well and yeah the wait If I'm not mistaken. Yes, the last per version is in there Which I can prove that works using to list plugins. I think If I do let's put path equals This plugins actually say false but Let's move on to get Some nice things going the actual DUI So on the same folder There was there is the UI code In this case we import the three to plug in info first just to make sure it's there because of the parameters in this case is not needed and We subclass the UI In DPF DUI is made with open GL Which is not something easy to work with But I made already some xx in classes that you can use to make some Backgrounds some knobs some stuff like that and we'll do something like that very very quickly Let me just Delete everything that is not needed here Sample rate change we don't care for this Actually, I think I can delete everything The only thing you need to you need to implement Is the on This play and I'm just going to put here the game as well Something quick if I'm comment this from the mic file Yeah, so now it it will build the UI or why doesn't have anything in there yet I should I should tell you that the first parameter there on DUI class is First setting the size There It comes with an empty size by default. So if you don't Define it there. You can later call a set size something like this if We build it now I Think it's just a make will do It will compile DUI together with the DSP and If I load it in Jolty I Think I need to redo something here I'll do a new build. I just want to show you that the interface running Because we don't have anything there on the display the interface will be all black for now and it's well, let's see if it builds then well, the first thing we'll want is probably some background for the plugin and just It's almost there. I'll add a background quickly if this actually worked I know what's going on. I Actually deleted this bit Yes Sorry Yeah, I actually need to say that the plugin has an UI otherwise DUI is there doing nothing so If I delete this a little bit Yes, so this would be your UI that is right now just empty doesn't do anything so Just to make things quick. I'll just add a quick background there Let's see if I can copy it from something this one This part you don't have to follow. I'm just Going to show something quick just to generate some artwork There's a small utility I have in Python that converts B90 file b90 files in this case PNGs or in all type of images into C code so that you can use it directly for OpenGL Which is If I can open it. Yeah, this big thing that is just raw data Let's see if I can get this working Actually, now I need to see some examples because I don't remember how it was Yes, like this Where was it here? Just a second just a second. Yep. So the image is in there. We need just needs Yes, this needs to be hard to work That would be if you don't have OpenGL installed the headers that My name is image. Yes, I need to import the image And after that we can go to some real examples Okay, just need to import this I don't have time to explain everything here, but What I did was just importing an image We using some utility to convert it to C code I had an image class here and then the image loads the data from that C file and The size is actually the image size Which if everything goes well load it in JLV. Oh just need Just need to actually display the image If everything goes well, well the plugin will have that image as the background. Yes This is then you put some knobs on top of stuff like that Well, that way you can build your own UI I really have as I said, I already have class there for sliders knobs buttons stuff like that, so it's At least for the PIX map based stuff is already there There's also an easier API for drawing 2D to this stuff via nano VT Like it's like a HTML5 canvas API That you can draw stuff with if you don't want to use raw OpenGL and now I Want to show some actual examples of this If I have everything updated a lot of color in here and my computer is a bit slow Let's see. Let's see a load JLV Yeah, this is one of the things you can do with OpenGL If I put some Generator here Let's see if I can get it all of you through here Yes, you probably know this visual visualization thing from somewhere else It's copied from the XMM the XPMC Visualization code So if you know OpenGL you can do fancy stuff like that for the UI If you want some Something more basic You can do stuff. The cat is a bit faster than usual You have your knobs The switch and then some fancy animations if you want to Yes, this is Carla the these color things are Carla's specific stuff. These are the actual parameters and Yeah, just some direct access to some parameters, but yeah, you can see here you have your own your Parameters with the units in this case is actual just percentages and Yeah, this is basically what you can do with DPF This plugin will work cross-platform VST, LD2 stuff like that and let's go on You can compile it for yeah for my question Windows I actually have set up to cross compile it on this machine Because it's just make files so you can use Ming W and you There's something new I made a few months ago that You can do all your DSP using Macs Then there's an option in Macs, MacsChain to export the file and Then you can set up a repository in DPF using that file and that files gets transformed into a plugin and Well, there's basically it there's not much time to show you everything here what I can show you is the link for the documentation which is The bottom one the working progress documentation is in the bottom link That also has some examples for stuff like latency parameters What is it? Yeah First the parameter You have programs stuff like that I need to work to make more examples for the other stuff. Yes, that's it questions if you want to see Examples of plugins made of DPF If you go into the DPF project page the bottom has the some Has links to plugins made with DPF Most of them are made by me or some ports and Then some audio made by Damian, I think so, yeah so clone it fork it then Send me some requests or something like that Hopefully this makes Your job on making plugins easier it certainly did for me because I had to do a bunch of stuff for every plugin and Now with everything already set up. It's just Take an example modify a little bit and then I have a working plugin already for the LV2 VST lots by everything like that Just nice For the why it's just open GL because the graphics is then you open GL for DSP. There's no dependency at all Actually for cross-compiling because already includes the lots but and LV2 headers everything You don't have to install absolutely anything just compiler Because the headers are all there and I was missing something No, that's basically it if you want to know about the Let's see if I have here. Yes Because open GL is not for everyone There's The nano VT thing that you can use to draw to this stuff which are is already integrated So you can study this code and then do stuff like that for me. That's it. Thank you