Active GUI element
Static GUI element
Code
WPS object
File/Path
Command line
Entry-field content
[Key combination]
Creating Karaoke disks with OS/2 and eComStation
After using DOS for two years in his business and constantly struggling with the 640k limit, Bart was looking for options. Windows 3.1 wasn't much better than DOS and Windows 95 was not out yet. He noticed that IBM was marketing something called OS/2 Warp. He has been using OS/2 since 1994. Currently all PCs in his business use eCS.
What is a Karaoke Disc?
Karaoke players—as you might find them at a Sears, Toys 'R Us, Best Buy etc.—play a special CD-ROM called CD+G (CD plus graphics). Graphics information (the lyrics) is squeezed onto the disk along with the WAV (music) data. CD+G discs are available at those same stores, on eBay (search for "CDG"), or online at places like Sunfly Karaoke.
What are MP3 / CDG File Pairs?
Some resourceful individuals have found a way to pull the music and lyrics info off of these discs using scripts written in Python. The result is two similarly named files except for the extension. i.e.:
01 - Blitzkrieg Bop.mp3 01 - Blitzkrieg Bop.cdg
Over on the Dark Side there is software to play theses file pairs on your computer. I believe WinAmp does this. There is a Java application, Plarbebu, that can play these files; the author offers Windows, Mac and Linux distros. The Mac distro was the only one that I could open (zip file), but I have not gotten it working, it stalls at the splash screen. I contacted with the author, and he said he would make a new distro. But that was some months ago, and there are no new files on his download page. If you get Plarpebu to work, please contact me.
What is Python?
Python is an interpreted language, like REXX. I do not know much about it, but I know that thanks to Andrew MacIntyre, we have a Python interpreter. Installation is simply a matter of copying the contents of the archive to your drive.
What is cdgtools?
cdgtools is basically two Python utilities:
- cdgrip.py leeches the mp3/cdg file pairs from your CD+G disc so you can play them on your computer.
- cdg2bin.py creates an ISO image file from mp3/cdg file pairs. Burning this image to a CD-ROM creates a CD+G disk.
With these utilities you have the ability to leech songs and lyrics off your CD+G disks and create your own custom CD+G disks with only the songs you want. If you are inclined, there are a great deal of mp3/cdg collections on the web, using file sharing applications like amule, opennap, or torrents.
Creating the ISO Image File from mp3/cdg File Pairs with cdg2bin.py
- Copy the contents of the Python distribution to your hard drive, e.g., E:\Programs\python243
- Copy lame.exe to the Python directory. (LAME is required for decoding the MP3 files)
- Put the mp3/cdg file pairs in a directory, e.g., E:\Temp
- Open a command window and change to your Python directory
- Call cdg2bin.py like this:
python.exe cdg2bin.py file1.mp3 file2.mp3 etc. etc.
I have a script, cdg2bin.cmd, that works pretty well:
/* Python script: convert cdg & mp3 file pairs into an ISO, when burned you have a CD+G disc that plays on karaoke players */ /* Normally this python script would be called like so: */ /* python cdg2bin.py *.mp3 */ /* In linux, the bash shell expands it to: */ /* python cdg2bin.py file1.mp3 file2.mp3 file3.mp3 */ /* It doesn't work this way on OS2, the script is called with one argument: */ /* python cdg2bin.py *.mp3 */ /* So I created this Rexx script. It's for my sister, don't ask me to sing! */ /* BTW, it doesn't matter if you spec mp3 or cdg, the script automatically adds both file pairs */ /* Notes: */ /* files beginning with "- " crapped out */ /* used double quotes, not singles, in case song name has an apostrophe */ /* tested with Paul's tor tor20060122.zip */ /* burn with cdrdao2 write --driver generic-mmc --device 0,1,0 --buffers 64 --eject --overburn --speed 12 cdg.toc cdrdao2.exe copied to \OS2\APPS, cdrdao.dll copied to \OS2\APPS\DLL */ /* tested with lame-3.96.1.zip, Athlon build. Copied lame.exe to Python dir */ call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call SysLoadFuncs searchcrit = '*.cdg' list = '' filedir = 'E:\TEMP' pythondir = 'E:\TOR' say say 'Make sure cdg & mp3 files are in: ' filedir say 'Your Python directory is: ' pythondir say 'Lame.exe should be in your Python directory' say '@pause' call Directory filedir rx = SysFileTree(searchcrit, 'flist', 'FO') if rx \= 0 then do say "Error collecting file information, rc" rx return rx end do i=1 to flist.0 list = list || ' "' || flist.i || '"' end If flist.0 > 0 then do say 'Number of files matching search criteria,' searchcrit ', was' flist.0 end else say 'Nothing matched your search criteria:' searchcrit say call Directory pythondir '@python cdg2bin.py' || list return 0
Ripping File Pairs Off Your CD+G Disk with cdgrip.py
First you need to copy an image (aka: ISO or BIN file) off the CD, then use cdgrip.py to get the file pairs from the image. From the cdgtools readme:
Note that not all drives support reading CD+G disks. To read the graphics data your drive needs to support reading RW subchannel data. You can use any CD/DVD drive that supports either raw interleaved mode or deinterleaved mode.
I tried grabbing an image from a CD+G disk using readcd.exe from the cdrtools2 package, like this:
readcd2.exe dev=0,1,0 -clone f=e:\temp\cd.iso
This produces an ISO file cd.iso; and a TOC file cd.iso.toc.
The cdgtools readme suggests this task be performed with cdrdao2.exe. I tried it like this:
cdrdao2.exe read-cd --driver generic-mmc --device 0,1,0 --read-subchan rw_raw cd.toc
However, I get an exception error.
You can now use cdgrip.py to do the MP3+G encoding. Something like:
python.exe cdgrip.py cd.iso.toc
Unfortunatley, I have some problems getting this to work. If you are a Python expert and have figured out a way to do this, please contact me. Fortunately, I am only concerned with mp3/cdg file pairs available on the internet, and I don't need to rip any CD+Gs. Consult the cdgtools README for more information.
Notes
- cdgtools also ships with a GUI script which does not work under OS/2, eCS.
- I put cdg2bin.cmd, readcd2.exe, mkisofs2.exe, and cdrdao2.exe in C:\OS2\APPS. I put cdrdao.dll in C:\OS2\DLL.