--- title: "“Santa-C” Holiday Program" type: "article" slug: "santa-c-holiday-program" url: "http://localhost/article/santa-c-holiday-program/" markdown_url: "http://localhost/article/santa-c-holiday-program.md" published_at: "2020-10-27T17:10:44+00:00" modified_at: "2026-06-21T23:23:19+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "This program contains two novel approaches to BASIC programming of the 2068 computer that I developed in teaching the subject in adult education classes. One is a departure from the text-book method of programming BEEP (music?) and the other is the concurrent playing of BEEP music with animation. We get by with such a mixture…" category: - name: "SUM" slug: "sum" taxonomy: "category" url: "http://localhost/category/periodicals/sum/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Warren Fricke" slug: "warren-fricke" taxonomy: "indiv" url: "http://localhost/indiv/warren-fricke/" publication: "SUM" publication_r: id: 10242 title: "SUM" type: "periodical" url: "http://localhost/periodical/sum/" authors: "Warren Fricke" volume: "3" issue: "11" issues_articles: - id: 26631 title: "SUM v3 n11" type: "issue" url: "http://localhost/issue/sum-v3-n11/" pages: "5-7" pubdate: "November 1985" archive_link: false volumeissue: "vIIIn11" article_media: - id: 56247 title: "Santa-C" type: "computer_media" url: "http://localhost/computer_media/santa-2/" --- # “Santa-C” Holiday Program This program contains two novel approaches to BASIC programming of the 2068 computer that I developed in teaching the subject in adult education classes. One is a departure from the text-book method of programming BEEP (music?) and the other is the concurrent playing of BEEP music with animation. We get by with such a mixture in this instance because the melody is the familiar, bouncy jingle called, SANTA CLAUSE IS COMING TO TOWN. It’s from the score shown in figure 1. This is a display type of program. Run it, look, and listen. Here, for those interested in how it works, is an explanation. First off, BEEP music on the 2068, as the Manual presents it and is usually written, is awkward. Programs require many BEEP and/or DATA lines to store the values of duration and pitch. Duration usually has decimal values and pitch may have negative ones. Values such as this are a nuisance to enter because the keyshifting to get commas, decimal points, and negative signs is time consuming and error prone. SANTA-C takes a different approach. It assigns duration to a sequence of lower case variables, using letters “a” to “j” where they have arbitrary values from .25 to 20. These values are, for the prime notes of the scale, a geometric progression and double in value . from one prime note to the next longer one. Some notes may have values that are mid-way to the prime ones. Lines 1010 and 5130 of the LISTing assign such values to the variables, so the quarter-note getsS a value of 4, the whole-note a value of 16, a thirty-second note a value of 0.5, etc. Rests, periods of silence, use these same values. At this stage it is necessary only to establish their proper time relationship to each other so that a quarter-note has a duration of one-guarter of a whole-note. The tempo or playing speed of a song can then be varied simply by changing the denominator, here 48, that appears in the BEEP lines 1135, T2337: and 1335. Increasing the 48 increases the tempo. SANTA-C uses the same pitch values that are given in the manual. But these can be negative if any note has ae pitch below middle C of the scale. When the melody has such a note, an arbitrary constant of 10 is added to all notes of the song to eliminate negatives. and then, in the BEEP line, a compensating 10 is deducted. Refer to and compare lines 1135, 1235, and 1335. These two departures from the conventional allow us to use strings to store the duration and pitch values of a sequence of musical notes and rests. Every note that we are likely to encounter can be represented by just three characters, a lower case letter and 2 digits. Such strings can easily be sliced into pieces of 3 characters each in a FOR-NEXT loop. The first of these characters contains the duration value; the second and third contain the pitch value. These values are converted to numerical ones and adjusted if need be and then sent to a BEEP line that renders the proper tone. Why use strings instead of DATA lines? For many applications on the 2068, strings are more concise and easy to manipulate. DATA lines always involve commas, and sometimes negative signs and decimal points. Workable, but confusing and tedious because of the key shifting required. All of the music for the jingle this program produces is contained in the 3 strings of lines 1020 to 1040. DATA lines would require nearly five times’ the program space for the same information. Normally the 2068 can do only one thing at a time, either BEEP or take some action. So BEEP music and animation do not readily mix. SANTA-C mixes the two however, and gets away with it because the tune selected is somewhat a bouncy strain that seems to blend with the prancing steps of the reindeer. The program is arranged so that it plays a note, does one part of the animation picture, plays the next note, does a second part of the picture, plays the next note, etc. (Ed. note: try adding sleigh bells. Try adding SOUND 0,34;1,0;2,26;3,0;4,12;5,0;6,0;7,0;8 16;9,16;10,16;12,8; 1 ## Source Code: Santa-C ``` 2 REM \..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.. 3 REM \: SANTA-C \ : 4 REM \: by \ : 5 REM \: WARREN FRICKE \ : 6 REM \: -1985- \ : 7 REM \''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\'' 10 GO SUB 5000 20 GO SUB 4000 40 DIM e$(32) 50 LET f$=e$+CHR$ 144+CHR$ 145+CHR$ 146+CHR$ 145+CHR$ 144+CHR$ 145+CHR$ 146+CHR$ 145+CHR$ 151+CHR$ 152 60 LET g$=e$+CHR$ 147+CHR$ 148+CHR$ 149+CHR$ 150+CHR$ 147+CHR$ 148+CHR$ 149+CHR$ 150+CHR$ 153+CHR$ 154 70 LET h$=e$+CHR$ 149+CHR$ 150+CHR$ 147+CHR$ 148+CHR$ 149+CHR$ 150+CHR$ 147+CHR$ 148+CHR$ 153+CHR$ 154 1000 RESTORE 5130 1010 READ a,b,c,d,e,f,g,h,i,j 1020 LET a$="d17d14d15e17f17d17d19d21e22g22d14d15e17e17e17d19d17e15g15e14e17e10e14e12g15e09i10" 1030 LET b$="g79e79d79" 1040 LET c$="g69e69e12e14e12e11e12e09g09e12e14e12e11e12h09e14e16e14e13e14e11e11e11d11d12e14e12e11e09e07e69f07d07d04d05e07f07d07d09d11e12g12d04d05e07e07e07d09d07e05g05e04e07e00e04e02g05e14j12h69" 1050 LET d$=a$+b$ 1100 FOR n=1 TO LEN d$-2 STEP 3 1135 LET duration=VAL d$(n): LET pitch=VAL d$(n+1 TO n+2)-10: BEEP duration/48,pitch: GO SUB 2000+(1000 AND n/2=INT (n/2)): NEXT n 1200 FOR n=1 TO LEN a$-2 STEP 3 1235 LET duration=VAL a$(n): LET pitch=VAL a$(n+1 TO n+2)-10: BEEP duration/48,pitch: GO SUB 2000+(1000 AND n/2=INT (n/2)): NEXT n 1300 FOR n=1 TO LEN c$-2 STEP 3 1335 LET duration=VAL c$(n): LET pitch=VAL c$(n+1 TO n+2)-10: BEEP duration/48,pitch: GO SUB 2000+(1000 AND n/2=INT (n/2)): NEXT n 1350 PAUSE 30 1360 GO TO 1100 2000 REM FIRST POSITION 2005 PRINT AT 6,0; INK 6;f$( TO 32)' INK 6;g$( TO 32): GO TO 3500 3000 REM second position 3005 PRINT AT 6,0; INK 6;f$( TO 32)' INK 6;h$( TO 32) 3500 LET f$=f$(2 TO LEN f$)+f$(1): LET g$=g$(2 TO LEN g$)+g$(1): LET h$=h$(2 TO LEN h$)+h$(1): RETURN 4000 REM background 4005 BORDER 0: PAPER 0: INK 7: CLS 4020 FOR n=1 TO 20 4030 PLOT OVER 1; INK (3*RND+4);255*RND,30*RND+145 4040 NEXT n 4050 PLOT 0,48: DRAW 255,32 4060 PLOT 0,112: DRAW 110,-51 4070 PRINT AT 14,5;"\::\::\::\::\::\::";AT 15,5;"\::\::\::\::\::\::" 4080 PRINT AT 16,5; INK 1;"\ :\::\::\::\::\: ";AT 17,5;"\ '\''\''\''\''\' " 4090 PRINT AT 16,6; INK 6;"\..";AT 16,9;"\..";AT 17,9;"\''" 4100 PRINT AT 13,5; INK 2;"\ :" 4120 PRINT INK 1;AT 12,5;".";AT 11,5;".";AT 9,8;"." 4130 PRINT INK 1;AT 11,6;"S"; OVER 1;CHR$ 8;"s" 4140 PRINT INK 1;AT 10,7;"O"; OVER 1;CHR$ 8;"s" 4150 PRINT FLASH 1; INK 4; PAPER 2;AT 19,2;" ";AT 20,2;" MERRY CHRISTMAS ";AT 21,2;" " 4160 PRINT INK 4;AT 9,26;"\::";AT 10,25;"\:: \::";AT 11,26;"\::\::";AT 12,25;"\:: \::\::";AT 13,26;"\::\::";AT 14,24;"\:: \::\::\::";AT 15,23;"\:: \::\::\:: \::";AT 16,22;"\:: \::" 4170 FOR r=16 TO 18: PRINT INK 6;AT r,26;"\::": NEXT r 4200 PRINT AT 8,26;"_" 4210 PRINT AT 9,25;"_";AT 9,27;"_" 4220 PRINT AT 11,28;"_";AT 13,28;"_";AT 14,29;"_";AT 15,30;"_" 4230 PRINT AT 17,11;"_";AT 18,2;"__________________";AT 19,24;"______";AT 20,21;"____" 4250 RETURN 5000 REM sleigh graphics 5002 FOR j=USR CHR$ 144 TO USR CHR$ 154+7: READ k: POKE j,k: NEXT j 5005 RETURN 5010 DATA 0,2,4,8,120,24,28,27 5020 DATA 0,0,0,0,0,0,24,240 5030 DATA 0,16,16,32,96,176,24,27 5040 DATA 19,15,6,28,32,64,0,0 5050 DATA 112,242,48,24,4,2,0,0 5060 DATA 19,79,60,32,16,8,0,0 5070 DATA 112,242,48,32,32,64,128,0 5080 DATA 0,0,6,7,2,3,7,7 5090 DATA 0,0,1,2,21,88,170 5100 DATA 95,151,188,82,49,15,0,0 5110 DATA 218,254,8,20,34,255,0,0 5130 DATA .25,.5,1,2,4,6,8,12,16,20 9997 STOP 9998 SAVE "SANTA" LINE 1 ```