tentacle and daisy

Tried it with the oscillator – not a great response – very little variation in numbers

now testing with an envelope to try and make the sound play on squish by setting up a trigger for an envelope that fires when the difference between the two notes is over the threshold. I first tried it in the audiocallback but it doesn’t seem to work so well, even though this is where the metro is, perhaps the analogue Read is not good inside of the audiocallback? I am also having issues with the serial monitor not connecting so I am currently adjusting the hysteresis value by ear. This will probably change over time as the materials degrade. It sounds better once the trigger code was moved to the main loop. Triggering adenv.Trigger from within the main loop is still working. It is not yet having the effect I was hoping for and I think that is due to the length of the start and end of the envelopes or the curve so I will experiment with those parameters. It would be great if lighter touches could extend the length of the envelope….

At the moment if the following code

 currentValue = analogRead(analogPin);
    if (abs(currentValue - previousValue) >= hysteresis)
    {
      adenv.Trigger();
      //update the previous value
      previousValue = currentValue;
      
    }
  Serial.println(currentValue);

works temporarily then the trigger stays on. This occurs when the code is in the audio callback and in the main loop

In the audio call back the sound is noisy, like there are multiples or the value is changing too fast. TODO – add smoothing – it could make this much better. TODO – ask on the daisy forum where I should be putting this code.

In the main loop the sound is clear. I don’t know if this is the best method for getting the response I was hoping for. If it kept working correctly and the pitch was changeable as well then perhaps this would feel more fun and reactive.

TODO: add map before getting the current value so that I can get a better range of values – also perhaps using floats rather than integers would be better (is this where I am going wrong? does daisy always need floats – I feel like I have seen this mentioned before)

Changed to floats and moved the code back to the main loop – it lasted longer before playing sound consistently

removing serial made no difference – still the same error.

**note I should add a trim pot for changing the hysteresis