20080416
The Start of Something Big!
Finally! A real program I can call really be proud of.My audio program works!
There was some difficulty at first reguarding something about the device /dev/dsp but it turns out any program that uses KDE squats the device for KNotify or some other program. One more reason to use GNOME as Linux's GUI, I guess.
This first program I'm trying to get the computer to Play a little of Pink Floyd's "I Wish You Were Here". (About 8 notes, if I recall.) It is a simple guitar tab, and guitar is very similar to piano only the strings are spaced by about 6 notes in the G chord. (It's been a while since I've played any major musical instruments, so bear with me on the technical terms.)
Currently, the sound that I get is a little limited. I'm not exactly using a Moog.
This is the start of something big!
Labels: lifeisgood, music, OpenAL
posted by Bushido Hacks 4/16/2008 04:51:00 PM (0) comments top
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
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
20070224
Brace yourself! - Click!
posted by Bushido Hacks 2/24/2007 10:56:00 PM (0) comments top
20070218
Hillary doesn't have a snowball's chance
If you still believe that Hillary is going to be our next president, you don't know Barack Obama.While Mrs. Clinton is rasing money from the Hollywood A-List this weekend, Obama is in the South.
I mean, why would anyone want to vote for a woman who has fought to promote legislation to ban videogames, used the news media in her state to start a moral panic against Obama's race and religion, write books about things she knows little about, and yet she wants to play "supermom" for this country.
I could care less about Obama's race, religion, or the length of time he has had in political office.
But the last thing this country needs is another W.A.S.P. in the oval office.
Obama '08!
Labels: games, imho, movies, music, obvious, politics
posted by Bushido Hacks 2/18/2007 04:15:00 PM (0) comments top
20070128
The Pope Condems Video Game, Cartoon Violence - Click!
His Holiness Pope Benedict XVI gave lapsed Catholics one more reason to skip Church on Sunday by condemning video game and cartoon violence on Wednesday, January 24, taking a few lines from Miami lawyer and anti-videogame activist Jack Thompson.This is ironic considering there is a VeggieTales videogame on the market that is not very good which has pleanty of Cartoon Violence and a Left Behind videogame which is really bad. (Yeah, so what if non-Catholics make that blasphemous crap. They still sell it at the Catholic supply store and at Christian bookstores.) I miss the old Pope.
I guess if saving the Princess by slaying a few demons is wrong, then I don't want to be right.
Labels: animation, dogma, fud, games, movies, music, news, PS3, thevirus, Wii, wtf
posted by Bushido Hacks 1/28/2007 10:25:00 AM (1) comments top
20061218
Music 2006 in Review - Click!
Time again for the music reviews for year 2006.Rock music came out on top this year in Europe thanks to Lordi who really should come to the United States so the radio stations can stop playing Abba and Ace of Base when ever anyone makes a request for an artist from Scandinavian region of the world.
Meanwhile, the ever-lasting failure that is known as mainstream music actually put something good out this year. (The world must be coming to an end! Mainstream never plays anything good.) I mean, unless you work at a Hot Topic, you probably won't know who VNV Nation is. But ask anyone about the recent top forty trash that is on the radio, and they'll give you an answer.
By the way, VNV Nation is a great EBM band if you are on vacation. Listen to "Beloved".
Anyway, back to the suck genre--er, mainstream.
As much as I loathe mainstream, GNARLS BARKLEY is worthy of praise. "Crazy" should be Record of the Year at the Grammys next year. (Mark this down: Feb. 11, 2007.) If they don't win, the Grammy next year, then the Recording Industry Association of America has failed.
New to this year's music review is my DIAF List. DIAF (Die In A Fire) List is the list of all the music that SUCKED this year. If you buy their clay pidgeons (CD) or download their computer virus (mp3), then you are part of the problem.
- Any attention whore celebrities who are over 40 and whose name rhymes with "ondonna". (Here's a hint: Her name begins with M.) Here full name is not listed because I have better things to do than boost her Google Search score.
- Any emo bands espeically if they have the words Patrol and a four letter word for winter time precipitation.
- Any falsetto pop artist whose singing like they're trying to kill the song in the same way a mentally unstable killer slays their victums with bizarre objects. If your name is noskralC ylleK, airalugA anaitsirhC, or what ever skanky harpie that can't sing worth a sh*t who is selling clay pidgeons and viruses (both computer and venerial) whose purpose is to croon to the zombie eMpTyV croud that has about as much though as the scum on the bottom of their shoe.
The world is starting to wake up again. They can now identify what is real and what is trying to put them back to sleep.
Labels: music
posted by Bushido Hacks 12/18/2006 08:02:00 PM (0) comments top