PT Player 3.51 Fix
ZXNet echo conference «music.zx»
From Ivan Roshin → To Alexey 13 April 2001
Hello, Alexey!
30 March 2001 you wrote:
AL> I recently read the help for BV 2.10 and it talked about a glitch in
AL> the subject is PT 3.51, so, I don’t quite understand what it is
AL> is it? Could you fix it?
As is known, to use music written in PT
3.51, in your program, it must be compiled with the player. Yes
Well, the player will not play music correctly if it contains
commands 9 and A (change the envelope frequency) were used, including
case if such a command is on a note using
envelope (if the command is not on a note, but by itself - all
will be fine).
The incorrect playback is that the envelope frequency is not
will change as if such a command did not exist at all. A
in order to still correctly play modules with commands 9 and A,
I need to fix the bug in the player.
In the description of BV 2.10 I gave a method of correction (zeroing
byte at offset #4C1 from the beginning of the player), but it was not quite
accurate Teams 9 and A then began to work, but not
finished changing the frequency when the next note was encountered,
using an envelope. So still some modules
didn't sound right.
So how do you make the final fix? B
source text of the player (it is included in the PT 3.51 package)
there is this fragment:
;--- install_E ---E_ins0 JR Ei_form
Esl_ids LD HL,0 ;stp_sld_env
LD (Esl_sds+1),HL
Esl_ist LD A,0 ;stp_sld_p
LD (Esl_stp+1),A <──────────────────────────── (1)
LD (Esl_sts+1),A
LD A,#18
LD(E_ins0),A
Ei_form LD A,0 ;env_form
LD(E_form+1),A
AND A
JR Z,temp
Ei_frq LD HL,0 ;env_frq
LD (E_frq+1),HL
XOR A
LD L,A
LD H,A
LD(Ei_form+1),A
LD (Esl_stp+1),A <──────────────────────────── (2)
LD (Esl_frq+1),HL
What do we see? (1) - to a variable at Esl_stp+1
one of the command parameters 9 or A is placed. Next, if this
the command was on a note using the envelope (i.e. Ei_form+1
not 0), then a program fragment containing (2) is executed -
Resetting the Esl_stp+1 variable to zero. The command parameter is reset to zero -
and as a result there will be no change in frequency of the envelope.
For a final fix, a fragment of the player needs to be
change it like this:
;--- install_E ---
E_ins0 JR Ei_form
Esl_ids LD HL,0 ;stp_sld_env
LD (Esl_sds+1),HL
Esl_ist LD A,0 ;stp_sld_p
LD (Esl_stp+1),A
LD (Esl_sts+1),A
LD A,(Ei_form+1)
AND A
JR Z,BUG_F3LD A,#3E
LD (BUG_F2),A
BUG_F3 LD A,#1
LD ( E_ins0 ), A
Ei_form LD A,0 ;env_form
LD (E_form+1),A
AND A
JR Z,temp
ei_frq LD HL,0 ;env_frq
LD (E_frq+1), HL
XOR A
LD L,A
LD H,A
LD (Esl_frq+1), HL
LD ( Ei_form + 1 ), A
BUG_F2 JR BUG_F1
LD A,#1
LD (BUG_F2),A
JR temp
BUG_F1 LD ( Esl_stp + 1 ), A
Let's take a look at the snowflakes.
С уважением, Иван Рощин.