![]() |
|
![]() |
| The algorithm was discovered in 1983, and for how computationally cheap it is, I'd say it's pretty convincing. Waveguide synthesis is a generalization of the same idea, often with more realistic results.
Variations on Karplus-Strong synthesis can yield some pretty wacky, dry and plucky types of sounds. In the original paper, the authors propose a variant of the algorithm which involves randomly alternating the sign (+/-) of every sample in the feedback loop, which creates a lot more atonal information in the signal. There’s also a variation floating around which uses an allpass filter in the feedback loop to introduce inharmonicity in the signal, see for example https://www.youtube.com/watch?v=SpC3t1EVF_Q. |
![]() |
| It is great that the author included some known pieces for you to "watch" (click the music icon on the bottom right). Of course one first goes to Bach to test the mettle. While "watching" BWV 578 one thing I immediately noticed was how the rhythm of the counterpoint stood out to me in a new way. I have seen many visualizers (the great https://www.youtube.com/user/smalin/videos deserves mention), but I have found most to have some sort of constant object moving around to visualization the tones (i.e. a ball moving up and down). In this case, there is no "moving object" that we follow and we are instead left with the tones in isolation. I greatly enjoyed seeing how this increased my appreciation of Bach's rhythmic counterpoint as I could see when multiple strings were plucked at the same time with the clear purple coloring. Amazing work!
|
![]() |
| It does, and very cleverly too. The '?' button explains what's going on - he just takes the fourier analysis of the shape of the string when it's released, and plays tones from that. |
![]() |
| The way strings resonate means the tone you hear contains the fundamental tone and a number of higher harmonics of that tone. Depending on where (and how) you play the string you can emphasise the harmonics more or the fundamental tone more.
Here for example is a piece made up largely of the harmonics (Portrait of Tracy Jaco Pastorius) https://www.youtube.com/watch?v=nsZ_1mPOuyk That's an electric bass and the bell-like sounds are harmonics. Basically he's just lightly touching the string in specific places to suppress the fundamental tone so you just hear the harmonics. Whereas here (Stir it up - Bob Marley and the Wailers) https://www.youtube.com/watch?v=1hwL3S3Gtzs when the bass comes in, the player is holding his hand near the bridge (back of the strings) with the side of the palm resting on the strings to suppress all the harmonics so you only get the fundamental tone and it has this sort of muffled quality (because a lot of the brightness comes from harmonics). |
![]() |
| There is an acoustic version, you can tune it however you like, and choose from all kinds of chords, but once you chose a chord it has to be tuned precisely to that set of notes or it would be "out of tune".
Each course of strings on the webpage somewhat behaves and sounds like an "ovikannel" when you strum it manually. Here's one that was found hanging on a wall but they were normally attached to an entrance door so the wooden balls would swing against the strings when the door was opened, and play the chime: https://www.reddit.com/r/finnish/comments/dvd125/my_finnish_... One of the commenters was quite curious as to what it would sound like. Well about like this. |
![]() |
| As others said - they're chords. And not just any chords, but chords we know sound great together. (If you haven't seen the 'Pachelbel Rant' yet, you should, it's an entire comedy bit based on the fact that these chords are fundamental to music: https://www.youtube.com/watch?v=uxC1fPE1QEE)
If you click on the little notes in the bottom right, you can pick other sets of chords, which give a different "vibe". (Me, I'm partial to the Andalusian ones) That's why common advice to people starting the guitar is "Three chords, you can play anything. Four, you control the mood. Five, you're a god among men" |
![]() |
| I also have serious popping in chrome on my mac.
This shouldn't happen. The main reason is the use of createScriptProcessor. This should be replaced with AudioWorklet. Use WASM + SharedArraybuffer for calculation. The visual of picking the strings is great, I spent a lot of time on it, I believe the vote is also a recognition of this. Here is a similar idea (karplus) implemented with Rust + WASM, which is much better in terms of audio quality: https://jackschaedler.github.io/karplus-stress-tester/ I also wrote a simple api to use Rust wasm audio here: If you are interested in doing some use cases, leave a message. I am actively maintaining it recently. |
![]() |
| It would be nice if he or she described the algorithm in more detail. A common and simple string-synthesis method is called Karplus-Strong, but this sounds a bit better. |
![]() |
| Well, this fixed it. I bet there is a lot of confusion for the people reporting it just works, while their phone is on silent. Seems to work on silent if you have headphones on. |
![]() |
| As a musician, it's super interesting looking at the JS source (if you're a developer) and seeing how he applies musical concepts like notes and progressions to code. |
![]() |
| Hey all: don't miss the music button in the bottom right!!
You can play classical music on the simulated instruments. This is the nicest thing I've seen in a long time. |
![]() |
| reading some of the reactions to this, it amazes me how many free VSTs just need a web interface of some kind to suddenly become interesting and popular.
If you have a DAW there are so many interesting free sound generators on the internet. Just spitfire audio has their free lab VSTs which give you 60 VSTs to play with - and thats just one company. https://labs.spitfireaudio.com/ Its all just missing the front end a DAW normally provides but is too complicated for people just looking to mess around with sounds. |
![]() |
| Here's the text extracted from a screenshot of the ? provided to ChatGPT so you don't have to do extra work.
Pluck by Murat A math-based string simulator. Download on Apple App Store for $1.99 [Image of Apple App Store download button] - It's fun to have on iPad with multitouch, especially for kids (even 1 year olds). - Support this project Both the audio and visuals are generated using the same math, rendered at different speeds so the eye can see. No tricks or audio files are used: everything is calculated from raw sine waves, with a theory of how energy is released in a pluck. - The vibrations are modeled based on how far down the string you pluck from. - The velocity of midi notes are mapped to both pluck position, as well as pluck strength. This YouTube video of a slow motion string pluck proves that our simulated result is very close to reality. [Embedded YouTube video of slow motion pluck] Technical details: - Each string is simulated with 12 overtones (integer multiples of the note frequency) - To calculate amplitude of each overtone, we take the Fourier transform of the plucked string at the time the pick is released - Higher frequency overtones decay faster than lower frequency overtones - 72 strings x 12 overtones x 44,100 samples per second = 52,920,000 calculations per second - Audio buffer of 1024 samples are sent to the GPU to compute in parallel on each tick There are several directions I can take this project from here: 1. Turn it into an interactive educational tool to teach physics of sound, timbre & music. 2. Turn it into a music learning tool for kids where songs are pre-made as chords that the user can pluck to learn rhythm and feel. 3. Turn it into an interactive art installation 4. Turn it into a game where i.e. a bouncing ball plucks the strings & you try to match the melody If you are interested in any of the above, please get in touch at [email protected] or @moyfer. |
Karplus-Strong can be extended in ways to simulate different types of plucking, acoustic pickup at bridge, or electric pickup at any point along tbe string, and plucked at any point along the string. Body resonance can be simulated etc. It's a pretty fun synth technique to play with. Amazing to take beyond simulating conventional instruments.