I search for a nsf player with editable pitch table+nsf rec

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
I search for a nsf player with editable pitch table+nsf rec
by on (#92508)
I have read on internet that nsf files contains a pitch table. The nsf players out there can't playback nsf music in another scale. And if i change the pitch table in a nsf. I call it converting nsf to nsf by only replacing the pitch table. I choose what channels to replace pitch table with.
Example: i would not change the pitch table on NOISE and DPCM channel. Because those channels are the drums.
And drums should not have a new pitch table.

Let's say i take a (2A03/2A07) nsf file. I play song 001. Then i open up the pitch table window and change the sound register tuning system.
The features:
1. Change the frequency of each note.
2. Repeat 12 note frequencies across all octaves at once or repeat only 2 octaves or more or no octave repeating.
3. A keytracking knob that crossfades the frequency from all notes available to the center octave pitch. The space/interval between notes is editable.
4. Rotating the picth table. Horizontal and vertical pitch table flipping.
5. Random note frequency deviation.

This is not possible with famitracker.

Edit:
Thanks to rainwarriror.

Here is the pitch table location in nsf files created by famitracker:

It starts with:
Code:
5B0D9C0C
hex.

And it ends with:
Code:
0E000D00
hex.

by on (#92510)
There could be a pitch table in a NSF, however, it totally depends from a game or music editor. I.e. it is not something standart with certain location and format.

Also, depending from a player, there could be a pitch table with a value for every note, or a table with few times more values (like 16x), for 'micronotes', or a table for a single octave.

by on (#92513)
Well, this is the python program I used to generate the pitch table for my experiment in the DPCM thread:

http://rainwarrior.ca/projects/nes/lately_tuned.py

You can use a hex editor to paste the output over the pitch table in an NSF made by FamiTracker. Each pitch is a two-byte little-endian value. The original NTSC/2A03 pitch table is defined in periods.s in the FamiTracker NSF driver, but the data is 192 bytes long and begins with: 5B 0D 9C 0C

Search for this string, paste over your new 192 byte pitch table. (Note if you look at periods.s the values are big-endian in the code; to find them in a hex editor you need to swap every byte pair.)

You might be disappointed with the results though; the NES does not really have a lot of tuning accuracy. It's not a very good medium for experiments in temperament.

by on (#92514)
It looks like there are two requests that could be made out of this:
  1. Make an NSF player supporting arbitrary scaling of APU periods at runtime, so that an NSF can be transposed to a different key at playback. Useful for remixes, karaoke (such as the "Danger Zone" sound alike in Top Gun, which would need to be taken down a major third and slowed down a bit), etc.
  2. Some players have the ability to translate period values into MIDI note values (e.g. "middle C (60)" or "A above middle C (69)"). But some NSFs, especially those using a slightly altered tuning (e.g. A = 438.74 instead of 440.00 so that a 17-byte DPCM loop can be in tune), would need a different table to translate frequencies into note values.

by on (#92515)
A nsf player can emulate any nes game regardless how different the nsf driver is. The nsf player pitch/frequency stream can be edited in real time by a pitch table module. Then record and save the new song that uses another scale. When recording a nsf. The frequencies of all notes is modified by the pitch table module. The new nsf song does not use the original nsf driver. It uses a new nsf driver. It's like importing nsf files in famitracker then connect only (Square 1) (Square 2) (Triangle) to pitch table. Then editing the pitch table. Then you have a new song. Then export it to nsf.

by on (#92516)
Tepples, if you want to adjust pitch in NSFPlay/NSFPlug you can actually just edit the CPU clock frequency in the in_yansf.ini file. This is probably the most robust way to transpose an NSF's pitch, and as you'd expect the update frequency will remain at 60hz or whatever it's set at in the NSF.

by on (#92518)
rainwarrior wrote:
Tepples, if you want to adjust pitch in NSFPlay/NSFPlug you can actually just edit the CPU clock frequency in the in_yansf.ini file.

Which other NSF players, both real-time players and players that can output a wave file, support this adjustment, especially with some way to specify the frequency change in semitones?

by on (#92521)
I don't know if you can adjust the CPU clock on other NSF players; I don't remember seeing it on anything else. I just know about NSFPlay because I've been working on it. I will consider adding a GUI for pitch control.

by on (#92524)
rainwarrior wrote:
I will consider adding a GUI for pitch control.
Finally.

by on (#92527)
I don't suppose anyone knows how to edit the pitch table in a PPMCK-generated nsf?

by on (#92532)
Doesn't PPMCK store all the frequencies inlined? I.e. each note is stored as a 16-bit value containing its frequency (or period, rather).

by on (#92622)
cak wrote:
I don't suppose anyone knows how to edit the pitch table in a PPMCK-generated nsf?
A while ago, I have modified PPMCK to allow custom pitch tables (with up to sixteen values) to be entered.

In the source codes level, you can do it by editing the macros with the pitch table with conditional compilation, so that they can be replaced by your own pitch table, when it is compiled.

To do with a NSF file already generated, I do not know, but try using a hex editor to search for the data which is the contents of the pitch table; maybe you can find it like that!