Dbug wrote: ↑Fri Apr 16, 2021 2:29 pm
feel free to experiment
You should not say things like that to someone who is struggling to find the courage to finish a game.
That is not kind of you.
Dbug wrote: ↑Fri Apr 16, 2021 2:29 pm
My idea was to find an encoding to basically generate a series to write on A, B, C, A, B, C, A, B, C, ... computing the best combination of values to write to generate a 8 bit quality sample by just changing the volume value, so basically 4 bit encoding, two values per byte, but high quality, but did not have the time.
Well, it sounds good .. but I wonder if there could be a more efficient approach by considering that we don't necessary have to cycle around A, B and C
Because, in the end, what's matter is the sum : conv(A)+conv(B)+conv(C) (with conv() being the reverse logarithmic scale thing)
The goal is to make this sum follows (as much as possible) the sampled signal.
It may happen that, for some reason, the best way to follow the signal is to only make one or two channel change rather than systematically update all three channels.
In such a perspective, the encoding would consist in finding a sequence of couple (channel, value) .
A, 2, B, 3, B, 4, B, 5, A, 3, etc .. ect ..
And the player loop would look like:
Code: Select all
#define VIA_1 $30f
#define VIA_2 $30c
#define LATCH_REG_NUMBER sta VIA_1:lda #$EE:sta VIA_2:stx VIA_2
#define LATCH_REG_VALUE sta VIA_1:lda #$EC:sta VIA_2:stx VIA_2
playnote_loop
;; ... read sample whatever way
adr_samp
lda _Sample
;; insert here code get channel register in register A
sta reg_number + 1
;; insert here code to get channel value in register A
sta reg_value + 1
reg_number
lda #0: LATCH_REG_NUMBER
reg_value
lda #0: LATCH_REG_VALUE
inc adr_samp+1
bne playnote_loop
inc adr_samp+2
dec _Counter
bne playnote_loop
Only one channel amplitude register writing in the loop in order to make sure that changes of output level (A+B+C) occur on an hyper periodic basis.
It could even be possible to use some NOP to help making sure that the loop content is always the same duration and does not depend on branching condition.
The goal here would be that the writing in amplitude register are made hyper regularly .. Regularity is more important than speed for sound fidelity.