Page 1 of 1
BRR looping and sample directory
Posted: Mon Aug 01, 2011 6:00 pm
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?
Posted: Mon Aug 01, 2011 6:32 pm
by ccovell
I know next to nothing about BRR, but isn't SNES sample data 16-bit?
Posted: Mon Aug 01, 2011 7:29 pm
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.
Posted: Tue Aug 02, 2011 5:59 am
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.
Posted: Tue Aug 02, 2011 5:07 pm
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?
Posted: Tue Aug 02, 2011 5:59 pm
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.
Posted: Tue Aug 02, 2011 6:22 pm
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.
Posted: Wed Aug 03, 2011 3:31 am
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.