MediaWiki:Sitenotice:
2025-12-29: I have restored the wiki to a backup from the end of November. Starting in September 2025, accesses went form the 800MB-1.2GB range per month to 26GB in September, 42GB in October, and 70GB in November with most accesses originating from China. As soon as I realized what was causing all the access problems in November, I shut it down (it had reached 36GB by then) behind a password/login screen. The database had gotten corrupted, and I tried a restore from just before the spike in access but that didn't work. Thus, end of November. I still have the other daily backups so if there were any important additions in December, let me know and maybe they can be recovered. - Allen H.

Music made easy (Rainbow 1981-07)

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Revision as of 11:31, 28 March 2019 by Luis46coco (talk | contribs)
Jump to navigation Jump to search

For those of you who like music, let us first recommend the fine article on the COLOR Computer in the latest issue of "80-Microcomputing." By far the best program there is one named "Music-Music-Music." And it is written for the COLOR Computer. But one of the things it does not do is allow you to play songs as a part of any other Programs you might wish to run. It's an entity (albeit a fine one) to itself.

What we were trying to do was put together a horse race program which we were going to call Derby (remem-ber, the RAINBOW comes from Louisville). We wanted the program to play "My Old Kentucky Home" as the horses moved to the post. But, a couple of try's in decoding notes from a music book into SOUND (and PLAY) statements left a lot to be desired.

Well, the "Music Music Music" program solved that problem for us, we used it to get a really good rendition of "My Old Kentucky Home." The problem was, how to get that code into another program.

Enter "Music Made Easyl" We just wrote the following few lines, added them to their own little space on the "Music Music Music" program, loaded a data tape for the song we wanted and then "broke" the original program. That left all the notes in their array, each with the proper code for SOUND's syntax. We then instructed the COLOR Computer to GOT06000 (the line where the Codebreaker started). The result was a Printout of the proper codes for SOUND. The codebreaker is listed below:

6000 FOR X=0 TO 750
6010 PRINT#-2,X,P(X)" "D(X)
6020 NEXT X

Here's the routine to Play the music for which you have obtained the codes. As to explanation Lines 1-5 READ in the conversion of the code obtained in the previous program and the numbers necessary to make SOUND work right. Line 10 is set to the number of notes -- which you will get from your codebreaker. Line 30 is a very important line, which converts musical "rests" into a FOR-NEXT loop. Line 40 actually plays the note. And Line 60 onward is the code from the codebreaker, all in DATA statements.

Here's the Program:

1 DIM N(48)

2 FOR N=l TO 48

3 READ N(N):NEXT

4 DATA 5, 19, 32, 43, 58, 69, 78, 89, 99, 108, 117, 125, 133, 140, 147, 153, 159, 165, 170, 176, 180, 185, 189, 193

5 DATA 197, 200, 204, 207, 210, 213, 216, 218, 221, 223, 225, 227, 229, 231, 232, 234, 236, 237, 238, 239, 241, 242, 243, 244

10 FOR X=1 TO 250:'SET TO # NOTES

20 READ P,D

30 IF P=0 THEN FOR T=l TO (D*5):NEXT: GOTO50

40 SOUND N(P),D

50 NEXT X 61 DATA 17, 8, 10, 8, 12, 8, 17. 8