Skip to content

How to check the actual quality of a sample from a game OST?

Talk about whatever you want. General forum rules still apply.

Moderator: Staff

  • Alianger Offline
  • Posts: 81
  • Joined: 2016-05-13, 23:55:38

How to check the actual quality of a sample from a game OST?

Post by Alianger »

For SNES OSTs for example, how do I check what the bit depth and sample rate are for each sample? As output by the system, not the original uncompressed sample.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

I think you can formulate your question better. You're trying to ask many questions in one statement, it feels like.

SNES samples are always in BRR format. The output from the system is always 16-bit stereo PCM, 32khz.

The sample rate of each individual sample depends on the pitch. If you use SPCPlay you can see the raw pitch values sent to the DSP, if you go Settings >Information > Channel 1. The pitch values are represented in hex, convert to decimal and multiply by 7.8125 for the sample frequency in Hz.

In general, it's impossible to see the quality of each individual sample if you only have the mixed output. The best you can do, is to isolate the sample (find some sound bit where no other sample is playing) and do a FFT spectrum analysis, but even this is imperfect if there is additional processing.
  • Alianger Offline
  • Posts: 81
  • Joined: 2016-05-13, 23:55:38

Post by Alianger »

Thanks. Well, I mean the quality of a single sample as it's playing in a track. On SNES they tend to be downsampled so I want to check by how much and see what I find to be the best sounding OSTs are using.

Checking the pitch doesn't seem to answer what I'm after (the quality of a specific instrument before it's decided or I guess regardless of what pitch it's playing at), so how do I do an FFT spectrum analysis?
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

If you want to get the "normalised" sample rate (or middle C frequency), you will still need to obtain the pitch value of the sample, but also the pitch itself (the note value), get the difference of semitones and use this table to obtain the C frequency.

the FFT you can get from for example audacity, in that case you'd pretty much look for a band stop frequency (common if the sample is resampled with an algorithm) or harmonics (typically caused by aliasing where there is no interpolation). But since the deduced sample rate STILL depends on the pitch for melodic instruments, you're not going to like that either.
  • Alianger Offline
  • Posts: 81
  • Joined: 2016-05-13, 23:55:38

Post by Alianger »

Do you know how to extract the samples from the game rom instead? I figure those should be at the default pitch.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

There is no default pitch, it depends on each sample and it is also defined in the sound program itself . You can find out how to extract samples from spc files by googling. But you will have to tune them yourself, some wave editors can do that for you.


But really, you can get exactly all you need regarding the "quality" of the sample from looking at the pitch value. Think about it like this. Game X uses a sample to play the note A5 and the sample pitch (=rate) is 8000 Hz. Looking at a table of piano key frequencies we can see that the frequency of A5 is 880 Hz. That gives about 9 sample points per full phase of the waveform. As this is not much to define the harmonics, it will probably not sound very well.

Post by vampirefrog »

You can use a pitch detection algorithm on the original samples, such as autocorrelation, or counting the zero crossings. Perhaps the tool 'aubiopitch' from aubio?

Post by patsm00re18 »

There are software on doing that thing! You can search it.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

Please stop bumping old threads, especially if you have nothing useful to add.

/Mod
Post Reply