Max for Eigenharp

Using Max/MSP to control the Eigenharp

A horrible hack to detect velocity

The Eigenharp generates continuous OSC data as soon as you start touching (and indeed while you’re releasing) a key. However, if you’re living in the MIDI world, you need an initial velocity to go along with the note. While you could certainly just use a constant velocity (probably a low value) and then use continuous OSC data to modify the sound, the fact is that most synths really need you to provide a “proper” initial velocity.

Given a sequence of positions (the OSC values) that will not be equally spaced apart, if you want to calculate velocity, you have to start calculating derivatives. Now my math skills are really lousy. There was a time when I could solve 2nd order differential equations but these days I can barely remember how to calculate the slope of a line!

Now the Eigenharp does have the ability to produce MIDI events but you don’t get access to a lot of very useful information that way, to wit, the continuous OSC data and you have to live with the restrictions such as MIDI pitch events applying to all notes being held down. (Yes, I know you can play tricks and use different MIDI channels for sequential notes but that causes grief at the receiving end).

So I decided on a temporary hack. The only thing for which I really need MIDI is to get that initial velocity. So I modified my eigenharp setup so that the 120 keys produce MIDI note events with each note number mapped to a key (so the MIDI note numbers are really just eigenharp key numbers, not actual notes). I then modified my Eigen.OSCProcessor so that it waits for MIDI note events before it starts sending OSC data. Up until now, as soon as initial OSC data was detected, we would send out the key number (as a MIDI note event) with a constant velocity value. Now, we can include the actual velocity. The MaxMSP patcher now has the opportunity to do whatever processing is desired but can now include the actual velocity of the note in question.

You can download the modified version of Eigen.OSCProcessor using the link below.

Eigen.OSCProcessor.maxpat

Here’s the modified Eigenharp setup I used.

user 3 ~ OSCforMax %2B MIDI

Leave a Reply

Your email address will not be published. Required fields are marked *