# Rust-LV2 [![Build Status][travis-badge]][travis-url] [![Current Crates.io Version][crates-badge]][crates-url] [travis-badge]: https://travis-ci.org/rustaudio/rust-lv2.svg?branch=master [travis-url]: https://travis-ci.org/rustaudio/rust-lv2 [crates-badge]: https://img.shields.io/crates/v/lv2.svg [crates-url]: https://crates.io/crates/lv2 A safe, fast, and ergonomic framework to create [LV2 plugins](http://lv2plug.in/) for audio processing, written in Rust. **This library is a work in progress.** It provides the following features, through the [LV2 Core specification](http://lv2plug.in/ns/lv2core/lv2core.html): * Lightweight, realtime non-blocking and allocation-free audio processing. * Generates all the boilerplate to make a LV2 plugin binary, usable by any LV2 host. * Any number of ports / Any channel mapping, which can be different for input and output. This obviously includes Mono, Stereo, Surround, etc., any configuration your CPU can handle. * Can be extended to support any additional features, extensions and port types. They can be official, unofficial or completely custom. Through the [LV2 official additional specifications](http://lv2plug.in/ns/), this library also provides many additional features, including: * MIDI processing * Serialization of custom data structures, and plugin-plugin or plugin-GUI communication and property manipulation * State management * Asynchronous work processing * Custom Graphical User Interfaces, both in a toolkit-agnostic and in a platform-agnostic way **(Not yet implemented)** * Presets handling **(Not yet implemented)** * ... and more! (Not yet implemented either) Note that this library will only provide Rust bindings for the official LV2 specifications, however it is compatible with any other arbitrary or custom specification, and other, external crates are able and welcome to provide Rust bindings to any other specification that will integrate with this library. ## Example This example contains the code of a simple amplification plugin. Please note that this isn't the only thing required to create a plugin, see the documentation below for more details. ```Rust // Import everything we need. use lv2::prelude::*; // The input and output ports are defined by a struct which implements the `PortCollection` trait. // In this case, there is an input control port for the gain of the amplification, an input audio // port and an output audio port. #[derive(PortCollection)] struct Ports { gain: InputPort, input: InputPort