Function Menu
Check out the New Wiki

BushidoHacks.com

You now have the power to defend the earth like never before!

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: , , , , ,



posted by Bushido Hacks 4/14/2008 01:46:00 PM (0) comments top

20080120

GT5 for PS3 driving in March - Click!

Despite the promises made by the local Gamestop dealer that Grand Turismo 4 Mobile for the PSP will be coming, it is now certain that it is in "development hell". (Noooo!!!)

On the other hand, Gran Turismo 5 Prolog will be coming to the PS3 on March 18. From what I've seen I like what I am seeing.

GT5 will also be available as a High Definition video game. (Translation: Expect Sony to jack up the price for this game.) Fortunately, the GT series has lived up to the hype. Especially since endurance racing (i.e. American LeMans) is way better than boring NASCAR racing. (LeMans drivers can make RIGHT turns! Endurnace racers can drive on hills, not just a straight track.)

Enough with the video game rhetoric. Back on the programming front, C++, PHP, and Python are being practiced. It is planned in the near future for Flash development using the Ming library. Ming allows for Flash development on Linux platforms, but the flash has to be created by hand rather than with the conviences of the GUI. On the other hand, Flash has tried constantly to make it seem like you can't make Flash without their expensive product. This PHP manual page contradicts that assumption.

This site is finally getting its ducks in a row. I predict more changes here soon. That is very good news.

Labels: , , , , , ,



posted by Bushido Hacks 1/20/2008 03:36:00 PM (0) comments top

20080108

Why is there no SVG3D?

It occured to me that the way that VRML/X3D handles 3D models has not changed at all since it was first introduced in 1994.

VRML relies on a set of verticies to draw objects. This list of verticles can be come LOOOOONG! But don't get me wrong. SVG has the same draw backs as VRML and X3D, but SVG can use Bezier curves where as VRML and X3D are still using 3 dimmentional polylines. The math behind the Bezier curve is not that hard to implement and has been part of the OpenGL documentation for many years.

Thus when you use a program such as Blender (which has a terrible GUI, by the way) to transform .3ds into .wrl or .x3d files, you get a list of points that turn round edges into square edges made up of more nodes than the smooth surfaces that were defined using a Bezier surface.

Maybe this is something to check out later and see if their is a way to extend SVG into 3D.

Labels: , , , ,



posted by Bushido Hacks 1/08/2008 02:05:00 PM (0) comments top

20070203

Mobo Jojo

My beautiful black case came in the mail yesterday. Special thanks to BUYPCDIRECT for providing the first step in my journey.

Building a computer is a monumental moment for any computer geek. It is like the same feeling that a wrenchead (one who likes to build their own car or motorcycle) has when they begin building their first vehicle.

My parents think that this project will occupy most of my time and that I won't stick to my regular work. Not true!

This project does cost money, and will need to be spread out over the next few months. This means I will still stay on task while I work on one of my greatest achivements.

That's another thing that concerns them: cost. My brother did a project like this a couple years ago. He ponied up for the biggest most expensive stuff that was out their.

I, on the other hand, have plans on building something a bit more moderate and less expensive.

While I have no interest whatsoever in Windows Vista, Microsoft has brought forth the need to upgrade to 64-bit computing.

In order to keep up with the Gates (as oppose to keeping up with the Jones), I have decided to build my computers based on x86-64 architecture.

If there is one thing that the people at Microsoft and the resistant group of geeks (including myself) agree on it is that Advanced Micro Devices (AMD) has the better architecture for this task. AMD has been working on 64-bit architecture for several years now, even while Intel was promoting the Pentium 4.

In 2005, one of the most significant competitions in the computer industry begain since the Browser Wars of the mid-1990s. This hype as we now know it is called the "Core Wars".

The "Core Wars" brought forth Dual-Core processing, an idea forged from the concept of parallel computing. Many of us have seen the ads for products from Intel.

For those of you who are not computer geeks, the products that Intel has advertized over the years are for computer chips called microprocessors. A microprocessor is nothing more than a piece of plastic with this little teeny-tiny switches on them that are arranged with such precission that a machine must be used to manufacture them. A computer has many of these devices embedded into them into a big circuit board called the motherboard, or mobo for short. One chip that is heavily advertised, and one of the most important, is called the central processing unit, also known as the CPU or "core". The CPU is "the brain" of the computer. It works so hard, a fan is attached to it to displace the amount of heat. On newer desktop machines, the CPU has its own fan separate from the other fan that keeps everything cool and well ventelated. Some cases have come with thermal gauges to monitor and regulate the amount of heat a computer puts out, especially the CPU.

Until last year, the concept of having more than one core in your computer was reserved for the highly skilled computer engineer or the hardcore gamer. To be quite honest, having one core is good enough for me. But the concept of multi-core systems, though more expensive, does have its advantages.

A computer with one core puts out alot of heat. If the heat is not pushed out of the system, other parts of the computer become warped from the high temperature. To alleviate the stress caused by such a high amount of thermal energy, computer engineers took a page from the supercomputer industry.

