How to use Pod Switches with Oopsy and Gen~?

I have a Gen~ patch that relies on toggles from a MAX/MSP patch. It expects a toggle to be either On or Off and produce a continuous stream of 1 or 0 respectively. How do I translate MAX/MSP toggles to the Pod switches using Oopsy. Are they toggles or are they latch? Can this be configured? Can I use some gen~ object to translate the input to On/Off. I’m a noob here so I’m happy to get some explanation.

Hi David!

With Oopsy, it’s the [gen~] that is compiled and anything outside of that (Max [toggle] for example) will not be compiled.

So, what you need to do is use the [param sw1] and [param sw2] operators inside of [gen~].
Here’s a patch that you can put together quickly. Create and connect these set of operators inside the [gen~] object in your Oopsy patch.

Screenshot 2023-06-22 at 4.03.08 PM

Then, select Pod, put your Pod into bootloader mode, and flash. Now, you should be able to press the buttons on your Pod and the LEDs should light up. For example, press down on the left button and the left LED will light up blue!!

And I highly recommend checking out the Pod template patch which you can find in Max 8Packagesoopsytemplatesoopsy_pod.maxpat. Analyzing it will help you understand how the hardware on your Pod are used in [gen~].

Let me know if you have any questions!

I got all of that! My program runs on the device via the Max template for DaisyPod. My question was specifically how to read the “param sw1” and “param sw2”. Do they produce a continuous stream of 0s if not pressed? And 1s if pressed? Or is it like a toggle On/Off. I’m having trouble figuring this out and not getting much result from them. Thanks again.

OK. I guess I can test this with the patch you sent.

1 Like

Thank you for the clarification!

Definitely, you will get a better sense of what’s going on by testing out that patch.
As you will be able to observe, [param sw1] & [param sw2] are outputting a stream of 1s when the switch is pressed down (LED turns on). And it’s outputting 0s when it’s not pressed down (LED is off).

From there, you can start to add more operators. Here’s an example of a toggle. When you press & let go Pod’s right switch, LED on the right turns on and stays on. Then, you can press & let go again to turn off the LED.

Screenshot 2023-06-23 at 9.58.41 AM

Because [param sw2] will be constantly outputting 1s during the moment when the switch is pressed down (even if it’s for a short moment), the [change] operator is needed to make sure that there’s a debounce happening.

Finally, it’s helpful to use Max objects (which again are not compiled) for testing purpose like this:

Screenshot 2023-06-23 at 10.00.15 AM

When the toggle object is on/1, it’s equivalent to when you’re holding down on Pod’s switch. And the output values displayed on the [number~] object should match how the Pod’s LED will behave. This is a good way to experiment and test without having to flash all the time.

What you can also do now is observe the [change] operator in action by changing the max in [accum] to like 100, remove the [change] operator from the chain, and toggle around the [toggle] object in Max to see how the [number~] object behaves. You should see the value in [number~] object going chaotic when the [toggle] is 1! Then, put the [change] back in and observe the difference.