LV2 Create

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

LV2 Create

Post by j_e_f_f_g »

Anyone using the C/C++ code generation feature of LV2 Create? I want to change some things about it, but need to know whom it will impact, if anyone.

Going to start on the UI stuff.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

User avatar
lucianodato
Established Member
Posts: 156
Joined: Sat May 15, 2010 9:00 pm
Has thanked: 3 times
Been thanked: 16 times

Re: LV2 Create

Post by lucianodato »

Hi Jeff, this is very useful for experimenting with quick dsp code. Thank's! However when I run it I get "Need to install helvetica 8 font", could this be avoided? I don't mind installing helvetica fonts though. Again thank's!
Arguy (IRC)
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Re: LV2 Create

Post by j_e_f_f_g »

lucianodato wrote:Hi Jeff, this is very useful for experimenting with quick dsp code. Thank's! However when I run it I get "Need to install helvetica 8 font", could this be avoided? I don't mind installing helvetica fonts though. Again thank's!
Well it needs to use some installed XWindow font and I assumed helv was a safe choice. When debian testing switches to Wayland, this will be rewritten as a cairo-using wayland app anyway.

P.S. Before you do serious coding, download the latest version (with the "Add source" button on the Compile page). You add your code to the file named after your project -- not dsp.c. The readme tutorial is updated.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: LV2 Create

Post by ssj71 »

Jeff:

I was using lv2 create last night (first time earnestly trying to make a plugin using it). One thing I can suggest, Cypress's PSOC system autogenerates lots of code for their systems. In the autogenerated code there is always a lot of comments, just like what you've done, but also there is always a block like:

Code: Select all

/*Insert User Code in this section*/

/*End of User Code*/
And anything NOT in those blocks will get automatically removed next time it is built. So there would be one block in most of the functions in the pluginname.c and in the struct of the pluginname.h . Near as I can tell, once your program creates the .c and .h for the plugin it doesn't touch them again. Not a big deal, but it would make it even harder for new devs to screw up.

Also I had to check the plugin.h file to figure out how to access the control ports. I didn't see in the docs or any of the source comments a guide for this. Pretty easy to figure out for me but I would recommend putting in the comment above the run function a quick example of accessing the users first control port, same as you do with the audio input and output port.

Overall excellent work. Makes it almost too easy to do plugin development :) Thanks.
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Re: LV2 Create

Post by j_e_f_f_g »

ssj71 wrote:there is always a block like:
/*Insert User Code in this section*/
And anything NOT in those blocks will get automatically removed next time it is built.
Well, that's the thing. All user code goes into the .c and .h files LvC makes for you for that purpose (for example My_Little_Amp.c and My_Little_Amp.h). And those 2 files are never overwritten, even if you add/delete controls/channels/state variables, add/remove support such as MIDI, or change any of the settings. (The only exception is if you change language from C to C++ after already adding your code, which would be silly). The skeleton code manages all the lv2/ladspa details.

LvC doesn't just spit out a blank template, then leave you on your own. Each and every update to your plugin can be done via the gui, right to compiling.
Also I had to check the plugin.h file to figure out how to access the control ports. I didn't see in the docs or any of the source comments a guide for this.
Hmm, right from the first example My_Little_Amp the tutorial shows accessing its Volume port. But maybe you read the initial version. Each update has gotten expanded docs (and they're still not even close to done. There's more docs to come).

But note in the comment header for pluginRun, all your control ports are listed by name and then code you can copy/paste, such as:

Volume = *Head.In[LV2_VOLUME]

I should make it

*plugin->Head.In[LV2_VOLUME]

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: LV2 Create

Post by ssj71 »

Aha. The problem was I originally created it with no input parameters, then decided to add one after the soruce had been created. I went through it again doin it all correctly the first time and there in the comment, it gave the example I was looking for. This is the primary argument for the "cypress" strategy, so that the .c would get updated when I go back and edit the ports. This is the exception case rather than the rule, so its up to you. Now I know so it doesn't make a difference for me.

However, when I do x386 compile and install the makefile tries to cp so.686 to the lv2 directory, where the gcc output is so.386.
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Re: LV2 Create

Post by j_e_f_f_g »

ssj71 wrote:the makefile tries to cp so.686 to the lv2 directory, where the gcc output is so.386.
Uh oh. I assumed that all 32-bit intel/amd systems would output "uname -m" as i386. Guess there's an i686 too.

Will work on a fix.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Post Reply