Help Please: How to divide x y grid into several areas?

    Dec 04 2012 | 1:46 pm
    Hey people :)
    I was wondering if someone could send me in the right direction. I'm doing a project using blob tracking to have footsteps on a floor as input. Since the technology for the project is still a work in progress I decided to simulate the footsteps by using an x y grid from the TouchOSC app and using simple xy-coordinates as footsteps.
    The goal is to have a square area (the floor) and within that area several smaller areas simulating different kinds of terrain (such as dirt, leaves, water etc.). I want to use the input from the x y grid to generate a randomly generated footstep sound per sub-area. So basically when stepping on the 'real floor', I want to hear my foot create a splash, or rustle some leaves or stepping on dirt depending on which area of the floor I'm standing in.
    The patch I'm using to connect TouchOSC with max uses a pictslider object for the xy grid, generating x and y. However I don't know how I can separate different areas in the grid to generate different kinds of sound.
    I'm very unfamiliar with Max MSP so I'm just trying to find tutorials and stuff to figure it out, but I couldn't find anything that looked useful for my project and now I'm starting to run out of time. Which is why I came here to see if anyone would know what to do.
    I thank you kindly for any help/tips you can give me.
    (I'm using Max 5.1)

    • Dec 04 2012 | 3:11 pm
      There IS no tutorial for this, since there are a number of ways to do it. Perhaps you should consider trying to break down the problem into smaller pieces and think through the pieces.
      One way to start would be to realize that the output from each of the multisliders gives you a value for each X and Y coordinate, so combining each one of those X outputs with each and every one of the Y outputs would give you a unique pair of values for each "column" of the grid, etc.
    • Dec 04 2012 | 3:27 pm
      Thank you for the response :)
      So you're saying divide the grid in smaller blocks and just take those x y values?
      Do you know where I can find how to connect the sound to a range of x y values?
    • Dec 04 2012 | 4:03 pm
      Those are most basic Max operations. Did you do the included tutorials? Should give you a pretty good starting point.
    • Dec 04 2012 | 4:12 pm
      I did a few, but it seemed like it would take a lot of time to do all of them and I'm short on time :P
      I'll take another look though and see if some of them can help me, thanks.
    • Dec 04 2012 | 4:22 pm
      I have an abstraction for this that may help you understand how it's done
      best, Zachary
    • Dec 04 2012 | 5:35 pm
      This abstraction looks pretty neat :)
      I'm new to Max so forgive me for not understanding it completely. Does it take an x y grid and divides it into smaller grids, all the same size? In the help there are 4 arguments, (z.grid 320 240 10 10), so it divides it into 100 smaller grids of 320 x 240?
      What are the four inputs next to the x y grid?
      And what is the output that you get?
      And basically, what does clicking on the grid do?
      And finally, is this usable in a patch, and can I use it?
      I understand that these are a lot of questions and it might take too much time to answer them, so I don't expect you to answer them, but it would be helpful :)
      I'll just continue doing the built in Max tutorials, maybe I'll understand it later.
    • Dec 04 2012 | 5:43 pm
      Hi Lixtryum,
      It's clear from your questions that if you are going to move forward with Max in your project (without hiring someone else to do the programming), then you should probably do some studying (but you know that already).
      The 4 inputs allow you to update/override the four arguments to the abstraction. 1st input/arg: defines the incoming x dimension 2nd input/arg: defines the incoming y dimension 3rd input/arg: defines the outgoing x dimension (scaled from incoming x) 4th input/arg: defines the outgoing y dimension (scaled from incoming y)
      So this is just a simple x/y number scaling patch. Passing it through a [pack 0 0] just truncates the decimal and outputs an int.
      best, Zachary
    • Dec 04 2012 | 5:55 pm
      How much would this hired programmer cost, haha.
      Yes I know I should do some studying, it's just the deadline that has me worried.
      But thank you very much for the help!