[HOWTO] Install sbagen in Ubuntu 10.04 Lucid Lynx and 10.10 Maverick Meerkat

This guide is outdated. For installing to newer version of sbagen in newer Ubuntu versions, follow instructions here.

SBaGen is a Binaural beat generator. For more info, visit the official SBaGen Website.

It is available for Linux, Windows and Mac. For Ubuntu, it is not available in any official repos so we need to compile it from source. Here is how you can do that.

Open Synaptic Package Manager and enable universe repository if you already haven’t done so. To do so, navigate to Settings > Repositories and check Community-maintained Open Source software (universe)
Now, press Reload in Synaptic Toolbar to reload the package lists.

Now, quit Synaptic Package Manager and open up terminal. First, you will need some packages to start building our app. So lets get those.

sudo apt-get install libvorbisidec-dev libmad0-dev

After installing required development packages, lets create a directory named sbagen where you can work with sbagen and change to it.

mkdir sbagen
cd sbagen

Lets download sbagen-1.4.4.tgz from sbagen website:

wget http://uazu.net/sbagen/sbagen-1.4.4.tgz 

Extract it

tar -xvzf sbagen-1.4.4.tgz

and change to that directory

cd sbagen-1.4.4/

Now, lets copy the required files to libs directory

cp /usr/lib/libvorbisidec.a libs/linux-libvorbisidec.a 
cp /usr/lib/libmad.a libs/linux-libmad.a 

Now, to build it, you need to run the included script called mk. To do so, just execute:


Now if you see no errors, the code must be compiled by now. You should be able to run it by doing a:


If you see an output like the following:

SBaGen - Sequenced Binaural Beat Generator, version 1.4.4
Copyright (c) 1999-2007 Jim Peters, http://uazu.net/, all rights 
  reserved, released under the GNU GPL v2.  See file COPYING.

Usage: sbagen [options] seq-file ...
       sbagen [options] -i tone-specs ...
       sbagen [options] -p pre-programmed-sequence-specs ...

For full usage help, type 'sbagen -h'.  For latest version see
http://uazu.net/sbagen/ or http://sbagen.sf.net/

this means sbagen has been compiled. To be able to use it conveniently in the future, you just need to move it to some bin directory. Lets move it to /usr/local/bin

sudo cp sbagen /usr/local/bin/ 

Now, you should be able to run it from any path by just invoking:


If you encounter any errors in any steps, please post the step and the corresponding error message in the comment box below. I will try to address the problem the best I can.

Now, after it is installed, you may want to try out an example file:

sbagen examples/basics/prog-chakras-1.sbg 

but it will give you the following error:

Can't open /dev/dsp, errno X

Please follow my other post to overcome this problem.

  • Thanks for supporting sbagen! I hope it’s creator is alive and well. He made a wonderful little application and then gave it to the world.

  • RandomMeerkat

    Thanks for your great help! On a 64 bit system you need to remove the -m32 flag as well in the file mk. Otherwise it does not compile.

  • MelodicContagion

    I get compiler errors when I run the make file. How can I fix them? I looked up more about the errors and it seems that the file ‘mk’ could be missing some linker statements I think? But I can’t tell where they are. I’m not sure how to run a plain text file as verbose so I can see what it’s making, and I can’t really make sense of the file when I look at it directly. All I know is it’s running gcc with a lot of options and/or libraries. I tried using ‘make -f mk’, but it has even more fundamental errors with the makefile, so I gave up on that.

    The errors were that ‘log’, ‘sin’, ‘exp’, and ‘pthread_create’ were undefined. Maybe the linkers were not in the right order? I looked in mk and can tell that they are -there-, but not what order they’re being mentioned in.

    • MelodicContagion

      Nevermind, I found it. The linker statements shouldn’t come before the C file’s name. That is, if you have my problem, you can go into the mk file and move “-lm -lpthread” from the OPT string to the LIBS string. Then it should work fine.

  • Here is a free database of sbg files, which can be previewed as audio: http://sbagendb.gusari.org/

  • yamil

    Hello, I get this error after running mk

    libs/linux-libvorbisidec.a(floor1.o):(.text+0xa4a): more undefined references to `oggpack_read’ follow
    collect2: error: ld returned 1 exit status