Having fun with a midi keyboard

So recently, I bought a great midi keyboard. The M-Audio Oxygen 61. Honestly, this keyboard is awesome. I love it. I’ve been playing with it non-stop ever since. And as a programmer, and mostly a game programmer in my spare time, I kept thinking about game music. One of the most important thing in a game in my opinion is the music. It makes the ambiance, create the feeling. It is underrated and is often overlooked. But that should not be the case. So what did you think I do? I made something. Some haunted house theme I guess. Enjoy.

PS: Yeah yeah, I know. This is a developement blog. And this post is not about programming. But must it always be about programming? Not really. This is for general stuff I make and think about. Though mostly related to programming and project, there is other thing I’m going to post, like this one.

A mix of C and C++

Oh the joy of mixing two different languages. Because yeah, even though C and C++ have a common root, it’s two different language with each their own set of functionnality. But why would I mix those two languages? Because I had to use a C library. Openssl to be exact. And god do I hate it right now. Not only because Openssl is quite frankly a mess, but also because the way C++ is made make it hard to have a clean code. And the person I am refuse to work with disgusting code. Knowing that C++ can throw, and how it handles the memory, I am making a wrapper around Openssl to be RAII compatible. Now that’s great, isn’t it? Well not really. Because of the very way Openssl is made, writing a nice and proper wrapper is much harder than expected. And once that is done, of course nothing works. Because Openssl is so complicated. Rant over.

Moral of the story: Kids. Don’t play with Openssl.

All aboard the message bus

Recently, I’ve been searching for different way to handle data through a game. How to pass in an efficient and beautiful way data to the differents module that can handle said data. And I remember a post I read here. Messaging bus is a nice way to handle data with minimal coupling. So I tried implementing a very basic and simple messaging bus.

Though I honestly believe the implementation and design could be better, it works. And I’m happy with the result. The code is available under zlib/png license so it’s freely usable by anyone.

Test your C++ code with Catch

I recently came upon the need to test some code, but I didn’t want to bother with doing manual testing. Hence, unit testing. It’s magic for real, when you have a nice system to do it. This is where Catch comes in handy. Catch is a very powerful testing tool for C++, that is header only. Now that is magic. No external library. And it’s only one header file. Even better. No? Yes.

Using Catch

Catch is easy, simple, and efficient. For real. I recently decided to test it on my small config class I made for my general utility library. Writing a test case is as easy as this:

Catch TestCase
TEST_CASE("RSM::Config", "[config]") {

RSM::Config config;

SECTION("Creating a config file from scratch") {
config.set("StringKey", "StringValue");

REQUIRE(config.hasConfig("StringKey") == true);


SECTION("Loading a config file") {

REQUIRE(config.hasConfig("StringKey") == true);

REQUIRE(config.get("StringKey") == "StringValue");

That’s it. This test the creation of a config file, and the loading of said config file. Compile, run, done. How hard can it be?

Onward to…

What comes out of this is the simplicity that I can make unit test for pretty much anything now, for all my projects. I intend to try myself at TDD eventually. I believe Catch is going to help me for that.