# Co-vibration of strings in electric pianos?



## skrjablin

Why don't any electric pianos (that I know of) try to implement the effect of co-vibration of strings?

If you don't know what I'm talking of, hold down a C major chord in the treble of an acoustic piano, but _quiet_, i.e. hold it down so quiet that it doesn't make any sound. Now push a contra C loud and fast, while still holding down the chord. The chord should resound, since it contains overtones from the contra C.

This should have a big effect on the sound of a piano, especially when the pedal is down. So why don't keyboard companies even try to imitate it? I was thinking about it for some time, and according to my thinking it should actually be easy to implement, programming-wise.


----------



## Ukko

That's an interesting idea. I have to ask, though, what is the demand for the feature? Seems like there would be little or no interest in pop/rock, where most electronic keyboards are utilized. It's a pretty subtle effect, compared to distortion. Maybe in the 'laid back' segment of jazz? Is there market-significant use of electronic keyboards in classical?


----------



## Ernie

While this sound is no doubt present, it is just about inaudible during playing. It would be heard by listeners standing close to a fine quality grand if the sound were produced in a way similar to what you describe. In my teaching days, I used to do it exactly as you described to demonstrate the existence of overtones to my students. In actual performance, I doubt it can ever be heard. On the other hand, the effect is present, (heard or not) and simply adds to the complexity of piano tone. Finding a way to sample it may add to the realism of a sampled piano tone even if the actual effect is unheard. Would the makers of electronic keyboards go to the trouble of including the effect in their samples - I doubt it.

Ernie


----------



## Weston

Just as speculation on the part of an electronic music fan: a physical modeled virtual piano might be able to do this in real time, but perhaps not with the computing power most of us have at our disposal. This would work much the same way as ray tracing works in 3D image rendering. That is definitely not done in real time! But it might work as a rendered piece. 

There probably isn't enough demand for it for anyone to have tried. It might be more possible on an acoustic guitar emulation where usually only six strings are involved.


----------



## Kopachris

Weston said:


> Just as speculation on the part of an electronic music fan: a physical modeled virtual piano might be able to do this in real time, but perhaps not with the computing power most of us have at our disposal. This would work much the same way as ray tracing works in 3D image rendering. That is definitely not done in real time! But it might work as a rendered piece.


No, it would be rather easy to implement, perhaps in a midi sequencer. All it would take is looking up the first few overtones of each note played, and if the key is open, add a fraction of main note's velocity to simulate the resonance. For instance, if the pedal is held down, it would be like sending a signal to play each overtone, but very quietly. It could add up for (say) a bunch of arpeggios.


Code:


void handle_keyPlayed(int note, int vel, int **open_keys, bool pedal) {
    const k;  //constant for finding overtone note velocities
    const int overtones[] = {12,19,24,28,31};  //semitones above main note
    playMidiNote(note, vel);
    if(pedal) {
        for(int i = 0; i < sizeof(overtones); i++;) {
            incNoteVel(note + overtones[i], vel * k / i);
        }
    }
    /* Then loop through open keys and check if they
    ** match one of the overtones.  If a match is found, call
    ** incNoteVel() to increase the velocity.
    */
}

I don't know exactly how MIDI handles stuff like note velocity changes in the middle of a note (it probably doesn't), so it might need a bit of a reworking in that department as well.


----------

