<commit_before># rust-vst2 [![Build Status](https://travis-ci.org/overdrivenpotato/rust-vst2.svg?branch=master)](https://travis-ci.org/overdrivenpotato/rust-vst2)
A library to help facilitate creating VST plugins in rust.

This library is a work in progress and as such does not yet implement all opcodes. It is enough to create basic VST plugins without an editor interface.

#### [Library Documentation](http://overdrivenpotato.github.io/rust-vst2)

### TODO
  - Proper editor support (possibly [conrod](https://github.com/PistonDevelopers/conrod) + [sdl2](https://github.com/AngryLawyer/rust-sdl2)?)
  - Implement all opcodes
  - Write more tests
  - Provide better examples

## Usage
To create a plugin, simply create a type which implements `Vst` and `std::default::Default`. Then call the macro `vst_main!`, which will export the necessary functions and handle dealing with the rest of the API.

### Example plugin
A simple plugin that bears no functionality. The provided Cargo.toml has a crate-type directive which builds a dynamic library, usable by any VST host.
###### lib.rs

```rust
#[macro_use]
extern crate vst2;
use std::default::Default;

use vst2::{Vst, Info};

struct BasicVst {
    info: Info
}

impl Vst for BasicVst {
    fn get_info(&mut self) -> &mut Info {
        &mut self.info
    }
}

impl Default for BasicVst {
    fn default() -> BasicVst {
        BasicVst {
            info: Info {
                name: "BasicVst".to_string(),

                ..Default::default()
            }
        }
    }
}

vst_main!(BasicVst); //Important!
```<commit_msg>Updated readme example<commit_after># rust-vst2 [![Build Status](https://travis-ci.org/overdrivenpotato/rust-vst2.svg?branch=master)](https://travis-ci.org/overdrivenpotato/rust-vst2)
A library to help facilitate creating VST plugins in rust.

This library is a work in progress and as such does not yet implement all opcodes. It is enough to create basic VST plugins without an editor interface.

#### [Library Documentation](http://overdrivenpotato.github.io/rust-vst2)

### TODO
  - Proper editor support (possibly [conrod](https://github.com/PistonDevelopers/conrod) + [sdl2](https://github.com/AngryLawyer/rust-sdl2)?)
  - Implement all opcodes
  - Write more tests
  - Provide better examples

## Usage
To create a plugin, simply create a type which implements `Vst` and `std::default::Default`. Then call the macro `vst_main!`, which will export the necessary functions and handle dealing with the rest of the API.

### Example plugin
A simple plugin that bears no functionality. The provided Cargo.toml has a crate-type directive which builds a dynamic library, usable by any VST host.
###### lib.rs

```rust
#[macro_use]
extern crate vst2;
use std::default::Default;

use vst2::{Vst, Info};

#[derive(Default)]
struct BasicVst;

impl Vst for BasicVst {
    fn get_info(&self) -> Info {
        Info {
            name: "BasicVst".to_string(),

            ..Default::default()
        }
    }
}

vst_main!(BasicVst); //Important!
```
{'fraction_non_alphanumeric': 0.11801652892561984, 'fraction_numerical': 0.005289256198347108, 'mean_word_length': 3.662557781201849, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6658054', 'n_tokens_mistral': 948, 'n_tokens_neox': 923, 'n_words': 310}