Here - 1000 BiT
Here - 1000 BiT Here - 1000 BiT
INSTRUCTOR NOTES 29MUSICThis lesson continues the introduction of SID chip features with applications to making \^jmusic.Review the lesson on sound effects. DATA statements are used and may also need to bereviewed.We treat the ADSR parameters (attack, decay, sustain and release) in some detail. TheADSR parameters define a loudness envelope or contour for the duration of the note.^^Each parameter is one nybble in length and so two parameters can share one SID chip ^Jregister. A and D share one register, S and R share another.This is how it is done. A nybble is a number from 0 to 15. Memory is stored as bytes (anumber from 0 to 255). So each byte holds exactly two nybbles and can be represented as16*H + L where H is the high nybble and L is the low nybble. ^jThree of the ADSR parameters are times (A,D,R). The S, sustain, is a volume or loudness ^Jvalue. A table of time values for A,D, and R is given. Note that the time is not proportionalto the parameter value. A value of 5 gives an attack rise time of 0.056 seconds, but a ^value of 10 gives 0.5 seconds. A table of time values is included in the lesson. Times up to l,24 seconds are possible. Such long times are not useful in ordinary music but are usefulin sound effects. ^We refer the reader to the C-64 Programmer's Reference Guide for two of the mostadvanced features of SID: the programmable filter and the fact that voice 3 can be usedto control some feature of voices 1 and 2, for example the frequency, for vibratoor glissando. *,^SID can also accept audio from an external source (tape recorder, etc.), process it with uthe filter and add it to the internal sound. The output can be re-recorded, so you canbuild up a rich polyphonic piece in this way. ^QUESTIONS:1. What kind of sound will you get if you set the attack and decay each to the value 2, ^and sustain and release to 0?2. How do you store the pitch and length of each note of music in the program?3. How do you put the attack and decay numbers into the same POKE statement?4. How many voices does SID have? ^j5. How would you change the program to use voice 2 instead of voice 1? Would it sound Othe same?164
LESSON 29MUSICGo back and review the SOUND EFFECTS lesson. It tells a lot about the SID soundchip. Also review DATA in Lesson 18.SID PLAYS A TUNE10 REM ROW YOUR BOAT12C=54272:REMBASE ADDR15 FOR I=C TO C+24:POKE l.0:NEXT20 POKE C+5,9:POKE C+6.0:REM30POKEC+24,15:REM40READH,L,D:REMADSRVOLUMEGET NOTE50 IF H
- Page 113 and 114: TONES BY THE BUSHELEnter: 10 REM **
- Page 115 and 116: "TM" stands for "timbre." Timbre is
- Page 117 and 118: INSTRUCTOR NOTES 20NAMES, CLOCKS AN
- Page 119 and 120: cAnytimeyou type, the characters ar
- Page 121 and 122: LESSON 21COLOR GRAPHICSADJUST YOUR
- Page 123 and 124: Add these lines to the above progra
- Page 125 and 126: INSTRUCTOR NOTES 22POKEing GRAPHICS
- Page 127 and 128: Try this: Change the number 83 to a
- Page 129 and 130: We can number the streets and house
- Page 131 and 132: n INSTRUCTOR NOTES 23 SECRET WRITIN
- Page 133 and 134: THE COMPUTER ISIMPATIENTThe compute
- Page 135 and 136: ^ INSTRUCTOR NOTES 24 PRETTY PROGRA
- Page 137 and 138: Assignment 24A:1. The delay loop is
- Page 139 and 140: Assignment 24B:1. Write a short pro
- Page 141 and 142: LESSON 25 LOGIC: AND, OR, NOTANOTHE
- Page 143 and 144: THE IF COMMAND TELLS LITTLE WHITE L
- Page 145 and 146: THE LOGIC SIGNSYou can use these si
- Page 147 and 148: LESSON 26 SNIPPING STRINGS: LEFTS,
- Page 149 and 150: CUTTING A PIECE OUT OF THE MIDDLETh
- Page 151 and 152: nnO INSTRUCTOR NOTES 27 SWITCHING N
- Page 153 and 154: MAKING NUMBERS INTO STRINGSRun10 RE
- Page 155 and 156: Assignment 27:1. Write a program wh
- Page 157 and 158: LESSON 28ACTION GAMES AND THE FUNCT
- Page 159 and 160: LOOKING IN THE KEYBOARD'S BOXHere i
- Page 161 and 162: Run it. It puts a white diamond on
- Page 163: cTHETARGETS ARE HEARTSAdd these lin
- Page 167 and 168: REGISTER ADDRESSES Base address is
- Page 169 and 170: D^ INSTRUCTOR NOTES 30 ARRAYS AND T
- Page 171 and 172: The DIM... command tells the comput
- Page 173 and 174: 1 REM *** EIGHT QUEENS ***2 GOTO 10
- Page 175 and 176: Assignment 30:1. Write a program wh
- Page 177 and 178: LESSON 31SPRITES FOR ACTION GRAPHIC
- Page 179 and 180: Then use the CRSR keys to move the
- Page 181 and 182: MANY SPRITES AT ONCEHere are the bo
- Page 183 and 184: WATCH OUT, TWO SPRITES ARE GOING TO
- Page 185 and 186: LESSON 32USER FRIENDLY PROGRAMSTher
- Page 187 and 188: TIE A STRING AROUND THE USER'S FING
- Page 189 and 190: SET TRAPS FOR ERRORSExample: Add th
- Page 191 and 192: LESSON 33DEBUGGING, STOP, CONTTHE S
- Page 193 and 194: Use the PRINT command to look at va
- Page 195 and 196: RESERVED WORDSABSAND ASC ATNCHR$CLR
- Page 197 and 198: ells and whistlesA phrase going bac
- Page 199 and 200: error trapPart of a program which c
- Page 201 and 202: listingA list of all the lines in a
- Page 203 and 204: emarkA comment you make in the prog
- Page 205 and 206: variableA name given to a box in me
- Page 207 and 208: FORMULA TOO COMPLEXYou wrote a stri
- Page 209 and 210: SYNTAXYou "spelled" the line wrong.
- Page 211 and 212: 1 REM A4-310 REM*** SMILE***13 POKE
- Page 213 and 214: 1 REM A6-210 REM*** FAVORITE***15 P
LESSON 29MUSICGo back and review the SOUND EFFECTS lesson. It tells a lot about the SID soundchip. Also review DATA in Lesson 18.SID PLAYS A TUNE10 REM ROW YOUR BOAT12C=54272:REMBASE ADDR15 FOR I=C TO C+24:POKE l.0:NEXT20 POKE C+5,9:POKE C+6.0:REM30POKEC+24,15:REM40READH,L,D:REMADSRVOLUMEGET NOTE50 IF H