DECIMAL DISTORTION VALUE WHAT IT SOUNDS LIKE ---------- --------------------- 00 & 11 TOTALLY SILENT 01 Buzzy tones 02 Carries distortion 1 downward into a rumble. 03 Flangy wavering tones, like a UFO 04 & 05 Pure tones 06 & 10 Inbetween pure tone and buzzy tones (Adventure death uses this) Maybe filters off the highs here 07 & 09 Reedy tones, much brighter, down to Enduro car rumble 08 White noise/explosions/lightning, jet/spacecraft engine 12 & 13 Pure tones, goes much lower in pitch than 04 & 05. 14 Electronic tones, mostly lows, extends to rumble. 15 Electronic tones, mostly highs, extends to rumble.So as "Batari" puts it himself:
setting the values, for instance, by AUDV0=10:AUDC0=12:AUDF0=4 will produce a tone, and it will stay on until you set AUDV0=0. typically, a frame counter is set up that keeps sounds on for a specified number of frames (which occur 60 times a second.)
| Note | Optimal | TIA | Cents Off | Dist (AUDC_) |
Pitch (AUDF_) |
|---|---|---|---|---|---|
| c2 | 32.6 | 32.7 | 6.9% | 6 | 30 |
| d2 | 36.4 | 36.2 | -9.8% | 6 | 27 |
| e2 | 40.7 | 40.6 | -5.6% | 6 | 24 |
| g2 | 48.1 | 48.3 | 8.5% | 6 | 20 |
X frames = 1 beat * 1 minute * 60 seconds * 60 frames
120 beats 1 minute 1 second
In this case, X is 30. In other words, the number of frames for a single beat is (3600 / # of BPM). (300 / BMP for PAL.)
dim musicPointer=a dim musicTimer=b dim tempaudv=t rem VOLUME DOWN AND SET CHANNELS AUDV0=0 AUDC0=DISTORTION rem INITIALIZE POINTERS AND TIMERS musicPointer=$FF musicTimer=0 startLoop rem TIME TO UPDATE NOTE? if musicTimer = 0 then gosub changeMusicNote musicTimer = musicTimer - 1 drawscreen goto startLoop changeMusicNote musicPointer = musicPointer + 1 AUDF0 = musicData[musicPointer] tempaudv = 8 if musicData[musicPointer] = $FF then tempaudv = 0 AUDV0 = tempaudv musicPointer = musicPointer + 1 musicTimer = musicData[musicPointer] rem value is (2 * #_OF_NOTES) - 1 if musicPointer > (2 * #_OF_NOTES) - 1 then musicPointer = #-1 return data musicData LIST OF FREQUENCY, LENGTH end |
Mary had a little lamb, E D C D E E E little lamb, little lamb D D D E G G Mary had a little lamb, E D C D E E E It's fleece was white as snow E D D E D CReplacing notes with the AUDF0 values:
Mary had a little lamb, 24 27 30 27 24 24 24 little lamb, little lamb 27 27 27 24 20 20 Mary had a little lamb, 24 27 30 27 24 24 24 It's fleece was white as snow 24 27 27 24 27 30Every syllable in the song takes about a beat, except for some of the "lamb"s and "snow" which take 2 or 4. So the lengths are:
Mary had a little lamb, 30 30 30 30 30 30 60 little lamb, little lamb 30 30 60 30 30 60 Mary had a little lamb, 30 30 30 30 30 30 30 It's fleece was white as snow 30 30 30 30 30 120Merging those into the note frequency, note length format the engine uses:
dim musicPointer=a dim musicTimer=b dim tempaudv=t rem VOLUME DOWN AND SET CHANNELS AUDV0=0 AUDC0=6 rem INITIALIZE POINTERS AND TIMERS musicPointer=$FF musicTimer=0 startLoop rem TIME TO UPDATE NOTE? if musicTimer = 0 then gosub changeMusicNote musicTimer = musicTimer - 1 drawscreen goto startLoop changeMusicNote musicPointer = musicPointer + 1 AUDF0 = musicData[musicPointer] tempaudv = 8 if musicData[musicPointer] = $FF then tempaudv = 0 AUDV0 = tempaudv musicPointer = musicPointer + 1 musicTimer = musicData[musicPointer] rem value is (2 * #_OF_NOTES) - 1 if musicPointer > 69 then musicPointer = #-1 return data musicData 24,30,27,30,30,30,27,30,24,28,-1,2,24,28,-1,2,24,60 27,28,-1,2,27,28,-1,2,27,60,24,30,20,28,-1,2,20,60 24,30,27,30,30,30,27,30,24,28,-1,2,24,28,-1,2,24,28,-1,2 24,30,27,28,-1,2,27,30,24,30,27,30,30,120 end |