Code: Select all :local song "370,175,200,370,175,3400,440,175,200,440,175,600,330,175,200, \ 330,175,600,370,175,200,370,175,1400,587,175,200,587,175,600, \ 330,175,200,330,175,600,370,175,200,370,175,200,554,175,200, \ 370,175,200,587,175,200,370,175,200,554,175,200,370,175,200, \ 494,175,200,440,175,200,415,175,200,440,175,200,494,175,200, \ 440,175,200,415,175,200,330,175,200,370,175,200,370,175,200, \ 554,175,200,370,175,200,587,175,200,370,175,200,554,175,200, \ 370,175,200,494,175,200,440,175,200,415,175,200,440,175,200, \ 494,175,200,440,175,200,415,175,200,330,175,200,370,175,200, \ 370,175,200,554,175,200,370,175,200,587,175,200,370,175,200, \ 554,175,200,370,175,200,494,175,200,440,175,200,415,175,200, \ 440,175,200,494,175,200,440,175,200,415,175,200,330,175,200, \ 370,175,200,370,175,200,554,175,200,370,175,200,587,175,200, \ 370,175,200,554,175,200,494,175,200,587,775,800,330,775,800, \ 440,175,200,440,75,100,440,75,100,880,175,200,440,75,100,440, \ 75,100,440,75,100,440,75,100,784,175,200,440,75,100,440,75, \ 100,440,75,100,440,75,100,740,175,200,440,75,100,440,75,100, \ 440,75,100,440,75,100,659,575,600,392,75,100,415,75,100,440, \ 175,200,440,175,200,440,75,100,440,75,100,880,175,200,440,75, \ 100,440,75,100,440,75,100,440,75,100,784,175,200,440,75,100, \ 440,75,100,440,75,100,440,75,100,740,175,200,440,75,100,440, \ 75,100,440,75,100,440,75,100,659,575,600,440,375,400,659,175, \ 200,554,575,2000,554,175,200,494,175,200,440,175,200,440,175, \ 200,440,375,400,494,175,200,554,375,2800,880,175,200,880,175, \ 200,880,175,200,740,375,400,659,575,1200,659,175,200,740,175, \ 200,659,175,200,659,175,200,587,375,400,659,175,200,587,175, \ 200,554,175,200,440,775,2400,659,175,200,554,575,2000,494, \ 175,200,494,175,200,440,375,400,440,375,400,494,175,200,554, \ 375,2600,880,175,200,880,175,200,880,175,200,880,175,200,740, \ 175,200,659,375,1200,659,175,200,659,175,200,740,175,200,659, \ 175,200,659,175,200,587,375,400,659,175,200,587,175,200,554, \ 175,200,440,775,800" :set song [ :toarray $song ] :for i from=0 to=( [ :len $song ] - 3) step=3 do={ :local freq [ :tonum [ :pick $song $i ] ] :local length ( [ :tostr [ :pick $song ( $i + 1 ) ] ] . "ms" ) :local pause ( [ :tostr [ :pick $song ( $i + 2 ) ] ] . "ms" ) :put ":beep frequency=$freq length=$length" :beep frequency=$freq length=$length :put ":delay $pause" :delay $pause }

Kudos to those who did the song conversions! I shortened the Crazy Train script a bit by putting the beep frequency/length and delay values into an array. I actually wrote another version that did some substitution on the values (simple compression), but it only decreased the script by about six additional lines.I was curious about automating the conversion process as mentioned in one of the previous posts. I wrote a perl program to convert the above Crazy Train ROS script into the script below. It might be easier to use a text file for a source for an automated conversion to a ROS script. Since I tend not to like to reinvent the wheel, I found the following link and a program that might prove useful...The link includes a link for Windows command line programs to export/import a MIDI file to and from a comma-separated value (CSV) text file. The Windows program versions appear to be Unix based variants. I'm playing with the programs to see if it might be able to be used in conjunction with an automated program or process to convert a MIDI file into a ROS script. I have to admit using my Tik router to play music is kind of fun, but probably not all that useful.