It is currently Sun Aug 19, 2018 8:48 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Jun 12, 2018 1:18 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6600
Location: Canada
This is an archival post of an experiment I made in 2012 and originally posted at the Famitracker forums at that time.

The idea came from this discussion: http://forums.nesdev.com/viewtopic.php?f=6&t=5473

We determined that the tuning scheme of the DPCM playback frequencies appeared intended to play a C major scale and a few other notes tuned to A440. However, there also appears to be a mistake in how they implemented sample lengths, causing them to read 1 extra byte at the end of the sample. For looped samples this causes the pitch to lower by that relative length, so in the case of the smallest practical looped sample that could have been used (16+1 bytes) the intended playback pitch is lowered by a ratio of 16/17. This is close to a semitone, but not quite equivalent.


As an experiment, I composed this piece in Famitracker, with accompanying tracks one semitone lower, but then replaced the tuning tables to correct the rest of that tuning difference between 16/17 and 100 cents. The NSF plays with this corrected tuning table, and the Famitracker FTM will play at the original semitone approximation.

Overall the result isn't that compelling, mainly because the DPCM tuning is very imprecise to begin with. Matching its A440 scheme kind of centres the error, but it's still not very well in tune, especially on PAL where two of the frequencies are further off than they should be. It was intended only as a exploration of how close I could get under ideal circumstances.


Another thread that might be useful information, where other possible sample lengths are explored:
https://forums.nesdev.com/viewtopic.php?f=6&t=13169


Attachments:
lately_tuned.py.zip [688 Bytes]
Downloaded 22 times
lately_tuned.ftm [3.88 KiB]
Downloaded 31 times
lately_tuned.nsf [5.97 KiB]
Downloaded 34 times
Top
 Profile  
 
PostPosted: Tue Jun 12, 2018 9:47 pm 
Offline
Formerly ~J-@D!~
User avatar

Joined: Sun Mar 12, 2006 12:36 am
Posts: 453
Location: Rive nord de Montréal
Heheheh, that's nice. Looped samples are tough indeed.

A long time ago, I wrote a interactive (cli) tool to convert WAV files to DMC. It had a high quality resampler (and optional dither?), and it was possible to adjust the gain and pitch (octave, scale, cents) prior to conversion, and then the converted sample could be heard. Basic DMC emulation was done: the non-linearity of the 2A03 sound was simulated, the 16 playback speeds can be selected and changed anytime, the sample can be looped and the start and length of the sample can be changed too, according to the limitations of the DMC channels.

That was a great tool to make looped samples: with a script that searched (by brute force) loop lengths that can result in perfect loops according to a detuning tolerance, I could naturally convert slightly detuned samples that looped perfectly.

I know I have that tool somewhere, and I can dig it up if someone's interested. The script's probably lost, but is easy to rewrite though.

_________________
((λ (x) (x x)) (λ (x) (x x)))


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group