Am I doing one line stunts that I shouldn't do with Programread and was just lucky the first time?
This plays correctly, "voice1_out" address is added twice because it is a byte value selecting words in the DATA block:
Programread(@ulawDecodeTable+Voice1_out+Voice1_out, SAMPLEOUTword) //=Ok!
These variants does not work:
(just adding zero to the address fails)
Programread(@ulawDecodeTable+Voice1_out+Voice1_out+0, SAMPLEOUTword) //distortion or nothing
.
(Adding brackets fails:)
Programread(@ulawDecodeTable+(Voice1_out+Voice1_out), SAMPLEOUTword) //twice the speed or nothing
. (Indicating that adding brackets makes the value of Voice1_out+Voice1_out doubled)
.
(multiplying Voice1_out by two instead of Voice1_out+Voice1_out fails:)
Programread(@ulawDecodeTable+Voice1_out*2, SAMPLEOUTword) //twice the speed or nothing
. (Indicating that Voice1_out * 2 adds twice as much as Voice1_out+Voice1_out)
.
Different approach, with a solution (starting reading at+4608, could be zero or what ever) :
This fails:
Programread(@ulawDecodeTable+Voice1_out+Voice1_out+4608, SAMPLEOUTword) //nonsense/distortion
.
This works and I guess this is more like the proper way to do it?:
Ok, so you don't mean my attempts were violations of sanity, then.
I will send you my full code, but it may be hard to examine, since things are going on inside an interrupt triggered externally. (When I get some time off I can try to boil it down to something smaller, easier to examine.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Am I doing one line stunts that I shouldn't do with Programread and was just lucky the first time?
This plays correctly, "voice1_out" address is added twice because it is a byte value selecting words in the DATA block:
Programread(@ulawDecodeTable+Voice1_out+Voice1_out, SAMPLEOUTword) //=Ok!
These variants does not work:
(just adding zero to the address fails)
.
(Adding brackets fails:)
. (Indicating that adding brackets makes the value of Voice1_out+Voice1_out doubled)
.
(multiplying Voice1_out by two instead of Voice1_out+Voice1_out fails:)
. (Indicating that Voice1_out * 2 adds twice as much as Voice1_out+Voice1_out)
.
Different approach, with a solution (starting reading at+4608, could be zero or what ever) :
This fails:
.
This works and I guess this is more like the proper way to do it?:
Last edit: Roger Jönsson 2 hours ago
You have figured this out. Well done.
Send me the code will the five example. It will be interesting to see what is happening.
Ok, so you don't mean my attempts were violations of sanity, then.
I will send you my full code, but it may be hard to examine, since things are going on inside an interrupt triggered externally. (When I get some time off I can try to boil it down to something smaller, easier to examine.)