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

Re: Very basic sound programming question



On Apr 1, 5:27 am, lyricalnanoha <lyricalnan...@usotsuki.hoshinet.org>
wrote:
> On Wed, 1 Apr 2009, Jim wrote:
> > <gids...@sasktel.net> wrote:
>
> >> Here is an assimilation volume control I came across in ML
>
> >> 300: A0 90       LDY #90
> >> 302: A9 60       LDY #60
> >> 304: 38            SEC
> >> 305: ED 14 03  SBC 0314
> >> 308: 8D 0C 03  STA 030C
> >> 30B: A2 01       LDX #01
> >> 30D: CA           DEX
> >> 30E: DO FD     BNE 030D
> >> 310: AD 30 C0  LDA C030
> >> 313: A2 60        LDX #60
> >> 315: CA            DEX
> >> 316: D0 FD       BNE 0315
> >> 318: AD 30 C0  LDA C030
> >> 31B: 88            DEY
> >> 31C: D0 ED      BNE 30B
> >> 31E: 60            RTS
>
> >> DURATION $301 (769), PITCH $303 (771), VOLUME $314 (788)
>
> >> For Volume, the maximum is half the number for the pitch.
> >> 1=softest   pitch/2=loudest
>
> >> Test with this
> >> 320:A9 01 8D 14 03 EE 14 03 AD 14 03 C9 60 D0 F3 60
>
> > Thank you very much for that. Sadly I have no way of entering it, as I
> > don't have an assembler. My hunt for a Super Serial card so I can use
> > ADTPro continues :-)
>
> The actual machine-code is there, you can use the monitor to enter it
> (call -151)
>
> -uso.


If ye be baffled by machine code, then applesoft to the rescue

10 FOR I= 768 TO 768+64 : READ J: POKE I,J: NEXT
20 DATA 160,144,169,96,56,237,20,3,141,12,3,162,32,202,208,253
30 DATA 173,48,192,162,64,202,208,253,173,48,192,136,208,237,96,96
40 DATA 169,1,141,20,3,32,0,3,162,1,169,1,32,88,252,202
50 DATA 208,248,238,20,3,173,20,3,201,64,208,233,96,0,0,255
60 HOME: INPUT "ENTER (PITCH,DURATION) -> ";PT$,DUR$
65 PT = VAL (PT$): DUR = VAL (DUR$)
70 FOR VOL = 1  TO  PT/2
80POKE 771,PT: POKE 769,DUR :POKE788,VOL: CALL 768
90 NEXT : GOTO 60

also a CALL 800 will run the volume scale in machine language