View Full Version : music drum machine

06-22-2012, 04:32 PM
Hello, I want to code a drum sequencer, but I'm stuck at the best way to go with it.

Basically, on the timeline issue. I can play x amount of sounds at any given time, what I don't figure out yet, is how to manage time events, and if this would be the best route to go.

Figured I could use 60 bpm, which can be used at 60 fps movieclip, but afterwards, use an if comparisson at everyframe?

For subframes, either i choose a different fps or go with timing classes.

Any ideas are more than welcome.


06-25-2012, 12:56 AM
Can you go into a little more depth on how this will work? I'm not exactly sure what a "drum sequencer" is, to be honest. Is it basically virtual drums? Sorry for the slowness. I believe once I understand how it will work I can offer some help! It sounds like an interesting project :)

06-25-2012, 01:51 AM
Something like this?

Build it with classes and external sounds.

06-25-2012, 11:04 PM
Thanks for your repplies.

@codevisual, the aplication is something similar to what [afz]snickelfitz posted. Basically it's a grid with some boxes that are ticked and they play a sound accordingly.

@[afz]snickelfitz I plan to use sampled sounds indeed. My main issue at this point is how to manage correct timing, to trigger the sounds.

Let's say I have 16 possible sounds. I need to check them every 330 ms. My machine seems too slow to do several if statements to correctly play them, so I think it's a timing issue.

Any ideas on a possible fix? (To keep time very accurate).

12-04-2012, 09:44 AM

Andre Michelle (http://blog.andre-michelle.com) has done a lot of work with audio sampling and sequencing in as3, and has some open source code. His tonfall project (https://code.google.com/p/tonfall/) could be useful, as might some of his older experiments.

As snickelfitz says, you will want to do this with classes, rather than using the timeline. The timeline will cause latency problems that having all of your code in frame 1 and seperate .as files will avoid. Also, make sure you are working in as3 as as2 has unresolvable latency issues.

- dialectric

11-02-2013, 07:37 AM
fantastic :)

love vashikaran
vashikaran specialist