Tuesday, November 19, 2013

Polishing up the GUI

It takes me a couple more days to get Songbook Manager into a presentable form. Scouring the web to study the Android UI standards, UI tutorials from many websites, and downloading the free icons, I was able to get the app into a pretty nice presentation. By then the software has a main songbook screen, a favorite songbook screen, a utility screen where songbook can be imported, email,  back up, and restore.



Converting a paper songbook to a computer readable format

The software that we use to play and manage Karaoke songs is TKaraoke. It is available as a free and Pro version. The free version seems to work pretty well for us so we stick with it. It is so much better than the set top box that packs a lot tunes and plays the songs back in a very "robotic" tempo. TKaraoke software plays music video clips that has been ripped of the music DVD so the music and voice are sung by a real singer. There are 2 audio tracks on the video clip. The first one included the singer voice so one can learn to sing by watching/listening to the clip repeatedly. The second track only has music so one can practice singing with it.

The main advantage of storing video clips on the computer hard drive vs DVD is that the hard drive can store many thousand of video clips instead of the traditional 16-20 songs / DVD. The selected video clips can now be queued up in a playlist. They are played automatically when the previous video clip is completed. People can now easily select their songs, insert them into the playlist and wait for their turn.

But as the library of video clips grow, the songbook catalog is getting thicker. Every time new video clips are inserted into the collection, new songbook catalog must be generated and printed out. When the songbook catalog is longer than 50 pages, it is no longer practical to print out the paper songbook after new songs are inserted into the collection on a regular basis.

TKaraoke software has a tool that converts its songbook catalog into a text file that contains song IDs, DVD names and singer names in the collection. It is intended for printing out to paper songbook to be used as reference when selecting songs.

The format of the file is pretty simple. I was able to convert this into an Android sqlite database within a  couple days. A few more days of tweaking, I finally have the songbook resided in my phone.



The first screen has 2 buttons to let me convert the songbook into sqlite DB and to display the book from sqlite DB. This screen is intended for me to experiment with new things in Android and sqlite. It will go away shortly after the main songbook display implementation is completed.

Now that I am successfully getting the songbook of about 8000 songs into my phone. My next hurdle is to present the data so that they would be easily located by the user. I added 4 buttons to sort the list by song name, singer name, search for a song title, search for singer name. Java made this task very easy using the collections sort, search, comparator, and comparable  objects. If I were going to implement the same feature in C, this task would definitely take a few days. But Java make things so easy, it only takes a "noob" like me a couple hours to accomplish all of these tasks.


The fun is on...

An opportunity that allows me to take a break from work so I took it. I always want to learn developing software for the Android platform but never really have time to get into it beside a few weeks of playing with my HTC phone and the Motorola Xoom tablet trying to root them.

To start off with the project, I spend a couple weeks learning the official Android programming language which is Java. Although I spend many years working with C, C++ and many other programming languages through out my career, I never have a need to learn Java until now. Java looks similar to C++ in many respects, but it is quite a bit different once I delve deeper into the language. One thing immediate clears to me from the very beginning that Java seems to have all the libraries and packages available at one's disposal. One no longer needs to write code to perform mundane simple  tasks anymore.

Once I could understand Java code comfortably,  I downloaded the ADT tool from Google and started to get familiar with it. The tool used Eclipse IDE with all the Android specific plug-ins installed. It was similar to Microsoft Developer Studio tool that I had used for few years earlier, but it was a little bit confusing at first -- and it is still very confusing, but thanks to the internet, Google Search, and StackOverflow, I became very proficient with the tool in a very short time.

Saturday, November 9, 2013

How it all started

I am a pretty lousy karaoke singer. My wife and I didn't even know how to sing any tune of music until a couple years ago. I had attended many parties that, at the beginning, was just the usual food, drink, mild booze, and chit-chatting. As the night wore on, however, the party host turned up the karaoke machine and people gathered around the TV screen, consulting songbooks, entering their selection, and taking turns picking up the microphone and singing. It sounded like a lot of fun but I would just hang around the room and listen to the music, never actually singing. Most of the voices were pretty normal and occasionally, a voice would come through the high and low tone of the music -- I would have told myself that if I just heard this over the radio, I would undoubtedly believe that the voice belonged to a very popular singer. Once in a while, people requested that I sing a song to contribute to the festivity but my face would instantly turn red, babbling the only excuse I could come up with - I don't know how to sing.

So why does a guy who doesn't know the first thing about singing start writing about karaoke music  anyway? Well, I probably don't have much to contribute to how certain tunes should be performed, but I noticed right away that many changes could be made to improve the process of selecting songs - making it easier, so to speak. 

The biggest hindrance to the song selection process is the songbook itself. Depending on the collection, songbooks can be a few pages to a few hundred pages long. It's a pretty difficult task to quickly select a song, enter it's ID via a remote control,  and then finally passing the book around to other people - especially when you don't know the song, singer, or how the lyrics begin. To make matters worse, most party hosts only have at most 2 songbooks available so people must patiently wait for their turn. It is also painfully frustrating when a very "thorough" singer, who seems to enjoy going through every single entry in the songbook in minute details from cover to cover, begins looking for his/her favorite song.

Having witnessed the "thorough singer" phenomenon more than a few times, I keep telling myself that if I ever need to be occupied by a fun project, writing an application on the smartphone, with it's goal being to replace the paper songbook, would be something I'd be very interested in developing.

But then time and priority always got in the way so the project never even started...