This is part of my journey on pybind11. I wrote a tiny FM Synthesis library in C++ and a Python wrapper for that using pybind11.<p>There is a command-line piano app in the examples directory if you want to play with it. Here is the link: <a href="https://github.com/charstorm/koelsynth/tree/main/examples/simple">https://github.com/charstorm/koelsynth/tree/main/examples/si...</a><p>My next target is to attach this to some kind of physics simulation - like a bunch of balls moving around in a box with some internal walls. When the ball hits certain trigger points, it produces the sound.
nice work!<p>Have you tried to port it to WASM?<p>Python can also call the wasm with wasmer<p>I ported <a href="https://github.com/chaosprint/glicol">https://github.com/chaosprint/glicol</a> for my Python audio project using the same method<p>for your physics idea, with wasm, perhaps it can be something like this?<p><a href="https://jackschaedler.github.io/karplus-stress-tester/" rel="nofollow noreferrer">https://jackschaedler.github.io/karplus-stress-tester/</a>
Omg..I have that physics simulation and made crappy sound tones in audacity for it. I want to use this to make better sounds.<p>I added a music block to Goober Dash level editor:<p>https//gooberdash.winterpixel.io/<p>When your Goober, or a physics crate, hits the music block, it plays a note. I didn't release this branch yet. Can I use the piano notes from this lib in our game? I wouldn't be adding the generator code to the game, I just need sound files.
Nice, I like simple projects like this.<p>However, Wikipedia has a better diagram and explanation of ADSR:<p><a href="https://en.wikipedia.org/wiki/Envelope_(music)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Envelope_(music)</a>
Why is it that FM synthesis was so well-suited to relatively simple early digital hardware (eg. Yamaha's DX/TX line)?<p>Does that also make for relatively simple software FM synthesis?