Welcome to AddressOf.com Sign in | Join | Help

Coding 4 Fun Drum Machine (in VB.NET)

The Coding 4 Fun - Building a Drum Machine with DirectSound article that Duncan Mackenzie brought to my attention looked pretty interesting, however, it doesn't have a VB.NET version.  Although the C# version runs well enough and you can use it as a resource to build your own ideas from, I just couldn't leave well enough alone.  So, last night, I converted it to VB.NET.  Ran into a few glitches due to the little differences C# and VB.NET have in regards to arrays, division operator and C# ++ operator.  I don't know if anyone else is interested in the VB.NET source, so if you are, leave a comment and I'll see what I can do.

Also, this is the first project that I've used the C#->VB.NET conversion tool that comes with the VB.NET Resource Kit.  It turns out its and updated version of the one I downloaded over a year ago.  They've improved the conversion process a bit; however, there are still enough gotchas that you must know C# in order to complete a conversion.

[update] I made a few more changes to the sample.  Modified it so that the not so representative progressbar is replaced by another beatcontrol and increased the timer resolution so that you can see approximately what beat is taking place as the mix progresses.  I also removed the play and stop from the menu and added a Start/Stop button with the accelorator key of ALT+S.  Finally, added visual styles... after all, everyone is running XP or newer, aren't they?  Here's a screen shot:

[update] Yet another update, I've zipped up the project and you can download it here.  In order to play with this, you will need to make sure you have the DirectX 9.0 SDK installed.

Published Saturday, February 7, 2004 9:17 PM by CorySmith
Filed under: , ,

Comments

# re: Coding 4 Fun Drum Machine (in VB.NET)

Sunday, February 8, 2004 7:45 AM by Duncan Mackenzie
I'd like to see the VB.NET code... and the code for that treemap of the file system too :)

# re: Coding 4 Fun Drum Machine (in VB.NET)

Friday, May 14, 2004 4:41 AM by Tom
Cory, there is now also a Pocket PC version of the Drum Machine available at http://www.microsoft.com/belux/nl/msdn/community/columns/munoz/cfrhythm.mspx

# re: Coding 4 Fun Drum Machine (in VB.NET)

Tuesday, January 3, 2006 2:30 PM by I need VB.Net example!
I have been searching the internet for the last week for enough code to learn how to stream buffers with directsound in VB. How would I go about obtaining a copy of the source? Also, im trying to make a project where im using Directshow to decode and render an mp3 and then use directsound to manipulate the buffer... Would you have any information to help me along the way? I need to be able to change the frequence and volume of the MP3. There doesn't seem to be any VB.Net examples out there! Thanks

# re: Coding 4 Fun Drum Machine (in VB.NET)

Monday, August 14, 2006 7:58 AM by Marius
I'm also looking for n VB.net version and some examples to work with DirectSound and Mp3's
thanks
Anonymous comments are disabled