mtthw-meyer / libdaisy-rust

Hardware Abstraction Layer implementation for Daisy boards
MIT License
47 stars 17 forks source link

Example Request: Low Latency Convolution #17

Open matt-erhart opened 3 years ago

matt-erhart commented 3 years ago

see http://blog.reverberate.ca/post/zero-latency-convolution/

This would be my learning project, figure other might like it too, but you could get it working much fast than me. It's useful for reverb & cabinet/mic simulation via impulse responses. I assume it's what all the impulse response (IR) guitar pedals are doing.

mtthw-meyer commented 3 years ago

I want to get some DSP functions into the library (or a separate DSP crate) eventually. Once I get the core hardware enabled and working I want to do stuff like that and other things that can be ported from the cpp version of this library.

mtthw-meyer commented 3 years ago

There are some existing crates to look at as well. For using/contributing/forking.

https://github.com/liebharc/basic_dsp

https://github.com/klangner/dsp.rs

mtthw-meyer commented 3 years ago

This is still beyond my current knowledge level. You can watch me experimenting with stuff over here https://github.com/mtthw-meyer/embedded-dsp

matt-erhart commented 3 years ago

Cool! Check out https://www.youtube.com/channel/UCUR_LsXk7IYyueSnXcNextQ/playlists for more info on time-frequency analysis (using convolution) in the non-real time context.

chaosprint commented 1 year ago

This is still beyond my current knowledge level. You can watch me experimenting with stuff over here https://github.com/mtthw-meyer/embedded-dsp

Hi,

You can also check:

https://github.com/RustAudio/dasp

How can we create a variable to store the dsp engine?

I try to create the DSP instance during #[init], then return it to [local]:

let oscillator = SinOsc::new(440.0);
Local {
   oscillator
}

But in the audio_handler:

let s = oscillator.next();
audio.push_stereo((s, s)).unwrap();

No sound is played.