Original Post

Hey,

I decided to spend a little time this weekend putting together a VB sound generator, which attempts to be a cycle accurate VSU emulator. You give it an input file of register values and time delays, and it converts it to a wav file, and optionally outputs C code corresponding to the input sequence.

I’ve been wanting to do this for a long time… it just finally seemed like a good time to do it. There’s a lot of reasons for it, the main one being that it’s inconvenient to develop sounds by testing them on the VB to hear how they sound, and unfortunately Reality Boy isn’t very accurate. I’m hoping in the long term that it may be possible to optimize this and roll it into RB, though that’s not on my todo list yet.

What really started the project was wanting to know how the random noise generator worked (the manual specifies an LFSR, but it wasn’t clear on what’s actually output, and the tap locations, or notations, don’t really make sense). The easiest and most for sure way for me to figure this out was to make a long recording and pull out the bit sequence. I did this by writing a MATLAB script to detect the first edge in the wav file, then sample 1/2 sample past that, and every sample beyond that. From that I got the LFSR bit sequences (which repeated as expected every time πŸ™‚ ).

I’m guessing there will be bugs and inaccuracies (I haven’t compared any of it with hardware yet, though it sounded good to my ear :-P).

I’m just posting the exe, example input file, and readme for now, though I’ll post the source with the next version… so try it out and give me some feedback πŸ˜‰ . I’d also like a GUI for this… as much as I dislike Visual Basic, this actually seems like the perfect application for that… so we’ll see. Of course if anyone else would like to do the GUI, that’d be great (but let me know so I don’t start one πŸ˜‰ ).

DogP

Attachments:
27 Replies

Okay… attached is Version 1.1, which has a few minor changes in how values are processed, as well as a few other small changes. The source code is also included in the zip.

I have some other things I’d like to add, but I wanted to get this version out, along with the source. For the next version I’ll get the other additions made, as well as any fixes/changes/additions that you guys suggest.

DogP

Attachments:

If you can supply some good info about the sound hardware (and other general stuff, like memory maps), I might add support for the VB to my MML compiler.

I doubt I’d be of much use for writing an input plugin for winamp though. Sound emulation isn’t exactly my forte.

mic_ wrote:
my MML compiler

Hey, that looks very handy! Do you have access to the official docs? If not, I could send you just the VSU part.

A lot of it could possibly be figured out with DogP’s program; including reading its source and comparing various input data with the code (and sound) produced by it.

BTW, I’ve kinda started on a Winamp plugin. I think, because of the disconnect between the size of the file and the audio data coming out of the emulator, I need to make a “ring buffer” FIFO that the emulator can write to and that can be played from (by sending chunks of it to the Winamp output plugin). If enough people (or just DogP ;-)) would rather I work on the GUI version, I’ll put the plugin on hold. Of course, if someone else wants to write the GUI, feel free (but let me know).

  • This reply was modified 14 years, 9 months ago by RunnerPack.

Are you trying to play in real time as it’s processing, or are you having it pre-process it all, then basically just play back the wav? I’m not sure whether it’ll keep up real time on all computers.

But feel free to work on whatever you find to be more interesting… I don’t really need a GUI, but in the long run I think there should be a GUI for it, to ease people into making VB sounds, rather then forcing them to jump into a text config file with strange names and values that don’t really mean anything.

And yeah… the official manual should have lots most of the info you need. Version 1 was basically just writing exactly what the official docs said… in v1.1, I actually tested some things on hardware to clarify what wasn’t clear in the manual.

DogP

DogP wrote:
Are you trying to play in real time as it’s processing, or are you having it pre-process it all, then basically just play back the wav? I’m not sure whether it’ll keep up real time on all computers.

I was going to pre-buffer at least 576 bytes of wave data (don’t ask me; it’s a Winamp thing :-P) and then do the parsing/generating and playing in parallel.

I compiled your code with -O1 using cygwin (O2 and O3 produced a weird wav file naming bug) and it seems to go a good deal faster. I didn’t do any measuring, but I’m pretty sure it would be able to do (the example.txt file) fast enough for real-time on my “ancient” 2.4GHz P4. I may add a configuration setting for the size of the FIFO.

But feel free to work on whatever you find to be more interesting… I don’t really need a GUI, but in the long run I think there should be a GUI for it, to ease people into making VB sounds, rather then forcing them to jump into a text config file with strange names and values that don’t really mean anything.

10-4. I personally like the hands-on approach of a hand-edited text file. That’s the way I am about HTML/CSS and most other layout/formatting, too. So, I’ll keep going on the plugin, since that is most conducive to that type of work-flow. Plus, there’s always mic_’s program for “actual musicians” to use πŸ˜‰ (I hope…)

I found a promising scripting language for windows with nice GUI features. It’s called AutoIt. I’m going to investigate using it for the GUI. Only thing I’m not sure of is loading existing files. Not sure about its file I/O capabilities.

That looks pretty nice… I wonder how the performance is.

DogP

 

Write a reply

You must be logged in to reply to this topic.