Forums > MaxMSP

number box to trigger i to number box…. help? strange problem to be solved?

December 5, 2010 | 10:58 pm

Hi Guys,

i have a very strange problem i was wondering if someone could solve it?

i am sending 4 numbers through a number box to (trigger i)object, this is then going into another number box that will trigger gates 1,2,3 or 4.

The problem is that when i send all of my numbers into the first number box – only the number 2 reads in the second.

If i send them in one at a time they all read in the second float box?

How do i fix this problem? – is it something to do with the trigger object?


December 5, 2010 | 11:17 pm

– Pasted Max Patch, click to expand. –

December 6, 2010 | 1:00 am

What are you trying to achieve with this patch? The way it is set up now any number you send to the first number box will be sent to the second number box four times in a row which looks fairly pointless with the set up you have. Just connect a [print] object to the second number box to see what data is actually passing through.


December 6, 2010 | 12:39 pm

if you want to control each gate separately, this way it is not happening. if you can explain what you want to achieve, it would be easier to help!

Nickolas


December 6, 2010 | 9:23 pm

Hi Guys,

Thanks so much for having a look. As a further explination:

Basicly the numbers are being sent from the buttons on a wii controler. I wish the numbers 1-4 to control switching between gates 1-4. i.e when number 1 is pushed the gate one remains, when 2 is pushed it switches to gate 2 remaining open, etc.

The problem is that the controler sends out two bangs when a button is pushed.
What i have put here is what i thought might be away around having the two bangs?

PLEASE help me! its for my uni project! – hope i have explained enough! let me know if more explination is needed!

Thank you
x


December 6, 2010 | 9:34 pm

two bangs? or a 1 then a 0 which you are converting to bangs?

you can try [onebang] to restrict bangs. but you need to differentiate between the numbers coming in. if it’s 1 2 3 4 then you can send these directly to your [gate 4].


December 6, 2010 | 9:57 pm

Yes each button has an if statement to give it numbers 1-4.
i did the [trigger i] to get rid of the zero and let the number remain.

i dont think i need a bang?

i just want the numbers 1-4 to go trigger the gates 1-4.

- how do i fix this? – it seams such a simple idea?

Thanks
x


December 6, 2010 | 10:31 pm

If you send the data from the buttons you want to use to the receives in this patch it should open the gates as you want.

– Pasted Max Patch, click to expand. –


MIB
December 6, 2010 | 10:34 pm

I don’t have a wii controller but have used others, and the way they usually work is to give you a button id and then button state. so you would get a list of say "4 1" when you press button 4 down and then "4 0" when you release that button. now if that is the case with the wii, it’s easy as pi ;)

[route 1 2 3 4] (where 1 2 3 4 are the button ids), then connect to your gates and you are golden since the ids will be stripped and only the On/Off messages will go through…

EDIT: well, seems I should have looked at your patch better. I didn’t see the [gate 4]. sorry


December 7, 2010 | 12:47 am

I am still unsure how to get the sole numbers 1-4 without interferance of 0′s from letting go of the button.???


December 7, 2010 | 1:49 am

I’m fairly sure the buttons send out 0 when released and some other value (depending on the button) when pressed so using [> 0] [sel 1] will trigger a bang when a certain button is pressed providing you have the buttons routed seperately (the help patch with aka.wiiremote shows you how this can be achieved). You can then use a [trigger] for each button individually set to whichever gate outlet you want it to open.


December 7, 2010 | 12:34 pm

Thanks luke, i see what you mean. That does work for selecting the gates.

But if i want to alternate between gates how do i turn the other three gates off when one is being used? – i need this because im going to be controling filters inside the gate with the wii controler?


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