sabato 23 maggio 2015

Send program change on track selection with Bitwig Studio 1.1

Today I decided that I really wanted to be able to change the effects in rakarrack on track selection in Bitwig. This is far easier than imagined, but requires a controller script and a naming convention for tracks. Here it is. The instructions below are for ubuntu, but I am sure the script will work fine on other platforms.

loadAPI(1.0);
host.defineController("Generic","Program changer","1.0","7ab8d8ee-fd26-11e4-a322-1697f925ec7b");
host.defineMidiPorts(0,1);

function init()
{
    function nameObserver(arg){
name=arg;
res = name.match(/.*PC#([0-9]+).*/);
if (res!=null)
   if (!(res[1] === undefined)){
program = parseInt(res[1]);
if (program != null){
   println(program);
   sendProgramChange(0,program);
}
   }
    }
    var cursorTrack = host.createCursorTrack(0,0);        
    cursorTrack.addNameObserver(255,"",nameObserver);

}


Save the script in your bitwig controller scripts path (see below for downloadable file), add a Generic->Program changer controller in bitwig, and connect the midi output port of the controller script to your hardware or software emulation. In my case I selected Virtual Raw MIDI/1 (I use ubuntu, so I added  modprobe snd-virmidi to my /etc/rc.local file, and I can connect to rakarrack this way). 




Note: you also have to connect rakarrack to the same virtual alsa port (e.g. using patchage), and check "midi program change table" in rakarrack midi preferences, but this is not the main topic of this post.

Next, change the name of some bitwig track so that it contains the string PC#nn, where nn is a controller number. The precise string may be changed by changing the regular expression used in the script. I have two tracks using two different programs.



As you can see, PC#nn is just a sub-string of the track name, which may still be descriptive. Now select one such track and watch your program change event to happen!

You can find the complete script here:

https://github.com/vincenzoml/vincenzomlBitwig

And in case you're wondering, here's some music I make, mostly with Bitwig on Linux nowadays.

https://soundcloud.com/vincenzoml

giovedì 22 gennaio 2015

Why I do not support ind.ie anymore

Some time ago, I started sharing and "liking" links from ind.ie. This is because I totally agree with the motivations and the goals of the project, relating to provably private social networking, file sharing, and communication. Now I have to do an unpleasant thing: RETRACT my recommendation.

The reason is, they decided to start by focusing on a single platform, and a proprietary one, which is only supported on proprietary hardware. This decision is not just questionable, or debateable, in the context. It's wrong.

Software aimed at being a private communication platform must first of all be open source, and that's what they are doing, but second, it must be portable. This is because if you find out, or believe, that your hardware or operating system is bugged (on purpose or not) and leaks your private conversations, you must be able to go to a different vendor, chose a product that you consider better, and recompile the product in order to access your data and contacts again. That's not ideology; that's what you technically need, to decentralise power and be on the safe side of things. If their software is not portable, I don't see why I should even consider using it in the future.

Giving money or effort to an open source project is an investment of the whole society, and I think we all should do it more often, but what do I do with the source, if I can't even compile it, since it's written for a proprietary hardware/software combination? I can imagine parts of the software will be portable, so we all could hack alternative interfaces for a product. But why should I accept to be on the wrong side of the technological gap, that is, be unsupported from the maker, when I am supporting the product as an user? In other words, why should I invest in a maker which is not investing in me as an user?

Since ind.ie recently referenced the Paris deaths and freedom of speech, which I found untasteful from the start, I'll add that if we all want to be Carlie Hebdo -- and I'm not claiming I do -- we must start from having the courage to say unpleasant things to people, and to put our face, name and reputation on it. I am doing this now, with my 29/37 coding/life ratio (TM ;-) ) and my 18 years (half of my life) of formal computer science education and academic research activity, which I think gives me some authority on what is correct and what is not correct in designing a secure, private, decentralised software.

So: my not-so-politically-correct statement is "what ind.ie is proposing to do with the money of their donors is totally wrong".

For the time being, I advice my friends to keep using dropbox, google, facebook, whatever centralised product you use, it's just safer. It's one player less in the game, more mature products, less potential bugs. If you really want to have something like what ind.ie promised, you can fork their code, or fork somebody else's code, or start over from scratch, or support someone else in doing that. I'll be glad to support and even contribute work to any future project along the same lines, who also shares with me the values and reasons I explained above.

Let me conclude by saying that: 1) I am writing this only because I am sorry for the false advertising I unwantedly did when sharing links to ind.ie, but 2) that I want to leave a positive note too, because the effort, dedition, and communication abilities of the ind.ie team have been really great; it's unfortunate that I can't agree with the direction they took, but at least I can say they worked very hard, and maybe in the end they will change their mind. I'll be glad to change my mind in turn in that case.

Vincenzo