Results 1 to 9 of 9

Thread: Drum Machine (Sick Beatz) w/Song Mode

  1. #1

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Drum Machine (Sick Beatz) w/Song Mode

    Drum Machine code snippet enjoy - color coded timing and volume levels.
    This program works on XP machines but Vista users will need to copy DX8VB.DLL from an XP system into the Windows\System folder of Vista, and register it using regsvr32.

    Attached Files Attached Files
    Last edited by technorobbo; May 4th, 2009 at 07:18 PM.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  2. #2

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: Drum Machine

    Added the ability to save patterns and a Demo file

    Post Edit
    Thanks to Edgemeal for catching a couple of focus bugs which are now fixed.

    Last Update 5/04/2009 at 07:15PM.

    • Each Pattern can now be assigned it's own tempo
    • Minor Layout and functionality changes
    • Add Pattern Button inserts pattern into list (was a replace pattern)
      for easier editing.
    • Song Mode added
    • Using QueryPerformanceCounter API Time Stamps for higher tempo accuracy.
    • Using QueryPerformanceCounter API for high tempo accuracy.
    • Upgraded to 12 Voices, 6th & 7th pattern added.
    • Third,Fourth and Fith Demo Pattern Added
    • Edgemeal's suggestion for a Rolling Pointer added.
    • Bug Fix 3 - Reset -Clear Notes from Persistent BMP
    • Bug Fix 2 - Persistent now bitmap updated with edits.
    • Second Demo pattern added.
    • Bug Fix 1 - Sound shut off when app lost focus-added DSBCAPS_GLOBALFOCUS flag.
    Last edited by technorobbo; May 4th, 2009 at 07:17 PM.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  3. #3
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Thumbs up Re: Drum Machine (Sick Beatz)

    TR,

    Love it!

    I'm thinking about a couple of added features:

    1) A longer "metronome(?)" region, so the "song" can be longer

    2) The ability to make it loop automatically

    3) The ability to have it stop at the end of the "notes" (not play all the way through #96, or whatever the end of the available area is...)

    Before I start...have you done any of those things already?

    Thanks!

    Bryce

  4. #4

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: Drum Machine (Sick Beatz)

    Quote Originally Posted by vbfbryce View Post
    1) A longer "metronome(?)" region, so the "song" can be longer
    I'm designing it to be a pattern based Drum Machine where the patterns are then arranged in to a song.

    Quote Originally Posted by vbfbryce View Post
    2) The ability to make it loop automatically
    That would be Song Mode

    Quote Originally Posted by vbfbryce View Post
    3) The ability to have it stop at the end of the "notes" (not play all the way through #96, or whatever the end of the available area is...)
    96 ticks is based on the lowest common denominator for a 16th note and a triplet 16th note. 4/4 time obvoiusly other time signature exist but most pop falls into these 2 categories. If you a Rush, Alex Van Halen, SoundGarden or Dave Brubeck then you crave non-pop signatures. It can be implemented down the line but right now I'm concentrating on Song Mode.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  5. #5
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Drum Machine (Sick Beatz)

    Getting better and better! , but this one (April 30th) uses a lot of CPU, older versions didn't use any or wasn't even noticeable.

  6. #6

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: Drum Machine (Sick Beatz)

    Quote Originally Posted by Edgemeal View Post
    Getting better and better! , but this one (April 30th) uses a lot of CPU, older versions didn't use any or wasn't even noticeable.
    The other one used a timer control but the millisecond resolution led to spotty beats per minute adjustments 120 BPM (and many others) wasn't actually achieveable (119 or 121) due to rounding. I had to use the microsecond resolution to achieve fine BPM adjustment. Since there are no interrupt driven calls to resolve the issue I had to resort to a timing loop and QueryPerformanceCounter. I kept the timer for the graphics since timing there wasn't totally critical.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  7. #7
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: Drum Machine (Sick Beatz)

    <EDITED 10:53AM EST>

    Ignore this question...the 375.9545 is a measure of my system's performance counter, right?

    <End of Edit>

    TR,

    When the form loads, "tickfrequency" is 357.9545.

    Where does this value come from? It looks like it gets assigned after the "CopyMemory" statement.

    How do QueryPerformanceFrequency and CopyMemory work to yield this frequency?

    Thanks!

    Bryce
    Last edited by vbfbryce; May 1st, 2009 at 09:54 AM.

  8. #8

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: Drum Machine (Sick Beatz)

    First let me say that the next version due to post I reduced the cpu usage by a novel combination of timer and QueryPerformanceCounter. The next version will include song mode BTW. Now to answer your question.

    QueryPerformanceCounter is current value of the high-resolution performance counter. The high performance counter has a resolution that is unique to your machines speed and processor. QueryPerformanceFrequency gets you how many ticks there are per second in your counter. I subdivide this so I get the 12 tick per quarter note resolution depending on the tempo you choose.

    copymemory's role is necessary because both these functions return a 64 bit number that vb cant handle. to make it work properly it gets copied directly into a currency data type so it doesn't get translated by vb (vb would not make use of the decimal portion so you won't get a true 64 bit number).
    Last edited by technorobbo; May 2nd, 2009 at 10:10 AM.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  9. #9

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: Drum Machine (Sick Beatz) w/Song Mode

    Song Mode Posted as well as a song mode Demo. Timing is no longer a loop it uses QueryPerformanceCounter TimeStamps to reduce CPU usage. (Edgemeal -Thanks for keeping me thinking about it), by Setting the timer at a high resolution (5ms) I could check the timerstamp with out using a loop. Much smoother performance.

    So get up and dance people!!!!!!!!
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width