BRR looping and sample directory

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
psycopathicteen
Posts: 3001
Joined: Wed May 19, 2010 6:12 pm

BRR looping and sample directory

Post by psycopathicteen »

Say I want to have 2 instrument samples, a square and a triangle wave.

Is this currect?

Code: Select all

directory:
dw square
dw square
dw triangle
dw triangle

square:
db $00,$00,$00,$00,$00,$00,$00,$00,$00
db $02,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff

triangle:
db $00,$01,$23,$45,$67,$89,$ab,$cd,$ef
db $02,$fe,$dc,$ba,$98,$76,$54,$32,$10

I am hearing sounds, but neither sound like a square nor a triangle, and one has a different pitch than the other.

Am I messing this up anywhere?
ccovell
Posts: 1041
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Post by ccovell »

I know next to nothing about BRR, but isn't SNES sample data 16-bit?
psycopathicteen
Posts: 3001
Joined: Wed May 19, 2010 6:12 pm

Post by psycopathicteen »

Found my mistake.

"range" bits had to not be 0, and the "end" bit had to be set on the last sample chunk.
mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ »

This is what I use (I got it from Memblers' NSF player):

Code: Select all

; 50% square
.DB $b3,$88,$88,$88,$88,$77,$77,$77,$77
And if you want it with twice the period:

Code: Select all

.DB $b2,$88,$88,$88,$88,$88,$88,$88,$88,$b3,$77,$77,$77,$77,$77,$77,$77,$77
and so on.

isn't SNES sample data 16-bit?
It's 4-bit.
psycopathicteen
Posts: 3001
Joined: Wed May 19, 2010 6:12 pm

Post by psycopathicteen »

Another question. I heard from many places that the SNES uses interpolation on the samples.

1) what kind of interpolation is it, and how is it calculated?

2) does it use interpolation on octaves higher than the sampled frequency?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

psycopathicteen wrote:I heard from many places that the SNES uses interpolation on the samples.

1) what kind of interpolation is it, and how is it calculated?
It's some sort of 4-tap "Gaussian interpolation", and it's calculated the way the bsnes source code says it's calculated. I still haven't been able to get someone to explain the precise difference between "Gaussian interpolation" and standard 4-tap cubic spline interpolation.
psycopathicteen
Posts: 3001
Joined: Wed May 19, 2010 6:12 pm

Post by psycopathicteen »

Here is another question. Is the Gaussian filter always the same, or does it vary depending on what note the channel is playing.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

I admit the "guassian interpolation" is something I've yet to really understand.
However, I'm pretty sure it does some kind of anti-aliasing when downsampling (playing the sample at a higher rate than it's original rate, that is higher than 0x1000 in the freq regs), so that parasite low frequencies doesn't appear.
Useless, lumbering half-wits don't scare us.
Post Reply