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!

Boids

As I mentioned in my previous post, I made a Boids simulation in Java as a school project. The course is now over, so I published the source code under the GPL. It can be accessed via svn from http://svn.beatwaves.net/svn/boids.

It uses the Processing library for the UI and you will need to download the Processing 'core.jar' separately to build and run the application. Processing is released under the LGPL, so I could include the jar in my svn repository also, if I only found the right source code to distribute with it. But I didn't find it right away and I'm lazy, so you'll need to download this your self :)

The version in svn uses the Processing P3D renderer by default, but it should be fairly easy to get it to work with the OpenGL renderer also. You just need the right libraries in your classpath and change (comment/uncomment) a few lines in the source code.

I found out after coding this, that someone else made a very similar implementation in Java also. Great minds think alike and so on...

For me this was just a (rather interesting) school project and I'm not interested in continuing work with it. But if you find it (or parts of it) worth developing further, please leave me a comment and tell me what you are doing with it!

What I've been up to lately

It's been a while since I last blogged, so I thought I'll just post about what I've been up to lately:
  • The Psycho Acoustic Bass Plugin
    I promised to develop it in a public svn repository, but never published the URL. Sorry about that. Anyway, it is now in a working state and available here. It doesn't do miracles, but it does do something. I'll blog more about this when I get some feedback from the project report...
  • Suunto heart rate monitors in Linux/OS X
    I bought myself a Suunto Heart rate monitor with a "pc pod" for connecting it to a computer. However, Suunto provides only Windows software for getting training data out of the device. Long story short, I ended up writing a small ANT driver for Linux and have been able to get some data out of the device. However the data format is rather cryptic, and I've been in contact with Suunto about the possibilities of getting a Linux/OS X version of their (rather good looking) Training SDK out. I haven't yet gotten a good response from them, but once I do, I'll blog...
  • Futurice
    In the beginning of the year I started working part-time as a software developer at Futurice. I've been doing mainly mobile software development, and so far I've enjoyed it :)
  • Ardour 2.8 is out!
    It looks like this time I haven't made a single commit to the 2.X tree since the last release. Partly because of my new job and lots of school work I haven't had quite as much time to work with Ardour as I could have wished. However, I have been doing some little work here and there in the 3.0 branch. Nothing big though.
  • Boids (flocks herds etc.)
    This is a school project that I got a bit obsessed about :) The idea is to make a flocking model where each character in the flock acts autonomously, together forming clear flocking behavior. This is a Java project which is not ready yet, but you can nevertheless check it out here if you wish. It uses the great Processing framework (from "Java mode") for the 3D graphics. More on this once The course finishes. I'll also make the source code publicly available :)
As you can see, I've really been a lazy blogger, as there is a lot I could have blogged about :/ Anyway, I will try my best to keep you posted with my progress with this stuff. The plugin project especially is something that probably still requires some work to be truly useful, and hopefully I'll get some feedback from people who are interested.

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.