MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

A software string machine ensemble chorus effect
MUFF WIGGLER Forum Index -> Music Tech DIY  
Author A software string machine ensemble chorus effect
quarterturn
No one seems to offer a true three-phase, 6.0 Hz + 0.6 Hz LFO chorus in a modern, digital pedal - at least that I'm aware of. So, I tried coding my own!

I used an ElectroSmash PedalShield with an Arduino Due. It's not the best "DSP" platform, but I own it and it can do about 1K instructions between each 44,100 samples/sec.

Note it is not done yet. It sounds nice, but there's also an artifact which seems to follow the LFO wavetable. I have not found the source of it yet.

Here's the code: https://github.com/quarterturn/due_ensenble_chorus/tree/master/chorus_ test
Here's a demo: https://youtu.be/trdEuEkJ5kU

I used my Casio MT-600 in the demo, 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.
weasel79
nice one, was reading up about the juergen haible analogg solina chorus just yesterday!

mind sharing the code once you exterminated the bugs?
quarterturn
It's now fixed! Here's a demo: https://youtu.be/LhwaD3CNPv8

Here's the code: https://github.com/quarterturn/due_ensenble_chorus
Use the "Clone or Download" button and either download it as a zip or use git on your system with the git link. The good code is in the "chorus_test" directory, ignore the one at the root level - I need to delete that.

You can play around with the equation in mktable.py to tweak the LFO waveform. Adjusting the range will increase or decrease the level of pitch shifting, while changing the divisors will adjust the intensity of each component. You can also edit the initial offset for the delay taps in the ring buffer, which will also alter the character of the sound. I'm using 512 samples at the moment.
commodorejohn
Sound gorgeous grin
Sandrine
Cool! I see you have rem'd it out (knob ctrl) but a tip: never use map() in anything time dependent as it uses floats and gobbles up resources alot.
What I do is just longs (unsigned longs) mult up the numerator by 1024 (or 1000 or 100 if needs to be visable during debug), then divide by denominator after other constants/vars. Way faster.

In that case (0-25) it would be pot0 = ((long) (pot0+1)*100)/4096;
But for this use (no decimals) simply pot0 /= 40;
quarterturn
With regards to the map function, thanks for the advice about it using floats. Makes sense it would.

I have tweaked a few things in the code so pull a new version from git if you want the latest.

There's a board called a Teensy 3.6 which has way more RAM, is 180 MHz, and has hardware floating point. There is also a stereo audio interface for it here: https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio- shield/

I've sent a message to the maker to see if he designed it with a specific stompbox in mind. If so, this will be my next version. It will be MUCH better, since I'll be able to generate the LFO on the fly, have oversampling and 16-bit stereo in and out. Hell yeah, independent triple chorus on each channel, fully adjustable!
emmaker
quarterturn wrote:
There's a board called a Teensy 3.6 which has way more RAM, is 180 MHz, and has hardware floating point. There is also a stereo audio interface for it here: https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio- shield/


There is an audio interface that connects directly up to the Teensy 3.2 and 3.6 made by the Teensy folks (PJRC). It also has an existing 'driver' for it. Check out the forum on the PJRC website for the Teensy. There is a lot of information there.

Teensy Forum

There is a new Teensy 4.0 which is faster and has more RAM. Downside is it doesn't have a lot of IO pins broken out (about the same number as the 3.2) but it does have I2S and SPI ports.
quarterturn
quarterturn wrote:

There is an audio interface that connects directly up to the Teensy 3.2 and 3.6 made by the Teensy folks (PJRC). It also has an existing 'driver' for it. Check out the forum on the PJRC website for the Teensy. There is a lot of information there.


I think the Tindie link is the same I2S codec, just with more robust protection and 1/4" ins and outs. The seller says it fits 1590BB or 1590N1 die-cast boxes.
commodorejohn
Sandrine wrote:
Cool! I see you have rem'd it out (knob ctrl) but a tip: never use map() in anything time dependent as it uses floats and gobbles up resources alot.
What I do is just longs (unsigned longs) mult up the numerator by 1024 (or 1000 or 100 if needs to be visable during debug), then divide by denominator after other constants/vars. Way faster.

Ditto this. Any time you can substitute fixed-point math for floating-point you're going to see a significant benefit in performance/resource usage - particularly useful in resource-limited environments like small microcontrollers.
quarterturn
Teensy 3.6 and Steve Lascos' 1/4" audio interface are in. I'll start a new thread once it's running on the new hardware. It's going to sound a LOT better with a real codec. The Due ADC is just terrible in terms of noise. It's probably not the SAMD chip's fault, but how they routed the signals to it. Anyhow the Due is a dead-end for the project.
JimY
I think it sounds just right.

As for noise, if it was the Electrosmash shield, then I think you can DIY something better (and a lot cheaper). The Due itself might not be the only noise problem.
In my opinion the Electrosmash product has a noisy -5v generator that isn't necessary if you use single rail op-amps that can sense and output down to ground. The converter chip is running about 46kHz IIRC, and you don't want that anywhere near an ADC input.
It also lacks sufficient power supply decoupling. There are also very high value resistors in sensitive places and an input capacitor that can let in rumble almost down to DC which will limit how loud the audio you feed it can be.

If you can do some smd work, it might be possible to improve the Electrosmash product by changing a few resistors and capacitors and adding some 100nF mlcc bypass capacitors on the power supply rails.
jorg
Great job! It's amazing how a triple chorus can shine up a crap keyboard.
MUFF WIGGLER Forum Index -> Music Tech DIY  
Page 1 of 1
Powered by phpBB © phpBB Group