You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/27 8:27
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
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

Attach file:


zip vb_snd_gen.zip Size: 142.28 KB; Hits: 269
Top

#2
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/27 9:38
PVB Elite
Joined 2003/7/26
USA
1471 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
Wow, a great idea and superb execution!

Not only is it handy for VB game making, it can also be used to make sound effects for PC games, and such! (I definitely intend to try making some sounds for Flash games with it. In fact, if I really get bored, I might even make a Flash port...)

I could probably make a (non-Visual Basic) front-end or GUI version, but I thought of another solution: make a WinAmp input plugin. It would allow instant previewing while debugging a sound and then the C code could be generated on the clipboard, or Notepad.exe could be used as an output window. You would even get Linux (and probably OSX) support for free that way, since XMMS comes with practically every distro.
Top

#3
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/27 12:18
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
Awesome work DogP!
Top

#4
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/27 14:34
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Thanks for the comments... the GUI that I'm talking about would be for configuring the registers, rather than editing the input text file. You could move sliders around to make waveforms (or select predefined ones), use dropdowns to select registers and hit checkboxes to select their meanings (instead of just putting in the raw values). Then of course a preview button, which would run it through the process and play the wav file. The ability to step back and forth through the commands would be nice.

DogP
Top

#5
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/27 22:43
PVB Elite
Joined 2003/7/26
USA
1471 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
Well, that only sounds moderately more difficult than the RB front-end I worked on, and that wasn't so bad.

Hmm... maybe David Tucker and I are the only ones who've seen my version of the front-end... I never got a reply when I sent it to him and it doesn't look like he posted a new RB on his site. Maybe I'm the only one who has it!

Well, I guess it won't do any harm to post it here. Maybe someone can try it on Vista/7 and I can tweak it if necessary (although it was compiled with VS2008 instead of VC6, like the old one was, so it should work better). I fixed a few bugs and added the new command-line arguments (like netplay) as well as giving it a graphical face-lift.

EDIT: What's the deal with the length restriction on attachment filenames? It's supposed to be "Reality Boy Front-end (Win32; EN).exe". Maybe it's the semicolon...

Also note that it's a self-extracting archive including source, executable, and (HTML) help.

Attach file:


exe Reality Boy Front-end (Win32.exe Size: 548.92 KB; Hits: 211
Edited by RunnerPack on 2010/1/27 23:04
Edited by RunnerPack on 2010/1/27 23:06
Top

#6
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/28 2:01
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Yeah, GUIs in C++ aren't too bad, but I just want something that I can put very little effort into making... but if you want to make it, that's even less effort than doing it in VB ;) . Maybe I'll mock up what I think the GUI should be like and post it here for comments and ideas. I probably haven't used VB in about 10 years anyway, so who knows what I'd remember :P .

DogP
Top

#7
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/28 8:20
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Here's a quick mockup of the GUI that I was thinking of. Basically, it'd allow a high-level selection of parameters, allowing various options depending on those selected. Of course I didn't disable controls as appropriate, but basically you could select one of the 5 main options, then options for that, and any unavailable options would be disabled. The frequency would of course have to be converted from Hz to the nearest available option, and I think those hover tips would be useful for telling specifics, like Envelope Volume is a channel master volume or initial envelope value.

Then when you're done, select "output settings" to set the settings and go to the next line. The forward and back buttons at the bottom allow you to scroll through the file, though I guess there should be an insert/delete line option.

There's a few things that I forgot, like a preview wav button, and selecting where the files go (and optional code output), but hopefully you get the idea.

DogP

Attach file:



jpg  screenshot.jpg (62.80 KB)
10_4b61489f7ceba.jpg 626X596 px
Top

#8
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/29 8:46
Newbie
Joined 2010/1/29
7 Posts
Long Time User (10 Years)
I second the idea for a winamp plugin, that would be great.
Top

#9
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/29 9:23
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Could you guys elaborate on the Winamp plugin thing? I personally rarely use Winamp, but I don't see how this generator as a plugin would be useful.

How do you plan on configuring the registers? Are you just wanting Winamp to play whatever is generated from a manually configured file rather than having to double click the wav file? Or maybe the plugin would look like a strange graphic equalizer and you could configure there? I have no experience w/ Winamp plugins, so I really doubt I'll do it, but if anyone would like to, I'd be glad to help make it happen.

DogP
Top

#10
Re: Virtual Boy Sound Generator (VSU Emulator)
Posted on: 2010/1/29 15:15
Newbie
Joined 2010/1/29
7 Posts
Long Time User (10 Years)
I was thinking more along the lines of having something like VGM files (http://www.smspower.org/music/uploads/Help/vgmspec150.txt) with values to write to the VSU and delays, and the input plugin would allow listening to these files directly in winamp.
Top

 Top   Previous Topic   Next Topic


Register To Post