OK, here's the ultimate volume boost trick for digis.

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

OK, here's the ultimate volume boost trick for digis.

Post by pixel »

Code: Select all

    ; Stop channels.
    lda #$7e
    sta $900a
    sta $900b
    sta $900c
    sta $900d

    ; Let channels rest until LSFRs are empty.
    ; Some extra explaining why that takes so long
    ; would be nice.
    ldy #0
l:  dey
    bne -l

    ; Start alto channel at highest frequency of
    ; ~8659Hz, which is 128 CPU cycles.
    lda #$fe
    sta $900b

    ; Waste 56 cycles.
    ; 2+10*5+4
    ldy #11     ; 2
l:  dey         ; 2
    bne -l      ; 3

    ; Waste missing 2 cycles.
    nop         ; 2

    ; Start soprano channel at same frequency as alto.
    ; Takes 6 cycles. Then it's exactly half a wave
    ; (64 cycles) apart from the alto.
    ; Complain to my weed dealer if I'm wrong.                                                                                                                
    lda #$fd    ; 2
    sta $900c   ; 4

    rts
Sounds REALLY good on a real machine with tube.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
nanoflite
Vic 20 Newbie
Posts: 12
Joined: Thu Sep 25, 2014 4:00 pm

Re: OK, here's the ultimate volume boost trick for digis.

Post by nanoflite »

Nice trick! The sample playback itself is handled by the volume register I assume? While this trick tries to make the average sound output as high as possible on average?
User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: OK, here's the ultimate volume boost trick for digis.

Post by pixel »

nanoflite wrote: Mon Nov 16, 2020 6:23 am Nice trick! The sample playback itself is handled by the volume register I assume? While this trick tries to make the average sound output as high as possible on average?
Yep, it's still the volume register. I guess it gets as loud as it can get. :)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
Post Reply