Dvojkanalova hudobna rutinka so stereofonnymi reverbami

Zdrojový kód


3      5b00            *s
4      5b00                                            33 "2#" Dvojkanalka s reverbom
5      5b00                                                    Totaaaalne zmenena !!!
6      5b00                                                    22.09.96 - 29.09.96
7      5b00            *s
8      5b00            *z!
9      5b00            ;o17.63
10     5b00            left   =    #1f                  lavy D/A
11     5b00            right  =    #3f                 pravy D/A
12     5b00            cwd    =    #7f                 riadenie 8255
13     5b00             
14     5b00            maxvol =    #1f                 Maximalne volume
15     5b00            maxdel =    #10                 Maximalne delay v reverboch
16     5b00             
17     5b00            llrev  =    maxdel*#0100
18     5b00                   org  #00                 *** Veci v rychlej ramke ***
19     0000            revll  ds   llrev                lavy reverb buffer
20     1000            revrr  ds   llrev               pravy reverb buffer
21     2000            voltab ds   #2000               volume tabulka (maxvol+1)*256
22     4000            k3
23     4000                   org  #8000
24     8000            int    ds   #0200               vektor + rutinka interuptu
25     8200            ticho  ds   #0200               nasamplovane ticho
26     8400                   ds   #0100
27     8500            player ds   #0100               adresa pre ulozenie playera
28     8600             
29     8600            vol    =    >voltab
30     8600            revlhi =    >revll
31     8600            revrhi =    >revrr
32     8600            hitich =    >ticho
33     8600            hiti00 =    hitich*#0100
34     8600            titi   =    hitich+hiti00
35     8600             
36     8600                   org  #6000               *** Veci v pomalej ramke ***
37     6000            p
38     6000 f3         run    di                       Hlavny start
39     6001 31a367            ld   sp,stack
40     6004 3e80              ld   a,#80               Ini 8255
41     6006 d37f              out  (cwd),a
42     6008 d31f              out  (left),a
43     600a d33f              out  (right),a
44     600c 01fd7f            ld   bc,#7ffd            banka so samplami
45     600f 3e14              ld   a,#14
46     6011 ed79              out  (c),a
47     6013             
48     6013 210020     mkvolt ld   hl,voltab           Vypocet volume tabulky
49     6016 0620              ld   b,#20               maxvol+1
50     6018 e5         mkv1   push hl
51     6019 7c                ld   a,h
52     601a e61f              and  #1f
53     601c 87                add  a,a                 x rotacii
54     601d 87                add  a,a                 2^x = 256/(maxvol+1)
55     601e 87                add  a,a
56     601f 67                ld   h,a
57     6020 5d                ld   e,l
58     6021 cd3863            call multi
59     6024 cb3f              srl  a
60     6026 ed44              neg
61     6028 d680              sub  #80
62     602a cb05              rlc  l
63     602c 8c                adc  a,h
64     602d e1                pop  hl
65     602e 77                ld   (hl),a
66     602f 2c                inc  l
67     6030 20e6              jr   nz,mkv1
68     6032 24                inc  h
69     6033 10e3              djnz mkv1
70     6035             
71     6035 210082     mkpsst ld   hl,ticho            Vytvorenie samplu "ticho"
72     6038 110182            ld   de,ticho+1
73     603b 010001            ld   bc,#0100
74     603e 3680              ld   (hl),#80
75     6040 edb0              ldir                     256 bajtov #80
76     6042 04                inc  b
77     6043 71                ld   (hl),c              256 bajtov 0
78     6044 edb0              ldir
79     6046             
80     6046 210000     mkrev  ld   hl,revll            Vymazanie buffera reverbov
81     6049 110100            ld   de,revll+1
82     604c 010020            ld   bc,2*llrev
83     604f 3680              ld   (hl),#80
84     6051 edb0              ldir
85     6053             
86     6053 210080            ld   hl,int              Vytvorenie INT vektora
87     6056 7c                ld   a,h
88     6057 ed47              ld   i,a
89     6059 ed5e              im2
90     605b 3c                inc  a
91     605c 77         mkint  ld   (hl),a
92     605d 2c                inc  l
93     605e 20fc              jr   nz,mkint
94     6060 24                inc  h
95     6061 74                ld   (hl),h
96     6062 6c                ld   l,h
97     6063 eb                ex   de,hl
98     6064 215b63            ld   hl,rutint           Instalacia INT rutinky
99     6067 010900            ld   bc,rutend-rutint
100    606a edb0              ldir
101    606c             
102    606c 3e01       inic   ld   a,#01               Inicializacia hradla
103    606e 324c61            ld   (count1+1),a        a jeho parametrov
104    6071 326761            ld   (count2+1),a
105    6074 214664            ld   hl,text1
106    6077 224961            ld   (kanal1+1),hl
107    607a 213065            ld   hl,text2
108    607d 226461            ld   (kanal2+1),hl
109    6080 219965            ld   hl,stack1
110    6083 224661            ld   (stptr1+2),hl
111    6086 211966            ld   hl,stack2
112    6089 226161            ld   (stptr2+2),hl
113    608c             
114    608c 3e01              ld   a,#01               Inicializacia
115    608e 327965            ld   (sysv1-1),a         kanalovych systemoviek
116    6091 3e02              ld   a,#02
117    6093 328965            ld   (sysv2-1),a
118    6096 3eff              ld   a,#ff
119    6098 328865            ld   (nnww1),a
120    609b 329865            ld   (nnww2),a
121    609e 210000            ld   hl,#00
122    60a1 227a65            ld   (ffnn1),hl
123    60a4 228a65            ld   (ffnn2),hl
124    60a7 210082            ld   hl,ticho
125    60aa 228665            ld   (ssadd1),hl
126    60ad 229665            ld   (ssadd2),hl
127    60b0 216463            ld   hl,obalx
128    60b3 227e65            ld   (ffoad1),hl
129    60b6 228065            ld   (ffopc1),hl
130    60b9 228e65            ld   (ffoad2),hl
131    60bc 229065            ld   (ffopc2),hl
132    60bf 228265            ld   (vvoad1),hl
133    60c2 228465            ld   (vvopc1),hl
134    60c5 229265            ld   (vvoad2),hl
135    60c8 229465            ld   (vvopc2),hl
136    60cb             
137    60cb 3ec3       init   ld   a,#c3               Inicializacia playera
138    60cd 326585            ld   (theend),a          a jeho parametrov
139    60d0             
140    60d0 3e20              ld   a,>voltab
141    60d2 321285            ld   (vol1l),a           volume
142    60d5 321785            ld   (vol1r),a
143    60d8 325585            ld   (vol2l),a
144    60db 325d85            ld   (vol2r),a
145    60de 321e85            ld   (volbl),a           gain reverbov
146    60e1 323385            ld   (volbr),a
147    60e4             
148    60e4 3e10              ld   a,revlhi+maxdel     delay reverbov
149    60e6 322a85            ld   (delbl),a
150    60e9 3e20              ld   a,revrhi+maxdel
151    60eb 323f85            ld   (delbr),a
152    60ee             
153    60ee 210000            ld   hl,#00              frekvencie
154    60f1 220285            ld   (pitch1),hl
155    60f4 224585            ld   (pitch2),hl
156    60f7             
157    60f7 3e00              ld   a,ticho
161    6101 326f85            ld   (lop1hi),a
162    6104 327785            ld   (lop2hi),a
163    6107             
164    6107 dd218282          ld   ix,titi             registrove parametre
165    610b 210000            ld   hl,#00
166    610e 110010            ld   de,revrr
167    6111 d9                exx
168    6112 210000            ld   hl,#00
169    6115 110000            ld   de,revll
170    6118 31a367            ld   sp,stack
171    611b c30085            jp   player              A sup ho do playera !
172    611e             
173    611e 3e0f       error  ld   a,#0f
174    6120 d3fe              out  (#fe),a
175    6122 f3         exit   di                       Navrat do MRS
176    6123 ed56              im1
177    6125 af                xor  a
178    6126 ed47              ld   i,a
179    6128 3e10              ld   a,#10
180    612a 01fd7f            ld   bc,#7ffd
181    612d ed79              out  (c),a
182    612f c3b3f4            jp   #f4b3
183    6132             
184    6132            hradlo                          Obsluha (vola sa kazdych 50 Hz)
185    6132 e5                push hl                  hl-1
186    6133 d5                push de                  de-l
187    6134 d9                exx
188    6135 e5                push hl                  hl-2
189    6136 d5                push de                  de-r
190    6137 dde5              push ix                  h-ix
191    6139             
192    6139 3efe              ld   a,#fe               caps shift
193    613b dbfe              in   a,(#fe)
194    613d 0f                rrca
195    613e 30e2              jr   nc,exit
196    6140             
197    6140 fd217a65          ld   iy,sysv1            1.kanal
198    6144 dd215555   stptr1 ld   ix,#5555            stack pointer 1
199    6148 215555     kanal1 ld   hl,#5555            program counter 1
200    614b 3e55       count1 ld   a,#55               pocitadlo 1/50
201    614d 3d                dec  a
202    614e cc4062            call z,comand
203    6151 324c61            ld   (count1+1),a
204    6154 224961            ld   (kanal1+1),hl
205    6157 dd224661          ld   (stptr1+2),ix
206    615b             
207    615b fd218a65          ld   iy,sysv2            2.kanal
208    615f dd215555   stptr2 ld   ix,#5555            stack pointer 2
209    6163 215555     kanal2 ld   hl,#5555            program counter 2
210    6166 3e55       count2 ld   a,#55               pocitadlo 1/50
211    6168 3d                dec  a
212    6169 cc4062            call z,comand
213    616c 326761            ld   (count2+1),a
214    616f 226461            ld   (kanal2+1),hl
215    6172 dd226161          ld   (stptr2+2),ix
216    6176             
217    6176 2a8065     ff1    ld   hl,(ffopc1)         Frekvencia 1
218    6179 cde161            call obalka
219    617c 228065            ld   (ffopc1),hl
220    617f 2a7c65            ld   hl,(ffoo1)
221    6182 19                add  hl,de
222    6183 ed5b7a65          ld   de,(ffnn1)
223    6187 19                add  hl,de
224    6188 220285            ld   (pitch1),hl
225    618b             
226    618b 2a8465     vv1    ld   hl,(vvopc1)         Volume 1
227    618e cde161            call obalka
228    6191 228465            ld   (vvopc1),hl
229    6194 7a                ld   a,d
230    6195 e61f              and  maxvol
231    6197 c620              add  a,>voltab
232    6199 321285            ld   (vol1l),a
233    619c 7b                ld   a,e
234    619d e61f              and  maxvol
235    619f c620              add  a,>voltab
236    61a1 321785            ld   (vol1r),a
237    61a4             
238    61a4 2a9065     ff2    ld   hl,(ffopc2)         Frekvencia 2
239    61a7 cde161            call obalka
240    61aa 229065            ld   (ffopc2),hl
241    61ad 2a8c65            ld   hl,(ffoo2)
242    61b0 19                add  hl,de
243    61b1 ed5b8a65          ld   de,(ffnn2)
244    61b5 19                add  hl,de
245    61b6 224585            ld   (pitch2),hl
246    61b9             
247    61b9 2a9465     vv2    ld   hl,(vvopc2)         Volume 2
248    61bc cde161            call obalka
249    61bf 229465            ld   (vvopc2),hl
250    61c2 7a                ld   a,d
251    61c3 e61f              and  maxvol
252    61c5 c620              add  a,>voltab
253    61c7 325585            ld   (vol2l),a
254    61ca 7b                ld   a,e
255    61cb e61f              and  maxvol
256    61cd c620              add  a,>voltab
257    61cf 325d85            ld   (vol2r),a
258    61d2             
259    61d2 3ec3       hdrend ld   a,#c3               Koniec 50Hz obsluhy
260    61d4 326585            ld   (theend),a
261    61d7 dde1              pop  ix                  h-ix
262    61d9 d1                pop  de                  de-r
263    61da e1                pop  hl                  hl-2
264    61db d9                exx
265    61dc d1                pop  de                  de-l
266    61dd e1                pop  hl                  hl-1
267    61de c30185            jp   loop
268    61e1             
269    61e1 5e         obalka ld   e,(hl)              Nacitanie bajtu z obalky
270    61e2 23                inc  hl
271    61e3 56                ld   d,(hl)              Tvar obalky:
272    61e4 23                inc  hl                     dw LLRR
273    61e5 7a                ld   a,d                 a: dw LLRR
274    61e6 fe80              cp   #80                    dw LLRR
275    61e8 c0                ret  nz                     dw goto  (#8080)
276    61e9 ab                xor  e                      dw a:
277    61ea c0                ret  nz
278    61eb 7e                ld   a,(hl)
279    61ec 23                inc  hl
280    61ed 66                ld   h,(hl)
281    61ee 6f                ld   l,a
282    61ef 18f0              jr   obalka
283    61f1             
284    61f1 e5         nota   push hl                  Obsluha noty:
285    61f2 4f                ld   c,a
286    61f3 fd5e0c            ld   e,(iy+#0c)
287    61f6 fd560d            ld   d,(iy+#0d)
288    61f9 fdcbff4e          bit  1,(iy+#ff)
289    61fd 200d              jr   nz,setsa2
290    61ff 7a         setsa1 ld   a,d                 nastavenie
291    6200 329a67            ld   (hix+1),a           adresy
292    6203 53                ld   d,e                 samplu
293    6204 1e00              ld   e,#00
294    6206 ed53a167          ld   (hl1),de
295    620a 180b              jr   sets12
296    620c 7a         setsa2 ld   a,d
297    620d 329967            ld   (hix),a
298    6210 53                ld   d,e
299    6211 1e00              ld   e,#00
300    6213 ed539d67          ld   (hl2),de
301    6217            sets12
302    6217 fd6e04            ld   l,(iy+#04)          Frek.obalka
303    621a fd6605            ld   h,(iy+#05)
304    621d fd7506            ld   (iy+#06),l
305    6220 fd7407            ld   (iy+#07),h
306    6223 fd6e08            ld   l,(iy+#08)          Volu.obalka
307    6226 fd6609            ld   h,(iy+#09)
308    6229 fd750a            ld   (iy+#0a),l
309    622c fd740b            ld   (iy+#0b),h
310    622f             
311    622f 69                ld   l,c                 Vypocet
312    6230 2600              ld   h,#00               frekvencie
313    6232 29                add  hl,hl               z cisla
314    6233 29                add  hl,hl               noty
315    6234 29                add  hl,hl
316    6235 fd7500            ld   (iy+#00),l          Vzorkovanie samplu:
317    6238 fd7401            ld   (iy+#01),h          F(Hz) = 256 * nota
318    623b             
319    623b e1                pop  hl
320    623c fd7e0e     nnic   ld   a,(iy+#0e)          a je to.
321    623f c9                ret
322    6240             
323    6240 7e         comand ld   a,(hl)              Spracovanie prikazov
324    6241 23                inc  hl
325    6242 cb7f              bit  7,a                 Menej ako #80 ->
326    6244 28ab              jr   z,nota              -> to su noty
327    6246 fe80              cp   nic                 #80 je "nic" alebo "end"
328    6248 28f2              jr   z,nnic
329    624a             
330    624a fe8e              cp   max
331    624c d21e61            jp   nc,error            maximalne je 'max' prikazov
332    624f 114062            ld   de,comand
333    6252 d5                push de
334    6253 e5                push hl
335    6254 87                add  a,a
336    6255 c663              add  a,tabcom
338    6259 6f                ld   l,a
339    625a 3001              jr   nc,#01
340    625c 24                inc  h
341    625d 7e                ld   a,(hl)
342    625e 23                inc  hl
343    625f 66                ld   h,(hl)
344    6260 6f                ld   l,a
345    6261 e3                ex   (sp),hl
346    6262 c9                ret
347    6263             
348    6263            goto   =    #8080
349    6263            nic    =    #80                 Prikazy
350    6263            jump   =    #81
351    6263            call   =    #82
352    6263            ret    =    #83
353    6263            for    =    #84
354    6263            next   =    #85
355    6263            halt   =    #86
356    6263            rerun  =    #87                 loop
357    6263            vvobal =    #88                 volu.obalka
358    6263            ffobal =    #89                 frek.obalka
359    6263            sampel =    #8a                 definicia sampla
360    6263            offset =    #8b                 posun frekvencie
361    6263            wait   =    #8c                 dlzka noty
362    6263            reverb =    #8d
363    6263            max    =    #8e
364    6263             
365    6263 3c62       tabcom dw   nnic                Syntax:
366    6265 7f62              dw   cjump               jump adresa
367    6267 8462              dw   ccall               call adresa
368    6269 8c62              dw   cret                ret
369    626b 9762              dw   cfor                for pocet
370    626d a962              dw   cnext               next
371    626f bb62              dw   chalt               halt
372    6271 6c60              dw   inic                inic
373    6273 0f63              dw   cvobal              vvobal adresa
374    6275 1963              dw   cfobal              ffobal adresa
375    6277 eb62              dw   csamp               sampel start loop
376    6279 2363              dw   cffset              offset posun
377    627b 2d63              dw   cwait               wait pocet
378    627d bf62              dw   crevb               reverb delay gain delay gain
379    627f             
380    627f                                            === Programovaci jazyk ===
381    627f cd3363     cjump  call getww               db jump
382    6282 eb                ex   de,hl               dw adresa
383    6283 c9                ret
384    6284             
385    6284 cd3363     ccall  call getww               db call
386    6287 cd9e62            call push                dw adresa
387    628a eb                ex   de,hl
388    628b c9                ret
389    628c             
390    628c            cret                            db ret
391    628c dd2b       pop    dec  ix
392    628e dd2b              dec  ix
393    6290 dd6e00            ld   l,(ix+#00)
394    6293 dd6601            ld   h,(ix+#01)
395    6296 c9                ret
396    6297             
397    6297 7e         cfor   ld   a,(hl)              db for
398    6298 23                inc  hl                  db pocet_opakovani
399    6299 dd7700            ld   (ix+#00),a
400    629c dd23              inc  ix
401    629e dd7500     push   ld   (ix+#00),l
402    62a1 dd7401            ld   (ix+#01),h
403    62a4 dd23              inc  ix
404    62a6 dd23              inc  ix
405    62a8 c9                ret
406    62a9             
407    62a9 eb         cnext  ex   de,hl               db next
408    62aa cd8c62            call pop
409    62ad dd35ff            dec  (ix+#ff)
410    62b0 2805              jr   z,nxtend
411    62b2 dd23              inc  ix
412    62b4 dd23              inc  ix
413    62b6 c9                ret
414    62b7 eb         nxtend ex   de,hl
415    62b8 dd2b              dec  ix
416    62ba c9                ret
417    62bb             
418    62bb 2b         chalt  dec  hl                  db halt
419    62bc d1                pop  de                  (zastavi vykonavanie prikazov)
420    62bd af                xor  a                   (je to ako aaa: nic; jump aaa)
421    62be c9                ret
422    62bf                                            === Prikazy na hudbu ===
423    62bf             
424    62bf cddc62     crevb  call getdel              db reverb      Definicia reverbu
425    62c2 c600              add  a,>revll            db delay_left    (1..maxdel)
426    62c4 322a85            ld   (delbl),a           db gain_left     (0..maxvol)
427    62c7 cde462            call getvol              db delay_right   (1..maxdel)
428    62ca 321e85            ld   (volbl),a           db gain_right    (0..maxvol)
429    62cd cddc62            call getdel
430    62d0 c610              add  a,>revrr
431    62d2 323f85            ld   (delbr),a
432    62d5 cde462            call getvol
433    62d8 323385            ld   (volbr),a
434    62db c9                ret
435    62dc             
436    62dc 7e         getdel ld   a,(hl)              prinesie parameter pre delay
437    62dd 23                inc  hl
438    62de fe10              cp   maxdel
439    62e0 d8                ret  c
440    62e1 3e10              ld   a,maxdel
441    62e3 c9                ret
442    62e4             
443    62e4 7e         getvol ld   a,(hl)              prinesie parameter pre volume
444    62e5 23                inc  hl
445    62e6 e61f              and  maxvol
446    62e8 c620              add  a,>voltab
447    62ea c9                ret
448    62eb             
449    62eb cd3363     csamp  call getww               db sampel     Definicia samplu
450    62ee fd730c            ld   (iy+#0c),e          dw start_adresa
451    62f1 fd720d            ld   (iy+#0d),d          dw loop_adresa
452    62f4 cd3363            call getww
453    62f7 fdcbff4e          bit  1,(iy+#ff)
454    62fb 2009              jr   nz,setsl2
455    62fd 7b         setsl1 ld   a,e
456    62fe 326c85            ld   (lop1lo),a
457    6301 7a                ld   a,d
458    6302 326f85            ld   (lop1hi),a
459    6305 c9                ret
460    6306 7b         setsl2 ld   a,e
461    6307 327485            ld   (lop2lo),a
462    630a 7a                ld   a,d
463    630b 327785            ld   (lop2hi),a
464    630e c9                ret
465    630f             
466    630f             
467    630f cd3363     cvobal call getww               Volume obalka
468    6312 fd7308            ld   (iy+#08),e
469    6315 fd7209            ld   (iy+#09),d
470    6318 c9                ret
471    6319             
472    6319 cd3363     cfobal call getww               Frekvencna obalka
473    631c fd7304            ld   (iy+#04),e
474    631f fd7205            ld   (iy+#05),d
475    6322 c9                ret
476    6323             
477    6323 cd3363     cffset call getww               Offset frekvencie
478    6326 fd7302            ld   (iy+#02),e
479    6329 fd7203            ld   (iy+#03),d
480    632c c9                ret
481    632d             
482    632d 7e         cwait  ld   a,(hl)              Definicia dlzky noty
483    632e fd770e            ld   (iy+#0e),a
484    6331 23                inc  hl
485    6332 c9                ret
486    6333             
487    6333 5e         getww  ld   e,(hl)
488    6334 23                inc  hl
489    6335 56                ld   d,(hl)
490    6336 23                inc  hl
491    6337 c9                ret
492    6338             
493    6338 2e00       multi  ld   l,#00               Nasobenie hl=h*e
494    633a 55                ld   d,l
495    633b 29300119          dw   #3029,#1901
496    633f 29300119          dw   #3029,#1901
497    6343 29300119          dw   #3029,#1901
498    6347 29300119          dw   #3029,#1901
499    634b 29300119          dw   #3029,#1901
500    634f 29300119          dw   #3029,#1901
501    6353 29300119          dw   #3029,#1901
502    6357 29                add  hl,hl
503    6358 d0                ret  nc
504    6359 19                add  hl,de
505    635a c9                ret
506    635b             
507    635b 08         rutint ex   af,af               Rutinka beziaca z prerusenia
508    635c 3e01              ld   a,#01
509    635e 326585            ld   (theend),a
510    6361 08                ex   af,af
511    6362 fb                ei
512    6363 c9                ret
513    6364            rutend
514    6364             
515    6364 00008080   obalx  dw   #00,goto,obalx      Neutralna obalka
            6463        
516    636a             
517    636a            k
518    636a            ;--------------------------------------------------------------;
519    636a            ; Hudobne data - priklad hudby
520    636a             
521    636a            drum   =    #c000               Adresy samplov
522    636a            hihat  =    #cd50               (tri sa neloopuju)
523    636a            hooman =    #d530
524    636a            string =    #eea0               (stvrty sa loopuje)
525    636a            strlop =    #eea0+#58
526    636a             
527    636a 8a         bum    db   sampel
528    636b 00c00082          dw   drum,ticho
529    636f 8c20              db   wait,32
530    6371 88                db   vvobal
531    6372 d063              dw   obamax
532    6374 83                db   ret
533    6375             
534    6375 8a         tss    db   sampel
535    6376 50cd0082          dw   hihat,ticho
536    637a 8c10              db   wait,16
537    637c 88                db   vvobal
538    637d d063              dw   obamax
539    637f 83                db   ret
540    6380             
541    6380 8a         hom    db   sampel
542    6381 30d50082          dw   hooman,ticho
543    6385 88                db   vvobal
544    6386 d063              dw   obamax
545    6388 83                db   ret
546    6389             
547    6389 8a         str    db   sampel
548    638a a0eef8ee          dw   string,strlop
549    638e 88                db   vvobal
550    638f d063              dw   obamax
551    6391 83                db   ret
552    6392                                            *** Obalky ***
553    6392             
554    6392 00000101   obalup dw   #00,#0101           Stupajuce volume, oba kanaly
555    6396 02020303          dw   #0202,#0303
556    639a 04040505          dw   #0404,#0505
557    639e 06060707          dw   #0606,#0707
558    63a2 08080909          dw   #0808,#0909
559    63a6 0a0a0b0b          dw   #0a0a,#0b0b
560    63aa 0c0c0d0d          dw   #0c0c,#0d0d
561    63ae 0e0e0f0f          dw   #0e0e,#0f0f
562    63b2 10101111          dw   #1010,#1111
563    63b6 12121313          dw   #1212,#1313
564    63ba 14141515          dw   #1414,#1515
565    63be 16161717          dw   #1616,#1717
566    63c2 18181919          dw   #1818,#1919
567    63c6 1a1a1b1b          dw   #1a1a,#1b1b
568    63ca 1c1c1d1d          dw   #1c1c,#1d1d,#1e1e
            1e1e        
569    63d0 1f1f8080   obamax dw   #1f1f,goto,obamax   oba kanaly naplno
            d063        
570    63d6 011f8080   oballl dw   #1f01,goto,oballl   len lavy kanal
            d663        
571    63dc 1f018080   obarrr dw   #011f,goto,obarrr   len pravy kanal
            dc63        
572    63e2             
573    63e2 1f1f1e1e   obdown dw   #1f1f,#1e1e         Klesajuce volume, oba kanaly
574    63e6 1d1d1c1c          dw   #1d1d,#1c1c
575    63ea 1d1b1a1a          dw   #1b1d,#1a1a
576    63ee 19191818          dw   #1919,#1818
577    63f2 17171616          dw   #1717,#1616
578    63f6 15151414          dw   #1515,#1414
579    63fa 13131212          dw   #1313,#1212
580    63fe 1d111010          dw   #111d,#1010
581    6402 0f0f0e0e          dw   #0f0f,#0e0e
582    6406 0d0d0c0c          dw   #0d0d,#0c0c
583    640a 0b0b0a0a          dw   #0b0b,#0a0a
584    640e 09090808          dw   #0909,#0808
585    6412 07070606          dw   #0707,#0606
586    6416 05050404          dw   #0505,#0404
587    641a 03030202          dw   #0303,#0202,#0101
            0101        
588    6420 00008080   quiet  dw   #00,goto,quiet      Nulova hlasitost stale
            2064        
589    6426             
590    6426 14148080   obalxx dw   #1414,goto,obalxx   Nizsia hlasitost pre reverby
            2664        
591    642c             
592    642c 00001400   fobvib dw   0,20,40,60,40,20,0  Frekvencna obalka
            28003c00    
            28001400    
            0000        
593    643a 80802c64          dw   goto,fobvib         (vibrate efekt)
594    643e             
595    643e 00005000   fobarp dw   0,80                Frekvencna obalka
596    6442 80803e64          dw   goto,fobarp         (arpegiato efekt)
597    6446             
598    6446                                            *** Text pre kanal 1 ***
599    6446             
600    6446 8d010001   text1  db   reverb,1,0,1,0      reverb off
            00          
601    644b 8b0000            db   offset,0,0          offset off
602    644e 89                db   ffobal              frekvencna obalka
603    644f 2064              dw   quiet               nulova
604    6451 88                db   vvobal
605    6452 2064              dw   quiet               bud ticho
606    6454 8a                db   sampel
607    6455 00820082          dw   ticho,ticho
608    6459 8c00              db   wait,0
609    645b 80808080          db   nic,nic,nic,nic     1024 pedesiatin ticha
610    645f             
611    645f 82         txtrst db   call
612    6460 8063              dw   hom                 zvuk = hooman
613    6462 82                db   call
614    6463 1465              dw   melodi              zahraj kratku melodiu
615    6465             
616    6465            ;Predvadzanie nabehu a dobehu hlasitosti
617    6465             
618    6465 82                db   call                zvuk = string (periodicky)
619    6466 8963              dw   str
620    6468 8c20              db   wait,32             1 doba = 32 pedesiatin
621    646a 88                db   vvobal
622    646b 9263              dw   obalup              obalka = hlastost narasta
623    646d 20                db   32                  1 dobu znie zvuk (s obalkou)
624    646e             
625    646e 84048085          db   for,4,nic,next      4 doby znie zvuk v strede
626    6472 88                db   vvobal
627    6473 d663              dw   oballl
628    6475 20                db   32                  1 dobu znie vlavo
629    6476 88                db   vvobal
630    6477 d063              dw   obamax
631    6479 20                db   32                  1 dobu znie v strede
632    647a 88                db   vvobal
633    647b dc63              dw   obarrr
634    647d 20                db   32                  1 dobu znie v pravo
635    647e 88                db   vvobal
636    647f d063              dw   obamax
637    6481 20                db   32                  1 doby znie zvuk v strede
638    6482 88                db   vvobal
639    6483 e263              dw   obdown              obalka = hlasitost klesa
640    6485 20                db   32                  1 dobu doznieva
641    6486             
642    6486 88                db   vvobal              Tentokrat zahraj melodiu
643    6487 e263              dw   obdown              s doznievajucou obalkou
644    6489 82                db   call                a zvukom string
645    648a 1465              dw   melodi
646    648c             
647    648c            ;Pozor, idu frekvencne obalky !
648    648c             
649    648c 82                db   call                zvuk = hooman
650    648d 8063              dw   hom
651    648f 82                db   call                demostruj frek.obalku
652    6490 c564              dw   melfre
653    6492             
654    6492 82                db   call                zvuk = string
655    6493 8963              dw   str
656    6495 82                db   call                demostruj frek.obalku
657    6496 c564              dw   melfre
658    6498             
659    6498            ;Pozor, idu reverby !
660    6498             
661    6498 82                db   call                zvuk = hooman
662    6499 8063              dw   hom
663    649b 88                db   vvobal              volume = trosku tichsie
664    649c 2664              dw   obalxx              (kvoli reverbu)
665    649e 82                db   call
666    649f db64              dw   melrev
667    64a1             
668    64a1 82                db   call
669    64a2 8963              dw   str                 zvuk = string
670    64a4 88                db   vvobal
671    64a5 e263              dw   obdown              volume = klesajuce
672    64a7 82                db   call
673    64a8 db64              dw   melrev
674    64aa             
675    64aa 88                db   vvobal
676    64ab 2664              dw   obalxx              volume = konstantne
677    64ad 82                db   call
678    64ae db64              dw   melrev
679    64b0             
680    64b0            ;Nejake doznievane na koniec
681    64b0             
682    64b0 88                db   vvobal
683    64b1 e263              dw   obdown
684    64b3 8cff              db   wait,255
685    64b5 20                db   32
686    64b6 8d0d0f0e          db   reverb,13,15,14,15
            0f          
687    64bb 8080              db   nic,nic
688    64bd 8d010001          db   reverb,1,0,1,0
            00          
689    64c2 81                db   jump
690    64c3 5f64              dw   txtrst              A TO JE KONIEC HUDBY !!!
691    64c5             
692    64c5            ;Podprogram na demostraciu frekvencnej obalky
693    64c5             
694    64c5 89         melfre db   ffobal              frekvencia obalka: nic
695    64c6 2064              dw   quiet
696    64c8 82                db   call
697    64c9 2365              dw   mel                 kusok melodie
698    64cb             
699    64cb 89                db   ffobal
700    64cc 2c64              dw   fobvib              frekvencna obalka: vibrato
701    64ce 82                db   call
702    64cf 1465              dw   melodi              zahraj melodiu
703    64d1             
704    64d1 89                db   ffobal              frekvencna obalka: arpegiato
705    64d2 3e64              dw   fobarp
706    64d4 82                db   call
707    64d5 1465              dw   melodi              zahraj melodiu
708    64d7             
709    64d7 89                db   ffobal              frekvencna obalka: klud
710    64d8 2064              dw   quiet               (nulova)
711    64da 83                db   ret
712    64db             
713    64db            ;Podprogram pre demostraciu reverbov
714    64db             
715    64db 8d010001   melrev db   reverb,1,0,1,0      reverb off
            00          
716    64e0 82                db   call
717    64e1 2065              dw   meloff              kusok melodie
718    64e3             
719    64e3 8d051005          db   reverb,5,16,5,16    monofonny reverb: doznievanie
            10          
720    64e8 82                db   call
721    64e9 1465              dw   melodi
722    64eb             
723    64eb 8d101410          db   reverb,16,20,16,20  monofonny reverb: ozvena
            14          
724    64f0 82                db   call
725    64f1 1465              dw   melodi
726    64f3 80808080          db   nic,nic,nic,nic
727    64f7             
728    64f7 8d010001          db   reverb,1,0,1,0      reverb off
            00          
729    64fc 82                db   call
730    64fd 2365              dw   mel
731    64ff             
732    64ff 8d030f04          db   reverb,3,15,4,14    jemny stereo reverb
            0e          
733    6504 82                db   call
734    6505 1465              dw   melodi
735    6507             
736    6507 8d0f140d          db   reverb,15,20,13,20  brutalny stereo reverb
            14          
737    650c 82                db   call
738    650d 1465              dw   melodi
739    650f 80808080          db   nic,nic,nic,nic
740    6513             
741    6513 83                db   ret
742    6514             
743    6514 8b         melodi db   offset              frekvencia + 0
744    6515 0000              dw   0
745    6517 82                db   call                zahraj kusok meludie
746    6518 2365              dw   mel
747    651a             
748    651a 8b                db   offset
749    651b 3200              dw   50                  frekvencia + 50
750    651d 82                db   call                a takto zahraj melodiu
751    651e 2365              dw   mel
752    6520             
753    6520 8b         meloff db   offset              frekvencia - 30
754    6521 e2ff              dw   -30                 a takto zahraj melodiu
755    6523 8c10       mel    db   wait,16             1 doba = 16 pedesiatin
756    6525 8402              db   for,2
757    6527 28322880          db   40,50,40,nic
758    652b 1e1e80            db   30,30,nic
759    652e 85                db   next
760    652f 83                db   ret
761    6530             
762    6530                                            *** Text pre kanal 2 ***
763    6530             
764    6530 82         text2  db   call                (bum = kopak)
765    6531 6a63              dw   bum                 (tss = metlicky)
766    6533             
767    6533 8408              db   for,8
768    6535 2080              db   32,nic              8x bum
769    6537 85                db   next
770    6538             
771    6538 8080              db   nic,nic
772    653a             
773    653a 82         rytmus db   call                bum , tss , tss
774    653b 6f65              dw   bumts2
775    653d             
776    653d 82                db   call
777    653e 6a63              dw   bum
778    6540 20                db   32                  bum
779    6541 82                db   call
780    6542 7563              dw   tss
781    6544 88                db   vvobal
782    6545 d663              dw   oballl
783    6547 40                db   64                  tss left
784    6548 88                db   vvobal
785    6549 dc63              dw   obarrr
786    654b 40                db   64                  tss right
787    654c             
788    654c 82                db   call                bum , tss , tss
789    654d 6f65              dw   bumts2
790    654f             
791    654f 82                db   call
792    6550 6a63              dw   bum
793    6552 20                db   32                  bum
794    6553 82                db   call
795    6554 7563              dw   tss
796    6556 88                db   vvobal
797    6557 dc63              dw   obarrr
798    6559 40                db   64                  tss right
799    655a 88                db   vvobal
800    655b d663              dw   oballl
801    655d 40                db   64                  tss left
802    655e             
803    655e 82                db   call                bum , tss, tss
804    655f 6f65              dw   bumts2
805    6561             
806    6561 82                db   call
807    6562 6a63              dw   bum
808    6564 88                db   vvobal
809    6565 d663              dw   oballl
810    6567 20                db   32                  bum left
811    6568 88                db   vvobal
812    6569 dc63              dw   obarrr
813    656b 20                db   32                  bum right
814    656c             
815    656c 81                db   jump                a stale dokola
816    656d 3a65              dw   rytmus
817    656f             
818    656f 82         bumts2 db   call
819    6570 6a63              dw   bum
820    6572 20                db   32                  bum
821    6573 82                db   call
822    6574 7563              dw   tss
823    6576 4040              db   64,64               tss , tss
824    6578 83                db   ret
825    6579             
826    6579            k1                              *** koniec hudobnych dat ***
827    6579             
828    6579            ;--------------------------------------------------------------;
829    6579 01                db   #01                 Systemky kanalu 1
830    657a            sysv1
831    657a 0001       ffnn1  dw   #0100               +00 Frekvencia podla noty
832    657c 0000       ffoo1  dw   #00                 +02 offset frekvencie
833    657e 6463       ffoad1 dw   obalx               +04 Start frekvencnej obalky
834    6580 6463       ffopc1 dw   obalx               +06 Pocitadlo frekvencnej obalky
835    6582             
836    6582 6463       vvoad1 dw   obalx               +08 Start adresa volume obalky
837    6584 6463       vvopc1 dw   obalx               +0a Pocitadlo volume obalky
838    6586 0082       ssadd1 dw   ticho               +0c Bazova adresa samplu
839    6588             
840    6588 00         nnww1  db   #00                 +0e pocet 1/50 na notu
841    6589             
842    6589 02                db   #02                 Systemky kanalu 2
843    658a            sysv2
844    658a 0001       ffnn2  dw   #0100               +00 Frekvencia podla noty
845    658c 0000       ffoo2  dw   #00                 +02 offset frekvencie
846    658e 6463       ffoad2 dw   obalx               +04 Start frekvencnej obalky
847    6590 6463       ffopc2 dw   obalx               +06 Pocitadlo frekvencnej obalky
848    6592             
849    6592 6463       vvoad2 dw   obalx               +08 Start adresa volume obalky
850    6594 6463       vvopc2 dw   obalx               +0a Pocitadlo volume obalky
851    6596 0082       ssadd2 dw   ticho               +0c Bazova adresa samplu
852    6598             
853    6598 00         nnww2  db   #00                 +0e pocet 1/50 na notu
854    6599             
855    6599            ;--------------------------------------------------------------;
856    6599                                            Zasobniky systemu:
857    6599            stack1 ds   #80                 call/ret,for/next pre kanal1
858    6619            stack2 ds   #80                 call/ret,for/next pre kanal2
859    6699                   ds   #0100               Z80 machine code pre rutinku
860    6799            hix    ds   2                   |
861    679b            der    ds   2                   |
862    679d            hl2    ds   2                   |
863    679f            del    ds   2                   |
864    67a1            hl1    ds   2                   |
865    67a3            stack                           az potialto
866    67a3 00         e      nop
867    67a4            ;--------------------------------------------------------------;
868    67a4                   org  player              *** Player ***
869    8500 fb                ei                       Musi byt v rychlej ramke !
870    8501             
871    8501 01         loop   db   #01                 Kanal 1
872    8502 5555       pitch1 dw   #5555               <- frekvencia kanalu 1
873    8504 09                add  hl,bc
874    8505 3002              jr   nc,#02
875    8507 dd24              inc  xh
876    8509 dd44       ret1   ld   b,xh
877    850b 4c                ld   c,h
878    850c 0a                ld   a,(bc)
879    850d b7                or   a
880    850e 285b              jr   z,end1
881    8510 4f                ld   c,a
882    8511 06                db   #06
883    8512 55         vol1l  db   #55                 <- volume 1 left
884    8513 0a                ld   a,(bc)
885    8514 fd67              ld   yh,a
886    8516 06                db   #06
887    8517 55         vol1r  db   #55                 <- volume 1 right
888    8518 0a                ld   a,(bc)
889    8519 fd6f              ld   yl,a
890    851b             
891    851b 1a                ld   a,(de)              Lavy reverb
892    851c 4f                ld   c,a
893    851d 06                db   #06
894    851e 55         volbl  db   #55                 <- gain left
895    851f 0a                ld   a,(bc)
896    8520 fd84              add  a,yh
897    8522 d680              sub  #80
898    8524 12                ld   (de),a
899    8525 fd67              ld   yh,a
900    8527 13                inc  de
901    8528 7a                ld   a,d
902    8529 fe                db   #fe                 cp ..
903    852a 55         delbl  db   #55                 <- delay left
904    852b 3802              jr   c,#02
905    852d 1600              ld   d,>revll
906    852f             
907    852f d9                exx
908    8530             
909    8530 1a                ld   a,(de)              Pravy reverb
910    8531 4f                ld   c,a
911    8532 06                db   #06
912    8533 55         volbr  db   #55                 <- gain left
913    8534 0a                ld   a,(bc)
914    8535 fd85              add  a,yl
915    8537 d680              sub  #80
916    8539 12                ld   (de),a
917    853a fd6f              ld   yl,a
918    853c 13                inc  de
919    853d 7a                ld   a,d
920    853e fe                db   #fe                 cp ..
921    853f 55         delbr  db   #55                 <- delay reverb right
922    8540 3802              jr   c,#02
923    8542 1610              ld   d,>revrr
924    8544             
925    8544 01                db   #01                 Kanal 2
926    8545 5555       pitch2 dw   #5555               <- frekvencia kanalu 2
927    8547 09                add  hl,bc
928    8548 3002              jr   nc,#02
929    854a dd2c              inc  xl
930    854c dd45       ret2   ld   b,xl
931    854e 4c                ld   c,h
932    854f 0a                ld   a,(bc)
933    8550 b7                or   a
934    8551 2820              jr   z,end2
935    8553 4f                ld   c,a
936    8554 06                db   #06
937    8555 55         vol2l  db   #55                 <- volume 2 left
938    8556 0a                ld   a,(bc)
939    8557 fd84              add  a,yh
940    8559 1f                rra
941    855a d31f              out  (left),a
942    855c 06                db   #06
943    855d 55         vol2r  db   #55                 <- volume 2 right
944    855e 0a                ld   a,(bc)
945    855f fd85              add  a,yl
946    8561 1f                rra
947    8562 d33f              out  (right),a
948    8564             
949    8564 d9                exx
950    8565 c30185     theend jp   loop                <- toto sa modifikuje
951    8568 c33261            jp   hradlo
952    856b             
953    856b 26         end1   db   #26                 ld h,...  Loop samplu 1
954    856c 55         lop1lo db   #55
955    856d dd26              db   #dd,#26             ld xh,...
956    856f 55         lop1hi db   #55
957    8570 c30985            jp   ret1
958    8573             
959    8573 26         end2   db   #26                 ld h,... Loop samplu 2
960    8574 55         lop2lo db   #55
961    8575 dd2e              db   #dd,#2e             ld xl,...
962    8577 55         lop2hi db   #55
963    8578 c34c85            jp   ret2
964    857b            k2                              *** koniec playera ***
965    857b            l2     =    k2-player           dlzka playera
966    857b            cc     =    k-p
967    857b            l1     =    k1-p
968    857b            ll     =    l1+l2               dlzka kodu, z toho:
969    857b            dd     =    k1-k                dlzka dat
970    857b            l      =    cc+l2               dlzka rutinky

 bum    636a  *  bumts2 656f  *  call   0082  *  cc     036a  *
 ccall  6284  *  cffset 6323  *  cfobal 6319  *  cfor   6297  *
 chalt  62bb  *  cjump  627f  *  cnext  62a9  *  comand 6240  *
 count1 614b  *  count2 6166  *  cret   628c  *  crevb  62bf  *
 csamp  62eb  *  cvobal 630f  *  cwait  632d  *  cwd    007f  *
 dd     020f  *  del    679f  *  delbl  852a  *  delbr  853f  *
 der    679b  *  drum   c000  *  e      67a3  *  end1   856b  *
 end2   8573  *  error  611e  *  exit   6122  *  ff1    6176  *
 ff2    61a4  *  ffnn1  657a  *  ffnn2  658a  *  ffoad1 657e  *
 ffoad2 658e  *  ffobal 0089  *  ffoo1  657c  *  ffoo2  658c  *
 ffopc1 6580  *  ffopc2 6590  *  fobarp 643e  *  fobvib 642c  *
 for    0084  *  getdel 62dc  *  getvol 62e4  *  getww  6333  *
 goto   8080  *  halt   0086  *  hdrend 61d2  *  hihat  cd50  *
 hiti00 8200  *  hitich 0082  *  hix    6799  *  hl1    67a1  *
 hl2    679d  *  hom    6380  *  hooman d530  *  hradlo 6132  *
 inic   606c  *  init   60cb  *  int    8000  *  jump   0081  *
 k      636a  *  k1     6579  *  k2     857b  *  k3     4000  *
 kanal1 6148  *  kanal2 6163  *  l      03e5  *  l1     0579  *
 l2     007b  *  left   001f  *  ll     05f4  *  llrev  1000  *
 loop   8501  *  lop1hi 856f  *  lop1lo 856c  *  lop2hi 8577  *
 lop2lo 8574  *  max    008e  *  maxdel 0010  *  maxvol 001f  *
 mel    6523  *  melfre 64c5  *  melodi 6514  *  meloff 6520  *
 melrev 64db  *  mkint  605c  *  mkpsst 6035  *  mkrev  6046  *
 mkv1   6018  *  mkvolt 6013  *  multi  6338  *  next   0085  *
 nic    0080  *  nnic   623c  *  nnww1  6588  *  nnww2  6598  *
 nota   61f1  *  nxtend 62b7  *  obalka 61e1  *  oballl 63d6  *
 obalup 6392  *  obalx  6364  *  obalxx 6426  *  obamax 63d0  *
 obarrr 63dc  *  obdown 63e2  *  offset 008b  *  p      6000  *
 pitch1 8502  *  pitch2 8545  *  player 8500  *  pop    628c  *
 push   629e  *  quiet  6420  *  rerun  0087  *  ret    0083  *
 ret1   8509  *  ret2   854c  *  reverb 008d  *  revlhi 0000  *
 revll  0000  *  revrhi 0010  *  revrr  1000  *  right  003f  *
 run    6000  *  rutend 6364  *  rutint 635b  *  rytmus 653a  *
 sampel 008a  *  sets12 6217  *  setsa1 61ff  *  setsa2 620c  *
 setsl1 62fd  *  setsl2 6306  *  ssadd1 6586  *  ssadd2 6596  *
 stack  67a3  *  stack1 6599  *  stack2 6619  *  stptr1 6144  *
 stptr2 615f  *  str    6389  *  string eea0  *  strlop eef8  *
 sysv1  657a  *  sysv2  658a  *  tabcom 6263  *  text1  6446  *
 text2  6530  *  theend 8565  *  ticho  8200  *  titi   8282  *
 tss    6375  *  txtrst 645f  *  vol    0020  *  vol1l  8512  *
 vol1r  8517  *  vol2l  8555  *  vol2r  855d  *  volbl  851e  *
 volbr  8533  *  voltab 2000  *  vv1    618b  *  vv2    61b9  *
 vvoad1 6582  *  vvoad2 6592  *  vvobal 0088  *  vvopc1 6584  *
 vvopc2 6594  *  wait   008c  *                                

Bytes:1557  labels:174  errors:0   


Popis
Toto je hudobne hradlo umoznujuce hrat dvojkanalovu samplovanu hudbu. Kazdy kanal ma svoju vlastnu hlasitostnu a frekvencnu obalku pre lavu stranu a zvlast pre pravu stranu stereofonnej reprodukcie. Tymto dokaze kazdy z obidvoch kanalov uz sam o sebe vytvarat zaujimave stereofonne variacie. Okrem toho prvy kanal dokaze definovat reverby s parametrami (utlm a oneskorenie) zvlast nastavitelnymi pre lavu a pravu stranu, co umoznuje vyrabat este daleko fantastickejsie stereofonne variacie a rozne brutalne ozveny. Sucastou zdrojaku je tiez ukazkova hudba, ktora prezentuje hudobne schopnosti hradla.

Poznámky
Ako vystupne zariadenie pouziva hradlo dva 8-bitove D/A prevodniky, jeden pre lavu stranu a druhy pre pravu stranu stereofonnej reprodukcie. Zo zdrojaku vidno ze hradlo sice vyuziva dolnych 16 kB ramky (0000-3FFF) pre svoje buffery, ale nie je problem zmenit hodnotu v ORG tak aby vyuzival hornych 16 kB (C000-FFFF) a sample hodit do oblasti pamete 8000-BFFF spolu playerom. Ak ste zvedavi, ako znie hudba z tohto hradla, vypocujte si ukazkovu hudbu vo formate MP3.

Poslal
Busy