Control-Surface
Control-Surface copied to clipboard
Can I connect a HC-SR04 module instead of a potentiometer?
I would like to try to make a sensor expression pedal from this module
You cannot use it as a potentiometer, because you have to drive it differently, it doesn't output an analog signal.
However, there are plenty of tutorials on the internet on how to measure the distance, and once you have that, you can map it to a range from 0 to 127 (or 0 to 16383 for a 14-bit control) and send it over MIDI as explained in https://tttapa.github.io/Control-Surface-doc/Doxygen/d3/df7/midi-tutorial.html#midi_md-sending.
I found a library for this device - https://bitbucket.org/teckel12/arduino-new-ping/downloads/ Is it possible to link this library with Control Surface?
Is it possible to link this library with Control Surface?
You don't have to link the libraries.
The ping library gives you a value, and then you send that value over MIDI using Control Surface.
There is a link to the files https://www.youtube.com/watch?v=mWa1He9FP5U
I have already made this but I was using an Arduino Nano and Midi.h library. You can find everything about that at my website https://www.criusdigitalstudio.com/projects-english/crius-force-control-sonar-midi-controller . You can easily use it with the Control Surface library with small changes in the code.