Hi there!

I'm currently having a problem with my patch for one of the sensors for an installation I'm building. I'm quite new to both Pd and Bela, so I'm terribly sorry and please bear with me!

My installation involves triggering audio samples with piezo mics. I've written a Pd patch that loads up the appropriate sample and randomizes various aspects of the playback when the sensor is triggered. At the moment, there are two things I want to fix:

  1. The sample loops indefinitely at the same volume until the sensor is triggered again. I'd like the sample to continue playing, but then fade out for roughly a minute. (Ideally, the sensor could be re-engaged at any point to build texture.)

  2. I need the sample to retrigger every time the sensor is engaged, rather than having it be 1 touch for the ON position, another touch for OFF.

Here's a screenshot of my patch:

Any help is very much appreciated!

    gcerberville he sample loops indefinitely at the same volume until the sensor is triggered again. I'd like the sample to continue playing, but then fade out for roughly a minute. (Ideally, the sensor could be re-engaged at any point to build texture.)

    You can set a [delay 60000] whenever bonk~ sends you a bang which triggers an action (e.g.: a fade out) 60 seconds after the latest onset

    gcerberville I need the sample to retrigger every time the sensor is engaged, rather than having it be 1 touch for the ON position, another touch for OFF.

    banging the toggle causes it to toggle between 0 and 1. What you need instead is banging a [1( directly, bypassing the toggle.

      [t b]
      |
      [route  f]

      1) that's not how route works. If you want to route floats to the left, use [route float].
      2) you are sending it a bang, not a float, so even then nothing would go out of the left outlet

      Also, [spigot] only ever receives a 0 on its right inlet so it never opens. I think you can remove the spigot for the patch and it should start working as expected.

      That worked! Thanks so much for your help. I've been mostly underwater on this for months and I'm still learning, so I seriously appreciate it!