About | Rules and Guide | Sign In/Create Account | Write a Post
Construction1990’s Internet Montage? No!
Please excuse the site weirdness. Mike is fixing and making things.
Ludum Dare 31 — Coming December 5th-8th 2014!

  • ??? Begins: in 9 days, 7 hours, 9 minutes, 5 seconds
  • October Ends: in 10 days, 7 hours, 21 minutes, 5 seconds
  • Ludum Dare 31 begins: in 45 days, 8 hours, 9 minutes, 5 seconds
  • (FYI: Clock might be off) | Ludum Dare 31: Real World Gatherings (Now Open!)

    [ October Challenge 2014 | Resources | Submit/Edit | View All ]

    Tum tum tum TADA tum

    Posted by
    February 20th, 2010 2:47 pm

    Rythm patterns recognition works! It was a lot easier than I had expected. See in screenshot:

    • Patterns are described as string, for instance “1121”, where numbers from 1 to 4 mean drums 1 to 4 (and also keys 1 to 4)
    • The actual rythm is given by a list of numbers, given in beats. {0,1,2,3} means that the four notes of this pattern are played onĀ  each beat. {0, 1.5, 2, 2.5, 3} is a tad more funky :)
    • If no notes are played in the two beats following the last note, it times out and the pattern is reseted.
    • After each new note, we check if the current sequence matches a pattern, and then we check that the recorded times are close enough to the wanted times. If yes, the action is launched.

    Note that this implies that no pattern can be the prefix of another one, and that no note in a pattern can be equal or longer than two beats.

    Pom pom pom TADA pom!

    Pom pom pom TADA pom!

    One Response to “Tum tum tum TADA tum”

    1. snowyowl says:

      Sounds cool! Can’t wait to play it!

    Leave a Reply

    You must be logged in to post a comment.

    All posts, images, and comments are owned by their creators.

    [cache: storing page]