Using an Ultrasonic sensor data to play MIDI notes.

    Feb 16 2018 | 4:00 pm
    Hi all,
    I've been working on a small project for my course which is based around instruments for musical expression. With my Arduino, I have created a stream of data coming from an Ultrasonic Sensor HC-SR04, in correspondence to the distance of your hand.
    I have then mapped this data to Max to control the MIDI notes being outputted. For example if the distance is 4-5cm then the output will be MIDI value 60 or if the distance is 5-7cm then the output will be 61 etc....
    This has been successful however, every time the data flow is updated, (by delay(1000) a new MIDI on message is received. I want to implement a way that the note stays on constantly, only until a new MIDI number is sent.
    Does anyone think they could help find a solution?

    • Feb 16 2018 | 4:09 pm
      It would be easier to be of assistance if we could see your patch. To share your patch most efficiently, select all of its objects, choose Copy Compressed from the Edit menu, and then paste the results into the Forum post. Works like a charm, and will probably get you the quickest and most focused responses.