[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Very basic sound programming question



On Mar 31, 5:10 am, Jim <j...@magrathea.plus.com> wrote:
> On 2009-03-31, Jim <j...@magrathea.plus.com> wrote:
>
> [snip]
>
> Actually, hold off on that - I just discovered the sitehttp://8bitsoundandfury.ld8.org/programming.htmlwhich seems to have what I
> need. From that site:
> ----------
> Not sure where this came from so I can't properly credit it, though I'm sure
> I'm not giving away any trade secrets by publishing it here. Basically this
> just pokes in a Machine Language tone generator from AppleSoft which can, in
> turn, be called from the same AppleSoft program:
>
> 10 FOR L = 770 TO 790: READ V: POKE L,V: NEXT L
> 20 DATA 173,48,192,136,208,5,206,1,3,240,9
> 30 DATA 202,208,245,174,0,3,76,2,3,96
>
> Now we have the tone generating routine in memory all we have to do is tell
> it what note to play and for how long. This is done like so:
>
> 40 POKE 768,F: POKE 769,D

One critical piece of information seems to be missing... how to
actually trigger the sound!  You can do that with:
50 CALL 770

I played a low then high "C" with this:

10 FOR L = 770 TO 790: READ V: POKE L,V: NEXT L
20 DATA  173,48,192,136,208,5,206,1,3,240,9
30 DATA  202,208,245,174,0,3,76,2,3,96
40 F1 = 255 : D1 = 75 : REM LOW C
50 F2 = 64 : D2 = 50 : REM HIGH C
60 POKE 768,F1: POKE 769,D1 : CALL 770
70 POKE 768,F2: POKE 769,D2 : CALL 770