nesdev.comhttp://forums.nesdev.com/ Misc SNES sound questionshttp://forums.nesdev.com/viewtopic.php?f=12&t=17112 Page 2 of 2

Author:  tepples [ Thu Mar 08, 2018 1:39 pm ]
Post subject:  Re: Misc SNES sound questions

In other words, D flat major seventh.

To loop a chord, you first have to rewrite it as frequency ratios in just intonation in order to see how much of it to loop. A perfect fifth above a note whose frequency is x has a frequency 3x/2; a major third up is 5x/4. Thus you have unison, a major third up, a perfect fifth up, and a major third above a perfect fifth: fractions 1, 5/4, 3/2, and 15/8. The lowest common denominator of these fractions is 8, making the chord [8, 10, 12, 15]/8. Because the denominator is 8, you have to loop at a frequency 1/8 of the chord's root. In A440 tuning, D flat or C sharp is 277.183 Hz, making the loop frequency 277.183/8 = 34.6479 Hz.

The sample is at 32000 Hz, making one period 32000 / 34.6479 = 923.577 samples long. After opening it in Audacity, I found a decent loop of length 912 samples starting at sample 7986. This being less than 924 implies the sample is tuned slightly sharp of A440. So for now, let's try downsampling it such that the loop is 768 samples long. This means a sample rate of 32000 * 768 / 912 = 26947 Hz. After resampling the audio, I end up with a loop of length 768 samples starting at sample 6724. This could be a starting point for more experimentation.