electro-smith / libDaisy

Hardware Library for the Daisy Audio Platform
https://www.electro-smith.com/daisy
MIT License
335 stars 143 forks source link

Vocal Filter module/example #23

Closed PaulBatchelor closed 4 years ago

PaulBatchelor commented 4 years ago

I'm currently in the process of building a simple vocal formant filter, and I'm hoping to eventually merge it into the libdaisy codebase at some point.

I'm currently developing a version of it in my fork of the daisy repo under the "voxfilt" branch. What I've implemented so far does work (tested on my theremin!)

I expect to be developing this by myself, but I am open to suggestions and improvements. Also, would you want this to be one of the core daisysp modules?

The idea I have right now is to be able to have interpolate over vowel position (AEIOU) and maybe gender/voice type. Making the vowel selection multi-dimensional so you didn't have to go through the fixed AEIOU order would be cool as well. Perhaps it could be configured somehow using the LED matrix and other peripherals? Still thinking on this.

stephenhensley commented 4 years ago

nice!

I actually have a pretty "vowelfilt" that didn't make into another module. It's pretty much the FLOSS manual example for doing it with resons in csound.

It sounded okay with certain source material, but it was pretty finicky.

If that's along the line of what you're going for I can share that code with you as well.

andrewikenberry commented 4 years ago

This sounds great! We definitely want this to be one of the core modules.

PaulBatchelor commented 4 years ago

@stephenhensley I'd love to glance at the code, if you are willing to share.

I just remembered a while back I did a port of Daniel Clellands vowel filter for the iOS app HOWL, which uses soundpipe resons: https://github.com/PaulBatchelor/GROWL It actually sounds pretty good, and may be better than the bandpass filter approach I'm using (which can make the signal quite weak).

He has an interesting method for dividing the vowels into a two-dimensional control signal. Forget how he derived it, but it was a very fun to play with on a tablet device.

For some reason, I remember being reson being very numerically unstable. I seem to recall the reson algo using really really large floating point values, which would certainly cause an issue (especially since we're using floats and not doubles). If the algorithm can be fixed to use smaller numbers, maybe it would blow up less often.

stephenhensley commented 4 years ago

I think what I have is very similar (pretty sure it even uses resons that I ported from soundpipe). I'll dig it up, and send it over a little later today.

I definitely encountered the instabilities, and it would blow up pretty often.

On this processor there is actually some hardware double support, though I still prefer to keep everything as floats if we can for consistency. But there's a time and place for everything.

stephenhensley commented 4 years ago

vowel.zip

Here's the source for the vowelfilt that I did a while back. I think it works other than some amplitude issues, and possibly blowing up with certain parameter settings.

Everything was being controlled from an x-y plane where x was the vowel, and y was the "gender"

At the bottom is a different implementation that's all commented out. I think that was based on the fofilter from csound. I can't remember if I got it working or not.

stephenhensley commented 4 years ago

Oh, I forgot to include the reson source.

I have a lot of stuff like this (and other stuff from soundpipe/csound) floating around. I'll try to take an inventory of what I have scattered around other repos so neither of us have to report things that have already been ported.

PaulBatchelor commented 4 years ago

@stephenhensley it's a nice looking vowel filter implementation you got there. Haven't tested out the code yet though.

Going to try out resons and see if they sound any better than butbps.

For context, I'm using my new theremin as source signal, with using foot pedal + CV1/Knob1 to control the formants. The brighter waveshape settings make for a surprisingly ideal glottal approximation.

There was some noise in my system that I was affecting the formant position, so I ended up adding a bit of parameter smoothing.

I have yet to add genders to my implementation.

andrewikenberry commented 4 years ago

closing as this should be in daisysp