A Libaudioverse Status Update

Libaudioverse is my attempt at making 3D audio for native apps, something which is currently lacking in the typical indie price range. There are other systems with fully featured content management pipelines, but these are often overkill for small projects, especially in terms of budgets. If you know Web Audio, you are already basically familiar with most of the core concepts. While there are differences, general architectural experience should be broadly transferable from one system to the other, and Libaudioverse aims to solve many of the same problems as Web Audio.

That said, this post is primarily aimed at those already familiar with Libaudioverse. I will probably have an entire series about what makes Libaudioverse relatively easy for one person to maintain at some point, but this post is about the short-term and long-term future. It recently came to my attention that there are people outside my small circle of developer friends who might be interested in knowing where I stand and where I'm going, so I thought I'd write something up.

This post will proceed roughly by major feature, discussing the status of each. The short version is that Libaudioverse isn't something that I want to call stable, but I'm certainly interested in getting feedback at this point; it's working well enough to be useful and the API is pretty settled.

Read more…

The Horror of Audio Output

Update: I didn't realize there was a clarity issue, but the Hacker News thread made it clear that I should provide this clarification. I knew from the beginning of development that, no matter what I did, I'd need to support multiple backends. I had already written something like a third of the code that I would have to write by taking this route and, at some point, you just have to do it in the interest of actually moving forward. I am also developing a commercial library. To this end, some options that would otherwise be options are closed to me; I cannot use any dependency that my end users may need to purchase nor may I entertain the option of bringing in monolithic app development frameworks. Anyhow, back to your regularly scheduled blog post...

I've not been blogging recently because of two factors. The first of these is that we still do not have an accessible solution by which I can include math equations, save for me instructing you to learn LaTeX and view the source code of my articles; It would be incredibly hypocritical of me to make my blog posts inaccessible. The second is that the things I have been working on are somewhere between the domain of programming and math textbooks, with a bit of art and a lot of trial and error thrown in, so I simply haven't had anything interesting to say that fits into a blog post.

the latter of these has fixed itself and I expect I shall actually be posting semi-regularly again.

Today I want to talk about the horror of the world of audio output and all the wonderful broken promises you run into when you try. For a very long time, this was the hardest part of Libaudioverse, and I have had to literally give up on software libraries and at least one nice feature. I'm going to talk about this primarily in the form of an enumerated list of all the things I've had to try, talking about what's wrong with each one; if you're not interested in a post about various audio libraries and their brokenness, you can stop now. This is long, but I think it is worth chronicling so that others do not fall into the same pitfalls, something which has both frustrated me greatly and wasted weeks of Libaudioverse development time.

Read more…

A Libaudioverse Preview

Note: it was pointed out to me that I forgot to mention enum34 in the readme. If you were getting errors about not being able to import enum, installing enum34 (not enum, enum34) will fix them.

I haven't spoken about Libaudioverse much, primarily because I find code much more valuable than articles on a blog. You can run the former. You can use the former for cool games and technologies. But Libaudioverse is now at the point where I can and should talk about it more. So I shall. And perhaps more importantly, I have something I can release. It's not alpha-quality, thus the term preview. But it can give you a feel for what this will be, and it has some cool example programs. If you want to skip straight to the preview and not read the rest of this post, you can get the windows binaries here.

Read more…

Lambdatask and Monitors in C++: Combining Advanced Language Features for a Simple Interface

Lambdatask is a project that I was hoping to put off for a while. C++11 provides many useful thread primitives, but has major shortcomings. The most notable of these is the lack of concurrent and threadsafe data structures in the standard library. I'm not sure who thought it'd be a good idea not to seriously consider at least making std::queue threadsafe, but it's not and we get to live with that.

Unfortunately, among a bunch of features that Libaudioverse needs, threadsafe queues is one of them. More unfortunately, it needs them now so I can implement callbacks properly. I have identified three reusable things that it would be incredibly useful to have, the first two of which are surprisingly simple: a monitor, a threadsafe queue, and a library for the automatic parallelization of tasks with dependencies on other tasks. These libraries exist in various forms, but my research failed to turn up any that use only C++11 features. A library using only C++11 features will run on the 5 major platforms, and more are being added as we speak.

It is monitors that I want to talk about today. The code in lambdatask marks my transition from intermediate to advanced C++ developer. This alone isn't worth a blog post, but how the Monitor<T> works in Lambdatask is. The code here took me about 3 hours to work out, and I can thank here for the idea and this Stack Overflow question for the last piece of the puzzle.

