Forums > MaxMSP

Help with triggering samples based on joystick movement and time

Apr 16 2009 | 3:17 pm

Hi guys,

I am stuck on a fairly simple problem as I am new to Max/MSP.

I have a continous analog input, that has two directions, up and down. What I want is to be able to trigger different samples based on how many movements of the joystick in certain directions occur per second. For example, if the range is scaled to -1 (down), 0 (middle) and 1 (top), then if the joystick is moved up once in a second, trigger sample a, if joystick is moved up, back to middle and up again in space of a second trigger sample b, then the same process occurs but with samples c and d for downwards movement.

I’m aware a second may be too short amount of time, but this is just an example time. Also, I can figure out how to implement the analogue input, so if anybody can tell me how to do the rest of the patch i.e. comparing input with time and triggering the samples that would be great.

Thanks in advance for any help,


Apr 16 2009 | 6:14 pm

analogue input? What do you mean?

Looks like your project could be done based on the following objects. Check the related help files and tutorials:
[sfplay~] (with preload) (you could also use buffers etc, but if you’re a beginner, I would advise sfplay~ for a first version)
[dac~] (no kidding!)


Apr 17 2009 | 12:58 am

sounds like streetfighter 2 turbo power moves.

Apr 17 2009 | 3:08 am


I think this should give you a point of departure. I hope it helps.
Good luck! Probably there are other ways to dig this out.

Best regards,

— Pasted Max Patch, click to expand. —
Apr 17 2009 | 9:58 am

Thanks for the responses everyone, both are very useful!
Great patch dcocharro, definately helpful


Viewing 5 posts - 1 through 5 (of 5 total)

Forums > MaxMSP