1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// An example of a software synthesizer using the JACK back-end.
// The code that is shared between all backends is in the `test_synth.rs` file.
//
// Compiling
// =========
// You can compile this example with
// ```
// cargo build --release --examples --features backend-vst
// ```
// This generates a library that you can find
//
// * under `target/release/examples/libvst_synth.so` for linux
// * in the `target/release/examples/` folder for other operating systems.
//
// Running
// =======
//
// ## Under Linux
// Copy the `.so` file to a folder that is in the `VST_PATH` environment variable.
//
// ## Under Windows
// TODO
//
// ## Under MacOs
// TODO
// Note: the `rust-vst` repository contains a file `osx_vst_bundler.sh`, you will probably
// need this.
//
// ## Logging
// In order to enable logging, set the environment variable `RSYNTH_LOG_LEVEL` to
// one of the supported log levels.
// Recognized log levels are: 'off', 'error', 'warning', 'info', 'debug' and 'trace'.
//
// You can set the environment variable `RSYNTH_LOG_FILE` to the file name of the file in which
// you want to log.
//
// Note that these environment variables need to be visible to the host.
// Note that the example is also logging to a file in the realtime thread, which may cause clipping.
extern crate vst;
extern crate log;
extern crate asprim;
extern crate num_traits;
extern crate rand;
extern crate rsynth;
use *;
use VstPluginMeta;
use Category;
vst_init!;