Sound Effects
Moderator: Moderators
- Mike
- Herr VC
- Posts: 4987
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Here I use V=36864 as the base address of the VIC chip. In my programs I either write out the addresses in full, i.e. 36878, or 36879, or I use this convention. Also, in ML the VIC registers are addressed as $900x, with x=0..F.
Using another VIC register as "base" (say, S=36875) implies a more arbitrary choice, and one might well end up with negative offsets, like POKES-6,255 to activate custom chars.
Using another VIC register as "base" (say, S=36875) implies a more arbitrary choice, and one might well end up with negative offsets, like POKES-6,255 to activate custom chars.
-
- Vic 20 Drifter
- Posts: 38
- Joined: Wed Feb 25, 2009 1:48 am
Sound effects
Can someone check this out? My VIC is down. It's suppose to sound like R2D2.
10 for L=1 to int(20*rnd(1))
20 poke 36878, int(14*rnd(1))
30 poke 36874, 240 + int(16*rnd(1))
40 for T=1 to int(150*rnd(1)): next
50 poke 36878, 0: next
60 getA$: if A$="" then 60
70 goto 10
Phil.
10 for L=1 to int(20*rnd(1))
20 poke 36878, int(14*rnd(1))
30 poke 36874, 240 + int(16*rnd(1))
40 for T=1 to int(150*rnd(1)): next
50 poke 36878, 0: next
60 getA$: if A$="" then 60
70 goto 10
Phil.
The earth is - oh my gosh - ROUND ! !
Re: Sound effects
I would either change the offset to 239 or the random range to 15. This is because POKE 36874,255 generates the lowest note the VIC-20 can play, not the highest in the register as you might expect. On the other hand, perhaps this is exactly what you want, a very low beep now and then. If so, leave everything as it is.Commander#1 wrote:30 poke 36874, 240 + int(16*rnd(1))
The range of the oscillators is 255, 128-254.
Anders Carlsson