Crates.io | aych-delay |
lib.rs | aych-delay |
version | 0.1.1 |
source | src |
created_at | 2022-12-20 09:46:15.479802 |
updated_at | 2022-12-20 10:22:14.009052 |
description | A delay effect modelled after the H-Delay by Waves |
homepage | |
repository | https://github.com/timhudson/aych-delay |
max_upload_size | |
id | 742162 |
size | 96,398 |
Aych-Delay is a delay effect modelled after the H-Delay by Waves. It applies a delay effect to audio data and includes features such as feedback, ping-pong, width control, and lowpass/highpass filtering.
This project came about as a way for me to scratch an itch. I've been wanting to write audio software with Rust for a while, and recreating the H-Delay seemed like a fun challenge. I'm NOT a DSP expert, and I'm sure there are many ways in which this code could be improved. If you have any suggestions, feel free to open an issue or submit a pull request.
To use Aych-Delay in your Rust project, add the following to your Cargo.toml
file:
[dependencies]
aych_delay = "0.1.1"
To use Aych-Delay, create a new instance of the Delay
struct with the desired settings and call the process
method on your audio data:
use aych_delay::{Delay, Settings};
let mut delay = Delay::new(Settings {
delay_time: 166.66,
feedback: 0.75,
width: 0.5,
lowpass_filter: 22000.0,
highpass_filter: 300.0,
dry_wet_mix: 0.5,
output_level: 0.75,
..Settings::default()
});
let mut delay = Delay::new(settings);
let input: &[f32] = &[...];
let mut output: &mut [f32] = &mut [...];
delay.process(input, output);
You can also use the default()
method of the Settings
struct to get a set of default values:
let settings = Settings::default();
let mut delay = Delay::new(settings);
The examples
directory contains a basic example of using Aych-Delay with the rodio
library to play a sound file with the plugin applied. To run the example, use the following command:
cargo run --example basic <audio_file>
Aych-Delay includes lowpass and highpass filters implemented with the TPTOnePoleStereo
struct. This is a "Topology preserving transform" one-pole filter, derived from work by Zavalishin and Pirkle, and an implementation of the filter within the SOUL project (ISC license).
Aych-Delay is licensed under the MIT license. See the LICENSE
file for more information.