Rust Audio

Vst-rs unresolved imports: could not find `util` in `vst` & other

context

I am currently learning Rust, and thought that contents would be more meaningful to me if I apply them to a project. I started from the ‘sine-synth’ example, and managed to produce a VST, and also add some nice changes to the sound.

This is just with the purpose of playing around, so if it’s not an easy answer, just mention that. I just follow with other things.

problem

I want to try adding control parameters; following ‘ladder-filter’ example. Compiler complains of unresolved imports:

error[E0432]: unresolved import `vst::plugin::PluginParameters`
  --> src\lib.rs:11:57
   |
11 | use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters};
   |                                                         ^^^^^^^^^^^^^^^^ no `PluginParameters` in `plugin`

error[E0432]: unresolved import `vst::util`
  --> src\lib.rs:12:10
   |
12 | use vst::util::ParameterTransfer;
   |          ^^^^ could not find `util` in `vst`

I tried

including the dependencies found in vst-rs cargo.toml file

Relevant bits of code

cargo.toml dependencies (without attempted imports)

[dependencies]
vst = "0.0.1"
time = "0.1"

offending chunk of lib.rs (main file)

use vst::api::{Events, Supported};
use vst::buffer::AudioBuffer;
use vst::event::Event;
use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters};
                                                        ^^^^^^^^^^^^^^^^
use vst::util::ParameterTransfer;
         ^^^^

You are using the crates.io version of the crate, which is not yet updated with the thread safety changes, so it’s out of sync with the documentation. There will be a 0.2.0 update at some point that includes those changes. Until then, you can specify the dependency on the GitHub version, like this:

vst = { git = “https://github.com/RustAudio/vst-rs” }

1 Like

Thank you! Now I get some other error, which probably means that my problem is fixed.

For those who may see this later: be careful with vst = { git = “https://github.com/RustAudio/vst-rs” }. The quote characters there appear as typographical quotes, where it should use ascii quotes like: vst = { git = "https://github.com/RustAudio/vst-rs" }

1 Like

Haha, that’s one of the dangers of answering programming questions using the phone, I guess. :wink:

1 Like