Wednesday, June 10, 2015

Using LV2 atom:Path (or how to get files safely in a plugin without a GUI)

The end of last month marked 2 years since my initial commit to my first lv2 plugins. I've learned some things, but still am picking up more little by little. I was recently reminded that I don't know it all, when falkTX pointed out another stupid mistake I'd been making that prevented my GUIs from resizing correctly.

Water under the bridge though. I'm going to try to explain out how to use lv2 to have the host make a file selection dialog for you. I want all my plugins to work purely with host generated GUIs and loading files became necessary for porting the rakarrack *tron effects. The LV2 official documentation has improved a lot, but I was still struggling, so I thought I'd post this. The example to be used is rakarrack's reverbtron. Its a sort of convolution using very simplified impulse response files (which are actually text files). Instead of a constant sample rate in the IR, you just keep the most important samples and interpolate between them.

Regardless of the details, I have a module that needs files. All I need is to pass the file's path to the modules setfile() function and it takes care of the rest. How do I get that path? The whole process involves several extensions, and the most confusing part to me was figuring out what was what. But I got it, so read on...

Thursday, June 4, 2015

How to Boycott SourceForge

I was finally convinced to leave I was holding out, trying to be true to a service that once was the best and most dedicated to free license and open source software, but finally, due largely to this editorial, have decided to join the boycott. Since I don't like doing things half-way I'm taking everything down and trying to make it as easy as possible for others to do the same.

If you are using git already, it won't take much to move your repositories to Github. Bitbucket will pretty much be the same commands. I already had an account so I won't describe how to sign up, but its pretty easy. Once signed in you can create a repository by clicking the little plus sign in the top right corner. Name the repo whatever your project name is and opt to leave it empty (I presume you already have the project hosted at You should make sure you're up to date on every branch from first. Once that is done you can just go to your local repo and issue the command:

git push[USERNAME]/[PROJECTNAME].git master

and repeat for every branch besides master.

You can then delete the local repo and re-clone it using the URL github give you, or just edit .git/config to update what URL origin points to, or there's some git command to do it that I can't remember. You can also go delete your project from BUT I decided to leave the skeleton of the project with links to the new home at github.

To do so make sure you haven't pointed your repo's origin to github yet. If you have substitute the project git URL for origin. Go delete every branch but master on by entering:

 git push origin :branch

Then on master branch do (carefully):

rm -rf *
echo moved to [github project URL] to boycott sourceforge >> README
git commit -a -m "boycott sourceforge"
git push origin master

Careful, because rm -rf * deletes everything in the current directory. This makes it so your repository is now empty except a nice little statement of what we think of the new

I only had source tarballs in the files section so I deleted them all and added the same readme as is in the repo. If you use this feature of it will be harder to find a substitute. This blogger subjectively goes through 14 alternatives and decides to stick with sourceforge. Hopefully you can find one of the alternatives workable.  I also edited the project description to say that the project had moved.

 If your project has a website you can move it to github quite easily too. Just go to your repo that is now using github for the origin and type:

git checkout -b gh-pages
rm -rf *

The name of the branch (gh-pages) is very important. Download the site source from the sourceforge ftp if you need or if you have a local copy just copy it all into the repo. Make sure you have an index.html and then just:

git add *
git commit -a -m "adding site"
git push origin gh-pages

Your new site is at http://[USERNAME][PROJECTNAME]
Not too bad!

I wish I had a good answer about binaries. If you use other features like mailing lists you might have to do some more homework too. If you have found good solutions, spread the word, leave a comment.

Now, as a commentary, SourceForge hasn't done anything illegal. The GPL of most open software allows them completely to package it with adware, malware or whatever. But is that cool? Heck no! So on grounds of ethics, it has come time to boycott. Do not visit, do not download from there, and do not give them your code to host. I avoided Github for a long time because I felt they weren't as dedicated to open source, since their site code is not open (and partially because I tend to kick back when something seems trendy). But honestly it seems they've found a business model that is working for them and allows us more freedom for free software projects. SourceForge is not what it once was, and we owe the current management of it no loyalty. I don't really mind which service you move to, but don't stay.