20080414
'Allo, ALUT! - Click!
I finally got around to creating my first program using sound.While this may not be something to be excited about, it is a milestone in my opinion.
For years, I've been trying to figure out what I can use to create my own music using the computer. Then I found out a few weeks ago about MarioPaint Composer (MPC), based on the music program from the SNES game Mario Paint. The big let down of course: No version of Linux. Windows and Mac users should definely get into this easy to use program that will probably be appended to the Free Software List.
So what is there for the Linux users? Lots of softwares, mainly stuff that is still in development or requires external hardware. But this is for people with more experience in music. To them K.I.S.S. is a rock band rather than an acronym.
I'm finally on the verge of creating a program that I've been looking forward to making that does what all the other softwares other than MPC have failed to do: Create a very simple software sythesizer for the computer. No Keyboards or Drums to hook up. Nothing fancy or dumbed down. Just a program to turn the computer keyboard into a piano keyboard. If it works (and it should), then I'll think about adding all that fancy stuff.
The software that is going to help me do it will be OpenAL Utility Toolkit (ALUT), based on how the OpenGL Utility Toolkit (GLUT) was designed.
First off, there is a simple Hello, World program that they have. The one below has been modified for C++
/* helloalut.cpp */
#include
#include
int main (int argc, char **argv)
{
ALuint helloBuffer, helloSource;
alutInit (&argc, argv);
helloBuffer = alutCreateBufferHelloWorld ();
alGenSources (1, &helloSource);
alSourcei (helloSource, AL_BUFFER, helloBuffer);
alSourcePlay (helloSource);
alutSleep (1);
alutExit ();
return 0;
};
Next the saving part. I think it is time to show off how to create a simple makefile and use it. Note that TABs must be used not spaces when indenting commands. Because of this blogging software's limitations, any line thia is indendt with space should be denoted as a tab character.
# Makefile
helloalut: helloalut.o
g++ helloalut.o -lopenal -lalut -o helloalut
helloalut.o: helloalut.cpp
g++ -c helloalut.cpp -o helloalut.o
Thanks to this quick lesson in how to make Makefiles, I now know that it is unnecessary to enclose modules using -Wl--start-group and -Wl--end-group when linking modules. Ofcourse this may be limited to the Linux operating system, but it is a significant change that should be ammended to the GCC tutorial.
So what does this Makefile do? Well for starters, the default name for a Makefile is Makefile. The make program is the prgoram that used to install or remove prgrams directly from source on Linux and UNIX operating systems. Thus it is a good idea to keep the source files when you use make to install a program. Makefile can have a different name but it is probably a better idea just to use the default. Ergo, there can only be one Makefile per directory where there is a program to be installed.
The above Makefile would do this in the console:
g++ -c helloalut.cpp -o helloalut.o
g++ helloalut.o -lopenal -lalut -o helloalut
In the more fancy projects there is generally a couple lines added to removed the software that was installed which is generally make clean, but I'll have more details about that when I update the programming tutorial later. Stay tuned.
In order to use the Makefile, you should be in the directory where the Makefile is. So cd to the directory where the source is.
The fancy programs generally have a shell script called configure that is in the directory that is written to check if all the components for the software that is to be install can run. Before the Makefile is executed, run ./configure. You don't need a configure file to use make, but it is helpful if you are writing something fancy. Right now, the Makefile that is being discussed in this blog entry is sutable for just one computer.
So we've changed directories, made sure that everything is set to run, time to build the program! It is so very, very simple, If your Makefile is called Makefile, just type this command.
make
That's it. Nothing else to do execpt run that program.
But what about make install? You don't need to worry about that. That's if you are root and want to install the program in /usr/local/, and involves writing more advanced scripts such as the make clean command that undoes a make install. (Come to thing of it, I wonder how I can set up a make update when a new version of one of the fancy programs becomes available.)
Wow! I covered alot of ground today. I hope this helps everyone clear the air about how to use make as well as getting started with using ALUT.
Just remember to K.I.S.S.
Labels: C++, make, music, OpenAL, OpenGL, software
posted by Bushido Hacks 4/14/2008 01:46:00 PM (0) comments top
20071225
Watch Out for the Archive Manager Bug in GNOME
A scary situation occured last week that I should have mentioned earlier.There is a but in GNOME's Archive Manager that will cause Linux, or hopefully GNOME to my knowlege, to crash.
Linux doesn't crash, Bushido. That is crazy talk.
True, but not every operating system is perfect. This seems more like a glitch that was probably overlooked by the GNOME developers. Fortunately, no serious damage occured to the system.
What happens is when you open a .zip file with the Archive Manager program, then click extract you get a message about how bash can't extract the files because there are to many arguments. A little while later OH SHI--
The best way to avoid this from happening is to use the console instead of the Archive Manager program.
Just type the following line to extract a .zip file.
unzip filename.zip
Hopefully this will be fixed soon.
Labels: bugs, linux, ohshi, scary, software
posted by Bushido Hacks 12/25/2007 05:35:00 PM (0) comments top
20070522
Major Blog Changes Coming
I don't know what is harder. Having to find the courage to go to a long overdue dental appointment, or trying to update this blog's layout.I'm making some changes to some old blog entries so that I can create a uniform style, add keywords, check spelling and grammar, so that I can try to attempt making changes to this blog.
Blogger's syntax makes me a little nervous. There was a reason why I chose to format my pages in PHP, but I ended out using JavaScript to create the advanced features which look like crap.
So, this week, BushidoHacks.com is under renovation. It won't be closed like the forums, but it will be making changes to attract more users to this site.
I really want to get ASUKA set up. I need to write up a Software Requirement Specification Document (SRSD).
Meanwhile, I need to see if I should still use Blogger or if I should switch to Wordpress. I'm glad that Blogger is finally using keyword labels like Wordpress, but if Wordpress is more efficient, then I may have to do something I really don't want to do: Migrate from Blogger to Wordpress.
But Blogger still has some great features. Moblogging (mobile blogging) using a cell phone. Automatically saving drafts. The power of Google's community of computer scientists and computer programmers. The network of users who write back.
I won't migrate from Blogger. But if the keywords post blog entries in several pages instead of posting once and using a database to call similar articles, then Wordpress may be the way to go.
But I should change this blog's layout before considering changing this blog's software.
Labels: asuka, blog, google, software, SRSD, websites
posted by Bushido Hacks 5/22/2007 11:25:00 AM (0) comments top
20070520
Fedora 7 comes out Thursday - Click!
Gearing up in preparation for Fedora 7. Not Fedora Core 7, Fedora 7 according to the Fedora Project website. Although, I do lament not having enjoyed experiencing Fedora 6, or as it was nick named "Zod".I would have loved to install Zod on my computer. I even bought "Kneel Before Zod" stickers from i-mockery.com.
I really liked the name of that distribution, and it's a shame that there isn't a cool name for Fedora 7. Superman II was and still is the best of the Superman movies. Gene Hackman as the original Lex Luthor. Terence Stamp as General Zod. Jack O'Halloran as Zod's silent right-hand man Non. Sarah Douglas as Zod's sexy henchwoman Ursa.
To be quite honest, the supervillians in the Superman movie are way cooler than Superman who everyone known is weakened by Kryptonite, which always seems to be emphasized in the Superman movies.
Basically, the plot in every Superman movie is predictable. Flashy enterance. A segway to Superman does something amazing. A supervillan arrives. The villan learns about Superman's weakness. They use it against Superman. The villians run a muck. Lois Lane gets entangled in the plot. Superman miraculously finds the strength within himself to distance himself from his own capture, saves the day at the last minute, steals a kiss from Lois. Roll credits.
DC and Marvel have better superheros. Batman has no powers but he is way cooler than Superman. Spider-man has problems that people can relate to and he has Jimmy Olsen's job. The Incredible Hulk is one of my favorite superheros though the movie wasn't that impressive. And don't get me started on the X-Men and Teen Titans.
But this post is suppost to be about Linux.
Fedora 7 brings back the well-missed KDE and OpenOffice.org, a couple of great softwares that GNOME really didn't work well with.
I would really like to get some programming done before Fedora 7 arrives. I really would like people to see that.
Labels: comics, diy, linux, movies, software, zod
posted by Bushido Hacks 5/20/2007 08:34:00 AM (0) comments top
20070424
GNU Radio - Click!
I really wanted to come up with a clever title that was a play on Wall of Voodoo's "Mexican Radio", but I just didn't have it in me.With 2007 nearing the midpoint, my self-made computer is nearly complete. All I need now is the memory, a backup power source, a little bit of thermal grease for the processor, and something to patch up that hole in the back where a TV or Graphics card goes.
But since I'm not interested in television, and because I don't play alot of video games to justify shelling $300 for a graphics card, I want to develop an interest in software defined radio (SDR).
It turns out this project will be more challenging that I thought, but I am still eager to find some way to do this project without breaking the budget.
I recently learned that many of the projects I want to do require an industrial level of supplies or components, be it a SDR or an electric generator. An eBay search does not return any results that satisfy my requests.
I spend alot of time working on my computer, but I also want to listen to the radio. Nearly every result returned some form of mediocre FM radio reciever that was part of a TV card. But I want something that listens to AM so I can hear Cardinal games and picks up the FM radio stations that don't play some rap station or top-40/emo crap on five other radio frequencies where my favorite stations are located. I want a radio card that can block out that crap and pick up my Red Birds and Industrial Rock as clear as a bell. Unfortunately, the consumer market appeals to the Lowest Common Denominator. So it looks like I will need to build what I want.
Despite the fact that I did not learn about things like Verlog when I took a computer logic course, I still have the textbook from that class and would like to put it to use. I may need to review my knowledge of assembly language which may be of no use since my new computer is a 64-bit dual-core machine. I'm starting to think that maybe I should have majored in computer engineering rather than computer science considering I have a very limited knowledge about programmable logic arrays (PLAs), but I am willing and open to learn.
Reading the requirement list provided by the GNU Radio website, I really did not want to pay $850 for a hardware device that with the right components can be made for far less. Who ever is running the GNU Radio project obviously is not thinking like a broke college student. Do I really need that many Logic Elements (LEs) for this project? A child can build a radio for a science fair project out of a couple of circuit and a paper clip. These guys are thinking in terms of the most expensive products out there. Altera does have some appealing products that are quite afordable and simple to program. But to place the project cost at $850?! Who's running this project? Kaz Hirai?!
As much as this is an important project, the requirements are full of oversight. I know I can do better at a fraction of the cost!
Labels: diy, hack, hardware, linux, mod, music, radio, science, SDR, software, tech
posted by Bushido Hacks 4/24/2007 09:49:00 PM (0) comments top
20050203
Nice TuSSH - Click!
A good computer operator should always have a back up of their most important data and aplications when the you-know-what hits the fan.Recently, I have learned to take advantage of Dreamhost.com's Linux Server capabilities including the fact that I can compile PERL and C++ online using SSH and query my mySQL database.
Secondly, I have always wanted a way to access SSH through a small handheld device. PocketPC could not do this, the failed Familiar Project never had anything, but Palm had a program.
The program is called TuSSH, short for Tungsten SSH. SSH is a secure form of telnet. This is one of the greatest programs I have ever used since I learned about OpenOffice.
TuSSH is freeware but it is not open source. So if you really really like this program, donate $20 to the guys who created TuSSH.
posted by Bushido Hacks 2/03/2005 01:16:00 PM (0) comments top