When you play any tone on the instrument (e.g. piano) besides the main tone (for A (la) it is 440 Hz) you will get a number of "overtones". In this demo I tried to emultae them. On the strings instrument overtones generated by different parts of the string. For example when you play any note the string will vibrate from start to end. Then it will vibrate by halfs (you get base tone frequency * 2). Then it vibrate by thirds (tone frequency * 3). And so on and so forth. The first six overtones contain all notes from dominant seventh chord (for C it will be C, E, G, Bb).
freq note 16.35 C0 32.70 C1 49 G1 65 C2 81 E2 98 G2 114 almost Bb2 130 C3Check Wikipedia for more info.
I still don't have exact formula for volume change of overtones. In this demo I made simple "volume factor" - Nth overtone will have 1/N*volume_factor volume.
Usage: Select frequency, number of overtones, volume factor and press "Test". It should play the sound.
freq= n_overtones= volume_factor=