Jump to content
IGNORED

RMT Instrument volume


twh/f2

Recommended Posts

HI !

 

can please somebody give me an example on how to play an RMT instrument with a specific volume?

I'm not really understanding all possible RMT-vectors, so it might be pretty simple or bloody compliacted.

 

The RMT code "API documentation" is simply highlighting this:

jmp rmt_sfx			;* A=note(0,..,60),X=channel(0,..,3 or 0,..,7),Y=instrument*2(0,2,4,..,126)

not a word about volume :(

.proc setSfx

	tax
	lda sfx_table,x
	asl @ 
	tay	; RMT routine expects instrument number * 2 in Y register
	ldx #0 ; channel number (0-3)
	lda #12 ; C-1 note
	jsr rmt_player+15 ; initialise instrument

	rts

.endp
Link to comment
Share on other sites

The example in asm_src/sfx/sfx.a65 shows how to set the SFX volume. Namely, before calling RASTERMUSICTRACKER+15 (or rmt_sfx), write a $X0 to RMTSFXVOLUME where X is the desired volume. For example:

 

        lda RANDOM                                      ;random number
        and #$07                                        ;0..7
        ora #$08                                        ;8..15
        asl @
        asl @
        asl @
        asl @                                           ;*16
        sta RMTSFXVOLUME

        ; ... set registers here ...

        jsr RASTERMUSICTRACKER+15
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...