how to loop
ZXNet echo conference «code.zx»
From Vladimir Galtscev → To Kirill Frolov 24 November 1998
Hi, Kirill!
one day on 11/23/98 at exactly 02:22:00 I noticed an altercation between
Dmitry Lomov and Kirill Frolov about how to loop and I couldn’t
pass by without kicking this matter...
KF>> numbers in Wicommn. This table is not endless. The problem is
KF>> phase matching at the time of restart from the beginning of the table.
DL> loop the table in the zero phase. length will depend
DL> on the combination of frequencies... and who has it easy right now? :)
KF>> Maybe there are smarter solutions? Like for example in AOHs it
KF>> done ?
DL> there the timer helps, you can also count the real time. I didn’t pick specifically.
KF>> I can’t do it in real time - now it’s 23KHz, but then it will be 10.
DL> not so little. maybe it will roll.
I may be wrong, that's my right, but just today
(or yesterday, or maybe tomorrow) I mixed two sine signals
and it didn’t seem to me that there was 10 kHz...
Best looping - endless playback in real time
Here's the program:
LD IX,#1000
LD D,TAB/256
LD HL,0
LD BC,#0100 ; first signal frequency
EXX
LD D,TAB/256
LD HL,0
LD BC,#0432 ; frequency of the second signal (greater than the first)
P1
LD E,H
LD A,(DE); take the 1st byte
ADD HL,BCEXX:EX DE,HL
LD H,E
ADD A,(HL):RRA; find the arithmetic mean with 2nd
EX DE,HL
ADD HL,BC
; You don't have to put the second EXX...
; in register A the result
OUT(XX),A
DEC LX:JP NZ,P1
DEC HX:JP NZ,P1
RET
With best wishes, Vladimir Galtscev or -=STS=-