Data is posted on the (old) 2A03.org forums, but since it has proved instable, I'll post the results here, and recalc them to be sure, posting at the same time my GNU Octave code to get that data, so anyone can verify how the result was obtained.
Code:
0; % if you want to put in a m file
function hz = midi2freq(note)
hz = 440 * 2 .^((note - 69) / 12);
end
% an helper
function notestruct = make_notestruct(octave, scale, cents)
notestruct = struct("octave", octave, "scale", scale, "cents", cents);
end
% note that it can output an invalid MIDI notes (values outside 0~127)
% as well as non integer values.
function midinote = freq2midi(freq)
midinote = log2(freq ./ 440) .* 12 + 69;
end
function notestruct = midi2notestruct(midinote)
closestnote = round(midinote);
oct_offs = floor(closestnote/12);
closestnote = closestnote - oct_offs*12;
octave = oct_offs - 1;
scale = closestnote;
cents = (midinote - oct_offs*12 - scale) * 100;
notestruct = make_notestruct(octave, scale, cents);
end
function str = scale2disp(scale)
scaledisp = ["C";"C#";"D";"D#";"E";"F";"F#";"G";"G#";"A";"A#";"B"];
str = scaledisp(scale+1);
end
nesfreq = 315000000 / 176;
dmcperiods = [0x36; 0x48; 0x54; 0x6A; 0x80; 0x8E; 0xA0; 0xBE; 0xD6; 0xE2; 0xFE; 0x11E; 0x140; 0x154; 0x17C; 0x1AC];
dmcfreqs = nesfreq ./ dmcperiods;
dmcmidi = freq2midi(dmcfreqs);
dmcnotes = midi2notestruct(dmcmidi);
fprintf("DMC period octave scale cents\n");
fprintf("-----------------------------------------\n");
for i=1:length(dmcperiods)
fprintf("0x%03X %2d %2s %+2.6g\n", dmcperiods(i), ...
dmcnotes.octave(i), ...
scale2disp(dmcnotes.scale)(i), ...
dmcnotes.cents(i));
end
Results:
Code:
DMC period octave scale cents
-----------------------------------------
0x036 11 C -17.8827
0x048 10 G -15.9277
0x054 10 E +17.2014
0x06A 10 C +14.4778
0x080 9 A -12.0177
0x08E 9 G +8.28576
0x0A0 9 F +1.66859
0x0BE 9 D +4.15558
0x0D6 9 C -1.77808
0x0E2 8 B +3.76755
0x0FE 8 A +1.56068
0x11E 8 G -3.8633
0x140 8 F +1.66859
0x154 8 E -3.28682
0x17C 8 D +4.15558
0x1AC 8 C -1.77808