MediaWiki:Sitenotice:
2024-03-02: The wiki ran out of disk space, so things were not working. This has been resolved by adding another 5GB of quota ;-) Thanks to Tim Lindner for reporting the issues. 2020-05-17: If a page gives you an error about some revision not being found, just EDIT the page and the old page should appear in the editor. If it does, just SAVE that and the page should be restored. OS-9 Al (talk) 12:22, 17 May 2020 (CDT)

Music made easy (Rainbow 1981-07): Difference between revisions

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
=MUSIC MADE EASY=
<blockquote>
La etiqueta '' 'blockquote' '' sangrará ambos márgenes cuando sea necesario en lugar del margen izquierdo solo como lo hacen los dos puntos.
</blockquote>
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.
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.


Line 13: Line 8:
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:
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:


<source lang=C>
int main()
{
    printf("hola");
}
</source>
<code>
<code>
6000 FOR X=0 TO 750<br>
6010 PRINT#-2,X,P(X)"  "D(X)<br>
6020 NEXT X<br>
</code>
: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:
<code>
1 DIM N(48)


6000 FOR X=0 TO 750
2 FOR N=l TO 48


6010 PRINT#-2,X,P(X)"  "D(X)
3 READ N(N):NEXT


6020 NEXT X
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


</code>
</code>
: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

Revision as of 11:31, 28 March 2019

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