ROBOTC.net Blog  

ROBOTC News

Ringtone converter for ROBOTC

One comment

Thanks to Shep from our forums for providing us information about his very cool project!

Submitted by Shep:

—————————————————————————————–

If you like to play music on your NXT, if you use RobotC and have access to Microsoft Excel, have I got a deal for you!

I have created an Excel spreadsheet that will very easily convert RTTTL (Ring Tone Text Transfer Language) ringtones into RobotC code with very little effort. RTTTL ringtones are the original ringtones that were just beeps and tones.

The Excel file contains over 300 ringtones ready to convert just by selecting which one you want and then putting the code into your file. You can also add your own ringtones that you may already have or have found on the ‘net. I have found thousands of free ringtones. It will only work with RTTTL format files and RobotC.

Some of the files need considerable tempo adjusting to sound right, so I have added a way to adjust the tempo of the music.

Here is a sample of the output of the file: (yes, this code works, try it out!)

nxtDisplayCenteredTextLine(0, “Star Wars”);
PlayTone(695, 14); while(bSoundActive);
PlayTone(695, 14); while(bSoundActive);
PlayTone(695, 14); while(bSoundActive);
PlayTone(929, 83); while(bSoundActive);
PlayTone(1401, 83); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1188, 14); while(bSoundActive);
PlayTone(1054, 14); while(bSoundActive);
PlayTone(1841, 83); while(bSoundActive);
PlayTone(1401, 41); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1188, 14); while(bSoundActive);
PlayTone(1054, 14); while(bSoundActive);
PlayTone(1841, 83); while(bSoundActive);
PlayTone(1401, 41); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1188, 14); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1054, 55); while(bSoundActive);
wait1Msec(280);
PlayTone(695, 14); while(bSoundActive);
PlayTone(695, 14); while(bSoundActive);
PlayTone(695, 14); while(bSoundActive);
PlayTone(929, 83); while(bSoundActive);
PlayTone(1401, 83); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1188, 14); while(bSoundActive);
PlayTone(1054, 14); while(bSoundActive);
PlayTone(1841, 83); while(bSoundActive);
PlayTone(1401, 41); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1188, 14); while(bSoundActive);
PlayTone(1054, 14); while(bSoundActive);
PlayTone(1841, 83); while(bSoundActive);
PlayTone(1401, 41); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1188, 14); while(bSoundActive);
PlayTone(1251, 14); while(bSoundActive);
PlayTone(1054, 55); while(bSoundActive);

I don’t have a site for downloading, so all you’ll have to do is send me an email at Tinkernology_at_yahoo_dot_com requesting the converter and I will reply with the Excel file along with a RobotC file I created with 42 songs already converted and ready to play for your use. That’s almost 10 minutes of music ready to play.

And if you are an Excel Junkie like me, you will enjoy tearing this file apart. I spent many hours working on it.

Rock On!

—————————————————————————————–

Source: http://tinkernology.blogspot.com/2010/07/ringtone-converter-for-robotc.html

Written by Vu Nguyen

September 7th, 2010 at 9:29 pm

Posted in Cool projects,NXT

Tagged with