PurrFX project update 19

Project status overview as of September 20, 2020.

Commits: September 20, 2020.

Development has gone far enough and it's time for some really interesting updates!

Let's start with the fact that the library now has classes and functions for converting register values ​​to sound frequencies. For example, for the Pulse1 channel, registers $4002 and $4003 are responsible for the sound frequency. Their combination gives us an 11-bit value, which, according to a special formula, is converted into a reproducible sound frequency.

Also, the library (using the CNote class) allows you to convert the frequency of a sound to a note, i.e. into a specific piano key. You can use this feature to render notes in one way or another (for example, on a piano roll).

The CNesState class allows you to do something like the simplest emulation of the processor's work, accumulating the values ​​of the registers. Thus, it is possible to simulate playback of track data even without using CNes class. Why is this needed? The fact is that, as mentioned earlier, the frequency of the sound (and hence the note) is determined by the value of two registers. But very often in a frame, only one of the registers is written, the writing to which is really necessary to change the sound frequency. This means that you need to accumulate the values ​​of the registers to correctly determine the notes.

To demonstrate the new features of the library, I created a new demo project Nsf2Mid. It works far from perfect, but the task of determining the beginning and end of a note is not trivial. Maybe you will be able to finalize the project to the possibility of error-free conversion?




 

Comments