1 Attachment(s)
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.
http://home.comcast.net/~technorobbo/Instructions.jpg
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
Re: Drum Machine (Sick Beatz)
Quote:
Originally Posted by
vbfbryce
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
2) The ability to make it loop automatically
That would be Song Mode
Quote:
Originally Posted by
vbfbryce
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.
Re: Drum Machine (Sick Beatz)
Getting better and better! :thumb: , but this one (April 30th) uses a lot of CPU, older versions didn't use any or wasn't even noticeable.
Re: Drum Machine (Sick Beatz)
Quote:
Originally Posted by
Edgemeal
Getting better and better! :thumb: , 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.
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
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).
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!!!!!!!!