If the name is not enough to tell you, a supercomputer is a computer with such high amount of processing capabilities that only a select few research laboratories, industries, and the government use them. A supercomputer, despite the recent advances in miniaturization brought on by improvements in nanotechnology, is about the size of a phonebooth and put out so much energy that it needs its own room with a large fan to blow out the hot air and draw in cool air. I read in some computing magazine that because these machines put out so much wasted energy, some companies in California channel the hot air into the air conditioning system to heat up the building in the winter time. Another company developed another, more practical idea to circulate the air in the room by reusing the air using convection. Convection occurs when hot air rises out of a heat source, then cools down causing the air to sink back to the floor where it is sucked back in again.

A supercomputer is able to process large amouts of information while generating less heat using a concept called parallel computing. This means a computer with dual-core processing uses two processors that have half the processing power as a single processing unit but because they work together, they computer the same amount of processing power as the single processing unit.

Because two processor with half the processing capabilities as a single processor but work just as dynamic, Intel has hyped up the concept with their "do more advertisement." *in that loud Kevin Spacy as Lex Luthor voice* WRONG!. Dual-core processing does not allow you to do work twice as fast as a single-core system unless you purchase a dual-core system with two processors that have the same power as the single-core processor EACH!

So what about this hype about "quad-core" (4 CPUs on one CPU)? Same concept. One big processor divided into four smaller processors with about a quarter of the processing capability as the single processor EACH!

The entire concept of the CPU was to store all those teeny-tiny switches onto ONE microprocessor. They way I see it, multicore processing is a step backwards, that or the chip manufacturing industry trying to cut cost instead of trying to find way to keep the computer from possibly burning up without burning a hole in your wallet, or worse burning the house down. (I'm talking to you Dell Computers!)

The downside to x86-64 architecture is that everything you know about assembly programming (especially for 16 and 32 bit systems) needs to be modified to include 64 bit systems. Fortunately, C and C++ programmers won't need to change the way the program too much. But if you use low level programming, now would be a good time to brush up on 64-bit assembly as technology marches on.

Labels: , , , , , ,



posted by Bushido Hacks 2/03/2007 08:46:00 AM (1) comments top

20061127

Book mark everything in this post

For those of you who have found my GCC & GLUT installation instructions extremely helpful, I thank you for your kind words and feed back.

Sadily, I do not have the time nor the resources to show examples or syntax of C, C++, or OpenGL.

Fortunately, I have found these resources to be VERY helpful over the break.



Other things I've picked up over the holiday include a few cellphone hacks for the RAZR. I was bummed out that I couldn't use that Blackberry I got on eBay. Never the less, I will be a sufficent backup device should my RAZR turn into a brick as I rage against Ma Bell. (Fight the machine! Woooo!)

First off, screw Ma Bell (Cingular) and her $2 ringtones and lack of work tools. According to Stephen Pierzchala in a May 2006 blog entry, the V3 has about as much processing power as one of the first 386 computers. This seems plasable considering that the Texas Instruments TI-83 graphing calculator could have easily replaced the command module on the Apollo spacecraft. I'm interested in doing the same thing to my RAZR that Pierzchala did, only without wiping the firmware. One program that I especially have my eye on is MIDPssh, a terminal emulator for mobile devices. Thus, over the Christmas break, I plan on doing some modding on my RAZR. A couple good RAZR mod sites are MotoModders.net and PlanetMotox.net. Hacker websites like Binary Revolution are also a good source for things that annoy the phone company.

Labels: , , , , , , ,



posted by Bushido Hacks 11/27/2006 09:33:00 PM (0) comments top

20050201

A crash course in OpenGL with airbags - Click!

The past two weeks I have been racking my brain trying to get OpenGL to work. Fortunately, I finally found some one who can help.
Compiling Instructions
Shell Script Instructions

As it turns out, my computer had GLUT, the OpenGL Utility Toolkit, and Mesa all along. In retrospect, I wish I had not upgraded/downgraded the files I already had. But I'm OK. If something bad happens I'll be sure to list it here.

Now, before you get all "Perhaps my computer has this already." Be certan that you do! Some of them have been packaged with GCC. But the most important thing that you should have, is X11. If you are using Linux or Unix, you're OK. Windows and MacOS users will have to keep looking.

Simple instructions:

If you plan on using more than one C++ file for a multipe object program for OpenGL (recommended!)
1) c++ -c gears.cpp -o gears.o
2) repeat step one for each module you plan on using
3) When you have all your .o files ready, execute the following line.
c++ -Wl--startgroup gears.o ... --Wl--endgroup -o gears.exe -I/usr/X11R6/include/ -L/usr/X11R6/lib/ -lglut -lGL -GLU -lX11 -lXmu -lXi -lm


I'll post a template for an OpenGL file later.
Check out the two links to seen what the attributes do.

Labels: , ,



posted by Bushido Hacks 2/01/2005 01:44:00 PM (0) comments top

top | Some Rights ReservedRSS FeedSEND E-MAIL!bushidohacks.com © 2004-2008