Page 1 of 2
Karplus Strong Synthesis
Posted: Sat Jun 11, 2016 6:55 am
by martinvicanek
In 1983, two computer science students Kevin Karplus and Alex Strong pblished their algorithm for string sound synthesis. It may be viewed as a physical model, with a fractional delay line in a feedback loop representing the string. A moderate lowpass in the loop quickly filters out the high frequencies of the excitation usually formed by a burst of white noise.
Owing to the dispersion of the fractional delay, the waveform changes at each cycle, resulting in a vivid, natural sound, as opposed to the static, strictly periodic oscillations from a wavetable. The excitation envelope may be shaped to generate a wide range of sound characteristics.
Inverting the phase in the feedback loop yields a tone with only odd harmonics, opening many possibilities like pan flute, marimba, glass bottle etc.
I have included a demonstration below, which is actually the best synth I have created so far.

There are ten presets to showcase its potential. What I find so fascinating is the rather low number of components and CPU hit.
Anyway, check it out for yourself an please give me feedback.
I am planning to release this as a VST. Any GUI artist out there willing to help?

Re: Karplus Strong Synthesis
Posted: Sat Jun 11, 2016 11:44 am
by DigiTonix
Wow! very interesting method of synthesis, I need to learn from you!...
The sound of some presets I similar to the famous synth from AAS,
May I, with your permission, take your resonator to use in your project???

Re: Karplus Strong Synthesis
Posted: Sat Jun 11, 2016 1:18 pm
by Spogg
Wow Martin!
What a delightful thing to find on a Saturday morning!
Initially I struggled with the two sets of attack/decay settings since I was thinking in conventional terms. I even made a version which wired a conventional ADSR to control the noise level but it was dreadful. Puzzled by this, I read up on the principle which is completely new to me. Once I understood broadly what the method was I was able to grasp programming it. I made preset 11 just to experiment.
Although the technique seems to have a more narrow application than typical synthesis, the range of results attainable makes it well worth having. Your range of presets demonstrated this admirably. They are all really nice too!
People really do need to listen to this thing! One thing that really appealed to me was the round-robin effect presumably created by the random element in the excitation noise. No two notes sound exactly the same and this could be very useful for multi-layering to get a rich ensemble result and also to emulate real-world playing of guitars for example. Normally a multi-sample arrangement would be needed for round-robin but this does it purely in synthesis, so I’m well impressed.
I also like the effects that you provided and I’ve “borrowed” the 3-stage LED which I thought was a great idea.
So, of course, I just had to interfere and I Spogged it a bit (file attached). I’ve made it so all the preset parameter names are unique which I had to do to load up one of your presets to play with it (I set the preset manager to lock too, so I could preserve your presets).
The other thing was the sustain pedal was turning on the LFO for the Modwheel so I replaced your Modwheel module with the one I always use. Maybe you intended this but I personally like to have Modwheel and sustain separate.
This is a really nice synth and the only thing that I think needs to be added is a tuner to set the octave, note and fine tune. I do hope someone can make a nice front panel for it at some point. Me, I can do orange…
Thanks for sharing this.
Cheers
Spogg
Re: Karplus Strong Synthesis
Posted: Sat Jun 11, 2016 1:20 pm
by KG_is_back
Hi martin. Very interesting project. I also experimented with string synthesis myself for a long time. What I tried to do is to resynthesize real guitar sounds from this. When you have a recording of real guitar string, you can extract the characteristics of the dampening filter, for example using this (
EQ match), simply by driving normal signal as the dry and one-period-delayed signal as wet.
Real strings actually vibrate in 2 dimensions (horizontally and vertically). The vertical vibrations have higher dampening (because they transfer more energy to the bridge) and decay faster. Horizontal vibrations decay slower and thus are more prominent after the attack phase. You can see this in
this image. Up to 1.5 mark the decay is quite fast and after that is gets slower.
The two vibration modes bleed into each other.
Another approach is to change the characteristics of the filter over time (for example, estimate response near the start, in the threshold (where fast dacay turns into slow) and near the end and then interpolate between them).
You can also extract the excitator (the pluck) by inverting the resonator (just switch it form feedback to feedforward delay).
I have some schematics where I experiment with this, yielding interesting results. unfortunately they are very old, buggy and hard to navigate (this was before memin was introduced to code, so you can imagine the hell of transferring coefficients to the filters). If you are interested I can clean them up a little and update them...
Re: Karplus Strong Synthesis
Posted: Sun Jun 12, 2016 12:11 pm
by stw
As usual very cool and perfectly coded stuff!
Thanks for sharing your work!
Re: Karplus Strong Synthesis
Posted: Sun Jun 12, 2016 4:10 pm
by Tronic
Re: Karplus Strong Synthesis
Posted: Sun Jun 12, 2016 6:50 pm
by martinvicanek
Thanks for the helpful feedback, guys.
@DigiTronix: yes, you may use all my stuff but please acknowledge me appropriately. Oh, and if you make millions with it I accept PayPal donations.
@Spogg, thanks a bunch for your detailed account! Some sharp obervations there as usual.

It had not occurred to me that preset names should be unique even across VSTs, so I updated my first post accordingly. And you were spot on with the mod wheel. I don't use a sustain pedal (you can tell i am not a keyboard player), so I overlooked that issue. It is fixed in the update, with sustain pedal support added.
Yes, no two notes sound equal because of the random excitation draws a new seed for each new note. That must be the reason why I don't get tired of a patch even after extensive jamming.
I thought a detuner would only make sense with a second oscillator. Most MIDI keyboards can transpose per se, or am I wrong?
Oh, thanks for preset #11. Although I would have added some dynamics to make it "bite" when you hit harder (my other presets do that, and I find that an important ingredient for expression.)
@KG_is_back: Yeah I remember your post that you are referring to. I think if you are after faithful emulation of a particular instrument, a sampler is the best approach. My ambition here is more modest, I just wanted to create something that sounds "interesting".
Thanks again, everybody. And please, hear my call for help with the GUI. Or do you really not care if this thing ends up orange?

Re: Karplus Strong Synthesis
Posted: Sun Jun 12, 2016 11:49 pm
by Spogg
martinvicanek wrote:...I thought a detuner would only make sense with a second oscillator. Most MIDI keyboards can transpose per se, or am I wrong?

I was thinking about multiple instances on the same or different tracks for detuning or fifths or octaves etc. The DAW can usually do this (but not if all on the same track) so it's not an important point, I just thought it might help in practice.
I forgot to mention what impressed me the most; using girls names for the presets. What a totally brilliant idea
This is a great synth Martin!
Cheers
Spogg
Re: Karplus Strong Synthesis
Posted: Mon Jun 13, 2016 12:53 am
by RJHollins
I forgot to mention what impressed me the most; using girls names for the presets. What a totally brilliant idea
Kar + Strong
hmmm ... Strong Woman with a Car ... ok

Re: Karplus Strong Synthesis
Posted: Mon Jun 13, 2016 5:33 am
by martinvicanek
Spogg wrote: [...] using girls names for the presets. What a totally brilliant idea

Yes, brilliant

indeed, but not mine. I stole it from a creative fella here on the forum.
