I should start by saying that I'm new to the Arduino. I'm familiar with a little programming in C/C++, and I can grasp some basic MIDI protocol, but other than that I'm really a musician. I apologize in advance if I don't know what I'm getting myself into. I've highlighted my main questions in bold so it's easier to read this wall of text.
Anyway, I'd like to make a theremin controller, though there's two main differences from most of the theremin projects I've seen online.
First off, I'm not looking to generate any kind of sound with the Arduino itself. I'd just like to send MIDI pitchbend data to a software synth, most likely NI's Massive. I'd like to send the information out of the Arduino's built in USB port, but after Googling some MIDI-based projects, they all seem to require separate MIDI ports attached to the board. So I guess my first questions are:
Can I send MIDI data over the Arduino's USB connection, or do I need a MIDI port?
Wouldn't I need to get a software synth to recognize the Arduino as a MIDI controller? If so, how?
And I've seen a lot of discussion debating Serial.write() vs. Serial.print(). Which am I supposed to use?
Secondly, I'm using a distance sensor (an HC-SR04 Ultrasonic sensor) rather than an antenna of some sort. I've already found a program which simply prints out the distance of an object from the sensor, so I have that working. The values can jump and act a little sporadic at times, but that's only if I move my hand really fast in front of the sensor.
Is an ultrasonic distance sensor fine for a theremin project, or is there some obvious problem with this method of input that I don't know about?
Another problem is scaling the values from the sensor to proper MIDI protocol. The output values need to be scaled down to a proper range for pitchbend data: which, from what I understand of most MIDI stuff, generally operates on a scale from 0 to 127. If that's true for pitchbend, that's not going to be enough for a smooth transition for a large range (hoping for at least a 2 to 3 octave range).
This is a bit confusing because I have an M-Audio Axiom Pro controller with a pitchbend wheel, and the transitions across large ranges are still incredibly smooth. Either the controller is sending out a much larger range of values, or the synth itself performs some kind of pitch smoothing between the standard 128 range it's given. So with that in mind, some final questions:
Is there any insight on how Massive (or software synths in general) handle pitchbend data?
Should I use a range of 128, or could I use a much larger range?
That's all the questions I can come up with for now.