Guitar Synth Velocity Measurment

In my recent post about how a MIDI guitar controller could be made by using the frets and strings as a matrix switch, I talk about measuring an analog signal off a divided pickup to generate velocity. It's occurred to me that the velocity value, The "loudness" of the note, should be measured at 90° after (based on wavelength of the detected note) the fretting of the note. For low E, a guitar's 6th string, this is a measurement delay of 3mS. This is the time taken for the very first peak of the note to rise from 0 volts to its peak.

a pick against a guitar string
Don't fret, it's just a hand picking on a defenceless string.

Now, this isn't really the peak of the note's first oscillation, it's the click of the plectrum, but for a loud note the plectrum hits the string harder and faster than it does for a low note, so that click is still likely a good measure for velocity. MIDI uses velocity as the label for its loudness parameter of a note-on command because MIDI was designed for keyboards, and a harder hit of a piano or organ key results in a faster time between the key switch contact moving from the rest position contact to the triggered position. Bang your fist on a piano keyboard for loudness and you're actually hitting it faster. This is also pretty much true for guitar.

So, delaying the measurement of the detected note's signal strength by 1/4 wavelength (AKA 90°) will give a realistic velocity response. It'll give the string's movement time enough to excite the pickup and produce a voltage, which in turn, is rectified and filtered to make a DC signal, giving us a loudness signal. Measure it the second a logic voltage is applied to the fret the string is sitting on will give yo the half-arsed hammer-on, where waiting 3mS gives time for the pick to energise the string.

So, the point?

A little latency is my friend. 3mS isn't really any worse than a real guitar's low E. In fact, this is probably why 7mS is where latency barely becomes noticeable and 12 to 15mS before it begins to be hard work to keep up with the signal. The best method isn't capture all the data at once, it's best, in fact, to capture the signals and assemble the note code for transmission barely in time.

If I use the analogReadFast command 2980uS after an open E6 string is played, and 1480uS after D4, second fret (E on the D string) is played, that's the point of peak velocity and the latency reduces as you go up the scale. 710uS at E1, 350uS at E1, 12th fret, and so on. It may even work out to be not even that directly logarithmic.

The things that pop into your head while watching a documentary about Pompeii, hey?

Comments

Popular posts from this blog

Removing Ollama From My Mac

Bike Porn

ALWAYS read the PDS