an attempt at a string-machine chorus effect

4 years 10 months ago #1821 by quarterturn
I'd like to have a "string machine" chorus effect. There were many implementations, but the sound I like best consists of three delays modulated 120 degrees out of phase by a combination of 6.0 Hz and 0.6 Hz sinewaves. It has a springy, bouncy sound which is hard to describe but unmistakable when you hear it.

I've implemented a circular buffer for incoming audio samples. The modulation wavetable is read in at three evenly spaced offsets to provide the phasing. The modulation copies the current sample by whatever distance is read from the wavetable index to the current buffer position plus the offset. I sum the two and then bitwise-shift right by one to divide the level by two. This is to prevent clipping.

Trouble is, it sounds awful. You can hear the modulation, but there's so much noise and distortion that the overall chorus effect is inaudible. I also noticed the example chorus code sound bad too if you turn off the mixer switch on the pedalshield and just listen to the DAC output.

The code is here on github: github.com/quarterturn/due_ensenble_chorus

Any help would be appreciated!
The following user(s) said Thank You: Ray, EmmaNeales

Please Log in to join the conversation.

4 years 9 months ago #1822 by Ray

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in to join the conversation.

4 years 8 months ago #1910 by quarterturn
I've thought about it some more and I think my problem is it's not enough to just delay the incoming audio,, you also have to stretch it by some amount.

As I read it, the chorus_vibrato code:
- fills the buffer to the current delay depth, each time playing back the current sample
- copies the last sample POT0 number of times
- increments the delay depth by POT0 max depth or decrements the delay depth by POT0

So as it goes up it plays a little more of the stretched by POT0 sample, and going down it plays less.
Beats me how this changes the pitch though other than the small part stretched by the POT0 value.

I think the key to having a wavetable LFO is to use a circular buffer for each "voice" and vary the position of the stretched sample.
The following user(s) said Thank You: Ray

Please Log in to join the conversation.

4 years 8 months ago - 4 years 8 months ago #1911 by quarterturn
At last, an almost working version!
Here it is: github.com/quarterturn/due_ensenble_chor...e/master/chorus_test
Here's a ink to a quick video demo:


I used my Casio MT-600, since it's battery operated and easy to get close to my code desk. I chose the driest preset it has, which is "violin". There's a tiny bit of chorus in it, but you can definitely hear the springy animation of the ensemble chorus. Also you can hear how the unwanted noise tracks the LFO.

If you feed in a narrow pulse or sawtooth, you'll hear the classic triple-BBD 120-degree phased sound.I think it's pretty close to what my Oakley SRE330 in triple mode.

What remains to be fixed is some sort of periodic noise which is getting in somehow from the LFO. I'm pretty sure it's the LFO as it's in sync with the period of the LFO wavetable. I'm pretty sure it's not an overflow or wrapping problem in the circular buffer. Maybe my code is taking too long to run inside the 44.1 KHz interrupt? I doubt this, as I hear a similar noise with everything commented out down to just one buffer.

It took me a long time to wrap my head around the chorus/vibrato example. There's confusing stuff going on in there as it does not use a circular buffer. Once I started over with a circular buffer it made a lot more sense and I got it working pretty quickly.
The following user(s) said Thank You: Ray, EmmaNeales

Please Log in to join the conversation.

4 years 8 months ago #1912 by quarterturn
FIXED! I was not handling when the LFO causes the buffer indexes to roll over in reverse. It sounds great now!

Updated code is here: github.com/quarterturn/due_ensenble_chor...e/master/chorus_test
To download go here github.com/quarterturn/due_ensenble_chorus and click the button and choose "zip", or you can use "git clone" with the git:// address.
The following user(s) said Thank You: Ray

Please Log in to join the conversation.

4 years 8 months ago #1914 by Ray
Wow thats a great job!!! thanks for sharing it :woohoo:

Please Log in to join the conversation.

4 years 8 months ago #1915 by quarterturn
New demo fixed code:


Next step is port it to the Teensy 3.x audio library as an effect so it can be part of a full string machine.
The following user(s) said Thank You: Ray

Please Log in to join the conversation.

2 years 9 months ago #2785 by EmmaNeales
Thanks for sharing this topic, i find it very helpful, that's what i was looking for! B)

Please Log in to join the conversation.

Time to create page: 0.073 seconds