overdrivenpotato / rust-vst2

VST 2.4 API implementation in rust. Create plugins or hosts.
MIT License
221 stars 23 forks source link

VST instrument example. #26

Closed monomadic closed 7 years ago

monomadic commented 7 years ago

Just a basic analog sine wave synth, as an example of how to do vst instruments with this library.

monomadic commented 7 years ago

Appveyor seems to be failing because of a server problem, but the code should pass.

overdrivenpotato commented 7 years ago

Thanks for the example, looks great. I'll test and merge this tomorrow afternoon when I get some time

piedoom commented 7 years ago

This is awesome! I've been meaning to learn this library + rust and you've made it much more accessible.

monomadic commented 7 years ago

I only made a very simple example here, there's only a small attack filter on the sound so it pops on release. I can fix that, but I risk drastically increasing the complexity of the example the more I add, and I figured this was about implementing an instrument with the api and not DSP code, so I left it here.

Are there other examples you guys would like to see?

overdrivenpotato commented 7 years ago

Feel free to add more examples, this is a good one as it's very simple. Ideally it should only illustrate how to make a minimal instrument rather than a fully featured synth.

monomadic commented 7 years ago

Exactly, I stopped at the point that it wasn't explaining the API any more. I'm thinking preset save/load? Btw @overdrivenpotato how do I get in contact with you?

monomadic commented 7 years ago

One thing about this code, currently the instrument uses the process function, but technically instruments that don't care about input buffers and overwrite the buffer completely (almost all instruments) should use processReplacing - but I don't think this is exposed in the API.

Boscop commented 7 years ago

http://teragonaudio.com/article/How-to-make-your-own-VST-host.html

In the VST SDK 2.4, processReplacing() became the new standard call. You may have to add in support to your host for the old style of process() plugins, though there aren’t so many plugins out there which still do this.

http://bass.radio42.com/help/html/29c47d2d-fbc5-90e8-3b97-507cce63e012.htm

process
Accumulating process mode delegate method (deprecated in VST 2.4, use processReplacing instead).

overdrivenpotato commented 7 years ago

The process and process_f64 methods are called by processReplacing and processDoubleReplacing respectively. This library doesn't do anything with calls to the old process function.

If you want to keep in touch, you can add me on discord: sofa#1029 or email me: marko@mijalkovic.ca