RBMUS-PO.TXT 11/12/84 HOW TO PUT MUSIC INTO YOUR RBBS by P. L. Olympia, Ph.D. Darwin Systems, Inc. Sysop, SUGI SIG/M RBBS, 301-963-5249 APOLOGIA In this piece, I will tell you how to put musical scores into your RBBS text files such as the WELCOME, BULLETIN and MENUx files. The actual musical score looks like so much alphabet soup to a caller using a communication program other than PC-TALK version 4.65 or later. With the correct version of PC-TALK, though, the caller hears the music on her PC. Now, this is the strangest piece I have ever written because the truth is ... I DON'T KNOW ANYTHING ABOUT MUSIC. I don't know a treble clef from a cleft chin; for years, I thought that C sharp was a dairy product from Kraft; I don't know how to play any musical instrument - although when I was 12 I played the organ - and then only because I was a boy! Anyway ... My point here is simply this: I cannot guarantee the veracity of anything I say about music. I figured out how to put music into RBBS by deduction and experimentation - like the good old days (a few years back) when I was at the university professing about atomic structure. I got on the right track after reading a piece written by Greg Rismoen (thanks, Greg). HOW IS IT DONE? Turns out that the whole thing is the ultimate in simplicity so long as you are not too shy about plagiarism. I began by fooling around with the BASICA PLAY statement. I failed miserably here given my shameful music knowledge (or lack thereof). I then started looking at some of the song programs in BASIC in the public domain. Then, everything fell into place ... Here is a one-line musical score that if you place in any of your RBBS text file will play that eternal favorite, "Happy Birthday" ^[[MBT120L4MFMNO4C8C8DCFE2C8C8DCGF2C8C8O5CO4A F E D2T90 B-8 B-8 A F G F2 ^[[00m Now, here is the file "HAPPYB.BAS" (author unknown) from where I got the notes: 5 FOR X%=1 TO 15:Y$=INKEY$:NEXT X% 6 IF INKEY$="" THEN 6 10 PLAY "t120 l4 mfmn" 20 PLAY "o4 c8 c8 d c f e2" 30 PLAY " c8 c8 d c g f2" 40 PLAY " c8 c8 o5 c o4 a f e d2" 50 PLAY "t90 b-8 b-8 a f g f2" 58 FOR X%=1 TO 15:Y$=INKEY$:NEXT X% 59 IF INKEY$="" THEN 59 60 CHAIN "A:PLOTTER Do you see the connection? All I did was begin the musical score with the ANSI sequence [MF (that is the ^[[MF), then appended all those arguments of the PLAY statement to it, then terminated the line with a . The ^[[00m in the following line is not really part of the song but simply turns off any special screen attributes so that the caller's PC-TALK defaults are restored. ONE MORE TIME Since I may have gone a little too fast there, let's review the rules: o Each musical score line must begin with [ (shows on your screen as ^[[) and terminate with a CTRL-N o The very first line should have MB (Music Background, that is, don't wait until the score is finished before continuing with another process) following the [ sequence. I found that MF (Music Foreground) also works. o The MB (or MF) is NOT necessary on succeeding lines. o Between the [ and the CTRL-N you can place the notes (A-G), musical directives such as T (Tempo, e.g., T120), L (Length of note e.g., L6), O (Octave, e.g., O3). All this mumbo-jumbo codes are explained below. Be patient. o Everything must be in CAPS. The BASICA PLAY statement is case- insensitive but PC-TALK which is the one that will interpret the musical code insists on CAPS only. o Spaces between the notes or music directives are OPTIONAL. o It is best to place all the notes or directives into one line. If the song is too long try to use as few lines as possible. That is because the song becomes artificially broken when PC-TALK sees a CR/LF sequence and echoes those to the user's terminal. o It is a good idea to terminate the song with [00m That turns off all special attributes to prevent PC-TALK from being confused. WHAT DOES ALL THAT GOBBLEDYGOOK MEAN? All you music lovers who are not programmers are probably wondering what all those musical codes such as G#, T120, O3, B-8 mean? Here is the scoop: CHARACTERS IN MUSICAL SCORE (AND BASICA PLAY STATEMENT) A - G Musical Notes # or + Following A-G note means sharp - Following A-G note means flat < Move down one octave > Move up one octave . Period acts as dotted note (extend note duration by 3/2) FOREGROUND OR BACKGROUND MF Music Foreground (complete note before starting another process; MB Music Background (another process may begin before speaker is finished playing note) DURATION, TEMPO AND OTHERS MN Music note duration Normal (7/8 of interval between notes) MS Music note duration Staccato (decrease duration of following notes) ML Music note duration Legato (increase duration of following notes) Ln Length of note (n=1-64, 1=whole note, 4=quarter note, etc) Pn Pause length (same n values as Ln above) Tn Tempo, n=notes/minute (n=32-255, default n=120) On Octave number (n=0-6, default n=4) Nn Play note number n (n=0-84, used in BASICA PLAY statement) Xstring Execute string (used only in BASICA PLAY statement) As I understand it, (what do I know?) the symbolism in the treble clef staff is such that it is represented by 5 lines. Each line corresponds to a note (tone?); each space between the lines also corresponds to additional notes. F ---------------- The mnemonic device for these are: E (reading bottom to top): D ---------------- C SPACES: F-A-C-E B ---------------- A LINES: Every-Good-Boy-Does-Fine G ---------------- F E ---------------- TEST-DRIVING THE MUSIC You can test the music on-line by placing it on any of the RBBS text files, even in DIR ## and calling for a listing of the file from a remote location. That is the hard way. The easy way is to use the program VIEW1.EXE (author unknown) which is available from this RBBS and others. VIEW1 requires BASRUN.EXE because this BASIC program was not compiled with the /O option. If the author of the program is reading this, it would be an act of kindness if you release the source code to the public domain. VIEW1 will display your color text files (but so does the TYPE command with ANSI.SYS installed) and play the music. Unfortunately, sometimes, a perfectly good musical score will be rejected by the program with an ominous message such as "Illegal function call ...". In some cases, the music works on an RBBS but is rejected by VIEW1. I use VIEW1 to test out the best place to break a long string of notes into multiple lines. COMPOSING YOUR OWN RBBS MUSIC If you have the musical talent and a programming bent, you can develop and test out your music interactively using BASICA and the PLAY statement. If you only have musical talent, you can use programs such as BLUESBOX.BAS (also available from this RBBS and others) to compose your computer music from sheet music. BLUESBOX saves the song into a text file but without line feeds - no problem with text editors such as WordStar. Other music composing programs such as the excellent (what do I know?) PC-MUSICIAN writes its output in binary form. Such a shame. Or, if you are like me whose musical talent went on permanent vacation, just rummage through the many BASIC songs programs in the public domain. PARTING NOTE Now that I have told you all the "secrets" of getting music into your RBBS, the least you can do is send your best efforts to my RBBS. But only popular and "beautiful" music please. I already have all the classical music and I really don't have any use for punk rock. And now, to see whether you've been paying attention, here is your pop quiz. Guess this tune. Please submit all entries to 1600 Pennsylvania Ave, Washington, DC 20001. All entries must be postmarked no later than when the Federal budget exceeds 1 trillion $. ^[[MSO3L16EL6EL16EL4EL4EL8EL4DL2FP4P16L16DL6DL16DL4DL4DL4DL2CP4P8P16 ^[[EL6EL16EL4EL4EL8EL4DL2FP4P16L16DL6DL16DL4DL4DL4DL2CP4P8P16 ^[[00m ENJOY!!       4 minutes left File Function ?