Sound effects editor

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Sound effects editor
by on (#133723)
I was inspired by the sound effects editor that NovaSquirrel threw together in a couple days to create an NES sound effects editor of my own. I'd like you to download it, bang on it, and see what you can come up with. If you've used MOD trackers, you'll pick it up easily. You can save your work with the Start button; try opening the .sav in a text editor for a nice surprise. And like Thwaite, it even supports a Super NES Mouse.
Re: Sound effects editor
by on (#133725)
Random thoughts:
- Maybe an option to detune the tonal channels so they're in tune with the odd noise channel tuning
- Converting a channel from noise to tonal produces hilariously incorrect values, if it originally contained tonal notes
- Converting a channel to/from noise doesn't produce very useful results otherwise
- Support for some kind of keyboard (whether the FC keyboard, Miracle, or whatever)
Re: Sound effects editor
by on (#133755)
I discovered when I made the editor that 93-step noise is fairly consistently about 40 cents sharp of A440 tuning. You can change the tuning by editing mktables.py and rebuilding the project. But if you tune the tonal channels to be in tune with the noise channels, it'll retune your music too.

Changing the channel doesn't "convert"; it reinterprets the old data in the new format. And the only part of the format that makes sense among all channels is the volume, though pulse and triangle use the same pitch range except for one octave of difference.
Code:
FEDC BA98 7654 3210  Each row is a 16-bit word in network byte order.
||   |||| | || ||||
||   |||| | || ++++- Noise: Period (15=lowest)
||   |||| | ++-++++- Pulse, Triangle: Log frequency (0=lowest)
||   |||| +--------- Noise: Timbre (0=hiss, 1=buzz)
||   ++++----------- Pulse, Noise: Volume (0=silent, 15=loudest)
||   ++++----------- Triangle: Priority (0=silent, 1=lowest, 15=highest)
++------------------ Pulse: Timbre (0=12.5% duty, 1=25% duty, 2=50% duty)
+------------------- Triangle: Bit 15 always set in exported data

It appears you want channel changes to perform some conversion. What should happen to the pitch if the user converts a tonal sound to noise and back?

I'll do a keyboard once I have a keyboard to test with. There's been speculative talk in #nesdev to make some sort of MCU-based translator between PS/2 keyboard protocol and the NES's SPI-like protocol, but it never resulted in any concrete projects. And unfortunately, MCUs are currently not my department. Or do I need to get an Arduino kit already so I can play with AVR?
Re: Sound effects editor
by on (#133769)
tepples wrote:
You can change the tuning by editing mktables.py and rebuilding the project

I like how the save file is a source file for the sound data. Maybe it's possible to (but mabye to much trouble in practice) have a tuner in the editor that also exports the tables to the source file save. It'll involve multiplication of a high precision fixed point number with a constant, and some modifications to the editor's table to read from ram.
Re: Sound effects editor
by on (#133779)
tepples wrote:
What should happen to the pitch if the user converts a tonal sound to noise and back?
Not certain about the "converting to noise" story. Converting from tonal noise to a tonal channel I would think should convert to closest match.

In any case, my other point was: even if it doesn't do any conversions, reinterpreting the tonal noise data as notes shouldn't cause entries like "G#█" or "4█":
Attachment:
incorrect.png
incorrect.png [ 1.35 KiB | Viewed 6367 times ]
Re: Sound effects editor
by on (#135604)
I now see what lidnariq is talking about.

So I what I expect to happen is:
While editing, have the square and triangle channels ignore but preserve bit 7 (Noise Timbre). So that it doesn't factor in the note lookup table;
When saving, if the channel is not noise then clear bit 7. So that the data will work on your engine.
Re: Sound effects editor
by on (#214040)
This has been absorbed into the latest version of Pently.