I took DogP’s VB Sound Generator code here http://www.planetvb.com/modules/tech/?sec=tools&pid=vsuemu and created a GUI wrapper around the VSU emulator part of it, making it a sort of VSU sandbox. I needed this tool to be able to play around with the noise channel in real time, but maybe it could be of use to some of you too. The tool uses PortAudio for playback and is built for OS X 10.6 using XCode 4, but perhaps somebody with the motivation and know-how could port it to Windows if needed.
The source code is on Bitbucket: https://bitbucket.org/blitter/vb-sound-generator
FYI I wrote it in about a week, so it’s still kind of rough around the edges, mainly that the audio playback gets pretty choppy if you turn on all six channels. I probably won’t spend much more time on it though. π
Attachments:
Awesome! I seriously just started on this exact same project last weekend (using Visual C++ 2010 to minimize the awefulness of writing a GUI π ). Luckily I only have a couple hours into it, so maybe I can scratch that off my list (though I’ll have to try compiling yours for Windows or Linux). π
The end result that I’m trying to create is a program similar to sfxr ( http://www.drpetter.se/project_sfxr.html ) for VB. The ability to quickly generate a “jump” sound that you like, then copy/paste it into code would be EXTREMELY useful IMO. But a GUI of the sound generator seemed like a logical first step. If I can get yours compiled, maybe I’ll use that as the base.
BTW, you say it gets choppy with all 6 channels… are you generating the audio on the fly? Can it generate to a file so you can listen to it without the choppiness (not in real-time). And is there any sort of sequencer, so you can sorta “compose” a song/sfx? And from your experience so far, does my VSU emulator code sound accurate? I never really tested much of it. π
DogP
Attachments:
Mine is written in Objective-C++/Cocoa, so you’re only going to be able to compile it on a Mac. π The VSU and audio engine parts are written in C++ though, so really only the GUI part would have to be rewritten.
Even though I cautiously left space in the GUI for it in the lower right, I didn’t port over your entire vb_snd_gen, just the part that generates the audio. I modified it to generate it on the fly, since my primary motivation was to play around with the noise channel in order to find register values of percussion sounds I liked for my music engine. Creating files and playing them back simply took too long. π I pretty much took inspiration from this mock screenshot http://www.planetvb.com/modules/newbb/viewtopic.php?post_id=9560#forumpost9560 but stopped short of porting over the sequencer/code generation aspect of what you did, since I didn’t need that. π
The waveform-based emulation code is pretty accurate to my ears, down to the aliasing artifacts– haven’t done a wave-to-wave analysis vs. the hardware though. Verdict is still out on the noise channel, after also messing with it in Mednafen. Will have to try on hardware soon. However I’m still not sure how “interval” actually works, since both in that generator and in my own experiments writing for the VSU, all I get is silence. I must be doing something wrong.
DogP wrote
The end result that I’m trying to create is a program similar to sfxr ( http://www.drpetter.se/project_sfxr.html ) for VB. The ability to quickly generate a “jump” sound that you like, then copy/paste it into code would be EXTREMELY useful IMO.
Hats off to both of you, DogP I agree w/ you about the usefulness of this project and would love to see an sfxr for VB :vb: I think that this would be invaluable and I can’t wait to see your progress.
Update: Fixed a bug with channel 5 and setting properties of the EV1 register.
Attachments:
blitter wrote:
Mine is written in Objective-C++/Cocoa, so you’re only going to be able to compile it on a Mac. π The VSU and audio engine parts are written in C++ though, so really only the GUI part would have to be rewritten.
Heh, doh… the GUI is the part that I didn’t want to write. I guess I can’t really complain, since I’m basically giving all you non Windows users the middle finger by using Visual C++. π
I pretty much took inspiration from this mock screenshot http://www.planetvb.com/modules/newbb/viewtopic.php?post_id=9560#forumpost9560
Yep… I kept looking back at my old mockup as well. I was hoping I’d just be able to use that form (I did that mockup in VB 6.0), but there didn’t seem to be a way to bring a VB 6.0 form into VC++ 2010… so I had to recreate it.
The waveform-based emulation code is pretty accurate to my ears, down to the aliasing artifacts– haven’t done a wave-to-wave analysis vs. the hardware though. Verdict is still out on the noise channel, after also messing with it in Mednafen. Will have to try on hardware soon. However I’m still not sure how “interval” actually works, since both in that generator and in my own experiments writing for the VSU, all I get is silence. I must be doing something wrong.
Cool… good to “hear” (see what I did there). π I believe the interval just automatically stops a sound after a specified amount of time… it may be a little bit tough to notice that it’s playing if you’re only doing a single note though, since it can be pretty short (or maybe the internal state counter isn’t getting properly reset or something).
I attached a crappy sound tester app I wrote a LONG time ago… I thought it was hosted somewhere on this site, but I couldn’t find it (maybe I just posted it on IRC years ago… I’ll see if KR155E can add it here). It’s very similar to the VSU emulator app (set up a sequence of register values and play), but of course it’s on real hardware… so if you think you’re doing something wrong w/ the interval, give that a try on real hardware.
BTW, I was just messing around with the sound generator app and found a few bugs… they probably don’t affect you though (sscanf related). Either way, I’ll fix up the code and upload a new version, probably this weekend.
DogP
Attachments:
If I had hairs on my chin for every project dogp is working on or has worked on…I’d look like a member of ZZ top…and not the drummer π
A Windows port of this GUI wrapper is a must-have. The vast majority of the computer OS market-share is Windows.
It’s been four years since last post/comment. There’s no update about the VSU Sandbox.
Neither the Windows port of it.
- This reply was modified 3 years, 4 months ago by Enophano.
Try the Discord page of the Virtual Boy Planet. There are much, much more activity there.