Arron W. Branigan did some pretty cool art for his Christmas program. On Day 110 I used his snowman image from the December, 1986 Rainbow article “Go Tell It On the CoCo”, and I chose his nativity scene from the same program for today. It’s Christmas Eve, and the cattle are lowing.
Would you like to know what cattle look like in Extended Color BASIC?
- 1270 REM ***COW***
- 1280 LINE (24,156)-(0,156),PSET
- 1290 LINE -(0,140),PSET
- 1300 CIRCLE (8,141),8,8,1,.50,.75
- 1310 LINE (8,134)-(28,130),PSET
- 1320 LINE -(36,132),PSET
- 1330 LINE (40,144)-(36,130),PSET
- 1340 LINE -(48,130),PSET:LINE -(44,144),PSET:LINE -(40,144),PSET
- 1350 LINE (46,141)-(44,156),PSET
- 1360 LINE -(28,152),PSET
- 1370 LINE -(16,152),PSET
- 1380 LINE (24,156)-(24,152),PSET
- 1390 LINE (36,140)-(40,153),PSET
- 1400 LINE -(28,152),PSET
- 1410 CIRCLE (42,116),25,2,.5,.15,.38
- 1420 PSET (39,133,2):PSET (45,133,2)
- 1430 PAINT (20,144),8,8
- 1440 CIRCLE (8,152),15,3,1,.75,1
- 1450 CIRCLE (36,150),15,3,1,.50,.25
- 1460 COLOR 2,1
- 1470 LINE (42,132)-(42,138),PSET
The LINE statement acted a little like the turtle in the old LOGO programming language. There’s a pencil position, and LINE remembers it. If you leave out the starting position, as Branigan does several times here, ECB assumes that the line starts where the previous line left off. If there was no previous line, it starts in the middle, location (128, 96). And remember that locations are mode independent in Extended Color BASIC. It doesn’t matter if you’re in high resolution, medium resolution, or low resolution, the location numbers will be the same.
If you want to see just the cow, add a line 1269 and a line 1471:
- 1269 PMODE 3,1:SCREEN 1,0:PCLS 3:COLOR 4,1
- 1471 GOTO 1471
Then, type GOTO 1269.
Most of the programs I’ve featured over the last eight days have also used music. Except for John Mosley’s Do You Hear What I Hear?, they all used the PLAY statement for that music. Branigan separates his melodies into subroutines. If you’ve loaded the program onto your CoCo or appropriate emulator, you can type GOSUB 1700 to hear “Away In the Manger”.
- 1700 REM **AWAY IN THE MANGER**
- 1710 FOR X=1 TO 2
- 1720 PLAY "V27;L4;O4;C;L4.;C;L8;
- O3;B-;L4;A;L4.;A;L8;G;L4;F;P30;F
- ;E;D;L2;C;L4;P30;C;L4.;P30;C;L8;
- D;L4;C;P30;C;G;E;D;C;F;L2;A;L4;O
- 4;C;P30;L4.;C;L8;O3;B-;L4;A;L4.;
- A;L8;G;L4;F;P30;F;E;D"
- 1730 PLAY "L2;C;L4;P30;C;L4.;B-;
- L8;A;L4;G;A;G;F;G;D;E;L2;F"
- 1740 NEXT X
- 1750 PLAY "L1;F"
- 1760 RETURN
I’ve chosen to display this the way it ran in The Rainbow rather than the way it would appear in a printout, because line 1720 is a long line. Melodies often were. The play statement was very cool, because rather than sound frequencies and durations, it used musical notes. Any letter from A to G was that note. The letter O set the octave; L set note lengths with 1 being a whole note, 2 being a half note, 4 being a quarter note, and so on; T set the tempo, V set the volume, and P was a pause. It wasn’t a rest, because P did not act like a note: you had to put the pause length after the letter P. It would not assume the length like notes did. Durations could even be dotted just as on a musical staff, the pound symbol denoted a sharp, and the dash a flat.
I used the same technique for the piano script in 42 Astoundingly Useful Scripts and Automations for the Macintosh, except that I do use a true rest, and I put dots on the note instead of on the duration.
This makes it very easy to translate music from paper to the computer. You can read the melody from the PLAY string: volume 27, quarter notes, note C, dotted quarter, another C, eighth note, octave 3, B-flat, and so on. Branigan uses semicolons to make the items more readable, but they’re not necessary.
On my piano script, you might play Beethoven’s famous four-note opening like this:
- piano --key E- --tempo 108 R - 12 G G G 2 v+++ -E
Using the PLAY statement, it would go like this:
- PLAY "V5;T2;O2;P2;L12;G;G;G;L2;V9;E-"
The PLAY statement could not play multiple voices at once. That’s one of the reasons Mosley wrote his own machine code for his tunes. Likely, another reason is that the one voice it does have is not the best that the CoCo can produce. But what PLAY lacked in quality, it made up in simplicity. You didn’t need any special knowledge of frequencies or even programming to make music. All you needed was the ability to read music. Because of this, The Rainbow contained a lot of music programs by people who wouldn’t otherwise have written computer programs. And if you did know programming, writing music editors was as simple as string manipulation. PLAY could even take a library of tunes or motifs and mix them up. A letter X followed by a string variable inserted the value of that string variable into the melody. Branigan used that feature in Frosty the Snowman:
- 4660 '***FROSTY THE SNOWMAN***
- 4670 F$="L2O2GL4EL8FL4GL2O3CL4O2BL8O3CL4DCO2BAGGBO3L8CL4DCO2BAL4G;O3CO2EL8GAL4GF"
- 4680 F1$="EFL2G":F2$="EDL2C"
- 4690 S$="L2GL4AAO3CL8CO2L4BAGEFAGFEL2EL4DDFFAAO3L2CCL8DL4CCO2BAL2G"
- 4700 T$="L4GL8GGL4GGAL8GGL4GGAGEGL2D"
- 4710 L$="L8BO3CL4DCO2BAGO3CO2L2EL8GAL4GFL2EO3DL1C"
- 4720 PLAY "T5;XF$;XF1$;XF$;XF2$;XS$;XF$;XF2$;XT$;XL$;"
- 4725 RETURN
The PLAY statement on line 4720 is made up entirely of a tempo and then predefined parts. Careful use of the substring function in PLAY allowed you to alter tempo, volume, duration, and even octave while reusing the same melody.
In response to 8 (bit) Days of Christmas: Eight holiday images created on the TRS-80 Color Computer, from the early to mid eighties.
- 42 Astoundingly Useful Scripts and Automations for the Macintosh
- MacOS uses Perl, Python, AppleScript, and Automator and you can write scripts in all of these. Build a talking alarm. Roll dice. Preflight your social media comments. Play music and create ASCII art. Get your retro on and bring your Macintosh into the world of tomorrow with 42 Astoundingly Useful Scripts and Automations for the Macintosh!
- 8 (bit) Days of Christmas: Day 1 (Do You Hear What I Hear?)
- For day 1 of the 8 (bit) days of Christmas, John Mosley’s “Do You Hear What I Hear?” from the December, 1987, Rainbow Magazine. Mosley coaxes four-voice music out of the CoCo 1 and 2 using a machine-language program.
- 8 (bit) Days of Christmas: Day 110 (Snowman)
- Day 110 of the 8 (bit) days of Christmas is Arron Branigan’s snowman, from December 1986. One of the strangest features of home computers of the era, including the TRS-80 Color Computer, was the use of “artifact colors” to produce more colors than were supposedly possible on the machine.
More Christmas
- Candy cane oatmeal crispies
- These candy cane cookies are a great way to use up post-Christmas candy canes. You might even want to hit the after-Christmas sales just to get canes to make these with.
- Sparkling lights for Christmas
- This POV-Ray scene file will animate sparkling lights against a green background. If you want to make three dimensional images with lots of similar objects and then animate them, this will show you how to do it.
- 8 (bit) Days of Christmas
- Eight holiday images created on the TRS-80 Color Computer, from the early to mid eighties.
- Have a Merry Scripting Christmas with Persistence of Vision
- The ASCII Merry Christmas from Astounding Scripts was taken from a scene I created in Persistence of Vision. It’s a very simple scene that highlights many of the advantages of using POV to create images.
- Real frothin’ eggnog
- You are going to need a straw to drink this eggnog—because it’s too frothy to pour out of your glass.
- Two more pages with the topic Christmas, and other related pages
More Color Computer
- Simple game menu for the Color Computer 2 with CoCoSDC
- This simple menu provides one screen for cartridges saved in the CoCoSDC’s flash ROM, and any number of screens for your favorite games for your friends to play.
- Rainbow Magazine preflight tool enhanced
- I’ve added several features to the Rainbow Magazine preflight tool, including a check for references to line numbers that don’t exist.
- CoCoFest! 2021
- Forty years later, I finally make it to CoCoFest!
- BASIC tokenization examined
- Why do old BASIC programs have strange characters in their .BAS files? Why do they look like they’re compiled code?
- What are the 8 bits in 8-bit computing?
- Retro computing is often called 8-bit computing. This is because the bytes that these computers use are composed of eight bits, and much of what the computer does is operating on these individual bits, not on the byte as a whole.
- 19 more pages with the topic Color Computer, and other related pages