Read more…

a Day with Haskell

I realized two important things the day before yesterday. The first is that I have programmed exclusively on Libaudioverse since the summer started. The second is that I know how to make an interpreter and, quite possibly, a compiler. Coupled with my interests (contributing to projects like Pypy, getting into grad school) and all the people who have said that compilers are a core part of CS, I've bumped it up my list a bit. My college does not give us the opportunity to take a class, so it's time to make my own.

To that end, I decided to finally learn Haskell and spent all of yesterday doing so. This has also been something on my list for a very long while. Basically, I was burned out with Libaudioverse, so it was time to do something else. Haskell is very unusual and also potentially very useful. I was actually quite impressed by how it was able to get at the core of some ideas, but there are some gotchas that prevented the code from being as clean as it could have been. I've got a commented implementation of binary search trees here and want to talk about just how strange Haskell is and why I'm actually very glad I'm learning it.

Please note that I am trying to convert some very deep ideas to English and am losing a lot of the elegance in the process. We can make nice analogies with imperative languages and real-world situations; this is not so with functional languages. Functional languages require working with them to understand them, in much the way that people say you shouldn't learn a foreign language by mapping it to your native tongue. If this post seems confusing or somehow lacking in detail, the reason is that the ideas in Haskell do not map well to English.

Read more…

My Thoughts on The Essential Shape of Games Part 1: What is the Essential Shape of a Game?

My quest for an MMO is leading me down all sorts of interesting avenues, most recently Libaudioverse and self-taught digital signal processing. While Libaudioverse is my top priority project at the moment, I am still devoting a non-negligible amount of thought to some core issues with game programming.

One of these is how one might go about making a game system that has three essential properties: network friendliness, developer friendliness, and flexibility. Spurred on by a design pattern called the Entity Component System, my brain began to generate ideas specifically aimed at MMOs, and for a while it seemed that an Entity Component System was the silver bullet. But I no longer think it is, at least not by itself.

And I wasn't even asking the right question. The question I should have been asking is this: leaving aside network issues for the moment, is there some structure that seems to encapsulate most or all games? The answer seems to be possibly, but I have yet to implement it.

Herein I share my thoughts on what the structure might be. Part 2 defines the problem in terms of an MMO and part 3 will talk about the options for actually getting this up and running. But first, we need to define the structure.

Read more…

Thoughts On C++

I've been refactoring Libaudioverse for the last little while. Specifically, I've been making it C++11. The last time I looked at it, C++11 was this theoretically nice thing as far as I was concerned: if you were anywhere but windows, you could use it no problem. Otherwise, hello Boost and really long compile times. VC++ 2013 changed that. The refactor to Libaudioverse shall shortly be completed (I've got maybe 4 more hours of work). C++11 is solely responsible for a lot of headache-saving, both now and in future. C++11 has changed my opinion of the language. Here's what got me to go from "this is revolting" to "this isn't really my favorite, but it gets the job done when speed really does count". I spent a great deal of time looking at alternatives for projects that need native code. In so far as I can tell, C++ has a huge amount of libraries and is the only option that runs on everything.

Read more…

Some Quick Notes on This Site

Here's just a quick couple things that you ought to know.

First, the comment system has accessibility issues. I am working on this, but the solutions are all suboptimal and it's going to take time. I will see e-mails if you comment. This is hitting NVDA and Firefox the hardest: that combination can't comment, at all. I need to open discussion with Disqus about this as they claim NVDA and Firefox are supported; failing that, I will probably need to write my own or move to WordPress. I can probably get something together, but it's going to take time. For the record, I did manage to comment using NVDA and Firefox when I originally set it up; it has apparently broken since.

Secondly, this blog is set up for MathJax. I'm going to tell you how you view MathJax accessibly in what will probably be the first article in an articles section. It can be done and does not involve MathPlayer. I could use inline LaTeX, but I wish to actually have it look like math; also, the procedure that will work for this web site will work for a miriad of others, not least of which is Stackoverflow. The "official" solutions we're supposed to be using don't work. Specifically why this is the case, and what isn't being done is the discussion of another post.

A Big Status Update and a New Project

I've been quiet on this blog for a good while. Life got really busy. Here's everything that's been going on. The most major piece of news is that I'm a founding member of 3 Mouse Technology. We're well under way at this point and I can finally talk about it publicly. I'm also deprecating Camlorn_audio in favor of a new project. More about both of these below.

Read more…