beatwaves.net

This is the personal webiste of Sakari Bergen. I'm a third year Communications Engineering student at the Helsinki University of technology. Most material on this site is related to my hobbies, specifically software, electronics and music. I hope you find something useful and enjoy your visit!

Psycho acoustic bass response extension plugin project

So, like I said yesterday, I will be creating a LV2 plugin as a school project. It will be a Psycho Acoustic Bass Response Extension Plugin aka. PABREP (yes, I just made up that acronym).

The basic idea is to create or enhance harmonic content from signal components that fall below the low frequency cut-off frequency of a sound reproduction system. These harmonics will then create a sensation of better bass because of the missing fundamental phenomenon (or at least I hope so). The method has been discussed in an AES paper, which I will be basing my work on.

For more details see my brief project plan. The plugin will be GPL and I'll develop it in a public svn repository. More info on that later...

Matlab, Octave and FreeMat

I will be implementing an LV2 plugin as a school project in the near future. So far I have however only been tinkering around with Matlab-work-alikes in Linux. The plan was to do some fast prototyping before doing the actual coding in C++. The problem is that fast prototyping isn't fast if you use for-loops and Octave or a stable version of FreeMat....

I first tried working with Octave but found out that compared to Matlab, it takes some thousand times more time to perform a function utilizing a for-loop I made for manipulating audio files. This made it unusable for me. I was told to use matrix operations instead of for-loops on IRC, but that kind of messed up the whole idea of fast prototyping of algorithms.

The principal problem with for-loops being slow is the fact the Matlab language is interpreted. However, for-loops can be made fast with JIT. This is where FreeMat kicks in.

FreeMat has a JIT implementation which utilizes the LLVM compiler infrastructure (which seems like an interesting project). There was no FreeMat package in (K)Ubuntu, so I had to compile it myself. FreeMat 3.6 is supposed to have some JIT-functionality, but I just couldn't get it to work. So, next up for trial was the svn version of FreeMat 4 (not released yet), in which I got JIT to work. The speedup with for-loops was very impressive! Though alas, FreeMat 4 still has lots of other bugs and incomplete parts in it for it to be truly useful.

Until FreeMat 4 is out (or Octave gets JIT) I gues I will have to use Matlab over remote X or in our school computer classes (which are fortunately open 24/7)...

GUIs for audio plugins

I've been developing a nice plugin visualization idea together with Ardour co-developer Sampo Savolainen lately. Sampo originally had the idea of feeding white noise through an EQ plugin, and displaying a spectrum of this to see the frequency response. This way you could see what the plugin is actually doing, instead of some approximation of what it is trying to do. The idea is to update the graph every time plugin parameters are adjusted. This will probably be embedded in Ardour's plugin GUI at some stage (probably in 3.0).

However, this approach had it's problems with getting a smooth graph. After a bit of thinking, I finally noticed we could simply use the impulse response of the plugin, and *drumroll* it works great! Sampo has cooked up a test client, which hosts a ladspa plugin and shows it's amplitude and phase response.

For anyone who knows his DSP, it should be pretty obvious that measuring the impulse response is only useful for LTI filters. However, another idea emerged from this one: Showing the difference between output and input (output_spectrum - input_spectrum) could be useful for non-LTI plugins. Plotting non-linear plugins like this should give valuable information about new signal components produced by non-linearities. However, selecting the parts of the signal to be used for the analysis is not trivial and will need quite a bit of thinking and experimenting.

To say a few words about Ardour development in general: 2.6 should be released any time now and 3.0 is moving forward fast. I finished a region export dialog for 3.0 today. It offers the possibilities to export the raw region output, region output with fades or track output.

Ardour tidings

So, I've been spending some time not being paid for working on Ardour, but it seems I just can't keep my hands off it...

After quite a bit of changes from the 2.X branch were merged into the 3.0 branch, it was time to merge my Summercode stuff there also. Merging my stuff was mostly pain free, but the 2.X merge seemed to be more problematic. libsndfile was removed from the source tree, but a pre-release version has to be used. Unfortunately, to have Ogg Vorbis support, you need to also get a svn version of Vorbis.

Today I also committed my session merging code, which is capable of merging regions, playlists, locations and the tempo map from external sessions. The GUI still needs work, and tracks is definitely something that should still be implemented.

Ardour's 3.0 branch in general is a bit messy at the moment. One big problem is memory corruption, which we haven't been able to diagnose yet. Some people say things work fine, but other have problems all over the place. Hopefully this will be solved soon.

Most development has moved to 3.0, as commits done to 2.X have to be committed to 3.0 also. That means no more merges to break things ;)

Summercode project report

I finally got my Summercode report written. This means that when I get confirmation that it is good enough for the project coordinators, my project is over. However, I will still be giving a short presentation regarding the project at the Openmind conference on Tuesday October 7th in Tampere, Finland.

I must say this summer was a great experience. I would like to thank everyone involved, especially the people who tested my work and gave great feedback. The project coordinators and all other people responsible for organizing and sponsoring the project also deserve credit. They are the people who made this all possible. Thank You!

For now I think I'll take some time off from Ardour and maybe fill my coding desires by writing a LV2 plugin. This is something I've wanted to do for some while, but never got it done. Nevertheless there is still some work that should be done regarding Ardour's export, which I will tackle some time later.

Anyway, here is the report, and as a bonus, the not-yet-published presentation slides I used at the finals.