Posts

Showing posts with the label 2A03

nagen v1

This is first public release of my online N ES A udio Gen erator (nagen), supplementary tool for my educational videos. You can use this rather low level tool to generate wav files from NES audio description. Go ahead and try it here: nagen v1  How to generate audio file Enter file name, such as "noise" Enter sound description (example is below) Click on "Generate wav file" button.  Example of audio description: size 30 frame 0  400c 1 1 0xA  400e = 0xFA  400f = 34  At this point nagen page should look like this: What to do with generated audio Click on file name (such as "noise.wav") to play it Click on download button (arrow pointing down) to download it  Audio description To set audio length in frames use size keyword (1 frame is 1/60 of second, hence 30 frames is half a second, 60 is one second), maximum is 10800 frames (3 minutes) To set frame number use frame keyword, then... ... write to NES registers using one of the following options: regis...

PurrFX project update 19

Image
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 cla...

PurrFX project update 18

Image
Project status overview as of September 16, 2020. Commits : From September 13 through 16 of 2020. One feature was very needed. It was not possible to edit individual register data fields in an easy way. It is these fields (groups of bits) that are responsible for such sound parameters as duty, volume, pitch and others (depending on the sound channel). For register field names you can visit this page: https://wiki.nesdev.com/w/index.php/APU CRegister class is now available, which organizes universal access to register fields. If you wish, you can make something of your own, more convenient, based on this class. For example: New demo project HackPlayer shows how you can actually use the CRegister class to change the duty for the Pulse1 and Pulse2 channels as needed.   Related information: https://wiki.nesdev.com/w/index.php/APU   Project pages: https://github.com/TheCatNose/PurrFX https://github.com/TheCatNose/PurrFX-sample-projects

PurrFX project update 15

Project status overview as of September 7, 2020. Commits : From September 6 through 7 of 2020. Over the past two days, I have done quite a lot. And the number of commits in the PurrFX repository has already exceeded 200! I started by fixing the problem of multi-threaded access to the emulation code in the NsfPlayer project (SDL version). I just used a mutex. Also for this project, I added the ability for the user to enter the name of the file to open. After that, I added classes to the library that allow you to store in memory data loaded from NSF files. These are the CDpcmDataBuffer and CFrameDataBuffer classes.   Then I created a pretty funny project called ReversePlayer . This project loads data from NSF files, stores it in memory (using the classes mentioned above) and ... Plays it backwards! Moreover, this is not just reverse sound, but the execution of commands in the reverse order. For this, a special proxy class CFrameDataProxy is used.   Looking at this project, on...

PurrFX project update 9

Image
Project status overview as of August 26, 2020. Commits : August 26, 2020. It is necessary to make sure that no existing NSF file is required to generate sound. So I made a simple but sufficient ready-to-use NSF file stored right inside the PurrFX library. Remember the 4th update in which we made NSF files in the HEX editor? It was exercise for what we did today.   In fact, the PurrFX framework is ready for organizing an audio stream based on any desired set of input data. This is very simple: 1. The audio library requires a portion of the sound and refers to your program; 2. Your program refers to one of the implementations of CNes (for example CNesGme ); 3. CNesGme starts the emulation process and, as necessary, refers to CFrameDataProducer implementations (for example CFrameDataFileReader ).   This process can be represented in the form of this diagram:   There are still lack of high-level classes to create the required set of frame data, but nevertheless the scheme...

PurrFX project update 8

Image
Project status overview as of August 25, 2020. Commits : August 25, 2020. After collecting the data, the next logical step is to use it. To do this, I created a class that reads frame data from a file and prepares it for use. This class, like any other implementation of CFrameDataProducer , interacts with the emulation code object by attaching to it.   What happens inside the emulation code for playing frame data based sound resembles (as I think) the operation of a device called the “Game Genie”. As soon as it comes to the play function from the NSF file, the code is intercepted and redirected to the play function at $6000 address. I cannot say that it is beautiful, but most likely there simply does not exist a more suitable way to use an arbitrary set of audio related instructions (in any required quantity, even in gigabytes). This is what the log file looks like, demonstrating the operation of the play function at the $6000 address:   And here is how it sounds (using the da...