Arduino inside an electric guitar

Hi hi hi

I want to make a little circuit and put it to my guitar's gut.
i've read all about lowpass/highpass passive and active filters, butterworth, chebyshev and all.
but seems Arduino is the solution for the thing i want. (or at least i think so)

details :

  • Input is an analog frequency (from guitar pickups)
  • amplitude of the input wave is small (it's about 200mV or so(variable based on pickup coil, rarely 1V is strings are stoke hard)
  • the input wave dies fast (damping factor is high, or whatever the scientific term is :confused: )
  • the outlet of guitar coils, which produce the wave (are they sine waves?) has high impedance. I know these should be considered, but don't know how

I need to :

  • take the input and first, block frequencies lower than 65Hz, or higher than 1200 Hz
  • increase sustain of the played note. (Shown at the picture below)
  • if the sustain is not like the blue lines, but is linear (green lines), then even better.

the lower cutoff frequency is the common hum sound generated by pickup coils. (absorbed from somewhere)
and the higher one is the highest pitch my guitar can play. (that's a D6 note ~1174 Hz)

I can use any Adruino chip, and any voltage supply.

is my demand list achievable using Adruino ? if so just give me guidelines, i have some programming background (in other languages) and can probably use your helps much better and faster :wink:

No arduino is suitable for your needs. - they're microcontrollers, not dsp's .

Not nearly fast or accurate enough.

Nearly all you require could be done by some fairly simple analog electronics.

Sustain is a bit more tricky.

I've sometimes wondered whether sustain could be achieved other than acoustically by providing gain between one guitar pickup and another used as a driver. Or even a single pickup in a Colpitts type oscillator...

The string is the resonant element.

The electronics could either be in the guitar, perhaps powered phantomly, or in the front end of the remote amplifier.

Never tried it. I'm a trumpet player.....

Any ideas, electronically competent guitar players? Given enough gain, something's gotta hoot.....

There goes my patent!

Allan

allanhurst:
I've sometimes wondered whether sustain could be achieved other than acoustically by providing gain between one guitar pickup and another used as a driver....

not sure if I understood what you said, but i've seen some infinity sustain mode done successfully, that uses two pickups, and (as the author of the idea said) one of the pick ups is the price of having that sustain.

probably what you're referring to.

Definitely not an Arduino product. Arduinos are great for digital applications, taking inputs and controlling outputs based on it.
This is a very different kind of project, you either need some analog electronics, or digital audio processing (digitise the signal and process it on much more powerful hardware than an Arduino).

thanks, both helped me a lot.

I read about DSPs and good thing is they're programmabe too. GOOD. and are faster as you mentioned.

But, is going the DSP way a wise decision cash-wise ?
any rough estimation of costs (for my needed stuff) is appreciated.

So far my read-&-learn journey to my customized guitar been like this :
The default stock wiring > alternative pickup combinations > passive filters > active filters > Adruino > and now DSP :slight_smile:

I am unsure to fully understand what exactly is your project, however with audio processing, you usually have to sample an input signal (44.1 KHz ?), output an analog signal and in between process some digital filtering. You CAN do all this with an arduino DUE.

An example of application:

If you are really interested to know how that works under the hood, see this tutorial (Google translate is your friend) for digital filtering:

I would use a Teensy. It has a good audio processing library.

The 65-1200 filter is easy.

The sustain is a bit more complex. I initially thought you would need to record the note and play back the recording but your diagram shows that won't work. I think you can do that effect with companding. The initial loud part of the note should be made softer while the soft part of the note should be made louder. This is a very common filter.

The part you haven't discussed is how to use the output from the Arduino. Are you expecting to plug this into a standard guitar amp? Then the output has to mimic the characteristic of the pickup.

You described some form of buffer/boost, some filtering (often integrated in existing designs) and a compressor.

There are lots of resources about guitar effects in a big diy guitar pedal building community, if you want to go the analog way.

Some of the bigger forums:

Projects are often available as kits.

For the digital route: Both, teensy with or without audio board or guitar pedal adapter and arduino pedalshield, will introduce noise into the signal chain (adc/dac, sampling frequency, interferrance, ...). Those platforms were simply not developed as audio processors. The teensy audio library helps offloading the necessary timing and conversions and has a wide variety of effects implemented, if you want to use the arduino environment.

About hum suppression:
unfortunately most of the hum noise is NOT 50 or 60Hz (depending on where you live), but also harmonics of this base frequency, that is 100 Hz, 150 Hz, 200 Hz etc.
So your low cut filter will not solve the problem.

There‘s several strategies you can use/combine:

  • 2 single coils wired antiparallel -> this is known as humbucker. The traditional humbucker dampens high frequencies. There are also humbuckers available in single coil size. They have reduced the high damping problem a lot and sound like single coils. They are called noise free single coils or similar.
    There are even more complex circuits for combining the advantages of single coil and humbucker, but this would lead too far here :slight_smile:

  • if you play a crunch or distorted sound, then the hum is actually hardly or not audible anymore. It only becomes audible once the tone fades out. You can now suppress the hum with a noise gate.

  • if the hum gets introduced in the cable rather than in the pickup, you can put a little high impedance amplifier into the guitar. Any old amplifier will NOT do, it must be an amplifer suitable for high impedance sources like a guitar pickup. Actually it‘s not even an amplifier in the strict sense of the word, it‘s an impedance converter.
    Shielding the electronics compartment of the guitar with aluminum foil also helps.

  • using high quality cable also helps.

  • if you REALLY insist on solving the hum problem with filters, then you need several very narrow notch filters for the base frequency and all the harmonics. This means you will have to pass your signal through a low latency high power audio DSP. Low latency, because high latency will affect the playing of the guitar. And the sound of the guitar will change. And not cheap.

About your high frequency cut filter:
Allthough you are right about the BASE frequency of your D6 note, the tones produced by the guitar strings also include higher frequencies, the harmonics. If you cut these frequencies, your guitar will sound very dull. The pickups can put out frequencies up to 15kHz, depending on type of pickup, load etc. Expanding this topic here might be too much for now.

About sustain:
This is what sustain/compressor effect pedals are for. Of course you can try to build your own digital or analog effect pedals, but as mentioned above, this is no job for the arduino, and also no job for someone with no experience in the field. If you want to learn and build it yourself, then by all means go ahead. But you will not save any money, if that is your goal. The commercially available effect pedals are cheaper and better than anything you could build yourself on the first attempt.

Advice from someone who has been playing guitar and building audio electronics for 20 years :slight_smile:

Thomas

Nice to hear from people who've worked in this field.

I am unsure to fully understand what exactly is your project, however with audio processing, you usually have to sample an input signal (44.1 KHz ?), output an analog signal and in between process some digital filtering. You CAN do all this with an arduino DUE.

The Due only has 12-bit ADC's and DAC's - I wouldn't reckon that good enough for serious quality.

The Due is fast - but it's not a dsp. These are specifically optimised for filter work with fast floating or fixed point multiply and accumulate (MAC) instructions, barrel accumulators etc. TI, Analog Devices, ON-SEMI etc all do good ones. Their design is quite different from general purpose processors such as arduinos.

They are also fairly expensive and use a lot of power, and their programming is not trivial. DSP programming is a specialist highly mathematical field - learn about Z-transforms if you want to make a start.

As mentioned above, many people have addressed guitar signal processing problems over the years, and there are many commercial products available.

Doing better than these offerings if new to the field is unlikely to be easy. Though skilled in audio electronics, I wouldn't even try.

Allan

For reference, here is a guitar effect pedal based on an arduino mega

with the words of the creators, found on https://www.reddit.com/r/diypedals/comments/877udm/arduino_mega_guitar_pedal/

Take also into consideration that the ADC is only 10 bits and does not feel like a finished commercial pedal that you could buy in a shop.

There is a video where you can hear how it sounds:

If you want to create your own lo-fi digital sound, this might be for you.

Why would you rob yourself of sweet harmonics

WoW, thanks all for your time and info .
You folk are the best. you ELECTRO_SONIC_ARTIST people.

actually the amount of required information to collect, the experience to gather, and the hard works needed, forced me to jump back to my simple passive varitone circuit, and gonna make a beautiful little PCB and use it inside my guitar.

again, THANK YOU...

Have you recorded any videos with the completed mod installed? Would be interested to hear it in action. I've seen many people use active circuit mods such as the Clapton mid boost mod. Send us a link!

allanhurst:
Nice to hear from people who've worked in this field.
The Due only has 12-bit ADC's and DAC's - I wouldn't reckon that good enough for serious quality.

Serious quality isn't necessary for all guitar applications. That gives you a 70dB dynamic range. It would exceed the real life noise floor in most cases. But some DAC/ADC IC have a built in anti-aliasing filter and that is a really important part that is missing from most microprocessors (or all?).

Not only is the noise floor usually pretty high, but in a mix or performance situation, the noise is eclipsed by the sound from all the other instruments.

Unless you're Pat Methany, you don't need 16 or more bits for this.